<commit_before><!DOCTYPE html>

<html>
<head>
  <title>Arrays and Hashes</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="../stylesheets/default.css">
  <link rel="stylesheet" type="text/css" href="../stylesheets/blog.css">
</head>

<body>

<header>
  <!-- Site logo -->
  <img src="../imgs/logo.png" alt="site logo">
  <h1>JavaScript &amp; Donuts</h1>
  <!-- Nav bar -->
  <nav>
    <ul>
      <li id="home"><a href="#">Home</a></li>
      <li id="portfolio"><a href="#">Portfolio</a></li>
      <li id="resume"><a href="#">Resume</a></li>
      <li id="blog"><a href="index.html">Blog</a></li>
      <li id="contact"><a href="#">Contact</a></li>
    </ul>
  </nav>
</header>

<main>
  <h1>Arrays &amp; Hashes <span>/ when and how to use them</span></h1>
  <h4>January 24, 2016</h4>
  <h4>Alyssa Page</h4>

  <section>
    <p>
    Both arrays and hashes are data structures. They allow adding data, accessing data and removing data.
    Let's create both with some data about a dog.
      <%
        dog_array = [["name", "Charlie"], ["age", 7], ["breed", "corgi"]]
        dog_hash = {
        :name => "Charlie",
        :age => 7,
        :breed => "corgi"
        }
      %>
    So now we have create an array of arrays and a hash both containing the same information about a dog. Data can be added while creating both data structures or after the empty structures are created.
    </p>
    <p>
    To access the data in an array we either need to know the index of where it is stored or iterate over each value until we find what we are searching for.
    Hashes on the other hand use unique keys to store and retrieve values. These are called key value pairs. So in order to find the age of the dog in the array we either have to know
    that it is stored at index [1][1] or iterate through the array to find it. In a hash we simply call the key
      <%
        dog_hash[:age] 
      %>
      and it accesses the value of 7.
    </p>
    Both hashes and arrays are used to store data but it is important to know when to use them. Hashes make retrieving data much easier and faster since 
    knowing the location is not neccessary. On the other hand, if you are wanting to iterate over a list of data, using an array and its methods would be easier.
    
   

      <!-- copy and paste as many sections as you want to add paragraphs -->
  </section>
</main>

<footer>
<div class="page-break"></div>
  <!-- links to social media -->
  <div class="social-media">
  <a href="https://twitter.com/page_ajay"><img src="../imgs/entoni_twitterbird-48.png" alt="twitter link"></a>
  <a href="https://github.com/ajpage"><img src="../imgs/entoni_github-48.png" alt="GitHub link"></a>
  <a href="https://www.linkedin.com/in/alyssa-page-b7714781"><img src="../imgs/entoni_linkedin-48.png" alt="LinkedIn link"></a>
  </div>
  <h6>&copy; <NAME> 2016</h6>
</footer>

</body>
</html><commit_msg>Update arrays-hashes.html<commit_after><!DOCTYPE html>

<html>
<head>
  <title>Arrays and Hashes</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="../stylesheets/default.css">
  <link rel="stylesheet" type="text/css" href="../stylesheets/blog.css">
</head>

<body>

<header>
  <!-- Site logo -->
  <img src="../imgs/logo.png" alt="site logo">
  <h1>JavaScript &amp; Donuts</h1>
  <!-- Nav bar -->
  <nav>
    <ul>
      <li id="home"><a href="#">Home</a></li>
      <li id="portfolio"><a href="#">Portfolio</a></li>
      <li id="resume"><a href="#">Resume</a></li>
      <li id="blog"><a href="index.html">Blog</a></li>
      <li id="contact"><a href="#">Contact</a></li>
    </ul>
  </nav>
</header>

<main>
  <h1>Arrays &amp; Hashes <span>/ when and how to use them</span></h1>
  <h4>January 24, 2016</h4>
  <h4>Alyssa Page</h4>

  <section>
    <p>
    Both arrays and hashes are data structures. They allow adding data, accessing data and removing data.
    Let's create both with some data about a dog.
      ``` [Ruby]
        dog_array = [["name", "Charlie"], ["age", 7], ["breed", "corgi"]]
        dog_hash = {
        :name => "Charlie",
        :age => 7,
        :breed => "corgi"
        }
      ```
    So now we have create an array of arrays and a hash both containing the same information about a dog. Data can be added while creating both data structures or after the empty structures are created.
    </p>
    <p>
    To access the data in an array we either need to know the index of where it is stored or iterate over each value until we find what we are searching for.
    Hashes on the other hand use unique keys to store and retrieve values. These are called key value pairs. So in order to find the age of the dog in the array we either have to know
    that it is stored at index [1][1] or iterate through the array to find it. In a hash we simply call the key
      ``` [Ruby]
        dog_hash[:age] 
      ```
      and it accesses the value of 7.
    </p>
    Both hashes and arrays are used to store data but it is important to know when to use them. Hashes make retrieving data much easier and faster since 
    knowing the location is not neccessary. On the other hand, if you are wanting to iterate over a list of data, using an array and its methods would be easier.
    
   

      <!-- copy and paste as many sections as you want to add paragraphs -->
  </section>
</main>

<footer>
<div class="page-break"></div>
  <!-- links to social media -->
  <div class="social-media">
  <a href="https://twitter.com/page_ajay"><img src="../imgs/entoni_twitterbird-48.png" alt="twitter link"></a>
  <a href="https://github.com/ajpage"><img src="../imgs/entoni_github-48.png" alt="GitHub link"></a>
  <a href="https://www.linkedin.com/in/alyssa-page-b7714781"><img src="../imgs/entoni_linkedin-48.png" alt="LinkedIn link"></a>
  </div>
  <h6>&copy; <NAME> 2016</h6>
</footer>

</body>
</html>
{'fraction_non_alphanumeric': 0.15479031708148652, 'fraction_numerical': 0.013296965564268667, 'mean_word_length': 3.0184931506849315, 'pattern_counts': {'":': 0, '<': 163, '<?xml version=': 0, '>': 169, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3358481', 'n_tokens_mistral': 1968, 'n_tokens_neox': 1871, 'n_words': 702}