<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: AmberJ</title>
    <description>The latest articles on Forem by AmberJ (@amberjones).</description>
    <link>https://forem.com/amberjones</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F238843%2F8ac9508c-09f3-465b-862b-234f14496273.jpg</url>
      <title>Forem: AmberJ</title>
      <link>https://forem.com/amberjones</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/amberjones"/>
    <language>en</language>
    <item>
      <title>Accessibility Considerations Unique in Mobile Applications</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 10 Feb 2020 14:48:44 +0000</pubDate>
      <link>https://forem.com/amberjones/accessibility-considerations-in-mobile-applications-1eh4</link>
      <guid>https://forem.com/amberjones/accessibility-considerations-in-mobile-applications-1eh4</guid>
      <description>&lt;p&gt;Don't have 2020 vision? Me neither! And we're not alone. The &lt;a href="https://www.who.int/en/news-room/fact-sheets/detail/blindness-and-visual-impairment"&gt;World Health Organization reports&lt;/a&gt; at least 2.2 billion people have a vision impairment or blindness, with about 15% of the world's population living with some form of disability. &lt;/p&gt;

&lt;p&gt;In 2019 I read a lot of passionate articles on web accessibility like &lt;a href="https://dev.to/char_bone/the-most-common-developer-web-accessibility-mistakes-how-to-solve-them-3mp5"&gt;this one on dev.to by Charlotte on common mistakes and how to fix them&lt;/a&gt;. I also began my venture into coding mobile applications. With these topics swirling together I wondered - &lt;strong&gt;are there different accessibility considerations when building a mobile app?&lt;/strong&gt; The answer is yes, and no! &lt;/p&gt;

&lt;p&gt;The internationally recognized standard for web accessibility defined in the &lt;a href="https://www.w3.org/WAI/standards-guidelines/"&gt;Web Content Accessibility Guidelines&lt;/a&gt; (WCAG) is written to evolve with technology. This means standards like &lt;em&gt;contrast, text size, and consistent navigation&lt;/em&gt; are identical in desktop websites and mobile apps.&lt;/p&gt;

&lt;p&gt;That being said, there are a few notable considerations unique to mobile applications.&lt;/p&gt;

&lt;p&gt;So we're all on the same page, I'm using &lt;strong&gt;mobile as a generic term that encompasses a variety of devices that are easy to carry&lt;/strong&gt; such as:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;phones and tablets&lt;/li&gt;
&lt;li&gt;digital TVs&lt;/li&gt;
&lt;li&gt;wearables such as smartwatches&lt;/li&gt;
&lt;li&gt;devices in car dashboards and airplane seatbacks&lt;/li&gt;
&lt;li&gt;devices in household appliances&lt;/li&gt;
&lt;li&gt;other “Internet of Things”&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Touch Targets
&lt;/h2&gt;

&lt;p&gt;This is the big one. The pixel density of mobile devices varies greatly. For this reason, the suggested target size is in &lt;strong&gt;mm not pixels&lt;/strong&gt;! Your user should feel comfortable using the pad of their finger (or thumb!) to tap the target.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best practices for touch target size:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensuring that touch targets are physically 7 – 10mm wide. This size is equivalent to the smallest average finger. On a typical mobile screen, 9mm is roughly 44 by 44 CSS pixels - but again screen density varies. &lt;sup&gt;[2]&lt;/sup&gt; &lt;/li&gt;
&lt;li&gt;Ensuring that touch targets are surrounded by a small amount of inactive space to help avoid mis-taps.&lt;/li&gt;
&lt;li&gt;If you want to use very small control targets, make an alternative, larger control available as well.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Screen magnification should not need to be used to obtain this size. That often introduces the need to pan horizontally as well as vertically, which can decrease usability. &lt;sup&gt;[3]&lt;/sup&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Where the touch screen is the primary mode of 
interaction&lt;/li&gt;
&lt;li&gt;Users with mobility impairments such as hand tremors&lt;/li&gt;
&lt;li&gt;Users who use a mobile device in environments where they are exposed to shaking such as public transportation&lt;/li&gt;
&lt;li&gt;Users who have difficulty with fine motor movements&lt;/li&gt;
&lt;li&gt;Users who access a device using one hand&lt;/li&gt;
&lt;li&gt;Users with large fingers, or who are operating the device with only a part of their finger or knuckle&lt;/li&gt;
&lt;li&gt;Users who have low vision may better see the target&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Custom User Interface (UI) Controls
&lt;/h2&gt;

&lt;p&gt;Android UI and iOS components have accessibility built-in with useful metadata in the default code for buttons, switches, checkboxes, etc.. This allows screen readers to speak these components out loud for blind and low vision users. It's recommended that whenever possible, use these baked-in controls to lessen the cognitive load and ensure you have appropriate labels! When you create your own custom views or components, you need to ensure they are accessible. &lt;/p&gt;

&lt;p&gt;If you’re writing a pure native app, you’ll need to learn the Accessibility APIs (application program interfaces) available to the platform you’re coding.  &lt;/p&gt;

&lt;p&gt;For example, iOS uses Swift, not HTML, so there is no “alt” attribute available to explain what an image is about and make it accessible.  To give images an accessible name, you'd use the &lt;a href="https://developer.apple.com/documentation/uikit/accessibility/uiaccessibility"&gt;.accessibilityLabel property&lt;/a&gt;.&lt;sup&gt;[1]&lt;/sup&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Further Reading:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://a11yproject.com/"&gt;The A11y Project&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/madalynrose/getting-set-up-to-manually-test-web-accessibility-3gon"&gt;Dev article by Madalyn Rose on getting set up to manually test web accessibility&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/design/human-interface-guidelines/"&gt;Apple developers human interface guidelines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/fundamentals/accessibility/accessible-styles"&gt;Google developer fundamentals on accessible styles (great visuals!)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;[1] &lt;a href="https://www.microassist.com/digital-accessibility/mobile-application-accessibility-part-2-of-2/"&gt;https://www.microassist.com/digital-accessibility/mobile-application-accessibility-part-2-of-2/&lt;/a&gt;&lt;br&gt;
[2] &lt;a href="https://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/design/touch-target-size"&gt;https://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/design/touch-target-size&lt;/a&gt;&lt;br&gt;
[3] &lt;a href="https://www.w3.org/WAI/WCAG21/Understanding/target-size.html"&gt;https://www.w3.org/WAI/WCAG21/Understanding/target-size.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>design</category>
    </item>
    <item>
      <title>An Intro to TensorFlow.js: Machine Learning made Accessible in JavaScript.</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 16 Dec 2019 03:45:55 +0000</pubDate>
      <link>https://forem.com/amberjones/an-intro-to-tensorflow-js-machine-learning-made-accessible-in-javascript-24o0</link>
      <guid>https://forem.com/amberjones/an-intro-to-tensorflow-js-machine-learning-made-accessible-in-javascript-24o0</guid>
      <description>&lt;p&gt;If you haven't heard of TensorFlow.js yet, let me introduce you! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TensorFlow.js&lt;/strong&gt; is a library from the TensorFlow platform. It aims to allow programmers to create and run machine learning models &lt;strong&gt;in JavasScript&lt;/strong&gt; easily and quickly! It can be used in the browser or sever-side in Node.js. &lt;/p&gt;

&lt;h2&gt;
  
  
  So what's in the TensorFlow.js library??
&lt;/h2&gt;

&lt;p&gt;The library provides pre-trained Machine Learning models you can implement &lt;strong&gt;without little to no previous knowledge of machine learning&lt;/strong&gt;. A machine learning model is a function with learnable parameters that maps an input to a desired output. &lt;/p&gt;

