<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Blog</title>
  
  
  <link href="http://ernestofuentes.xyz/blog/atom.xml" rel="self"/>
  
  <link href="http://ernestofuentes.xyz/blog/"/>
  <updated>2025-02-25T21:59:00.524Z</updated>
  <id>http://ernestofuentes.xyz/blog/</id>
  
  <author>
    <name>Ernesto Fuentes</name>
    
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>ILE RPG For Beginners</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/25/ILE-RPG-For-Beginners/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/25/ILE-RPG-For-Beginners/</id>
    <published>2025-02-25T20:40:41.000Z</published>
    <updated>2025-02-25T21:59:00.524Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Intro"><a href="#Intro" class="headerlink" title="Intro"></a>Intro</h1><p>This is my attempt to learn and document ILE RPG While following the text: “Programming in ILE RPG” </p><h1 id="Prerequisite"><a href="#Prerequisite" class="headerlink" title="Prerequisite"></a>Prerequisite</h1><p>My Current Set up :</p><ul><li>Windows 11</li></ul><h1 id="Program-Variables"><a href="#Program-Variables" class="headerlink" title="Program Variables"></a>Program Variables</h1><ul><li>A program <strong>variable</strong> is a named data item within a program that represents a location in the computers memory that can store data.</li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Intro&quot;&gt;&lt;a href=&quot;#Intro&quot; class=&quot;headerlink&quot; title=&quot;Intro&quot;&gt;&lt;/a&gt;Intro&lt;/h1&gt;&lt;p&gt;This is my attempt to learn and document ILE RPG While fol</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>C++ For Beginners</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/20/C-For-Beginners/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/20/C-For-Beginners/</id>
    <published>2025-02-20T15:26:39.000Z</published>
    <updated>2025-02-28T14:13:10.017Z</updated>
    
    <content type="html"><![CDATA[<h1 id="Intro"><a href="#Intro" class="headerlink" title="Intro"></a>Intro</h1><p>This is my attempt to learn and document C++, While following the text: “C++ Program Design<br>An Introduction To Programming and Object-Oriented Design” </p><h1 id="Prerequisite"><a href="#Prerequisite" class="headerlink" title="Prerequisite"></a>Prerequisite</h1><p>My Current Set up :</p><ul><li>Windows 11</li><li><a href="https://code.visualstudio.com/">Vs Code (with C++ Extensions Enabled)</a></li><li><a href="https://winlibs.com/">C++ Compiler</a></li></ul><h1 id="Hello-World"><a href="#Hello-World" class="headerlink" title="Hello World"></a>Hello World</h1> <figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;string&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;Hello, World!&quot;</span> &lt;&lt; endl;</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><ul><li>The top 3 lines will start almost all programs in C++</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;string&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br></pre></td></tr></table></figure><ul><li>This shows that program will use the iostream library to do inputs and outputs.</li><li>Line 1 and 2 are know as a preprocessor which are programs that run before the compiler.</li><li>Line 3 Indicates that the program will be using objects that are named in a special region called std</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span></span></span><br></pre></td></tr></table></figure><ul><li>Line 4 is know as a function which specifies the return value </li><li>The main method is the first function that is called when the program is compiled and executed. </li><li>The Word “Int” indicates the return type I this case Int is Integer. in C++ the main method will always return and int. </li><li>The word “main” is the name of the method</li><li>The () are used to delimit any arguments, in this case the main method does not require arguments. </li><li>The { } group together statements, and in this case this these statements make up the function.</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cout &lt;&lt; <span class="string">&quot;Hello, World!&quot;</span> &lt;&lt; endl;</span><br><span class="line"><span class="keyword">return</span> <span class="number">0</span>;</span><br></pre></td></tr></table></figure><ul><li>The first statement starts with cout which is an object that indicates an output stream</li><li>The &lt;&lt; inserts a element in this case to the output stream </li><li>Following this we have “Hello World” this is out output string that would display when the program is run.</li><li>Then the end of the first statement is end with endl this is know as a manipulator and this indicates a new line. </li><li>The second statement “return 0;” would be returned by the main method, a zero indicates that the program ran without issues. </li><li>A non zero output would mean that there was some error with the execution of the method.</li></ul><h1 id="User-Inputs"><a href="#User-Inputs" class="headerlink" title="User Inputs"></a>User Inputs</h1><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;string&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line"><span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span> </span>&#123;</span><br><span class="line">    <span class="comment">// cout &lt;&lt; &quot;Hello, World!&quot; &lt;&lt; endl;  </span></span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;Purchase price ?&quot;</span>;</span><br><span class="line">    <span class="type">float</span> Price;</span><br><span class="line">    cin &gt;&gt; Price;</span><br><span class="line"></span><br><span class="line">    <span class="comment">//compute the output sales tax</span></span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;Sales tax on $&quot;</span> &lt;&lt; Price &lt;&lt; <span class="string">&quot; is &quot;</span>;</span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;$&quot;</span> &lt;&lt; Price * <span class="number">0.04</span> &lt;&lt; endl;</span><br><span class="line">    <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><ul><li>The following ask the user for the input to calculate the sales tax of a purchase.</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="type">float</span> Price;</span><br></pre></td></tr></table></figure><ul><li>Here im creating a variable that will store the Price as a <strong>floating point</strong> number. </li><li>this is because the expected input could be a number with a decimal place (ex. 5.99).</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cin &gt;&gt; Price;</span><br></pre></td></tr></table></figure><ul><li>Cin is an object like cout, however Cin is an input stream </li><li>The users input value is converted to the internal format for floating point number and stores in the Price object.</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">cout &lt;&lt; <span class="string">&quot;Sales tax on $&quot;</span> &lt;&lt; Price &lt;&lt; <span class="string">&quot; is &quot;</span>;</span><br><span class="line">cout &lt;&lt; <span class="string">&quot;$&quot;</span> &lt;&lt; Price * <span class="number">0.04</span> &lt;&lt; endl;</span><br></pre></td></tr></table></figure><ul><li>The last statements will output the price then followed by the calculated sales tax.</li></ul><h1 id="Comments"><a href="#Comments" class="headerlink" title="Comments"></a>Comments</h1><ul><li>Comments is a mechanism that allows programmers to add prose or comments in code </li><li>Comments are ignored by the compiler, generally used to describe what a piece of code is doing.</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// Here is a comment that span one line </span></span><br><span class="line"><span class="comment">/* This a comment that can span </span></span><br><span class="line"><span class="comment">MULTIPLE</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">LINES</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure><h1 id="Objects"><a href="#Objects" class="headerlink" title="Objects"></a>Objects</h1><h2 id="Integer"><a href="#Integer" class="headerlink" title="Integer"></a>Integer</h2><ul><li>In C++ the basic integer type is called an <strong>int</strong> </li><li>The compiler and underling hardware determine the size of int <ul><li>for example most pc support size of 16 bits, where int can represent integers from -32768 - 32768</li><li>for unix it would be 32 bits and newer system can support up to 64 bit integers.</li></ul></li><li>There are also several other integer object types like <strong>short</strong> and <strong>long</strong> <ul><li>C++ does not determine the size of <strong>short</strong> or <strong>long</strong> however it does specfy the following:<br>  <em>NumberOfBits<sub>short</sub></em> $\leq$ <em>NumberOfBits<sub>int</sub></em> $\leq$ <em>NumberOfBits<sub>long</sub></em></li></ul></li></ul><h2 id="Character"><a href="#Character" class="headerlink" title="Character"></a>Character</h2><ul><li><p>Closely related to integer object the character object (<strong>CHAR</strong>) are represented by integers </p></li><li><p><strong>ASCII</strong> is a character set that is used for computers to interpret characters based on a corespondent number.  </p></li><li><p>because characters can be represented as number the following will always be true<br>  ‘a’ &lt; ‘b’ &lt; ‘c’ &lt; ….. &lt; ‘z’<br>  ‘A’ &lt; ‘B’ &lt; ‘C’ &lt; ….. &lt; ‘Z’<br>and<br>  ‘0’ &lt; ‘1’ &lt; ‘2’ &lt; ….. &lt; ‘9’</p></li><li><p>this is relationship is useful as it allows characters to be sorted, ex. alphabetically , etc..</p></li></ul><h2 id="Floating-Point"><a href="#Floating-Point" class="headerlink" title="Floating Point"></a>Floating Point</h2><ul><li><p><strong>Floating points</strong> object are used to represent real numbers, that is, numbers that have both an integer part and a fractional part.<br>  Ex. 3.1412</p></li><li><p>C++ comes with support for the 3 types of floating point numbers </p><ol><li>Float </li><li>Double</li><li>Long Double</li></ol></li><li><p>and these types are represented as subsets of one and other so:<br>  Float is a subset of double and double is a subset of long double</p></li></ul><h1 id="Constants"><a href="#Constants" class="headerlink" title="Constants"></a>Constants</h1><h2 id="String-and-character-constants"><a href="#String-and-character-constants" class="headerlink" title="String and character constants"></a>String and character constants</h2><ul><li><strong>String</strong> constants is a sequence of zero or more characters enclosed in double quotes</li></ul><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot; Hello World &quot;</span> </span><br></pre></td></tr></table></figure><ul><li>there are also characters know as escape characters:</li></ul><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot;Hello World!\n&quot;</span></span><br></pre></td></tr></table></figure><ul><li>here the <strong>\n</strong> would indicate that the character n is not a character but rather should be interpreted as a new line.</li></ul><table><thead><tr><th>Character Name</th><th>ASCII Name</th><th>C++ Escape Sequence</th></tr></thead><tbody><tr><td>newline</td><td>NL</td><td>\n</td></tr><tr><td>horizontal tab</td><td>HT</td><td>\t</td></tr><tr><td>vertical tab</td><td>VT</td><td>\v</td></tr><tr><td>backspace</td><td>BS</td><td>\b</td></tr><tr><td>form feed</td><td>FF</td><td>\f</td></tr><tr><td>alert or bell</td><td>BEL</td><td>\a</td></tr><tr><td>carriage return</td><td>CR</td><td>\r</td></tr><tr><td>vertical tab</td><td>VT</td><td>\v</td></tr><tr><td>backslash</td><td>\</td><td>\</td></tr><tr><td>single quote</td><td>‘</td><td>&#39;</td></tr><tr><td>double quote</td><td>“</td><td>&quot;</td></tr><tr><td>question mark</td><td>?</td><td>?</td></tr></tbody></table><h1 id="Integer-constants"><a href="#Integer-constants" class="headerlink" title="Integer constants"></a>Integer constants</h1><ul><li>The simplest way to write an integer constant in C++ would be to write:</li></ul><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">23 45 125 990</span><br></pre></td></tr></table></figure><ul><li>by default an integer would be interpreter by C++ as an int</li><li>you can append a l or L at the end of a number to treat a number as a long</li></ul><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">23L 45L 125L 990L</span><br></pre></td></tr></table></figure><ul><li>If an integer constant does not have a suffix the compiler will choose the type depending on the size </li><li>It will try int first and if the number is to big then it will try to store it in a long </li><li>and if the value is still to long it will through an error</li></ul><h1 id="Floating-point-constants"><a href="#Floating-point-constants" class="headerlink" title="Floating point constants"></a>Floating point constants</h1><ul><li><p>layout for floating point constants<br>  digits.digits[f | F | l | L]</p></li><li><p>the constant will consist of: </p><ol><li>sequence of number before the . </li><li>sequence of numbers after the .</li><li>optional type specifiers </li><li>also 1 or 2 could be omitted (ex. 0.5 or 1.0)</li></ol></li><li><p>like integers constants float constants by default are read as double unless otherwise specified</p></li><li><p>the suffix option are as follows: </p><ol><li>f, F &#x3D; float </li><li>l, L &#x3D; long double</li></ol></li><li><p>in C++ floating point numbers can be represented in scientific notation:<br>  1.23x10[^3]</p><p>  which is read as </p><p>  1230.0</p></li><li><p>the general for is a followed<br>  mantissa x 10 [^exponent]</p><p>  and the syntax is a follows </p><p>  Digits.Digits[Exponent] [f | F | l | L]</p></li></ul><p><em>either the whole part or fraction part can be omitted, but not both</em></p><pre><code>where the exponent is (e | E) [+ | -] Digits </code></pre><ul><li>The mantissa can be an integer or a decimal number. The expoents is a signed integer.<br>  Ex: 1.23E10 , 0.23E-4, 45.e+23, 23.68E12</li></ul><h1 id="Keywords"><a href="#Keywords" class="headerlink" title="Keywords"></a>Keywords</h1><table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td>asm</td><td>else</td><td>operator</td><td>throw</td></tr><tr><td>auto</td><td>enum</td><td>private</td><td>true</td></tr><tr><td>bool</td><td>explicit</td><td>protected</td><td>try</td></tr><tr><td>break</td><td>extern</td><td>public</td><td>typedef</td></tr><tr><td>case</td><td>false</td><td>register</td><td>typeid</td></tr><tr><td>catch</td><td>float</td><td>reinterpret_cast</td><td>typename</td></tr><tr><td>char</td><td>for</td><td>return</td><td>union</td></tr><tr><td>class</td><td>friend</td><td>short</td><td>unsigned</td></tr><tr><td>const</td><td>goto</td><td>signed</td><td>using</td></tr><tr><td>const_cast</td><td>if</td><td>sizeof</td><td>virtual</td></tr><tr><td>continue</td><td>inline</td><td>static</td><td>void</td></tr><tr><td>default</td><td>int</td><td>static_cast</td><td>volatile</td></tr><tr><td>delete</td><td>long</td><td>struct</td><td>wchar_t</td></tr><tr><td>do</td><td>mutable</td><td>switch</td><td>while</td></tr><tr><td>double</td><td>namespace</td><td>template</td><td>dynamic_cast</td></tr><tr><td>new</td><td>this</td><td></td><td></td></tr></tbody></table><ul><li>keywords have special meaning to the compiler and they <strong>CANNOT</strong> be changed by the programmer.</li><li>these are also case sensitive, which consist of lowercase letters only.</li></ul><h1 id="Identifiers"><a href="#Identifiers" class="headerlink" title="Identifiers"></a>Identifiers</h1><ul><li>names that are defined by the programmer</li><li>the rule for forming a valid identifier name is that it must be valid c++ name and cannot clash with any of the existing keywords.<br>  ex. n, price, x, numberOfPeople, getName, ….. etc </li><li>use clear and human readable name for the identifiers so that it helps with code readability.</li></ul><h1 id="Definition"><a href="#Definition" class="headerlink" title="Definition"></a>Definition</h1><ul><li>To use an object in C++ you must first define the object</li></ul><p><em>a Common form of a C++ definition is</em><br>    Type Id, Id, ….., Id; </p><pre><code>ex: int Sum;</code></pre><ul><li>Here I defined an integer object who identifier is <strong>Sum</strong>;</li><li>Also in this case the object is defined with no initial value, however memory is still allocated for the creation of this object.<br>  Other ex: <ul><li>int x </li><li>int WordCnt, Radius, Height;</li><li>float FlightTime, Mileage, Speed;</li></ul></li><li>all of the above are defined but not initialized.</li><li>generally it not recommend to define and not assign some value to an object as that could lead to an unified error.</li></ul><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;iostream&gt;</span></span></span><br><span class="line"><span class="meta">#<span class="keyword">include</span> <span class="string">&lt;string&gt;</span></span></span><br><span class="line"><span class="keyword">using</span> <span class="keyword">namespace</span> std;</span><br><span class="line">    <span class="function"><span class="type">int</span> <span class="title">main</span><span class="params">()</span> </span>&#123;</span><br><span class="line">        <span class="type">float</span> f;</span><br><span class="line">        <span class="type">char</span> c;</span><br><span class="line">        <span class="type">int</span> i;</span><br><span class="line">        <span class="type">double</span> d;</span><br><span class="line">        cout &lt;&lt; <span class="string">&quot;f&#x27;s value is &quot;</span> &lt;&lt; f &lt;&lt; endl;</span><br><span class="line">        cout &lt;&lt; <span class="string">&quot;i&#x27;s value is &quot;</span> &lt;&lt; i &lt;&lt; endl;</span><br><span class="line">        cout &lt;&lt; <span class="string">&quot;c&#x27;s value is &quot;</span> &lt;&lt; c &lt;&lt; endl;</span><br><span class="line">        cout &lt;&lt; <span class="string">&quot;d&#x27;s value is &quot;</span> &lt;&lt; d &lt;&lt; endl;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">return</span> <span class="number">0</span>;</span><br><span class="line">    &#125;</span><br></pre></td></tr></table></figure><ul><li>when the following is executed, the program outputs</li></ul><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">f&#x27;s value is 1.81825e+11</span><br><span class="line">i&#x27;s value is 8653</span><br><span class="line">c&#x27;s value is e </span><br><span class="line">d&#x27;s value is 1.12975e-231</span><br></pre></td></tr></table></figure><ul><li>As you can see the output can be unpredictable if objects are not initialized. </li><li>Another form of definition allows objects to be initialized when they are defined<br>  Type Id &#x3D; Const, Id &#x3D; Const ….., Id &#x3D; Const;</li><li>In practice it is:<br>  int Sum &#x3D; 0;<br>  float TaxRate &#x3D; 0.06;<br>  char Letter &#x3D; ‘a’;</li></ul><h2 id="Expressions"><a href="#Expressions" class="headerlink" title="Expressions"></a>Expressions</h2><h1 id="Simple-Expression"><a href="#Simple-Expression" class="headerlink" title="Simple Expression"></a>Simple Expression</h1><ul><li>The simplest form of the C++ expression is a constant with no operation applied<br>  ex.<br>  23;</li><li>Here the results yields &lt;23, int&gt;, and the ; after the expression is the C++ delimiter that separates or terminates an expression.<br>  ex.<br>  ‘a’;</li><li>Here the results yields &lt;97, int&gt;</li><li>An expression can also be an object with no operation applied. The result of evaluating this type of expression is the value of the object.<br>  ex.<br>  int XCoord &#x3D; 23;<br>  XCoord; </li><li>The result of evaluating the expression is &lt;23, int&gt;. In some sense, an operation is being applied to the operand XCoord. The operation being applied is one that fetches the value stored in XCoord.</li></ul><h1 id="Binary-arithmetic-operations"><a href="#Binary-arithmetic-operations" class="headerlink" title="Binary arithmetic operations"></a>Binary arithmetic operations</h1><ul><li>Arithmetic operations for integers</li></ul><table><thead><tr><th>Operation</th><th>Operator</th><th>Example</th><th>Result</th></tr></thead><tbody><tr><td>Addition</td><td>+</td><td>2+3;</td><td>&lt;5,int&gt;</td></tr><tr><td>Subtraction</td><td>-</td><td>4-7;</td><td>&lt;-3,int&gt;</td></tr><tr><td>Multiplication</td><td>*</td><td>3*4;</td><td>&lt;12,int&gt;</td></tr><tr><td>Division</td><td>&#x2F;</td><td>8&#x2F;2;</td><td>&lt;4,int&gt;</td></tr><tr><td>Remainder</td><td>%</td><td>10%3;</td><td>&lt;1,int&gt;</td></tr></tbody></table>]]></content>
    
    
      
      
    <summary type="html">&lt;h1 id=&quot;Intro&quot;&gt;&lt;a href=&quot;#Intro&quot; class=&quot;headerlink&quot; title=&quot;Intro&quot;&gt;&lt;/a&gt;Intro&lt;/h1&gt;&lt;p&gt;This is my attempt to learn and document C++, While follow</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>Bike Trail Logs</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/18/Bike-Trail-Logs/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/18/Bike-Trail-Logs/</id>
    <published>2025-02-18T20:19:18.000Z</published>
    <updated>2025-02-18T21:58:22.488Z</updated>
    
    <content type="html"><![CDATA[<h3 id="Trails"><a href="#Trails" class="headerlink" title="Trails:"></a>Trails:</h3><h2 id="Iron-Hill-Bike-Trail"><a href="#Iron-Hill-Bike-Trail" class="headerlink" title="Iron Hill Bike Trail:"></a>Iron Hill Bike Trail:</h2><ul><li>Located on the the south side of red top mountain, and spans about 3.9 miles in a loop.</li><li>Its mostly flat with a gravel surface</li><li>The Climbing is not super difficult, on my 8 speed bike I max out going up the hills but don’t feel the need for additional gears.</li><li>About 75 to 80 % of the trail runs along side the water. </li><li>There are three bridges along the trail. </li><li>There is parking onsite with additional overflow parking available as well. </li><li>Without a yearly pass the entry to the trail is 5$ as of 2024.</li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h3 id=&quot;Trails&quot;&gt;&lt;a href=&quot;#Trails&quot; class=&quot;headerlink&quot; title=&quot;Trails:&quot;&gt;&lt;/a&gt;Trails:&lt;/h3&gt;&lt;h2 id=&quot;Iron-Hill-Bike-Trail&quot;&gt;&lt;a href=&quot;#Iron-Hill-Bike-</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>Books Ive Read / Currenlty Reading</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/14/Books-Ive-Read-Currenlty-Reading/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/14/Books-Ive-Read-Currenlty-Reading/</id>
    <published>2025-02-14T18:29:04.000Z</published>
    <updated>2025-02-14T18:32:36.309Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Read"><a href="#Read" class="headerlink" title="Read"></a>Read</h2><ol><li>the wind up bird chronicals </li><li>all the pretty horses </li><li>fight club</li><li>wild sheep chase </li><li>no longer human</li></ol><h2 id="Currently-Reading"><a href="#Currently-Reading" class="headerlink" title="Currently Reading"></a>Currently Reading</h2><ol><li>vol 1 of 2666</li><li>catcher and the rye</li><li>Stoner</li></ol>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;Read&quot;&gt;&lt;a href=&quot;#Read&quot; class=&quot;headerlink&quot; title=&quot;Read&quot;&gt;&lt;/a&gt;Read&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;the wind up bird chronicals &lt;/li&gt;
&lt;li&gt;all the pretty hor</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>How to registering a domain name and create a dns record</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/14/How-to-registering-a-domain-name-and-create-a-dns-record/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/14/How-to-registering-a-domain-name-and-create-a-dns-record/</id>
    <published>2025-02-14T18:17:27.000Z</published>
    <updated>2025-02-14T21:31:31.047Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Prerequisites"><a href="#Prerequisites" class="headerlink" title="Prerequisites:"></a>Prerequisites:</h2><ul><li>A Vultr instance running (with a public IP address).</li><li>Access to your domain registrar’s control panel (In this example im using Hostinger).</li><li>SSH or other access to your VULTR instance(ex putty, etc..)</li></ul><h2 id="Step-1-Register-a-Domain-Name"><a href="#Step-1-Register-a-Domain-Name" class="headerlink" title="Step 1: Register a Domain Name"></a>Step 1: Register a Domain Name</h2><p>First you need to register a domain name if you haven’t already done so. Here are the general steps:</p><ol><li>Choose a Domain Registrar: Select a domain registrar (eg., Hostinger, goDaddy, etc ..).</li><li>Search for Available Domain Names: Use the registrar’s search tool to find an available domain<br>name.</li><li>Purchase the Domain: Once you’ve found an avlaiable domain, follow the registrar’s checkout<br>process to purchase it.</li><li>Access Your Domain Management Console: After purchasing, you’ll have access to your domain<br>management console where you can configure your DNS settings.</li></ol><h2 id="Step-2-Retrieve-the-IP-Address-of-Your-Vultr-Instance"><a href="#Step-2-Retrieve-the-IP-Address-of-Your-Vultr-Instance" class="headerlink" title="Step 2: Retrieve the IP Address of Your Vultr Instance"></a>Step 2: Retrieve the IP Address of Your Vultr Instance</h2><p>You will need the public IP address of your Vultr instance to point your domain to it.</p><ol><li>Log in to Vultr: Go to the Vultr Dashboard and log in.</li><li>Find Your Instance: Navigate to the “Instances” section, find your instance, and note the public<br>IPV4 address.</li></ol><h2 id="Step-3-Configure-DNS-Records-for-your-Domain"><a href="#Step-3-Configure-DNS-Records-for-your-Domain" class="headerlink" title="Step 3: Configure DNS Records for your Domain"></a>Step 3: Configure DNS Records for your Domain</h2><p>Now you need to configure the DNS records for your domain. Follow these steps based on your domain<br>registrar: </p><ol><li>login to Your Domain Registrar:</li></ol><ul><li>For example, if you registered your domain on NameCheap, Log in to your Hostinger account.</li></ul><ol start="2"><li><p>Navigate to DNS Management:<br>find the section where you can manage DNS setting or DNS records.</p></li><li><p>Add a Record for Your Domain:<br>You Will add an “A” record to point your domain to your Vultr instance IP address. Here’s how to do it:</p></li></ol><ul><li>Host: @ (or leave it blank, depending on the registrar)</li><li>Type: A</li><li>Value: Your Vultr instance’s public IP address(eg., 192.0.2.123)</li><li>TTL: 3600 (Default is usually fine)</li></ul>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;Prerequisites&quot;&gt;&lt;a href=&quot;#Prerequisites&quot; class=&quot;headerlink&quot; title=&quot;Prerequisites:&quot;&gt;&lt;/a&gt;Prerequisites:&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;A Vultr instance r</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>Setting up and using yt-dlp on Windows</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/14/Setting-up-and-using-yt-dlp-on-Windows/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/14/Setting-up-and-using-yt-dlp-on-Windows/</id>
    <published>2025-02-14T18:11:49.000Z</published>
    <updated>2025-02-14T18:11:49.469Z</updated>
    
    
    
    
    
  </entry>
  
  <entry>
    <title>Build Your Own Static Site Using Nginx On Debian</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/14/Build-Your-Own-Static-Site-Using-Nginx-On-Debian/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/14/Build-Your-Own-Static-Site-Using-Nginx-On-Debian/</id>
    <published>2025-02-14T14:07:18.000Z</published>
    <updated>2025-02-14T16:20:20.477Z</updated>
    
    <content type="html"><![CDATA[<h2 id="Prerequisites"><a href="#Prerequisites" class="headerlink" title="Prerequisites"></a>Prerequisites</h2><ul><li>A Debian-based server</li><li>Root Or Sudo privileges</li></ul><h2 id="Step-1-Update-Your-System"><a href="#Step-1-Update-Your-System" class="headerlink" title="Step 1: Update Your System"></a>Step 1: Update Your System</h2><p>Start by updating your package list and upgrading the system to make sure everything is up-to-date.</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> apt update &amp;&amp; <span class="built_in">sudo</span> apt upgrade -y</span><br></pre></td></tr></table></figure><h2 id="Step-2-Install-NGINX"><a href="#Step-2-Install-NGINX" class="headerlink" title="Step 2: Install NGINX"></a>Step 2: Install NGINX</h2><p>Install NGINX from the official Debian Repo</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> apt install nginx -y</span><br></pre></td></tr></table></figure><h2 id="Step-3-Start-and-Enable-Nginx"><a href="#Step-3-Start-and-Enable-Nginx" class="headerlink" title="Step 3: Start and Enable Nginx"></a>Step 3: Start and Enable Nginx</h2><p>Start the NGINX service and enable it to start automatically on boot.</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> systemctl start nginx </span><br><span class="line"><span class="built_in">sudo</span> systemctl <span class="built_in">enable</span> nginx</span><br></pre></td></tr></table></figure><h2 id="Step-4-Optional-Allow-NGINX-Through-the-Firewall"><a href="#Step-4-Optional-Allow-NGINX-Through-the-Firewall" class="headerlink" title="Step 4 (Optional): Allow NGINX Through the Firewall"></a>Step 4 (Optional): Allow NGINX Through the Firewall</h2><p>If running a firewall you need to allow traffic on the HTTP and HTTPS ports</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> ufw allow <span class="string">&#x27;Nginx Full&#x27;</span></span><br></pre></td></tr></table></figure><h2 id="Step-5-Create-a-Directory-for-Your-Website"><a href="#Step-5-Create-a-Directory-for-Your-Website" class="headerlink" title="Step 5: Create a Directory for Your Website"></a>Step 5: Create a Directory for Your Website</h2><p>Create a directory to store your static website files. For example, we create a website directory.</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> <span class="built_in">mkdir</span> -p /var/www/mywebsite/html</span><br></pre></td></tr></table></figure><h2 id="Step-6-Add-Your-Website-Files"><a href="#Step-6-Add-Your-Website-Files" class="headerlink" title="Step 6: Add Your Website Files"></a>Step 6: Add Your Website Files</h2><p>Now, place your website’s file (HTML, CSS, JS, image, etc) into the directory you just created.<br>For Example, let’s create a simple index.html file</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">echo</span> <span class="string">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;My Website&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;Welcome to My Website&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;&quot;</span> | <span class="built_in">sudo</span> <span class="built_in">tee</span> /var/www/mywebsite/html/index.html &gt; /dev/null</span><br></pre></td></tr></table></figure><h2 id="Step-7-Set-Permissions"><a href="#Step-7-Set-Permissions" class="headerlink" title="Step 7: Set Permissions"></a>Step 7: Set Permissions</h2><p>Set the appropriate ownership and permission for the web directory </p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> <span class="built_in">chown</span> -R www-data: www-data /var/www/mywebsite/html</span><br><span class="line"><span class="built_in">sudo</span> <span class="built_in">chmod</span> -R 755 /var/www/mywebsite</span><br></pre></td></tr></table></figure><h2 id="Step-8-Configure-NGINX-for-Your-Website"><a href="#Step-8-Configure-NGINX-for-Your-Website" class="headerlink" title="Step 8: Configure NGINX for Your Website"></a>Step 8: Configure NGINX for Your Website</h2><p>Now, you need to create a new configuration file for your website. NGINX configuration files are located<br>in &#x2F;etc&#x2F;nginx&#x2F;sites-available&#x2F; and &#x2F;etc&#x2F;nginx&#x2F;site-enabled&#x2F;<br>Create a new file for your website under &#x2F;etc&#x2F;nginx&#x2F;site-available&#x2F;:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> nano /etc/nginx/site-available/mywebsite</span><br></pre></td></tr></table></figure><p>Add the following configuration to the file:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">server &#123;</span><br><span class="line">    listen 80;</span><br><span class="line">    server_name mywebsite.com www.mywebsite.com;  <span class="comment"># Replace with your domain name or IP address</span></span><br><span class="line"></span><br><span class="line">    root /var/www/mywebsite/html;  <span class="comment"># Path to your website directory</span></span><br><span class="line">    index index.html;</span><br><span class="line"></span><br><span class="line">    location / &#123;</span><br><span class="line">        try_files <span class="variable">$uri</span> <span class="variable">$uri</span>/ =404;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h2 id="Step-9-Enable-the-Site"><a href="#Step-9-Enable-the-Site" class="headerlink" title="Step 9: Enable the Site"></a>Step 9: Enable the Site</h2><p>Create a symbolic link in the site-enable directory to enable the site.</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> <span class="built_in">ln</span> -s /etc/nginx/sites-available/mywebsite /etc/nginx/sites-enabled/</span><br></pre></td></tr></table></figure><h2 id="Step-10-Test-the-NGINX-Configuration"><a href="#Step-10-Test-the-NGINX-Configuration" class="headerlink" title="Step 10: Test the NGINX Configuration"></a>Step 10: Test the NGINX Configuration</h2><p>Before restarting NGINX, its important to test the configuration for syntax errors.</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> nginx -t</span><br></pre></td></tr></table></figure><p>If there are no errors, you’ll see a message saying that the syntax is ok. If there are errors, resolve them before proceeding.</p><h2 id="Step-11-Restart-NGINX"><a href="#Step-11-Restart-NGINX" class="headerlink" title="Step 11: Restart NGINX"></a>Step 11: Restart NGINX</h2><p>Restart NGINX to apply the new configuration</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> systemctl restart nginx</span><br></pre></td></tr></table></figure><h2 id="Step-12-Access-Your-Website"><a href="#Step-12-Access-Your-Website" class="headerlink" title="Step 12: Access Your Website"></a>Step 12: Access Your Website</h2><p>Now, open a web browser and navigate to your server’s IP address or domain name (e.g.,<br><a href="http://your_server_ip/">http://your_server_ip</a> or <a href="http://mywebsite.com/">http://mywebsite.com</a>). You Should see your static website!</p><h2 id="Step-13-Optional-Setting-Up-SSL-with-Let’s-Encrypt-HTTPS"><a href="#Step-13-Optional-Setting-Up-SSL-with-Let’s-Encrypt-HTTPS" class="headerlink" title="Step 13: Optional - Setting Up SSL with Let’s Encrypt (HTTPS)"></a>Step 13: Optional - Setting Up SSL with Let’s Encrypt (HTTPS)</h2><p>For enhanced security, you might want to set up SSL using Let’s Encrypt. Here how you can do that:</p><ol><li>Install Certbot:</li></ol><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> apt install certbot python3-certbot-nginx -y</span><br></pre></td></tr></table></figure><p>2.Obtain an SSL certificate:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> certbot --nginx -d mywebsite.com -d www.mywebsite.com</span><br></pre></td></tr></table></figure><p>3.Certbot will automatically configure SSL for your NGINX server and reload it.</p><h2 id="Step-14-Renewing-SSL-Certificates"><a href="#Step-14-Renewing-SSL-Certificates" class="headerlink" title="Step 14: Renewing SSL Certificates"></a>Step 14: Renewing SSL Certificates</h2><p>Let’s Encrypt certificates expires after 90 days, so it’s essential to renew them. You can set up a cron job<br>to automatically renew the certificate:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">sudo</span> crontab -e</span><br></pre></td></tr></table></figure><p>Add the following line to check for renewals twice a day:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">0 12 * * * certbot renew --quiet</span><br></pre></td></tr></table></figure>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;Prerequisites&quot;&gt;&lt;a href=&quot;#Prerequisites&quot; class=&quot;headerlink&quot; title=&quot;Prerequisites&quot;&gt;&lt;/a&gt;Prerequisites&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;A Debian-based serve</summary>
      
    
    
    
    
  </entry>
  
  <entry>
    <title>Hello World</title>
    <link href="http://ernestofuentes.xyz/blog/2025/02/10/hello-world/"/>
    <id>http://ernestofuentes.xyz/blog/2025/02/10/hello-world/</id>
    <published>2025-02-10T14:18:32.002Z</published>
    <updated>2025-02-10T21:48:37.072Z</updated>
    
    <content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">&quot;My New Post&quot;</span></span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;Welcome to &lt;a href=&quot;https://hexo.io/&quot;&gt;Hexo&lt;/a&gt;! This is your very first post. Check &lt;a href=&quot;https://hexo.io/docs/&quot;&gt;documentation&lt;/a&gt; for</summary>
      
    
    
    
    
  </entry>
  
</feed>
