<commit_before><!DOCTYPE>
  <html>

      <head>
          <title>Andrew's Blog</title>

          <link type="text/css" rel="stylesheet" href="../stylesheets/blog-stylesheet.css"/>

      </head>

     <body>

      <div id="site">Golbs' Wernda</div>

      <div id="topic">Class-y Writings</div>

      <div id="date">11.30.14</div>

      <div id="thoughts">If you weren't aware, Ruby is considered 'object-oriented' in terms of its programming approach; meaning that we create objects in Ruby that are our workers.  These objects are code that do our work for us, and even work together to do our work for us.  What happens if we want to create a group of objects that have the same function?  For example, we want to write a program that acts like RPG dice?  Should we write an object for a 4-sided die, then a 6-sided, then 8, then 10, then 12?  Of course that is possible, but we can make it a lot easier by using Ruby's 'class' structure.
      <br>
      <br>
      A 'class' structure in Ruby can create one block of code that can be used for a class of objects; like dice.  The following image shows us how a class for dice would look.
      <br>
      <br>
      <img src="../imgs/Class_Die.jpg" width = "350px"/>
      <br>
      <br>
      Looking at the example above, we see that some structures inside it look familiar, and something new:  'initialize.' The 'initialize' component of a class structure gives the class structure the ability to accept an argument, in this case the number of sides of the object/die we want to create.  When we 'initialize' the sides, we're telling the class to pay attention to the argument passed to it from the user.
      <br>
      <br>
      <img src="../imgs/Initialize.jpg" width = "350px"/>
      <br>
      <br>
      Note: We're also going to tell the class to return an error statement if the sides in the argument are less than 2, because a die with only 1 side is a marble, and there isn't a zero sided die (as far as current metaphysics can tell ;) )
      <br>
      <br>
      Below the initialize component you see we have structures that look like methods, that's because they are!  They're just methods we create inside the class.  We can do this repeatedly.  Separating code into methods in a class is a great way to organize.  But it's not always necessary, just clean, and courteous to other developers who use our code.
      <br>
      <br>
      <img src="../imgs/class_methods.jpg" width = "350px"/>
      <br>
      <br>
      Let's take a look at something new here in our class; the '@' symbol.  These designate methods and variables as 'instance variables'.  By placing the '@' symbol in front of methods and variables when we define them, we can call them in other parts of our class.  It's a little confusing though, because in the initialize component above, it says '@sides = sides'.  Remember that we're accepting an argument from the user that comes from outside this class.  This is called an instance.  Putting the @ in front of sides then equating it to 'sides' creates an instance variable.  Putting that instance variable in the intialize basically says "whatever the argument for the number of sides, declared by the user, use that argument in the class wherever we see the '@sides'".
      <br>
      <br>
      <img src="../imgs/instance_symbol.jpg" width = "350px"/>
      <br>
      <br>
      Instance methods perform the same way.  If we created an '@color' instance method in the class, we could say that the class is to pick a random color from a given set, then when we get output, we can say that the random number returned came from a specific colored die. This may not seem useful in the context of rolling a die; but instance variables are neccessary when crafting more complex classes that face challenges like decoding or creating bingo games.
      <br>
      <br>
      To wrap up, we can use classes in Ruby to help us peform a specific action repeatedly given challenge. We can give a random number from rolling a die of a specific size, create a list for a baker when given a number of people and their order, heck, even decode a message from North Koreans!  Then, when we want to do it again, we just call the class again.  Let's roll a die again but from a different size, new order coming in for the baker, <NAME> has sent another coded message to <NAME>...you get the point.
      <br>
      <br>
      Until next time!
  </div>

    </body>

  </html><commit_msg>Fixing img size<commit_after><!DOCTYPE>
  <html>

      <head>
          <title>Andrew's Blog</title>

          <link type="text/css" rel="stylesheet" href="../stylesheets/blog-stylesheet.css"/>

      </head>

     <body>

      <div id="site">Golbs' Wernda</div>

      <div id="topic">Class-y Writings</div>

      <div id="date">11.30.14</div>

      <div id="thoughts">If you weren't aware, Ruby is considered 'object-oriented' in terms of its programming approach; meaning that we create objects in Ruby that are our workers.  These objects are code that do our work for us, and even work together to do our work for us.  What happens if we want to create a group of objects that have the same function?  For example, we want to write a program that acts like RPG dice?  Should we write an object for a 4-sided die, then a 6-sided, then 8, then 10, then 12?  Of course that is possible, but we can make it a lot easier by using Ruby's 'class' structure.
      <br>
      <br>
      A 'class' structure in Ruby can create one block of code that can be used for a class of objects; like dice.  The following image shows us how a class for dice would look.
      <br>
      <br>
      <img src="../imgs/Class_Die.jpg" width = "300px"/>
      <br>
      <br>
      Looking at the example above, we see that some structures inside it look familiar, and something new:  'initialize.' The 'initialize' component of a class structure gives the class structure the ability to accept an argument, in this case the number of sides of the object/die we want to create.  When we 'initialize' the sides, we're telling the class to pay attention to the argument passed to it from the user.
      <br>
      <br>
      <img src="../imgs/Initialize.jpg" width = "300px"/>
      <br>
      <br>
      Note: We're also going to tell the class to return an error statement if the sides in the argument are less than 2, because a die with only 1 side is a marble, and there isn't a zero sided die (as far as current metaphysics can tell ;) )
      <br>
      <br>
      Below the initialize component you see we have structures that look like methods, that's because they are!  They're just methods we create inside the class.  We can do this repeatedly.  Separating code into methods in a class is a great way to organize.  But it's not always necessary, just clean, and courteous to other developers who use our code.
      <br>
      <br>
      <img src="../imgs/class_methods.jpg" width = "300px"/>
      <br>
      <br>
      Let's take a look at something new here in our class; the '@' symbol.  These designate methods and variables as 'instance variables'.  By placing the '@' symbol in front of methods and variables when we define them, we can call them in other parts of our class.  It's a little confusing though, because in the initialize component above, it says '@sides = sides'.  Remember that we're accepting an argument from the user that comes from outside this class.  This is called an instance.  Putting the @ in front of sides then equating it to 'sides' creates an instance variable.  Putting that instance variable in the intialize basically says "whatever the argument for the number of sides, declared by the user, use that argument in the class wherever we see the '@sides'".
      <br>
      <br>
      <img src="../imgs/instance_symbol.jpg" width = "300px"/>
      <br>
      <br>
      Instance methods perform the same way.  If we created an '@color' instance method in the class, we could say that the class is to pick a random color from a given set, then when we get output, we can say that the random number returned came from a specific colored die. This may not seem useful in the context of rolling a die; but instance variables are neccessary when crafting more complex classes that face challenges like decoding or creating bingo games.
      <br>
      <br>
      To wrap up, we can use classes in Ruby to help us peform a specific action repeatedly given challenge. We can give a random number from rolling a die of a specific size, create a list for a baker when given a number of people and their order, heck, even decode a message from North Koreans!  Then, when we want to do it again, we just call the class again.  Let's roll a die again but from a different size, new order coming in for the baker, <NAME> Un has sent another coded message to <NAME>...you get the point.
      <br>
      <br>
      Until next time!
  </div>

    </body>

  </html>
{'fraction_non_alphanumeric': 0.07118152404328908, 'fraction_numerical': 0.006024768492692179, 'mean_word_length': 3.078252957233849, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 99, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2194831', 'n_tokens_mistral': 2438, 'n_tokens_neox': 2317, 'n_words': 1388}