&lt;p&gt;These pre-configured models can be used straight out of the box and include common categories such as image, audio, and text.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--79o5sjpB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/8o6pt7u3483rm5d1dmya.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--79o5sjpB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/8o6pt7u3483rm5d1dmya.gif" alt="Alt Text" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also retrain one of these existing models. OR you can develop your own machine learning models! &lt;strong&gt;Again, all in JavaScript!&lt;/strong&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Working with a pre-trained Model
&lt;/h2&gt;

&lt;p&gt;It is recommend for your first exploration into TensorFlow that you use a pre-trained model. Its super simple to import into your project via npm or script tags! &lt;/p&gt;

&lt;p&gt;Here is the code for a pre-trained model called "Pose Estimator".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;posenet&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@tensorflow-models/posenet&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;estimatePoseOnImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imageElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// load the posenet model from a checkpoint&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;net&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;posenet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;load&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pose&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;net&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;estimateSinglePose&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imageElement&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;flipHorizontal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;imageElement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pose&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;estimatePoseOnImage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;imageElement&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pose&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mind boggled on how short that code is. &lt;/p&gt;

&lt;p&gt;For details into the Pose Estimator, check out the github at &lt;a href="https://github.com/tensorflow/tfjs-models/tree/master/posenet"&gt;https://github.com/tensorflow/tfjs-models/tree/master/posenet&lt;/a&gt; .&lt;/p&gt;

&lt;h2&gt;
  
  
  Training a Model
&lt;/h2&gt;

&lt;p&gt;Training involves several steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Getting a batch of data to the model.&lt;/li&gt;
&lt;li&gt;Asking the model to make a prediction.&lt;/li&gt;
&lt;li&gt;Comparing that prediction with the "true" value.&lt;/li&gt;
&lt;li&gt;Deciding how much to change each parameter so the model can make a better prediction in the future for that batch.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8rqHs06e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/shviwkv9crn7ih9iw51l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8rqHs06e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/shviwkv9crn7ih9iw51l.png" alt="Alt Text" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A well-trained model will provide an accurate mapping from the input to the desired output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Examples of TensorFlow in the Wild
&lt;/h2&gt;

&lt;p&gt;Machine learning sparks curiosity and  play. All kinds of exciting projects are being built with TensorFlow.js! One that really made me laugh  and want to explore more was the MoveMirror project by people at google.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Xy9uzHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/v51luef3pg4gnbh6ck9v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Xy9uzHG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/v51luef3pg4gnbh6ck9v.gif" alt="Alt Text" width="400" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You turn on your webcam and move around, and the computer pulls up pictures of poses that match yours in realtime. The image database is made of more than 80,000 pictures - people dancing, doing karate, cooking, walking, skiing and so on. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion:
&lt;/h2&gt;

&lt;p&gt;TensorFlow.js provides a powerful set of tools to implement Machine Learning in the browser and in Node.js. It makes Machine Learning accessible with pre-made models so you can get playing with it today!&lt;/p&gt;




&lt;p&gt;For a basic explanation of what a tensor is: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A tensor is a mathematical construct that enables us to represent physical quantities that otherwise would not be able to be described&lt;/strong&gt;. It is a container that can house multiple dimensions and the relationships. Coming from Computer Science, it can be helpful to think of them as a data structure. &lt;/p&gt;

&lt;p&gt;Do not worry if this sound confusing! Having a deep understanding of tensors is not necessary to implement or use the TensorFlow.js library. You can get started with Machine Learning but not worry about Tensors or Optimizers by using the &lt;a href="https://ml5js.org/"&gt;ml5.js library &lt;/a&gt; on top of TensorFlow.js. &lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>computerscience</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Exploring Language, Sarcasm, and Bias in Artificial Intelligence</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 09 Dec 2019 06:58:27 +0000</pubDate>
      <link>https://forem.com/amberjones/exploring-language-sarcasm-and-bias-in-artificial-intelligence-7jn</link>
      <guid>https://forem.com/amberjones/exploring-language-sarcasm-and-bias-in-artificial-intelligence-7jn</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdkufjdo523e0p3sbwoiy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdkufjdo523e0p3sbwoiy.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;How did a virtual voice assistant learn to be so sly? &lt;/p&gt;

&lt;p&gt;The answer is &lt;strong&gt;Natural Language Processing&lt;/strong&gt;, a subcategory of artificial intelligence. &lt;/p&gt;

&lt;p&gt;Sounds futuristic, yet Natural Language Processing is already deeply integrated into our lives. You'll find it in chatbots, search engines, voice-to-text, and &lt;em&gt;something you may use everyday&lt;/em&gt; - predictive text messaging.&lt;/p&gt;

&lt;h2&gt;
  
  
  Natural Language Processing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;First, what is a “Natural" Language?&lt;/strong&gt;&lt;br&gt;
This is any written or spoken language that has &lt;strong&gt;evolved naturally in humans&lt;/strong&gt; through use and repetition. This also includes sign language! &lt;/p&gt;

&lt;p&gt;An "unnatural" language would be programming languages like JavaScript, C+, Python, etc. &lt;/p&gt;

