<?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>DEV Community: Shay</title>
    <description>The latest articles on DEV Community by Shay (@shay90210).</description>
    <link>https://dev.to/shay90210</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%2F1251118%2F31bbfc01-ae85-4f57-b1cc-098b35ef1eb9.jpg</url>
      <title>DEV Community: Shay</title>
      <link>https://dev.to/shay90210</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shay90210"/>
    <language>en</language>
    <item>
      <title>Ruby: Hash Class</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Wed, 13 Mar 2024 15:43:05 +0000</pubDate>
      <link>https://dev.to/shay90210/ruby-hash-class-2o53</link>
      <guid>https://dev.to/shay90210/ruby-hash-class-2o53</guid>
      <description>&lt;p&gt;In Ruby, a hash is a data structure that stores key-value pairs. It is similar to an associative array or a dictionary in other programming languages. Hashes are unordered collections of data, where each element is addressed by a unique key.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hash Overview
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Key-Value Pairs&lt;/strong&gt;: Each element in a hash consists of a key-value pair. The key is unique within the hash and is used to access the corresponding value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unordered&lt;/strong&gt;: Hashes in Ruby are unordered, meaning there's no guarantee of the order in which the key-value pairs are stored internally. The order of insertion is not preserved.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexible Keys and Values&lt;/strong&gt;: Keys and values in a hash can be of any data type, including strings, symbols, integers, or even other hashes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dynamic Size&lt;/strong&gt;: Hashes in Ruby can grow and shrink dynamically as key-value pairs are added or removed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fast Lookup&lt;/strong&gt;: Hashes provide fast lookup times for retrieving values based on keys, making them efficient for tasks like data retrieval and storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Operations&lt;/strong&gt;: Hashes support common operations like adding new key-value pairs, deleting key-value pairs, iterating over key-value pairs, merging with other hashes, and more.&lt;/p&gt;

&lt;p&gt;Here's an example of a hash in Ruby:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Creating a hash
my_hash = { "name" =&amp;gt; "John", "age" =&amp;gt; 30, "city" =&amp;gt; "New York" }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Accessing values using keys
puts my_hash["name"]  # Output: John
puts my_hash["age"]   # Output: 30
puts my_hash["city"]  # Output: New York
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Adding a new key-value pair
my_hash["gender"] = "Male"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Iterating over key-value pairs
my_hash.each do |key, value|
  puts "#{key}: #{value}"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Output:
# name: John
# age: 30
# city: New York
# gender: Male
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, my_hash is a hash containing key-value pairs representing attributes of a person. You can access values using their corresponding keys, add new key-value pairs, iterate over all key-value pairs, and perform other operations typical of hashes in Ruby.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hash Methods
&lt;/h3&gt;

&lt;p&gt;Hash is a separate class with its own set of methods. While Hashes do inherit some methods from the Enumerable module, they also have their own unique methods specifically tailored for working with key-value pairs.&lt;/p&gt;

&lt;p&gt;Here are some examples of methods that are specific to Hash:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[]&lt;/strong&gt; - To access values by keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[]=&lt;/strong&gt; - To assign values to keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;each&lt;/strong&gt; - Iterate over key-value pairs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;keys&lt;/strong&gt; - Get an array of keys.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;values&lt;/strong&gt; - Get an array of values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;delete&lt;/strong&gt; - Delete a key-value pair.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fetch&lt;/strong&gt; - Retrieve a value by key, with an optional default value if the key doesn't exist.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;merge&lt;/strong&gt; - Merge two hashes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;select&lt;/strong&gt; - Return a new hash containing key-value pairs that satisfy a condition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;has_key? or key?&lt;/strong&gt; - Check if a key exists in the hash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;has_value? or value?&lt;/strong&gt; - Check if a value exists in the hash.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;invert&lt;/strong&gt; - Invert keys and values in the hash.&lt;/p&gt;

&lt;p&gt;These methods are specifically designed for working with Hashes and are not borrowed from other classes. However, Ruby's Hash class does include methods from the Enumerable module, which provides additional functionality for iterating over collections.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;theGlamTechie&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ruby</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Ruby: Each Method</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Tue, 27 Feb 2024 19:11:07 +0000</pubDate>
      <link>https://dev.to/shay90210/ruby-each-method-2le3</link>
      <guid>https://dev.to/shay90210/ruby-each-method-2le3</guid>
      <description>&lt;p&gt;The each method is a fundamental method used for iterating over elements in a collection, such as arrays, hashes, or ranges. It's commonly used for performing an action on each element of the collection. Here's an explanation of the each method:&lt;/p&gt;