&lt;p&gt;So Natural Language Processing is &lt;strong&gt;pushing computers to analyze and “understand” our human language.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Methods
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The n-gram Model&lt;/strong&gt;&lt;br&gt;
The n-gram model looks at n number of previous words typed and suggests the most probable next word based on past data. This is an older style of text prediction, but still commonly used. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F78nf1vryed8h1tz05fim.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F78nf1vryed8h1tz05fim.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(# of times (previousWord currentWord )) / (# of times previousWord)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Word Embedding&lt;/strong&gt;&lt;br&gt;
One of the most powerful ways of text prediction is through Word Embedding. Word embedding is the collective name for a set of language modeling and feature learning techniques in natural language processing where words or phrases from the vocabulary are mapped to vectors of real numbers which can use various algorithms to find its nearest neighbor. &lt;/p&gt;

&lt;p&gt;This allows our model to learn a more meaningful representation of each word. A large enough applied dataset can capture relations such as tense, plural, gender, thematic relatedness, and many more.[3]&lt;/p&gt;

&lt;p&gt;Here is a visualization with TensorFlow embedding projector.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fvyaaabudep82mex3al80.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fvyaaabudep82mex3al80.gif" alt="Tensorflow Visualization"&gt;&lt;/a&gt;[1]&lt;/p&gt;

&lt;p&gt;Word Embedding overlaps with Machine Learning and &lt;strong&gt;Deep Learning&lt;/strong&gt;, as large databases are processed and each word has association and relevancy in language to its neighbor. The text prediction is less random resulting in &lt;strong&gt;more human-like language.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fud5mt0kyx1p14pk66p7q.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fud5mt0kyx1p14pk66p7q.gif" alt="Swiftkey models"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A prediction accuracy between these two models is seen when Swiftkey switched from n-gram database to a "neural network" or deep learning model in 2016.[2]&lt;/p&gt;

&lt;h2&gt;
  
  
  The challenge of accurate Natural Language Processing is human nature.
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Body Language&lt;/strong&gt;&lt;br&gt;
How much of what we say is conveyed with body language? We're sensitive creatures. We express our emotions in tone and posture, not just with our words. We say things we don't mean, we exaggerate.  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F80bhzd75g24bwh366hot.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F80bhzd75g24bwh366hot.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Powerful indications of our intention include facial expressions, posture, gestures, and eye contact. This is where we'd have to add computer vision to our AI model. But this article is about language. ;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Abstract Language&lt;/strong&gt;&lt;br&gt;
Abstract language includes sarcastic remarks, metaphors, exaggerations. This results in machines just “missing the point”. It would be a lot easier to process human language if it was all based on simple grammar rules like using “s” to signify the plurality! Much of what determines  content is context-specific, culturally constructed, and difficult to describe in an explicit set of rules.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Can you teach a machine to recognzie sarcasm?&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;DeepMoji MIT Project&lt;/strong&gt; has one entertaining and surprisingly accurate answer. DeepMoji is a model that sifts through a dataset of 1.2 billion tweets to learn about the emotional concepts in text like sarcasm and irony based on the emojis responses.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu07qzk1rnlacyrhtls0j.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fu07qzk1rnlacyrhtls0j.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The algorithm created by MIT computer science researchers &lt;strong&gt;detects sarcasm in tweets better than humans.&lt;/strong&gt; The human group appropriately identified emotions in messages 76.1 percent of the time. DeepMoji accurately read the emotions 82.4 percent of the time.  [4]&lt;/p&gt;

&lt;p&gt;It's machine brain could provide chatbots with a more nuanced understanding of emotional context. You can participate in the project at &lt;a href="https://deepmoji.mit.edu/" rel="noopener noreferrer"&gt;https://deepmoji.mit.edu/&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Race and Gender Bias&lt;/strong&gt;&lt;br&gt;
Language is one of the most powerful means through which sexism and gender discrimination are perpetrated and reproduced. By not carefully considering our approach to Natural Language Processing, bots will replicate our great and terrible attributes.  &lt;/p&gt;

&lt;p&gt;A disaster example of this was &lt;strong&gt;Microsoft's AI chatbot, Tay.&lt;/strong&gt; Released onto Twitter in 2016, Tay was intended to mimic the language patterns of a 19 year old American girl and learn and respond to interactions. It went from &lt;em&gt;"humans are super cool"&lt;/em&gt; to spewing racist and genocidal tweets and taken offline only &lt;strong&gt;16 hours after launch&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;One of the more tame tweets...&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxtqgsm31p2s7eb5hra0t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxtqgsm31p2s7eb5hra0t.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As engineers, building applications and working with datasets, we need to be cognizant of where our data is coming from, how its collected, and any potential biases. &lt;/p&gt;

&lt;p&gt;The methods to mitigate gender and race bias in NLP are relatively new. [5] One way of approaching this problem is from a data visualization perspective. By visualizing how the model groups the data (with tools like TensorFlow for example), we can get an idea of what the model thinks are similar and dissimilar data points and potentially identify bias. &lt;/p&gt;

&lt;p&gt;One question I'll leave you to ponder on is what other ways can we neutralize bias in Natural Language Processing?&lt;/p&gt;

&lt;p&gt;Sources: &lt;br&gt;
[1] &lt;a href="https://projector.tensorflow.org/" rel="noopener noreferrer"&gt;https://projector.tensorflow.org/&lt;/a&gt;&lt;br&gt;
[2] &lt;a href="https://blog.swiftkey.com/swiftkey-debuts-worlds-first-smartphone-keyboard-powered-by-neural-networks/" rel="noopener noreferrer"&gt;https://blog.swiftkey.com/swiftkey-debuts-worlds-first-smartphone-keyboard-powered-by-neural-networks/&lt;/a&gt;&lt;br&gt;
[3] &lt;a href="https://ruder.io/text-classification-tensorflow-estimators" rel="noopener noreferrer"&gt;https://ruder.io/text-classification-tensorflow-estimators&lt;/a&gt;&lt;br&gt;
[4] &lt;a href="https://www.media.mit.edu/projects/deepmoji/overview/" rel="noopener noreferrer"&gt;https://www.media.mit.edu/projects/deepmoji/overview/&lt;/a&gt;&lt;br&gt;
[5] &lt;a href="https://www.oxfordinsights.com/racial-bias-in-natural-language-processing" rel="noopener noreferrer"&gt;https://www.oxfordinsights.com/racial-bias-in-natural-language-processing&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>inclusion</category>
    </item>
    <item>
      <title>Build Multiple Choice Quiz in React Native</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 02 Dec 2019 09:47:46 +0000</pubDate>
      <link>https://forem.com/amberjones/build-multiple-choice-quiz-in-react-native-4ho</link>
      <guid>https://forem.com/amberjones/build-multiple-choice-quiz-in-react-native-4ho</guid>
      <description>&lt;p&gt;This article is relevant to React Native!! If you are using React, you might find some state logic useful, but the components can not be transferred. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React Native Elements&lt;/strong&gt; has a component called &lt;strong&gt;CheckBox&lt;/strong&gt; which is a great base for a list, but it needs a little hacking to get it to interact like a multiple choice quiz. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;CheckBoxes allow users to complete tasks that involve making choices such as selecting options, or switching settings on or off. It provides a clear visual of either a true or false choice.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Since I couldn't find a native quiz component so I thought this would do the trick. I wanted a user to be able to click on a checkbox, or 'answer' and have a visual indicator change. The user would only be able to select one checkbox at a time though. &lt;/p&gt;

&lt;p&gt;I couldn't find an example of using CheckBox this way online that actually worked - I'm sure its probably out there - so here is how I customized it to become a simple dynamically rendering quiz component. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--A6CzR-M6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://i.imgur.com/nyJKxYW.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--A6CzR-M6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://i.imgur.com/nyJKxYW.gif" alt="Imgur" width="382" height="652"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Getting Started
&lt;/h4&gt;

&lt;p&gt;To use the CheckBox, download the react-native-elements dependency &lt;br&gt;
with your preferred package manager. &lt;/p&gt;

&lt;p&gt;Then import it into the top of your component like so.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;CheckBox&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-native-elements&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The most simple implementation of CheckBox is below, but there are many props available to add to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CheckBox&lt;/span&gt;
  &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Click Here&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Adding an &lt;strong&gt;onPress&lt;/strong&gt; prop  to CheckBox allows a function to toggle the state of 'checked' between true and false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CheckBox&lt;/span&gt;
  &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Click Here&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="na"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;})}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  The Problem
&lt;/h4&gt;

&lt;p&gt;That's cool, but what happens when I want to have multiple checkboxes to display the answer choices?&lt;/p&gt;

&lt;p&gt;As is, the checked state of all of them will be effected and toggled to all true or all false. &lt;/p&gt;

&lt;p&gt;I went ahead and added some more props with explanations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;question&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;question&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;answers&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;CheckBox&lt;/span&gt;
          &lt;span class="nx"&gt;center&lt;/span&gt;
          &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="c1"&gt;// if these are not empty strings, the default checkbox appears&lt;/span&gt;
          &lt;span class="nx"&gt;checkedIcon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;
          &lt;span class="nx"&gt;uncheckedIcon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;""&lt;/span&gt;
          &lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="c1"&gt;// ternary conditionally renders the color of choice container &lt;/span&gt;
          &lt;span class="nx"&gt;containerStyle&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
          &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;backgroundColor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isCorrect&lt;/span&gt;
              &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;lightgreen&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pink&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="nx"&gt;onPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handleSelection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
         &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="p"&gt;))}&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Selection State Solution
&lt;/h4&gt;

&lt;p&gt;I asked 2 questions in &lt;strong&gt;handleSelection&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;has any answer been selected before?&lt;/li&gt;
&lt;li&gt;if so, is it the same answer or a new answer?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A good 'ole shuffle toy problem came to mind. I needed a variable to keep track of the previous selection to compare it to the current selection. Then, I'd set variable to the current value for the next comparison.&lt;/p&gt;

&lt;p&gt;The magic happened in &lt;strong&gt;dynamically setting and referencing the state&lt;/strong&gt;, seen as this.setState({[answer.id]: true}).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt; &lt;span class="nx"&gt;handleSelection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;isSelected&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;prevChoice&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// has any answer been selected before?&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;isSelected&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// if not, we set all state to current answer variables&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
        &lt;span class="na"&gt;isSelected&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;prevChoice&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="c1"&gt;// A choice is already selected&lt;/span&gt;
      &lt;span class="c1"&gt;// If it is the same choice,&lt;/span&gt;
      &lt;span class="nx"&gt;prevChoice&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
        &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
          &lt;span class="c1"&gt;//  toggle off&lt;/span&gt;
          &lt;span class="na"&gt;isSelected&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
          &lt;span class="c1"&gt;//  assign state of answer to false&lt;/span&gt;
          &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="c1"&gt;//  reset the prev choice&lt;/span&gt;
          &lt;span class="na"&gt;prevChoice&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="c1"&gt;// else we know it is a new choice,&lt;/span&gt;
        &lt;span class="c1"&gt;// we dont change state of 'isSelected'&lt;/span&gt;
        &lt;span class="c1"&gt;// set the previous to current&lt;/span&gt;
        &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
          &lt;span class="c1"&gt;// assign state at previous value false&lt;/span&gt;
          &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;prevChoice&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="c1"&gt;// assign new id as prev&lt;/span&gt;
          &lt;span class="na"&gt;prevChoice&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;answer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I really enjoyed figuring out this solution! I'm sure there are many other ways. :)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>What do you include in your personal narrative?</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 25 Nov 2019 18:22:40 +0000</pubDate>
      <link>https://forem.com/amberjones/what-do-you-include-in-your-personal-narrative-53j0</link>
      <guid>https://forem.com/amberjones/what-do-you-include-in-your-personal-narrative-53j0</guid>
      <description>&lt;p&gt;Interviewers love the "so tell me about yourself" prompt.&lt;/p&gt;

&lt;p&gt;What are some things you include in your narrative that resonates with potential employers? &lt;/p&gt;

&lt;p&gt;Things you've taken out?&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Web, Native, &amp; Hybrid Apps Explained</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 25 Nov 2019 09:18:55 +0000</pubDate>
      <link>https://forem.com/amberjones/web-native-hybrid-apps-explained-1nlh</link>
      <guid>https://forem.com/amberjones/web-native-hybrid-apps-explained-1nlh</guid>
      <description>&lt;p&gt;What the heck are all these different types of apps?&lt;/p&gt;

&lt;p&gt;That's the question I asked myself when researching a tech-stack for my first mobile app. The following is what I learned and maybe it will save you a trip down the rabbit hole as well. ;)&lt;/p&gt;

&lt;p&gt;We've been using &lt;strong&gt;web apps&lt;/strong&gt; for a while now, accessing them through a &lt;strong&gt;web browser&lt;/strong&gt; (Chrome, Firefox, Safari, etc). &lt;/p&gt;

&lt;p&gt;Okay, makes sense.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;So what is the difference between a web app and a website??&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web apps are more &lt;strong&gt;interactive&lt;/strong&gt;, allowing a users to interact with data, while websites are &lt;strong&gt;informational&lt;/strong&gt;, displaying data. All web applications are websites, but not all websites are web applications. As you may already be thinking, this distinction can vary based on who you ask. There is no clear line of &lt;em&gt;how much interaction&lt;/em&gt; qualifies a website as a web app. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdj5199845vrmbj7ymg1b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fdj5199845vrmbj7ymg1b.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, is &lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt; a website or a web app? &lt;/p&gt;

&lt;p&gt;The 'right' answer doesn't matter. What matters is that you're thinking about the &lt;strong&gt;user experience and desired client results&lt;/strong&gt;! &lt;/p&gt;

&lt;h2&gt;
  
  
  Why build a web app?
&lt;/h2&gt;

&lt;p&gt;Web apps are generally written in JavaScript, CSS, and HTML - pretty well known languages. This means &lt;strong&gt;shorter development time&lt;/strong&gt; to get your app into the internet! It also makes it easy to maintain, as there is a single code base. &lt;/p&gt;