&lt;h3&gt;
  
  
  Syntax
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;collection.each do |item|
  # Code block to be executed for each item
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Parameters
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;collection:&lt;/strong&gt; The collection (array, hash, range, etc.) over which iteration is to be performed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;item:&lt;/strong&gt; Represents each individual element of the collection during iteration.&lt;/p&gt;

&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Array:&lt;/strong&gt; Iterate over each element of an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = [1, 2, 3, 4, 5]
array.each do |item|
  puts item
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Hash:&lt;/strong&gt; Iterate over each key-value pair of a hash.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hash = { "a" =&amp;gt; 1, "b" =&amp;gt; 2, "c" =&amp;gt; 3 }
hash.each do |key, value|
  puts "#{key}: #{value}"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Range:&lt;/strong&gt; Iterate over each element in a range.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(1..5).each do |num|
  puts num
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Behavior
&lt;/h3&gt;

&lt;p&gt;Executes the block of code for each element in the collection.&lt;br&gt;
The block's parameter (e.g., item, key, value, etc.) represents each individual element during each iteration.&lt;/p&gt;

&lt;p&gt;After executing the block for each element, the each method returns the original collection.&lt;br&gt;
&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;array = [1, 2, 3, 4, 5]
array.each do |item|
  puts item * 2
end
# Output:
# 2
# 4
# 6
# 8
# 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Notes
&lt;/h3&gt;

&lt;p&gt;The each method is commonly used in Ruby for iteration tasks, offering a clean and readable syntax.&lt;/p&gt;

&lt;p&gt;It's important to note that each does not modify the original collection. If you need to modify the collection, you might want to use methods like map, select, or reject, depending on your requirements.&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;theGlamTechie&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Ruby: Array Class</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Sun, 25 Feb 2024 19:15:01 +0000</pubDate>
      <link>https://dev.to/shay90210/ruby-array-class-4i2i</link>
      <guid>https://dev.to/shay90210/ruby-array-class-4i2i</guid>
      <description>&lt;p&gt;The Array class is a fundamental data structure used to store and manipulate collections of objects. Arrays in Ruby are ordered, indexed collections of objects, meaning the elements are arranged in a specific order and can be accessed using their position, or index, within the array. The Array class provides a wide range of methods for adding, removing, accessing, and manipulating elements within an array.&lt;/p&gt;

&lt;p&gt;Here's an overview of the Array class in Ruby:&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Arrays
&lt;/h3&gt;