&lt;p&gt;In the same hand, &lt;strong&gt;web apps do not need approval by an app store&lt;/strong&gt;, a process which can sometimes take weeks and multiple refactors due to rejection. Deploying a web app also avoids those app store developer fees – $25 at Google Play, $99 at Apple App.  (I'll talk about the pros in Native Apps)&lt;/p&gt;

&lt;p&gt;Because web apps are accessed through a browser, they do not need to be downloaded like mobile apps do. This can be a large appeal to some users. This does mean they &lt;strong&gt;require internet access&lt;/strong&gt;.   &lt;/p&gt;

&lt;h2&gt;
  
  
  Why build a Native App?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Native apps&lt;/strong&gt; are specifically built for &lt;strong&gt;one operating system or device.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Like a tailored suit, it is not going to fit everyone. While that's pretty restricting, there are advantages. &lt;/p&gt;

&lt;p&gt;You can release it on an app store! Stores have the potential for a huge draw, if that's what your after. There are the 2 major players Google Play and Apple App, but there are actually &lt;a href="https://www.businessofapps.com/guide/app-stores-list/" rel="noopener noreferrer"&gt;a lot more app stores you can release to!&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Building natively allows the application to &lt;strong&gt;use the device specific technology&lt;/strong&gt; such as an accelerometer, camera, and more. A developer can incorporate these features into an app.  &lt;/p&gt;

&lt;p&gt;Native apps can also be built to &lt;strong&gt;work without internet connectivity&lt;/strong&gt;. Spotify for example - once you download the app, you can save tunes to listen to later without a connection. Most modern apps have some sort of reliance on wifi or cell signal, but its an option! &lt;/p&gt;

&lt;h2&gt;
  
  
  Why build a Hybrid App?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hybrid apps combine some of the best features of web and native apps.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They are cost effective and fast to deploy - quicker to reserve spot in an app store. Often seen as a wrapper for an existing web page - this saves money in development as you can use a pre-existing or single cross-platform codebase. They can use &lt;strong&gt;some&lt;/strong&gt; native hardware.&lt;/p&gt;

&lt;h2&gt;
  
  
  Whats the right choice?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Think of what you want your app to accomplish before building!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The only wrong choice is not considering this before beginning to code. &lt;/p&gt;

&lt;p&gt;Does your app need hardware specific tools? If not, then maybe you are better off building a web or hybrid app. Is this app aimed at being used everyday?  Then maybe &lt;strong&gt;DO&lt;/strong&gt; build a native app so you can take advantage of push notifications.  &lt;/p&gt;

&lt;p&gt;As our technology ever increases, these definitions become more and more blurred. &lt;/p&gt;

&lt;p&gt;React Native for example uses JavaScript to bridge code to native widgets. It is a cross-platform framework that fits in somewhere between a Hybrid and Native app. New on the scene is &lt;a href="https://flutter.dev/" rel="noopener noreferrer"&gt;Flutter&lt;/a&gt; written in Dart, and claims to compile all the way down to native code. Is Flutter native then? Who makes the rules?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmfdtnc8m2l6vx594vg37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fmfdtnc8m2l6vx594vg37.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>firstyearincode</category>
      <category>beginners</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Intro to Linux for New Developers</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 18 Nov 2019 08:16:55 +0000</pubDate>
      <link>https://forem.com/amberjones/intro-to-linux-for-new-developers-1con</link>
      <guid>https://forem.com/amberjones/intro-to-linux-for-new-developers-1con</guid>
      <description>&lt;p&gt;Programming is a magical &lt;em&gt;art&lt;/em&gt;. Like any artist, reliable tools are important to your ability to become the best you can at your craft. Luckily for you, this one won't cost much. &lt;/p&gt;

&lt;p&gt;Your &lt;strong&gt;operating system&lt;/strong&gt; is a tool and you should give it some thought. You have more choices here than you might realize!&lt;/p&gt;

&lt;p&gt;Windows, OS X, and iOS are well known but there are &lt;em&gt;hundreds&lt;/em&gt; more operating systems out there in large part thanks to &lt;strong&gt;Linux&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I'll explain what that is and why, as a developer, using Linux will be beneficial for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Linux&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Linux is a &lt;strong&gt;kernel&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;A kernel is program at the core of a computer's operating system and is &lt;strong&gt;one of the first programs loaded on start up.&lt;/strong&gt; It controls almost &lt;em&gt;everything else&lt;/em&gt; in the system - how files are stored, how memory is managed, and even interactions with peripherals like USBs and printers. &lt;/p&gt;

&lt;p&gt;The Linux kernel is &lt;em&gt;freely available&lt;/em&gt; (&lt;a href="https://github.com/torvalds/linux"&gt;check it out on github&lt;/a&gt;), and as such many operating systems have grown from it, piling on other programs to make up a fully functional OS.&lt;/p&gt;

&lt;p&gt;These OSs are called Linux &lt;strong&gt;distributions&lt;/strong&gt; or &lt;em&gt;flavors&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Due to its modulearity and accessibility, Linux is super popular among DIY-ers who like to customize their setup, and people will happily share their "Linux builds". &lt;/p&gt;

&lt;p&gt;So when someone says "I use Linux", they probably mean that they use some &lt;strong&gt;distribution&lt;/strong&gt; of Linux. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Benefits of Linux OS&lt;/strong&gt;
&lt;/h2&gt;

&lt;h4&gt;
  
  
  There are 3 main benefits:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tcWz--qb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/tl7hatnw2mzot5iijzzq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tcWz--qb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/tl7hatnw2mzot5iijzzq.png" alt="Top three Reasons" width="800" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You don't have to empty your pockets by choosing a open source Linux distribution. Many were spawned from the same ideology  that humanity improves when technology is accessible. &lt;a href="https://ubuntu.com/about"&gt;Ubuntu&lt;/a&gt; for example.  &lt;/p&gt;

&lt;p&gt;Like the buffet your grandparents brought you to as a child, you are free to gleefully try all the different distros out! &lt;/p&gt;

&lt;p&gt;Don't worry about bloat, because Linux was originally created for programming, so most flavors are light and agile. In addition, the &lt;strong&gt;majority of programming languages (if they aren’t limited to a particular OS) work on Linux.&lt;/strong&gt; Have you tried working in WSL (Windows Subsystem for Linux)? Its awful slow and the set up can be very confusing. &lt;/p&gt;

&lt;p&gt;With Linux, you're in control of customization - no unnecessary software or bloatware if you don't want it. Desktop environments are abundant. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Large and small companies all over use Linux&lt;/strong&gt; so its highly likely you'll eventually come into contact with a distribution (if you haven't unknowingly already!). It is used in many if not most IOT (internet of things) devices and enterprise servers. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Amazon uses Ubuntu servers as well as their own distribution, Amazon Linux. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.techrepublic.com/article/how-linux-took-over-everything-including-microsoft-azure/"&gt;Linux usage surpasses Windows in Microsoft's Azure cloud&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Google even has two proprietary desktop distros (so you wont find them online) called Goobuntu and gLinux.  🤔&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Get familiar now to sharpen up those chops and add experience in your next resume! &lt;/p&gt;

&lt;h2&gt;
  
  
  Which one is for me?
&lt;/h2&gt;

&lt;p&gt;There are &lt;strong&gt;A LOT&lt;/strong&gt; of distributions. &lt;/p&gt;

&lt;p&gt;Because the Linux kernel is open source and anyone and use it build their own custom operation system, its impossible to say exactly how many, but the Linux wiki mentions over 400. &lt;/p&gt;

&lt;p&gt;There are however about a dozen that are popular in general use. &lt;/p&gt;

&lt;p&gt;These include Arch, Mint, Ubuntu, Debian, and enterprise grade CentOS - all well established and supported distributions. &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bRUwBBtg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/xrlfrza87b6c5njs5z0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bRUwBBtg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/xrlfrza87b6c5njs5z0z.png" alt="Linux Logos" width="800" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If working with a new operating systems sounds intimidating, &lt;a href="https://www.linuxmint.com/"&gt;Linux Mint&lt;/a&gt; is a solid start.&lt;/p&gt;

&lt;p&gt;Mint includes software like LibreOffice and outright support for multimedia formats, making a transition from Mac or Windows more comfortable. Its powerful and easy to use while sill maintaining that sweet customization Linux is known for. &lt;/p&gt;

&lt;p&gt;Each of the popular distributions have their strengths, so check out a few and search around Dev.to to see what other developers are using. ;)&lt;/p&gt;

&lt;p&gt;Good luck explorer! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>linux</category>
    </item>
    <item>
      <title>5 Delightful Things about Material-UI</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 11 Nov 2019 08:58:33 +0000</pubDate>
      <link>https://forem.com/amberjones/5-delightful-things-about-material-ui-5402</link>
      <guid>https://forem.com/amberjones/5-delightful-things-about-material-ui-5402</guid>
      <description>&lt;p&gt;Whether you go gaga for Material Design or gag looking at it, the "card" or "paper" concept with a focus on surfaces and edges continues to be a popular and broadly applied application style. &lt;/p&gt;

&lt;p&gt;Material-UI, the React component library based on Google Material Design,  allows for faster and easier stylized web development. With basic React framework familiarity, you can build a deliciously material app with Material-UI, and its almost like cheating. &lt;em&gt;Almost.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;This MIT-licensed open source project is more than just parlor tricks though and can get deep quickly. But don't let me scare you! I recently built an app with Material-UI for the first time, and by the end I was delighted. Here are 5 things I appreciated about Material-UI:&lt;/p&gt;

&lt;h4&gt;
  
  
  1. It's well documented
&lt;/h4&gt;

&lt;p&gt;The official documentation is organized and easily navigable. The library's popularity means you have access to tons of code examples on the web if the documentation is confusing. You can also head over to StackOverflow for technical Q&amp;amp;A from Material-UI devs and the core team.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Regular updates
&lt;/h4&gt;

&lt;p&gt;With the recent release of Material-UI v4 (May of 2019) and blog posts with new features and future goals posted monthly, Material-UI doesn't look like its dying down anytime soon. Along with feature updates and improvements, here are the GitHub stats from the latest blog posted November 8th: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;We have accepted 182 commits from 68 different contributors. We have changed 1,157 files with 31,312 additions and 9,771 deletions.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Cheers to that! 🙌🙌🙌&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Consistent appearance
&lt;/h4&gt;

&lt;p&gt;Okay, this is kind of cheating because its a library, so of course the appearance is going to be consistent. BUT Material-UI is a HUGE library, and the benefit is you have some choices.  &lt;/p&gt;

&lt;p&gt;Aesthetic preferences for Material Design aside, your web project has a high chance of retaining similarity in appearance and functions all throughout.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Creative freedom
&lt;/h4&gt;

&lt;p&gt;You don't have to have a consistent appearance if you don't want to! &lt;br&gt;
I know, I know - I just said that it creates a consistent appearance, but that's out of the box. As I hinted at earlier, there is actually quite a lot of depth to the Material-UI components and the developers encourage customization. Material-UI doesn't force Material Design style on you, &lt;em&gt;it just offers it.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;One delightful component was the ThemeProvider. Placed at the root of your app, you can change the colors, the typography and much more of all sub-Material-UI components! However, this is optional; Material-UI components come with a default theme. Code magic. &lt;/p&gt;

&lt;h4&gt;
  
  
  5. Components work in isolation
&lt;/h4&gt;

&lt;p&gt;Material-UI components are self-supporting, and will only inject the styles they need to display. They don't rely on any global style-sheets such as normalize.css! You only want to use that &lt;a href="https://material-ui.com/components/progress/"&gt;super cool progress spinner&lt;/a&gt;? Grab it! Live your best life! &lt;/p&gt;

&lt;p&gt;So there you have it! Go try it on for size if you haven't already. &lt;br&gt;
There are some great &lt;a href="https://material-ui.com/getting-started/learn/"&gt;resources for starting projects&lt;/a&gt; on the official website. &lt;br&gt;
If you have played around with Material-UI or its part of your regular build, let me know what you liked or what surprised you! &lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>How to Escape Callback Hell with JavaScipt Promises</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 21 Oct 2019 05:18:10 +0000</pubDate>
      <link>https://forem.com/amberjones/how-to-escape-callback-hell-with-javascipt-promises-42d0</link>
      <guid>https://forem.com/amberjones/how-to-escape-callback-hell-with-javascipt-promises-42d0</guid>
      <description>&lt;p&gt;What's callback hell and what the hell are Promises??  To dive into those questions requires some basic understanding of the Javascript callstack, so I'll go into brief detail about that first and then navigate you through and out of callback hell. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Nature of the Beast&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JavaScript is a single threaded language - meaning it has a single callstack and it can only &lt;strong&gt;execute one line of code at a time.&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;callstack&lt;/strong&gt; is basically a data structure which keeps track of what the program should run next. It follows the rules of FIFO - First In, First Out. &lt;/p&gt;

&lt;p&gt;Step into a function call and it gets adds to the top of the stack, return a function and it pops off the top of the stack.  &lt;/p&gt;

&lt;p&gt;You wouldn't grab the waffle at the bottom of the stack. Neither would JavaScript. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--a4v78MgR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/4rcsce8me8zwyzgtfkaa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--a4v78MgR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/4rcsce8me8zwyzgtfkaa.png" alt="" width="512" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So yeah, Javascipt has a single callstack. And this actually makes writing code simple because you don’t have to worry about the concurrency issues - or multiple computations happening at the same time. &lt;/p&gt;

&lt;p&gt;Great! &lt;/p&gt;

&lt;p&gt;...except when you &lt;strong&gt;do&lt;/strong&gt; want stuff to happen at the same time. For example,  writing web applications that make dozens of asynchronous calls to the network - you dont want to stop the the rest of your code from executing just to wait for a response. When this happens, its called holding up the event loop or "main thread". &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Callback Hell&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The first solution to work around JavaScript's single thread is &lt;strong&gt;to nest functions as callbacks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It gets the job done, but determining the current scope and available variables can be incredibly challenging and frustrating.&lt;/p&gt;

&lt;p&gt;And it just makes you feel like:  &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HJaIhd35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/0jcwqsd78si29lue3xcq.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HJaIhd35--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/0jcwqsd78si29lue3xcq.gif" alt="" width="500" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you have so many nested functions you find yourself getting lost in the mist - this is whats referred to as &lt;strong&gt;callback hell&lt;/strong&gt;. Its scary and no one wants to be there!  &lt;/p&gt;

&lt;p&gt;Nested callbacks tends to develop a distinct pyramid shape -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fightTheDemogorgon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;rollForDamage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seasonsLeft&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;closeTheGate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seasonsLeft&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;finalResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hawkins is safe for &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;finalResult&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; more seasons.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;failureCallback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;failureCallback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="nx"&gt;failureCallback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;And just imagine this happening even further, with 10 or 15 more nested functions calls. SCARY RIGHT??&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;JavaScript developers recognized this was a problem, and they created &lt;strong&gt;Promises.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Introduced in ES6 (2015), a Promise is an alternative way to format your asynchronous functions without breaking the event loop.  It returns a special promise object that represents a future result. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Whats the Difference?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A lot of it is formatting. &lt;/p&gt;

&lt;p&gt;Callbacks do  not return anything right away, they take a function as an argument, and then you tell the executing function what to do when the asynchronous task completes.&lt;/p&gt;

&lt;p&gt;Promises on the other hand immediately return a special promise object. They do not need a function argument, thus it does not need to be nested. &lt;br&gt;
You provide the action to be taken when the asynchronous task completes using a promise method called &lt;strong&gt;then()&lt;/strong&gt;. &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Chaining, aka the Power of Friendship&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8lZJBUxj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/32pbix2d0cl6pqur5i6z.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8lZJBUxj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/32pbix2d0cl6pqur5i6z.jpg" alt="Alt Text" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The truly &lt;strong&gt;AWESOME&lt;/strong&gt; thing about Promises is that they can be &lt;strong&gt;chained&lt;/strong&gt; by using their &lt;strong&gt;then()&lt;/strong&gt; method when we need to execute two or more asynchronous operations back to back. &lt;/p&gt;

&lt;p&gt;Each chained then() function returns a new promise, different from the original and represents the completion of another asynchronous step in the chain.&lt;/p&gt;

&lt;p&gt;You can basically read it as &lt;strong&gt;Do this, THEN do this, THEN this.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Promises also have a catch() method. Chaining a catch() to end of a chain will give you the errors for &lt;strong&gt;any failed promise in the chain&lt;/strong&gt;. Its also useful to set an action to take in the event of a failure in the chain.&lt;/p&gt;

&lt;p&gt;Promise chaining allows us to get rid of the nasty nesting callback pattern and flatten our JavaScript code into more readable format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fightTheDemogorgon&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;rollForDamage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seasonsLeft&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;closeTheGateIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seasonsLeft&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;finalResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hawkins is safe for &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;finalResult&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; more seasons.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;failureCallback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With ES6 syntax we can condense this even further!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;fightTheDemogorgon&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;rollForDamage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;seasonsLeft&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;closeTheGateIn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;seasonsLeft&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;finalResult&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hawkins is safe for &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;finalResult&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt; more seasons.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;failureCallback&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Defeating the Beast, Escaping Hell&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The beast here being asynchronous calls, and hell being callback hell.&lt;/p&gt;

&lt;p&gt;There is nothing stopping you from nesting Promise functions in typical callback fashion. &lt;strong&gt;But it's not necessary!&lt;/strong&gt; This is usually accidentally self inflicted and is just a lack a familiarity with Promises.&lt;/p&gt;

&lt;p&gt;You can think of Promises as callbacks in fancy new clothes.  It allows asynchronous code to look cleaner, promotes ease of use and readability, most importantly, it gives you a way out of callback hell. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1G9u7mL6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/fenib8mt3142d7ttvtds.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1G9u7mL6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://thepracticaldev.s3.amazonaws.com/i/fenib8mt3142d7ttvtds.gif" alt="Alt Text" width="480" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There is an even &lt;strong&gt;newer&lt;/strong&gt; method called Async/await introduced in ES8 (2017). Check it out! &lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks for reading!
&lt;/h3&gt;