&lt;p&gt;You can create arrays in Ruby using literal notation or constructor methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Literal Notation:&lt;/strong&gt; Enclosing comma-separated values within square brackets ([]).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_array = [1, 2, 3, 4, 5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using Constructor:&lt;/strong&gt; Calling the Array.new constructor method and passing initial values as arguments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_array = Array.new(3, "hello")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Accessing Elements
&lt;/h3&gt;

&lt;p&gt;You can access elements within an array using square brackets ([]) notation, specifying the index of the element you want to access.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_array = [10, 20, 30, 40, 50]
puts my_array[0] # Output: 10
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Array Methods
&lt;/h3&gt;

&lt;p&gt;The Array class provides a variety of methods for working with arrays. Some common methods include:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Adding and Removing Elements&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Push:&lt;/strong&gt; Add elements to the end or beginning of an array.&lt;br&gt;
&lt;strong&gt;Pop:&lt;/strong&gt; Remove elements from the end or beginning of an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Accessing and Modifying Elements&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;[], []=:&lt;/strong&gt; Access and modify elements at specific indices.&lt;br&gt;
&lt;strong&gt;at, fetch:&lt;/strong&gt; Access elements by index, with bounds checking.&lt;br&gt;
&lt;strong&gt;slice, slice!:&lt;/strong&gt; Extract or remove a portion of an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Iterating over Elements&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;each, map, select:&lt;/strong&gt; Iterate over elements in the array.&lt;br&gt;
&lt;strong&gt;each_with_index:&lt;/strong&gt; Iterate over elements along with their indices.&lt;br&gt;
&lt;strong&gt;cycle:&lt;/strong&gt; Repeatedly iterate over elements in the array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Searching and Sorting&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;include?, index:&lt;/strong&gt; Check if an element exists in the array and find its index.&lt;br&gt;
&lt;strong&gt;sort, reverse, shuffle:&lt;/strong&gt; Sort, reverse, or shuffle the elements in the array.&lt;br&gt;
&lt;strong&gt;min, max:&lt;/strong&gt; Find the minimum or maximum element in the array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array Properties&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Size:&lt;/strong&gt; You can determine the size of an array using the size or length methods.&lt;br&gt;
&lt;strong&gt;Empty?:&lt;/strong&gt; Check if an array is empty using the empty? method.&lt;br&gt;
&lt;strong&gt;Equality:&lt;/strong&gt; Compare arrays for equality using the == operator.&lt;/p&gt;
&lt;h3&gt;
  
  
  Multi-dimensional Arrays
&lt;/h3&gt;

&lt;p&gt;Ruby's Array class also supports multi-dimensional arrays, allowing you to create arrays of arrays.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;multi_array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
puts multi_array[1][2] # Output: 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Iterating Over Multi-dimensional Arrays&lt;/strong&gt;&lt;br&gt;
You can iterate over multi-dimensional arrays using nested loops or methods like each.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;multi_array.each do |row|
  row.each do |element|
    puts element
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using Array.new Constructor&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;multi_array = Array.new(3) { Array.new(3, 0) }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using Nested Loops&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;size = 3
multi_array = []
size.times do
  inner_array = []
  size.times do
    inner_array &amp;lt;&amp;lt; 0
  end
  multi_array &amp;lt;&amp;lt; inner_array
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;theGlamTechie&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>programming</category>
      <category>beginners</category>
      <category>coding</category>
    </item>
    <item>
      <title>Ruby: Date &amp; Time Class</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Sat, 24 Feb 2024 03:08:00 +0000</pubDate>
      <link>https://dev.to/shay90210/ruby-date-time-class-3a1d</link>
      <guid>https://dev.to/shay90210/ruby-date-time-class-3a1d</guid>
      <description>&lt;p&gt;In Ruby, the Date class is a part of the standard library that allows for the manipulation and handling of dates. It provides functionalities to work with dates in various formats, perform calculations, and convert between different representations. &lt;/p&gt;

&lt;p&gt;The Date class is particularly useful when dealing with dates and times in applications, such as managing appointments, scheduling events, or calculating durations.&lt;/p&gt;

&lt;p&gt;Here's an explanation of the Date class in Ruby:&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating Date Objects
&lt;/h3&gt;

&lt;p&gt;You can create a Date object in Ruby using one of several constructors:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Date.new Constructor:&lt;/strong&gt; You can create a Date object by specifying the year, month, and day.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'date'

date = Date.new(2024, 2, 23)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Date.parse or Date.strptime:&lt;/strong&gt; You can create a Date object by parsing a string that represents a date. The parse method attempts to parse the date from a string automatically, while strptime allows you to specify the format of the date string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;date1 = Date.parse('2024-02-23')
date2 = Date.strptime('23/02/2024', '%d/%m/%Y')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Date Arithmetic:
&lt;/h4&gt;

&lt;p&gt;The Date class provides methods for performing arithmetic operations on dates, such as adding or subtracting days, months, or years.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tomorrow = Date.today + 1
next_week = Date.today + 7
next_month = Date.today &amp;gt;&amp;gt; 1
next_year = Date.today &amp;gt;&amp;gt; 12
Date Comparison:
You can compare Date objects using comparison operators like &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=, ==, and !=.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if date1 &amp;gt; date2
  puts "date1 is later than date2"
elsif date1 &amp;lt; date2
  puts "date1 is earlier than date2"
else
  puts "date1 and date2 are equal"
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Formatting and Conversion
&lt;/h3&gt;

&lt;p&gt;The Date class provides methods to convert date objects to strings in various formats and vice versa.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;date = Date.today
date_str = date.strftime('%Y-%m-%d') # Format as "YYYY-MM-DD"
date_obj = Date.strptime(date_str, '%Y-%m-%d')
Retrieving Date Components:
You can extract individual components of a date, such as the year, month, and day.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;year = date.year
month = date.month
day = date.day
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Handling Time Zones and Time
&lt;/h3&gt;

&lt;p&gt;While the Date class handles dates, the Time class is used for handling time. The DateTime class is available for handling both date and time together.&lt;/p&gt;

&lt;p&gt;Overall, the Date class in Ruby provides a robust set of functionalities for working with dates, making it easy to manage date-related operations in Ruby applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Differences Between Date &amp;amp; Time
&lt;/h3&gt;

&lt;p&gt;Both the Date and Time classes are used for dealing with temporal data, but they serve different purposes and handle different aspects of time representation. Here's a breakdown of the differences between the two:&lt;/p&gt;

&lt;h3&gt;
  
  
  Date Class
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Representation:&lt;/strong&gt; The Date class is used specifically for representing dates without any time information. It stores year, month, and day components of a date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Precision:&lt;/strong&gt; Date objects represent an entire day, starting from midnight of the given date to just before midnight of the following day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Timezone:&lt;/strong&gt; Date objects do not store timezone information. They represent dates in the context of the calendar without regard to specific time zones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; It is primarily used for operations related to dates, such as calculating the difference between dates, adding or subtracting days, month, or years, and performing comparisons between dates.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'date'

date = Date.today
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Time Class
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Representation:&lt;/strong&gt; The Time class represents points in time, including both date and time components. It stores year, month, day, hour, minute, second, and microsecond components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Precision:&lt;/strong&gt; Time objects represent a specific moment in time, down to fractions of a second. They are precise up to the microsecond level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Timezone:&lt;/strong&gt; Time objects can store timezone information. They can represent time in different time zones or in UTC (Coordinated Universal Time).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Usage:&lt;/strong&gt; It is used for operations that require precise time information, such as measuring time intervals, calculating durations, working with timestamps, and performing time-based calculations.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require 'time'

time = Time.now
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;Use the Date class when you need to work with dates only, without considering specific times or time zones.&lt;/p&gt;

&lt;p&gt;Use the Time class when you need to represent points in time, including both date and time components, and when you need precise time measurements or need to handle time zone conversions.&lt;/p&gt;

&lt;p&gt;Other Time Methods&lt;br&gt;
&lt;strong&gt;# weekday&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pp Time.now.strftime("%A")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;# month&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pp Time.now.strftime("%B")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;# month abbreviated&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pp Time.now.strftime("%b")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;# weekday abbreviated, day of month, time and minutes with AM/PM&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pp Time.now.strftime("%a %e, %R %p")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;theGlamTechie&lt;/p&gt;

</description>
      <category>coding</category>
      <category>ruby</category>
      <category>learning</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Ruby: Integer &amp; Float Class</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Sat, 24 Feb 2024 02:52:03 +0000</pubDate>
      <link>https://dev.to/shay90210/ruby-integer-float-class-1k9p</link>
      <guid>https://dev.to/shay90210/ruby-integer-float-class-1k9p</guid>
      <description>&lt;h3&gt;
  
  
  Integer Class
&lt;/h3&gt;

&lt;p&gt;In Ruby, integer classes are a part of the core class hierarchy and represent numeric values without decimal points. Ruby provides several integer classes, each with its own set of methods and behaviors. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integer constructors:&lt;/strong&gt; You can create integers using constructor methods provided by the Integer class. For example:&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Integer() method
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = Integer("42") # Converts a string to an integer
Using to_i method:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = "42".to_i # Converts a string to an integer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Integer literals:&lt;/strong&gt; You can directly assign integer values to variables using their numeric representation. Ruby supports decimal, octal, hexadecimal, and binary literals.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decimal:&lt;/strong&gt; This is the most common way of representing integers. This type of decimal will always be a whole number. There is another class that represents decimal point integers.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 42
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Usage
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Mathematical Operations:&lt;/strong&gt; Integers are commonly used in arithmetic operations such as addition, subtraction, multiplication, and division.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 10
y = 20
sum = x + y # sum will be 30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Comparison Operations:&lt;/strong&gt; Integers can be compared using relational operators like &amp;lt;, &amp;lt;=, &amp;gt;, &amp;gt;=, and equality operators like ==, !=.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 10
y = 20
puts x &amp;lt; y # Output: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Iteration:&lt;/strong&gt; Integers are often used for looping constructs like for loops or iterators such as times.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5.times do |i|
    puts i
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Indexing and Array Access:&lt;/strong&gt; Integers are used as indices to access elements in arrays or other data structures.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arr = [10, 20, 30, 40, 50]
puts arr[2] # Output: 30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conversion:&lt;/strong&gt; Integers can be converted to strings (to_s) or other numeric types like floats (to_f) if needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 42
str = x.to_s # Convert integer to string
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Float Class
&lt;/h3&gt;

&lt;p&gt;In Ruby, floats are numeric data types used to represent numbers with decimal points. Floats, short for floating-point numbers, allow for the representation of both integer and fractional parts of numbers. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Float literals:&lt;/strong&gt; You can directly assign float values to variables using their numeric representation. Floats can be written in decimal notation or scientific notation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Decimal notation:&lt;/strong&gt; Floats written with a decimal point. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = 3.14
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Float constructors:&lt;/strong&gt; You can create floats using constructor methods provided by the Float class. For example:&lt;/p&gt;

&lt;h3&gt;
  
  
  Using Float() method
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = Float("3.14")
Using to_f method:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;x = "3.14".to_f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Integer &amp;amp; Float Methods
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;.Math.sqrt():&lt;/strong&gt; Will take a number and respond with the square root of that number; can be used with integers and floats&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.to_i:&lt;/strong&gt; Converts strings and floats into whole number integers&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.to_f:&lt;/strong&gt; Converts whole numbers into floats&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.round ():&lt;/strong&gt; Rounds a float to the nearest decimal point; use a number to get the specific decimal point&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.rand():&lt;/strong&gt; Prints a random number between what you want it to be; know that the index 0 counts as 1 and the last number will not be used in the code&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.odd?:&lt;/strong&gt; Checks if a number is odd&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.even?:&lt;/strong&gt; Checks if a number is even&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;theGlamTechie&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>learning</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Ruby: String Classes</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Thu, 22 Feb 2024 23:13:04 +0000</pubDate>
      <link>https://dev.to/shay90210/ruby-string-classes-and-its-methods-2n1m</link>
      <guid>https://dev.to/shay90210/ruby-string-classes-and-its-methods-2n1m</guid>
      <description>&lt;p&gt;In Ruby, string classes are used to represent and manipulate text data. This data can be anything inside of parenthesis. Therefore, if a number is represented inside of a parenthesis, such as "25", then it is no longer a digit but rather text in a string. &lt;/p&gt;

&lt;p&gt;Ruby provides several built-in classes and methods for working with strings. Here are some key aspects of string classes in Ruby:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String Literal&lt;/strong&gt;: Strings in Ruby can be created using single quotes (') or double quotes ("). Double-quoted strings allow for interpolation and escape sequences, while single-quoted strings are more literal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String Interpolation&lt;/strong&gt;: Double-quoted strings allow for embedding Ruby expressions within them using #{} syntax.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = "Alice"
age = 30
profession = "software engineer"

# Using string interpolation to embed variables within a string
message = "Hello, my name is #{name}. I am #{age} years old, and I work as a #{profession}."

puts message
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;String Concatenation&lt;/strong&gt;: Strings can be concatenated using the + operator or the &amp;lt;&amp;lt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;str1 = "Hello"
str2 = "World"
combined = str1 + ", " + str2  # returns "Hello, World"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  String class Methods
&lt;/h3&gt;

&lt;p&gt;Methods are blocks of reusable code that perform a specific task. They encapsulate functionality, making it easier to organize and manage code. Methods can take input parameters, perform operations based on those parameters, and optionally return a result.&lt;/p&gt;

&lt;p&gt;When using a method in ruby, a period will go before the method.&lt;br&gt;
The period (.) before a method is used to indicate that the method being called is being invoked on a specific object. This notation is known as "dot notation" or "method chaining."&lt;/p&gt;

&lt;p&gt;String class methods are methods that are defined on the String class in a programming language like Ruby. These methods are used to perform various operations on string objects.&lt;/p&gt;

&lt;p&gt;Below are examples of string class methods:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.empty?:&lt;/strong&gt; checks if the string is empty; will return true if string is empty&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.include?():&lt;/strong&gt; Searches for a substring&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.downcase:&lt;/strong&gt; returns a copy of the String with all uppercase letters replaced with their lowercase counterparts&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.swapcase:&lt;/strong&gt; returns a copy of the String with all uppercase letters replaced with their lowercase counterparts, and vice versa&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.upcase:&lt;/strong&gt; returns a copy of the String with all lowercase letters replaced with their uppercase counterparts&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.reverse:&lt;/strong&gt; returns a new String with the characters from the String in reverse order&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.concat:&lt;/strong&gt; can accept an integer as an argument, which it interprets as an ASCII code, translates into a single character, and adds to the original string&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.gsub():&lt;/strong&gt; returns a copy of the String it was called on with all occurrences of the first argument substituted for the second argument&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.strip:&lt;/strong&gt; removes all leading and trailing whitespace&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.capitalize:&lt;/strong&gt; returns a String with the first character converted to uppercase and the remainder to lowercase&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;gets.chomp:&lt;/strong&gt; gets input from user &amp;amp; newline by default ; can use gets if no new line is needed&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.split:&lt;/strong&gt; will divide the string where it sees that bit of text; called a delimiter&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.length:&lt;/strong&gt; checks for the amount of characters in string&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.start_with?() / .end_with?():&lt;/strong&gt; Checks if a string contains specific prefix and suffix&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.delete():&lt;/strong&gt; Deletes specific characters from a string.&lt;/p&gt;

&lt;p&gt;Happy Coding!&lt;/p&gt;

&lt;p&gt;theGlamTechie&lt;/p&gt;

</description>
      <category>ruby</category>
      <category>programming</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>Ruby: Methods &amp; Functions</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Wed, 24 Jan 2024 16:09:42 +0000</pubDate>
      <link>https://dev.to/shay90210/ruby-methods-their-functions-275a</link>
      <guid>https://dev.to/shay90210/ruby-methods-their-functions-275a</guid>
      <description>&lt;p&gt;In two years of my learning, I have delved into JavaScript first, Python second, and now it is Ruby's time to shine. With all of the programming languages that I have been studying, I know that they all share commonalities between each other. &lt;/p&gt;

&lt;p&gt;First, they all have methods! Makes sense because the point of a programming language like Ruby, Python, and JavaScript are that they create dynamic functionality to applications. &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What are Methods?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In Ruby, methods are the building blocks of code organization and functionality. They are essentially named blocks of code that perform specific tasks and can return values. Think of them as mini-programs within your larger program. Here's a breakdown of what methods are all about in Ruby:&lt;/p&gt;

&lt;p&gt;The next section will provide a common list of methods that are used in codes. While this list is small, there is a wide range of methods that can be used for Ruby.&lt;/p&gt;

&lt;h3&gt;
  
  
  Method Examples
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;.length&lt;/strong&gt; = Check the amount of chars, letters, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.reverse&lt;/strong&gt; = Reverses the value&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;.upcase / .downcase&lt;/strong&gt; = Converts string to all uppercase or lowercase&lt;/p&gt;

&lt;h3&gt;
  
  
  Def Method
&lt;/h3&gt;

&lt;p&gt;The &lt;strong&gt;def method&lt;/strong&gt; is used when a premade method is not useful to your code and you need to make a part of it more specific to completing a task. Def is short for define where you're defining a name for the method that you're creating.&lt;/p&gt;

&lt;p&gt;Then, you'll add the function. More methods can be applied inside your created method!&lt;/p&gt;

&lt;p&gt;At the end, ensure to end the code with the end keyword, so that the program will know where to end the function and proceed to the next line of code.&lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def calculate_area(length, width)
  length * width
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def is_even?(number)
  number % 2 == 0
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def greet_all(names)
  names.each { |name| greet(name) }
end
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ready to dive deeper? Check out these resources for even more method madness:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ruby Documentation:&lt;/strong&gt; &lt;a href="https://www.ruby-lang.org/en/"&gt;https://www.ruby-lang.org/en/&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Rails Guides:&lt;/strong&gt; &lt;a href="https://guides.rubyonrails.org/"&gt;https://guides.rubyonrails.org/&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Learn to Code With Ruby:&lt;/strong&gt; &lt;a href="https://teamtreehouse.com/library/topic:ruby"&gt;https://teamtreehouse.com/library/topic:ruby&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

&lt;p&gt;theGlamTechie&lt;/p&gt;

</description>
      <category>programming</category>
      <category>ruby</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>HTML &amp; CSS Syntax</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Thu, 11 Jan 2024 22:41:04 +0000</pubDate>
      <link>https://dev.to/shay90210/html-css-syntax-4f52</link>
      <guid>https://dev.to/shay90210/html-css-syntax-4f52</guid>
      <description>&lt;p&gt;Syntax is one of the most important rules of coding because syntax not only defines what you will place on a webpage, but it will also cause massive errors if done incorrectly. I've reviewed HTML and CSS syntax to understand the structure of the coding and to know where to place certain parts while knowing the proper names for each part.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;HTML Syntax&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h1&gt;Hello World!&lt;/h1&gt;

&lt;p&gt;The above code shows h1 tag being used to code Hello World into a h1 title.&lt;/p&gt;

&lt;p&gt;Below is the breakdown of the html code:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Element:&lt;/strong&gt;&lt;br&gt;
Element is the entire HTML code put together. It includes the opening and closing tags, and the content. There also may be attributes or ids added to the HTML element as well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: &amp;lt; h1 &amp;gt; Hello World &amp;lt;/ h1 &amp;gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Opening Tag:&lt;/strong&gt;&lt;br&gt;
The element starts with an opening tag, which is the name of the HTML element surrounded by angle brackets (&amp;lt; and &amp;gt;). The opening tag indicates the beginning of the element.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: &amp;lt; p &amp;gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Closing Tag:&lt;/strong&gt;&lt;br&gt;
The element also has a closing tag, similar to the opening tag but with a forward slash (/) before the element name. The closing tag marks the end of the element.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: &amp;lt;/ p &amp;gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Content:&lt;/strong&gt;&lt;br&gt;
The content of the element is the information or text that the element contains. It is placed between the opening and closing tags.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: &amp;lt; p &amp;gt;This is a paragraph.&amp;lt; /p &amp;gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;CSS Syntax&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;CSS (Cascading Style Sheets) is a stylesheet language used for describing the presentation of a document written in HTML or XML. Here's a breakdown of CSS syntax:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Selector:&lt;/strong&gt;&lt;br&gt;
The selector is used to target HTML elements that you want to style. It can be an element name, class, ID, or a combination of these.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: p h1 image/img video etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Declaration Block:&lt;/strong&gt;&lt;br&gt;
The declaration block is enclosed in curly braces {} and contains one or more declarations separated by semicolons. Each declaration includes a property and its corresponding value.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: p {
              }&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Property:&lt;/strong&gt;&lt;br&gt;
The property is the aspect of the selected element that you want to style (e.g., color, font-size, margin, etc.).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: p { 
            &lt;u&gt;font-size&lt;/u&gt;: 12px;
                              }&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Value:&lt;/strong&gt;&lt;br&gt;
The value is the specific setting for the property. It follows the property and is separated by a colon.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example: p { 
           font-size: &lt;u&gt;12px;&lt;/u&gt;
                              }&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Remember that syntax is important because the allows you to render what you need on the screen. But, if the code is not correct, your vision will not render and you will receive a lot of errors.&lt;/p&gt;

</description>
      <category>html</category>
      <category>css</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Revisiting &lt;div&gt; and &lt;span&gt;: A Refresher on HTML Structure</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Tue, 09 Jan 2024 16:11:32 +0000</pubDate>
      <link>https://dev.to/shay90210/div-vs-span-which-is-which-and-when-2amp</link>
      <guid>https://dev.to/shay90210/div-vs-span-which-is-which-and-when-2amp</guid>
      <description>&lt;p&gt;As I've been diving back into web development, I've found myself revisiting some of the fundamental building blocks of HTML. Two of these essential elements are the div and span tags, which play distinct roles in shaping content structure and styling. While they might seem straightforward at first glance, it's easy to get them mixed up or forget their nuances when you haven't used them in a while. So, let's take a quick refresher on what makes them different and how to use them effectively!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mastering the div&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Big Picture&lt;/strong&gt;: Think of div tags as containers for larger sections of your web page. They define distinct areas within your content, such as headers, navigation bars, article bodies, or sidebars.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No Specific Meaning&lt;/strong&gt;: Unlike more semantic HTML elements like header or article, div tags don't carry inherent meaning on their own. They're primarily used for layout and styling purposes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versatile Containers&lt;/strong&gt;: div elements can hold any kind of text, images, links, or other HTML elements within them. This makes them incredibly flexible for crafting diverse page structures.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nesting for Organization&lt;/strong&gt;: You can nest div tags within each other to create more complex layouts. However, remember to use indentation for better readability and maintainability of your code.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;div&amp;gt; &amp;lt;h1&amp;gt;Welcome to my website!&amp;lt;/h1&amp;gt;&lt;br&gt;
  &amp;lt;p&amp;gt;This is a paragraph of text about my website.&amp;lt;/p&amp;gt;&lt;br&gt;
  &amp;lt;p&amp;gt;Here's a highlighted phrase within this paragraph.&amp;lt;/p&amp;gt;&lt;br&gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Highlighting with span: Inline Styling for Precision&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Focused Formatting&lt;/strong&gt;: span elements are used for styling or scripting smaller portions of text, often within other blocks of content.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inline Placement&lt;/strong&gt;: Unlike div tags, span elements don't create line breaks. They flow seamlessly within the surrounding text, making them ideal for targeted styling or grouping related text elements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;br&gt;
&lt;code&gt;&amp;lt;div&amp;gt;&lt;br&gt;
  &amp;lt;h1&amp;gt;This is a heading &amp;lt;span&amp;gt;with a span inside&amp;lt;/span&amp;gt;&amp;lt;/h1&amp;gt;&lt;br&gt;
  &amp;lt;p&amp;gt;This is a paragraph &amp;lt;span&amp;gt;with another span&amp;lt;/span&amp;gt; demonstrating how spans can be nested within different elements.&amp;lt;/p&amp;gt;&lt;br&gt;
&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't Fear Confusion, Embrace Resources!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Even experienced developers can get these elements mixed up from time to time. The key is to trust your knowledge, refer to resources when needed, and experiment with code to solidify your understanding. Remember, practice makes perfect!&lt;/p&gt;

</description>
      <category>html</category>
      <category>beginners</category>
      <category>learning</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>From Visual Studio Code to the Cloud: Why Codespace Should Be Your New Beginner's IDE</title>
      <dc:creator>Shay</dc:creator>
      <pubDate>Mon, 08 Jan 2024 23:34:13 +0000</pubDate>
      <link>https://dev.to/shay90210/from-visual-studio-code-to-the-cloud-why-codespace-should-be-your-new-beginners-ide-mcc</link>
      <guid>https://dev.to/shay90210/from-visual-studio-code-to-the-cloud-why-codespace-should-be-your-new-beginners-ide-mcc</guid>
      <description>&lt;p&gt;As a beginner coder, I always used Visual Studio Code as my trusty IDE. It was familiar, efficient, and had endless extensions. But when it came to my first Codespace assignment on GitHub, I wasn't sure what to expect. Imagine my surprise when it launched... as Visual Studio Code! Except, this time, it was in the cloud.&lt;/p&gt;

&lt;p&gt;That's the magic of Codespace: it's a cloud-based version of your favorite IDE, bringing freedom and flexibility to your coding journey. Here are 5 reasons why Codespace should be your new go-to IDE as a beginner:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Code Anywhere, Anytime&lt;/strong&gt;: Gone are the days of tethering yourself to your desktop. Codespace lets you code wherever inspiration strikes, be it a cozy coffee shop or a sunny park. All you need is an internet connection and you're good to go!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Device Freedom&lt;/strong&gt;: Ditch the bulky laptop worries. Codespace works seamlessly on any device with a browser, from your trusty phone to a borrowed tablet. Access your projects and pick up where you left off, regardless of your hardware.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cloud-Powered Efficiency&lt;/strong&gt;: Say goodbye to storage constraints and bloated hard drives. Codespace lives in the cloud, so your personal device stays lean and mean. No software downloads, no local files, just one-click access to a fully equipped IDE, extensions included.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Git Integration Made Easy&lt;/strong&gt;: Codespace hails from the Git haven that is GitHub. This translates to seamless integration and smooth workflows. Committing code after a coding spree? Just click and go, no more pesky sync nightmares.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real-Time Collaboration with Live Share&lt;/strong&gt;: Working with teammates? Codespace has your back. Add the Live Share extension and code together in real-time, as if you were sharing the same keyboard. Collaboration just got secure and effortless.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My journey with Codespace has just begun, but I'm already hooked. It's the perfect blend of familiarity and cloud-powered freedom, making it ideal for beginner coders. Stay tuned for further updates as I delve deeper into its world!&lt;/p&gt;

&lt;p&gt;Happy coding!&lt;/p&gt;

</description>
      <category>learning</category>
      <category>codenewbie</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