&lt;p&gt;References: &lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=8aGhZQkoFbQ"&gt;https://www.youtube.com/watch?v=8aGhZQkoFbQ&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>AJAX History &amp; Modern Security</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Mon, 07 Oct 2019 05:34:10 +0000</pubDate>
      <link>https://forem.com/amberjones/hacktober-history-in-ajax-security-h69</link>
      <guid>https://forem.com/amberjones/hacktober-history-in-ajax-security-h69</guid>
      <description>&lt;p&gt;Happy national cyber security awareness month! &lt;/p&gt;

&lt;p&gt;Today I'll be exploring AJAX - an introduction to it, the vulnerabilities of using it, and then &lt;strong&gt;BONUS:&lt;/strong&gt; a great hacker moment in history. &lt;/p&gt;

&lt;p&gt;Okay lets get into it! &lt;/p&gt;


&lt;h3&gt; &lt;strong&gt;What is an AJAX?&lt;/strong&gt; &lt;h3&gt;

&lt;/h3&gt;
&lt;/h3&gt;
&lt;p&gt;AJAX coined in back in 2005 stands for &lt;strong&gt;A&lt;/strong&gt;synchronous &lt;strong&gt;J&lt;/strong&gt;avaScript &lt;strong&gt;A&lt;/strong&gt;nd &lt;strong&gt;X&lt;/strong&gt;ML. &lt;/p&gt;

&lt;p&gt;A super-powered combination of existing technologies that give dynamic and uninterrupted web experiences. We can 'upvote' a show without reloading the WHOLE DAMN PAGE and interrupting our Netflix binge.&lt;/p&gt;

&lt;p&gt;Truly, amazing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous" rel="noopener noreferrer"&gt;Asynchronous Javascript&lt;/a&gt; binds the technologies together and the XMLHttpRequest sends requests for information to the server via HTTP.&lt;/p&gt;

&lt;p&gt;The XML part? Its just the format of the request. Its kinda outdated and we don't use it too much anymore. Many sites now use JSON (JavaScript Object Notation) in place of XML. Fetch has replaced XMLHttpRequests. &lt;/p&gt;

&lt;p&gt;We still use the acronym AJAX as a generic term to describe technologies working together to quickly save or retrieve small amounts of info from the server. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the point where I raise my hand in favor of renaming it to AJAW&lt;/em&gt; - &lt;em&gt;&lt;strong&gt;A&lt;/strong&gt;synchronous &lt;strong&gt;J&lt;/strong&gt;avaScript &lt;strong&gt;A&lt;/strong&gt;nd &lt;strong&gt;W&lt;/strong&gt;hatever.&lt;/em&gt;&lt;/p&gt;


&lt;h3&gt; &lt;strong&gt;Security Issues&lt;/strong&gt; &lt;h3&gt;

&lt;/h3&gt;
&lt;/h3&gt;
&lt;p&gt;Now that we know what AJAX is, lets talk about its vulnerabilities. &lt;br&gt;
&lt;strong&gt;SPOILER ALERT!&lt;/strong&gt; There are a lot. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fl14365cnfridvv56mbvd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fl14365cnfridvv56mbvd.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I won't be going into each type of attack in this post, but more of WHY its possible. &lt;/p&gt;

&lt;p&gt;As we learned, AJAX has a lot of stuff going on inside it. What it doesn't have is built in &lt;strong&gt;security&lt;/strong&gt;.  When AJAX we being developed in the early 2000's, the priority was getting it to &lt;em&gt;work&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;One of the biggest vulnerabilities, as obvious as it may be, is that an since AJAX is just a bunch of tools it has no native encoding mechanisms. Function calls are sent in plain text to the server.&lt;/p&gt;


&lt;h4&gt;
&lt;strong&gt;Increased Attack Surface&lt;/strong&gt;&lt;h4&gt; 

&lt;/h4&gt;
&lt;/h4&gt;
&lt;p&gt;Attack Surface is all the ways attackers can try to enter data to or extract data from an environment. All the dynamic communication across the client and server, each data request is a way in to inject malicious content. &lt;/p&gt;

&lt;p&gt;Keeping the attack surface as small as possible is good security practice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7rcpir4d5ic6nwzu3xim.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F7rcpir4d5ic6nwzu3xim.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Asynchronous web is cool and all, but is it worth it if your data is traversing the wire in plain text and every request is a potential attack surface?&lt;/p&gt;

&lt;p&gt;Well, there is something I've been holding back from you. &lt;/p&gt;

&lt;p&gt;Its called &lt;strong&gt;HTTPS&lt;/strong&gt;. This is HTTP with &lt;strong&gt;S&lt;/strong&gt;ecurity. It is your same syntax for HTTP requests and responses but with encrypted data flow between client and sever, making your communication safer and more secure. &lt;/p&gt;


&lt;h4&gt;What can we do as individuls?&lt;h4&gt;

&lt;/h4&gt;
&lt;/h4&gt;
&lt;p&gt;Using secure HTTPS/SSL channels is the easiest way to prevent attacks from happening. Use modern web browsers and be sure you install updates regularly!  &lt;/p&gt;

&lt;p&gt;In 2018, Google started labeling sites lacking SSL Certificates (the certificate which once installed on the website results in an HTTPS secure URL) as “not secure”. Most browers have followed suite. Visit an HTTP site in Chrome and you'll probably see a warning like this: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3nrsnw9mxxrt6v43qx0b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3nrsnw9mxxrt6v43qx0b.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.eff.org/https-everywhere" rel="noopener noreferrer"&gt;&lt;strong&gt;HTTPS Everywhere&lt;/strong&gt;&lt;/a&gt; is a handy browser extension developed by the Electronic Frontier Foundation and is available for Mozilla Firefox, Google Chrome, Chromium, and Android. It uses clever technology to rewrite HTTP requests in HTTPS for hundreds of frequently visited websites. &lt;/p&gt;


&lt;h4&gt;What can we do as app builders and webmasters? &lt;h4&gt;

&lt;/h4&gt;
&lt;/h4&gt;
&lt;p&gt;A lot! There are a lot of ways (even easy ways) to mitigate the security vulnerabilities of using AJAX. It’s not terribly expensive or difficult to convert your site to HTTPS. It won't slow down your site or make it use more server CPU. Some web hosting companies even offer a SSL certificate for free as an incentive to host with them. &lt;/p&gt;

&lt;p&gt;Even if you’re not dealing with credit card information, using HTTPS will make your visitors accounts safer and can increase your search ranking. &lt;/p&gt;

&lt;p&gt;HTTPS is the norm! Get on board. &lt;/p&gt;


&lt;h3&gt;
&lt;strong&gt;Great Hacker Moment in History&lt;/strong&gt;&lt;h3&gt;

&lt;/h3&gt;
&lt;/h3&gt;
&lt;p&gt;October 4th 2005. &lt;/p&gt;

&lt;p&gt;Samy Kamkar was 19 years old when he released a cross-site scripting worm on what was at the time, the largest and most popular online social network - &lt;strong&gt;MySpace&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;In less than a day, Samy's virus made him the 'friend' to more than a million people.  It also added "but most of all, samy is my hero" to all his new 'friends' profiles.  &lt;/p&gt;

&lt;p&gt;The top-10 trafficked website was forced to shutdown to stop the onslaught.  &lt;/p&gt;

&lt;p&gt;How did he do it? Using AJAX - Javascript HTTP GETs and POSTs requests - and exploiting MySpace's oversight in preventing the injection of DIV tags.  MySpace has since secured its site against the vulnerability and for a fascinating technical breakdown, check it out on Samy's personal blog. &lt;/p&gt;

&lt;p&gt;While more experimental then malicious, Samy's worm gave the world a wake up call to the potential destruction of unsecured data requests.&lt;/p&gt;

&lt;p&gt;Thanks Samy! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy Hacktober everyone!&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;For more information on AJAX, HTTPS, and the Samy Worm check out these resources:&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX" rel="noopener noreferrer"&gt;https://developer.mozilla.org/en-US/docs/Web/Guide/AJAX&lt;/a&gt;&lt;br&gt;
&lt;a href="https://thehistoryoftheweb.com/what-does-ajax-even-stand-for/" rel="noopener noreferrer"&gt;https://thehistoryoftheweb.com/what-does-ajax-even-stand-for/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.owasp.org/index.php/Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)" rel="noopener noreferrer"&gt;https://www.owasp.org/index.php/Testing_for_AJAX_Vulnerabilities_(OWASP-AJ-001)&lt;/a&gt;&lt;br&gt;
&lt;a href="https://security.googleblog.com/2018/02/a-secure-web-is-here-to-stay.html" rel="noopener noreferrer"&gt;https://security.googleblog.com/2018/02/a-secure-web-is-here-to-stay.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.vice.com/en_us/article/wnjwb4/the-myspace-worm-that-changed-the-internet-forever" rel="noopener noreferrer"&gt;https://www.vice.com/en_us/article/wnjwb4/the-myspace-worm-that-changed-the-internet-forever&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>security</category>
      <category>javascript</category>
      <category>https</category>
    </item>
    <item>
      <title>Intro to Graph Data Structures</title>
      <dc:creator>AmberJ</dc:creator>
      <pubDate>Sun, 29 Sep 2019 22:27:25 +0000</pubDate>
      <link>https://forem.com/amberjones/intro-to-graph-data-structures-abk</link>
      <guid>https://forem.com/amberjones/intro-to-graph-data-structures-abk</guid>
      <description>&lt;p&gt;Data structures are just ways we organize data. &lt;/p&gt;

&lt;p&gt;The one I'm sure you're familiar with is the &lt;strong&gt;list&lt;/strong&gt; or &lt;strong&gt;array&lt;/strong&gt;, a &lt;strong&gt;linear&lt;/strong&gt; ordered sequence of values. This is your shopping list, your to-do, your reading, whatever. &lt;/p&gt;

&lt;p&gt;Lets explore the way more exciting realm of &lt;strong&gt;non-linear&lt;/strong&gt; graphs!&lt;/p&gt;

&lt;h4&gt;
  
  
  But first, some basics:
&lt;/h4&gt;

&lt;p&gt;A graph is comprised of objects connected by lines. &lt;/p&gt;

&lt;p&gt;In JavaScript (and computer science at large), we refer to those objects and lines as &lt;strong&gt;vertices and edges&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;The benefit of a graph structure is that not only can you represent nodes of data but also their &lt;em&gt;relationship&lt;/em&gt; to each other through properties assigned to their edges. &lt;/p&gt;

&lt;p&gt;Two common properties of edges are &lt;strong&gt;weights&lt;/strong&gt; and &lt;strong&gt;direction&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;If a graph has weights, it is considered &lt;strong&gt;weighted&lt;/strong&gt; and if it has direction, it is considered &lt;strong&gt;directed&lt;/strong&gt;. Direction can go one way or both ways. &lt;/p&gt;

&lt;p&gt;Susan can have a crush on Sally, but that doesn't mean Sally has a crush on Susan. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8d48c6klwattmg47q9t2.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F8d48c6klwattmg47q9t2.JPG" alt="Alt Text"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Now, imagine yourself, just floating in space all by your lonesome. You have a lot of knowledge, and no one to share it with. &lt;/p&gt;

&lt;p&gt;Another space traveler appears, "Hey friend! Lets keep in contact". You give them your number, and suddenly, you have meaning and cease to be a singular speck of dust in space. You have become a node and you have created a connecting &lt;strong&gt;edge&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;But it costs you.  &lt;/p&gt;

&lt;p&gt;Each time you call your space friend, you're billed by your telephone company $12393900.00. This is the &lt;strong&gt;weight&lt;/strong&gt; of your connecting edge. &lt;/p&gt;

&lt;h4&gt;
  
  
  Lets come back from space and look at IRL graph data structures
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5sp8qepost3hny2k6pcx.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F5sp8qepost3hny2k6pcx.JPG" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Classic example is Google Maps. Its just one big graph! &lt;/p&gt;

&lt;p&gt;Streets intersecting are vertices, and the streets themselves are edges. &lt;br&gt;
They are &lt;strong&gt;weighted&lt;/strong&gt; by distance in length and time. The streets also have a &lt;strong&gt;directionality&lt;/strong&gt; property...some streets only go one way. &lt;/p&gt;

&lt;p&gt;Traversing a Graph refers to finding a path between two nodes, finding the shortest path from one node to another and finding the shortest path that visits all nodes [1].&lt;/p&gt;

&lt;p&gt;On of many methods to traverse a graph is using &lt;strong&gt;Dijkstra's algorithm&lt;/strong&gt; (or Dijkstra's Shortest Path First algorithm, SPF algorithm). This is the one Google used (or a variant of) to implement their map application. This algorithm was originally conceived by Dijkstra in 1958 in 20 minutes at a cafe in Paris [2]. &lt;/p&gt;

&lt;p&gt;Here's what it looks like in Javascript: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgidzjdndg2lstu5t8qnf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fgidzjdndg2lstu5t8qnf.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  A note on Tree Graphs...
&lt;/h4&gt;

&lt;p&gt;That family tree you had to make in Kindergarten?  Yup, a Tree Graph. &lt;/p&gt;

&lt;p&gt;Here's the thing, &lt;strong&gt;Tree Graphs&lt;/strong&gt; are a highly specialized form of a Graph, with a root node that all other nodes are decedents of. &lt;/p&gt;

&lt;p&gt;Its important to make the distinction between a Tree Graph and a Graph, because they have some overlapping qualities like , but their rules on structuring data are completely different. &lt;/p&gt;

&lt;p&gt;So in JavaScript, they are considered entirely different data structures.&lt;br&gt;
For an in-depth and entertaining read on Trees, check out &lt;a href="https://dev.to/jillianntish/a-brief-descent-into-javascript-trees-48lm"&gt;this article&lt;/a&gt; by fellow DEV community member Jill. &lt;/p&gt;

&lt;p&gt;Graphs are a non-hierarchical structures of how data relates, connecting our entire world! &lt;/p&gt;

&lt;p&gt;Title Image: Social Network Analysis Visualization [Grandjean, M. (2016)]&lt;br&gt;
[1] &lt;a href="https://www.jenniferbland.com/the-difference-between-a-tree-and-a-graph-data-structure/" rel="noopener noreferrer"&gt;https://www.jenniferbland.com/the-difference-between-a-tree-and-a-graph-data-structure/&lt;/a&gt;&lt;br&gt;
[2]&lt;a href="https://www.vice.com/en_us/article/4x3pp9/the-simple-elegant-algorithm-that-makes-google-maps-possible" rel="noopener noreferrer"&gt;https://www.vice.com/en_us/article/4x3pp9/the-simple-elegant-algorithm-that-makes-google-maps-possible&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>firstyearincode</category>
    </item>
  </channel>
</rss>
