<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Programming on Nitesh Raya&#39;s Blogs</title>
        <link>/categories/programming/</link>
        <description>Recent content in Programming on Nitesh Raya&#39;s Blogs</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-us</language>
        <copyright>nitesh</copyright>
        <lastBuildDate>Mon, 09 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="/categories/programming/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>Text File Analyzer</title>
        <link>/post/text-file-analyzer/</link>
        <pubDate>Mon, 09 Mar 2026 00:00:00 +0000</pubDate>
        
        <guid>/post/text-file-analyzer/</guid>
        <description>&lt;img src="https://plus.unsplash.com/premium_photo-1685086785636-2a1a0e5b591f?q=80&amp;w=2832&amp;auto=format&amp;fit=crop&amp;ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" alt="Featured image of post Text File Analyzer" /&gt;&lt;p&gt;A simple c program to analyze text file.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Look into&lt;/code&gt; ==strtok_r== &lt;code&gt;or&lt;/code&gt; ==strchr==
&lt;code&gt;Data Strcuture:&lt;/code&gt; ==linkedList== or ==hash table==&lt;/p&gt;
&lt;p&gt;New post test.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>The ordered list implemenatation</title>
        <link>/post/the-ordered-list-implemenatation/</link>
        <pubDate>Wed, 22 Jan 2025 00:00:00 +0000</pubDate>
        
        <guid>/post/the-ordered-list-implemenatation/</guid>
        <description>&lt;img src="https://miro.medium.com/v2/resize:fit:1024/1*wA75yhv1kptx0bW_c9ooAQ.jpeg" alt="Featured image of post The ordered list implemenatation" /&gt;&lt;p&gt;The ordered list is the collection of items where each items maintains it&amp;rsquo;s position unlike Unordered list. The ordering of the item is typically ascending and descending and we assume that items are ordered with meaningful comparison operation.&lt;/p&gt;
&lt;h2 id=&#34;operations-of-ordered-list&#34;&gt;Operations of Ordered List
&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;OrderedList()&lt;/strong&gt;: Creates new ordered list that is empty. Returns empty list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;add(item)&lt;/strong&gt; : adds a new item to the list maintaining the order. Returns nothing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;remove(item)&lt;/strong&gt;: removes the item from the list , assuming the item is present in the list. Returns boolean(True or False)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;search(item)&lt;/strong&gt;: Searches for the item in the list. Returns boolean(True of False).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;is_empty()&lt;/strong&gt;: Test to see whether the list is empty. Returns boolean.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;size()&lt;/strong&gt;: Returns the number of the item in the list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;index(item)&lt;/strong&gt;: Returns the position of the item in the list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pop()&lt;/strong&gt;: Removes and returns the last item in the list.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;pop(pos)&lt;/strong&gt;: Removes and returns the position at the position &lt;code&gt;pos&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;img src=&#34;../../images/Pasted%20image%2020250121190525.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
		alt=&#34;Image Description&#34;
	
	
&gt;&lt;/p&gt;
&lt;h2 id=&#34;how-to-search-in-the-list&#34;&gt;How to search in the list?
&lt;/h2&gt;&lt;p&gt;Since the list is ordered it is pretty straight-forward to search through the list.
There are two things we need to consider, &lt;code&gt;item&lt;/code&gt; the data or the value that we are searching for and &lt;code&gt;current.data&lt;/code&gt; the data or the value of the current node.&lt;/p&gt;
</description>
        </item>
        <item>
        <title>How to use Promise in Javascript</title>
        <link>/post/how-to-use-promise-in-javascript/</link>
        <pubDate>Tue, 31 Dec 2024 00:00:00 +0000</pubDate>
        
        <guid>/post/how-to-use-promise-in-javascript/</guid>
        <description>&lt;img src="/images/promise_thumbnail.jpg" alt="Featured image of post How to use Promise in Javascript" /&gt;&lt;p&gt;Before learning about promise it&amp;rsquo;s important to know what &lt;a class=&#34;link&#34; href=&#34;https://en.wikipedia.org/wiki/Asynchrony_%28computer_programming%29&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;Asynchronous programming&lt;/a&gt; .&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In asynchronous programming, the program continues to execute tasks without waiting for other program to complete any task. It is independent and it uses &lt;strong&gt;callbacks&lt;/strong&gt;, &lt;strong&gt;==promises==&lt;/strong&gt; to wait for the tasks. This technique allows the program to run concurrently and use resources efficiently.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div style=&#34;text-align: center; padding: 20px; border: 2px solid #ffffff; border-radius: 8px; font-family: Arial, sans-serif; background-color: #002b26; color: #ffffff;&#34;&gt;
    &lt;h1 style=&#34;font-size: 2rem; margin-bottom: 20px;&#34;&gt;&#34;I Promise a Result!&#34;&lt;/h1&gt;
    &lt;p style=&#34;font-size: 1.2rem; margin: 10px 0;&#34;&gt;&#34;Producing code&#34; is code that can take some time&lt;/p&gt;
    &lt;p style=&#34;font-size: 1.2rem; margin: 10px 0;&#34;&gt;&#34;Consuming code&#34; is code that must wait for the result&lt;/p&gt;
    &lt;p style=&#34;font-size: 1.2rem; margin: 10px 0;&#34;&gt;A Promise is an Object that links Producing code and Consuming code&lt;/p&gt;
&lt;/div&gt;
&amp;nbsp;
&lt;div style=&#34;display: flex; align-items: center; background-color: #0f172a; border-radius: 8px; padding: 15px; border-left: 4px solid #3b82f6; color: #cbd5e1;&#34;&gt;
    &lt;div style=&#34;color: #3b82f6; font-size: 24px; margin-right: 12px; line-height: 1;&#34;&gt;&amp;#9432;&lt;/div&gt;
    &lt;div style=&#34;flex: 1; font-size: 16px;&#34;&gt;
        &lt;strong&gt;Note:&lt;/strong&gt; Arrow function expressions can have an 
        &lt;a href=&#34;#&#34; style=&#34;color: #3b82f6; text-decoration: underline;&#34;&gt;implicit return&lt;/a&gt;; so, 
        &lt;code style=&#34;background-color: #1e293b; padding: 2px 6px; border-radius: 4px; color: #cbd5e1; font-family: monospace;&#34;&gt;() =&amp;gt; x&lt;/code&gt; 
        is short for 
        &lt;code style=&#34;background-color: #1e293b; padding: 2px 6px; border-radius: 4px; color: #cbd5e1; font-family: monospace;&#34;&gt;() =&amp;gt; { return x; }
        &lt;/code&gt;.
    &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;a-simple-example-code-in-javascript&#34;&gt;A simple example code in Javascript
&lt;/h2&gt;&lt;p&gt;We are using fetch API to get the data from the endpoint and then chaining the result.&lt;/p&gt;
&lt;h3 id=&#34;how-it-works&#34;&gt;How it works
&lt;/h3&gt;&lt;ol&gt;
&lt;li&gt;First the fetch return a &lt;strong&gt;promise&lt;/strong&gt; that resolves to Response object if success or Reject if failed.&lt;/li&gt;
&lt;li&gt;Our first &lt;code&gt;.then&lt;/code&gt; block processes the resolved Response object.Here either error or the &lt;strong&gt;promise&lt;/strong&gt; is thrown.&lt;/li&gt;
&lt;li&gt;Our second &lt;code&gt;.then&lt;/code&gt; block processes the parsed JSON data.&lt;/li&gt;
&lt;li&gt;Our last chain catches error if there&amp;rsquo;s any.&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kd&#34;&gt;let&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;jsonData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;kr&#34;&gt;const&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;items&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;fetch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;https://dummyjson.com/products&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;//returns a Response or Reject Promise object.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;response&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;!&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;){&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;			&lt;span class=&#34;k&#34;&gt;throw&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;new&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;Error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;Response network error&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;//returns error
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;response&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;json&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;();&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// returns json promise
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;nx&#34;&gt;jsonData&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;catch&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;error&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;		&lt;span class=&#34;nx&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;error&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nx&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;jsonData: &amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;jsonData&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// output: undefined [i.e this gets executed before the data is assigned to the jsonData]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Our above example is a good example of using promise but there is a small bug where the data is not stored correctly in the &lt;code&gt;jsonData&lt;/code&gt; variable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why the heck is the data not being stored in our variable?&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is because the whole point of promise is to let other synchronous code run and not block the rest of the program to execute. It is a feature and not a bug.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Let&amp;rsquo;s understand this&lt;/strong&gt;
when the &lt;code&gt;fetch()&lt;/code&gt; function is called , it is supposed to return a new Promise object, which takes times as it has to connect to the network and get the data right? So, our code doesn&amp;rsquo;t get blocked, it instead leaves all the things inside the &lt;code&gt;fetch()&lt;/code&gt; function like other &lt;code&gt;.then() and .catch()&lt;/code&gt; to run later after the &lt;code&gt;fetch()&lt;/code&gt; resolves the result and directly moves to execute other part of the code, which in our case is &lt;code&gt;console.log(&amp;quot;jsonData: &amp;quot;+jsonData);&lt;/code&gt; since nothing has been returned by the promise yet the output results to &lt;code&gt;undefined&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to fix this ?&lt;/strong&gt;
The easiest fix is to log the data inside the second &lt;code&gt;.then&lt;/code&gt; block, which then makes sure that the data is initialized and logged only after.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-javascript&#34; data-lang=&#34;javascript&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;then&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;	
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;	&lt;span class=&#34;nx&#34;&gt;console&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;log&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;})&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt; &lt;/p&gt;
&lt;div style=&#34;display: flex; align-items: center; background-color: #0f172a; border-radius: 8px; padding: 15px; border-left: 4px solid #3b82f6; color: #cbd5e1;&#34;&gt;
    &lt;div style=&#34;color: #3b82f6; font-size: 24px; margin-right: 12px; line-height: 1;&#34;&gt;&amp;#9432;&lt;/div&gt;
    &lt;div style=&#34;flex: 1; font-size: 16px;&#34;&gt;
        &lt;strong&gt;Note:&lt;/strong&gt; We can also use &lt;strong&gt;Async/Await&lt;/strong&gt; to solve the problem, but that&#39;s something new to learn.
    &lt;/div&gt;
&lt;/div&gt;
&amp;nbsp;
&lt;h2 id=&#34;summary&#34;&gt;Summary
&lt;/h2&gt;&lt;p&gt;In short, promise is a easer and more cleaner way to write asynchronous functions , avoiding callback hell , more maintainable code and other many advantages over class callback functions!&lt;/p&gt;
</description>
        </item>
        <item>
        <title>The Unordered List (Singly Linked List) Implementation</title>
        <link>/post/the-unordered-list-singly-linked-list-implementation/</link>
        <pubDate>Mon, 30 Dec 2024 00:00:00 +0000</pubDate>
        
        <guid>/post/the-unordered-list-singly-linked-list-implementation/</guid>
        <description>&lt;img src="https://miro.medium.com/v2/resize:fit:1024/1*wA75yhv1kptx0bW_c9ooAQ.jpeg" alt="Featured image of post The Unordered List (Singly Linked List) Implementation" /&gt;&lt;h2 id=&#34;understanding-unordered-list&#34;&gt;Understanding Unordered List
&lt;/h2&gt;&lt;p&gt;The simplest way to describe about unordered list is it is a container of items with no ordering, meaning it can be anywhere on the container. This list contains a collection of individual nodes that has pointer to another node. It is important to know about &lt;strong&gt;Node&lt;/strong&gt; before learning unordered list.&lt;/p&gt;
&lt;div style=&#34;display: flex; align-items: center; background-color: #0f172a; border-radius: 8px; padding: 15px; border-left: 4px solid #3b82f6; color: #cbd5e1;&#34;&gt;
    &lt;div style=&#34;color: #3b82f6; font-size: 24px; margin-right: 12px; line-height: 1;&#34;&gt;&amp;#9432;&lt;/div&gt;
    &lt;div style=&#34;flex: 1; font-size: 16px;&#34;&gt;
        &lt;strong&gt;Node:&lt;/strong&gt; A node is a container which has two fields [data, next]. Data contains the actual value on the node and next contains the pointer to the next node if there is any otherwise it contains &lt;strong&gt;null&lt;/strong&gt;. 
    &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To understand it more clearly here is the figure that explains the entire analogy of Singly unordered list aka. &lt;strong&gt;Singly Linked List&lt;/strong&gt;.
&lt;img src=&#34;../../images/Pasted%20image%2020241230224311.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
		alt=&#34;Image Description&#34;
	
	
&gt;&lt;/p&gt;
&lt;p&gt;We have list of items that starts with 5 also known as head of the list, which then points to the other data of the list.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Things to point&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Each item on the list is a node not an individual data, where node contains both data and the pointer to another node known as next.&lt;/li&gt;
&lt;li&gt;The only reference of the list is set by the head which points to the latest node inserted.&lt;/li&gt;
&lt;li&gt;The list which is created only knows the head of the whole linked list so there is no way to get the value by index.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;how-to-add-a-node-to-the-list&#34;&gt;How to add a node to the list?
&lt;/h2&gt;&lt;p&gt;There are many ways to add data to the list, we can add either way , to the front or to the end of the list. The order of the list is not important as this is unordered. Here i will show you how to add to the front of the list i.e the head of the list.
Since we already know the head of the list as the only reference to the list is the head. We do the following to add the item to the list.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a node with data, and the pointer to null. &lt;img src=&#34;../../images/Pasted%20image%2020241230225902.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
		alt=&#34;Image Description&#34;
	
	
&gt;&lt;/li&gt;
&lt;li&gt;We need to store this on some variable because we need to point it&amp;rsquo;s next to the current head of the list.&lt;img src=&#34;../../images/Pasted%20image%2020241230230435.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
		alt=&#34;Image Description&#34;
	
	
&gt;&lt;/li&gt;
&lt;li&gt;Then we point the next of the temp to the current head and then assign the head to the temp.&lt;img src=&#34;../../images/Pasted%20image%2020241230230951.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
		alt=&#34;Image Description&#34;
	
	
&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&#34;python-code-to-implement-the-list&#34;&gt;Python code to implement the list
&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;add&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;temp&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;Node&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;data&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;temp&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;set_next&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;head&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;temp&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style=&#34;display: flex; align-items: center; background-color: #0f172a; border-radius: 8px; padding: 15px; border-left: 4px solid #3b82f6; color: #cbd5e1;&#34;&gt;
    &lt;div style=&#34;color: #3b82f6; font-size: 24px; margin-right: 12px; line-height: 1;&#34;&gt;&amp;#9432;&lt;/div&gt;
    &lt;div style=&#34;flex: 1; font-size: 16px;&#34;&gt;
        &lt;strong&gt;Time Complexity: &lt;/strong&gt; Since we only have to work with the first pointer the time complexity is O(1). 
    &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;getting-the-size-of-the-list&#34;&gt;Getting the size of the List
&lt;/h2&gt;&lt;p&gt;How do we get the size of the list? Can you try and think of a solution to get the size?
The most obvious thing that comes to mind is &lt;strong&gt;going through all the nodes and counting them right&lt;/strong&gt;?
YES! that&amp;rsquo;s the solution.
How do we implement that?
1. First thing is we need something to store the count of the list.
2. Then we start from the head (because we only have head as the reference of the list)
3. We then go step by step and increase the count of the variable until we hit the null pointer of the Node.
4. When we hit the null we stop and return the count of the list.&lt;/p&gt;
&lt;h3 id=&#34;python-code-to-implement-the-list-1&#34;&gt;Python code to implement the list
&lt;/h3&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;7
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;def&lt;/span&gt; &lt;span class=&#34;nf&#34;&gt;size&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;n&#34;&gt;current&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;bp&#34;&gt;self&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;head&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;while&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;current&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;!=&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;None&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;+=&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;1&lt;/span&gt; 
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;n&#34;&gt;current&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;current&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;get_next&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;()&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;n&#34;&gt;count&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;</description>
        </item>
        <item>
        <title>A New post on Programming topic</title>
        <link>/post/a-new-post-on-programming-topic/</link>
        <pubDate>Sun, 29 Dec 2024 00:00:00 +0000</pubDate>
        
        <guid>/post/a-new-post-on-programming-topic/</guid>
        <description>&lt;img src="https://plus.unsplash.com/premium_photo-1685086785636-2a1a0e5b591f?q=80&amp;w=2832&amp;auto=format&amp;fit=crop&amp;ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" alt="Featured image of post A New post on Programming topic" /&gt;&lt;p&gt;****#  How do we write clean code?
To write clean code, follow the Don&amp;rsquo;t Repeat Yourself (DRY)    principle and keep your code modular. Use meaningful variable names, functions, and comments to explain complex logic. Avoid deep nesting and use whitespace effectively to improve readability. This will make your code maintainable, efficient, and easy to understand.&lt;/p&gt;
&lt;h2 id=&#34;how-to-write-clean-python-codes&#34;&gt;How to write clean python codes.
&lt;/h2&gt;&lt;p&gt;When it comes to writing clean code, there are several best practices that can help improve the quality and readability of your Python code. One important aspect is to use meaningful variable names. Instead of using single-letter variables like &lt;code&gt;x&lt;/code&gt; or &lt;code&gt;y&lt;/code&gt;, consider using more descriptive names like &lt;code&gt;user_age&lt;/code&gt; or &lt;code&gt;product_price&lt;/code&gt;. Another key principle is to keep your code organized and structured. Use functions, classes, and modules to break down complex logic into smaller, manageable pieces. This makes it easier for others (and yourself!) to understand what the code is doing. For example, instead of writing a long, convoluted function like this:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;print(&amp;#34;Hello world!&amp;#34;)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Function with a clear and descriptive name. This makes the code more readable and maintainable. Similarly, when it comes to formatting your code, use consistent indentation and spacing to make it easier to read. Avoid using too many lines of code or complex logic that&amp;rsquo;s hard to follow. By following these best practices, you can write clean, readable, and maintainable Python code that makes it easy for others (and yourself!) to understand what it does.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;../../images/Pasted%20image%2020241229175742.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
		alt=&#34;Image Description&#34;
	
	
&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Working in reverse, this is the logic that we apply to good integration and deployment: one PR, one change. Shipping isolated, atomic changes means that if something goes wrong, we can disambiguate based on time because we can pinpoint the change that caused a change in behaviour.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id=&#34;code-blocks&#34;&gt;Code Blocks
&lt;/h2&gt;&lt;h4 id=&#34;code-block-with-backticks&#34;&gt;Code block with backticks
&lt;/h4&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;lang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;en&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;meta&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;charset&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;utf-8&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Example HTML5 Document&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Test&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h4 id=&#34;code-block-indented-with-four-spaces&#34;&gt;Code block indented with four spaces
&lt;/h4&gt;&lt;pre&gt;&lt;code&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;
&amp;lt;head&amp;gt;
  &amp;lt;meta charset=&amp;quot;utf-8&amp;quot;&amp;gt;
  &amp;lt;title&amp;gt;Example HTML5 Document&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
  &amp;lt;p&amp;gt;Test&amp;lt;/p&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4 id=&#34;code-block-with-hugos-internal-highlight-shortcode&#34;&gt;Code block with Hugo&amp;rsquo;s internal highlight shortcode
&lt;/h4&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-html&#34; data-lang=&#34;html&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cp&#34;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;lang&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;en&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;meta&lt;/span&gt; &lt;span class=&#34;na&#34;&gt;charset&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;utf-8&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Example HTML5 Document&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;head&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  &lt;span class=&#34;p&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;Test&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;p&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;html&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h4 id=&#34;diff-code-block&#34;&gt;Diff code block
&lt;/h4&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-diff&#34; data-lang=&#34;diff&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;[dependencies.bevy]
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git = &amp;#34;https://github.com/bevyengine/bevy&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;rev = &amp;#34;11f52b8c72fc3a568e8bb4a4cd1f3eb025ac2e13&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gd&#34;&gt;- features = [&amp;#34;dynamic&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;gi&#34;&gt;+ features = [&amp;#34;jpeg&amp;#34;, &amp;#34;dynamic&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;h2 id=&#34;list-types&#34;&gt;List Types
&lt;/h2&gt;&lt;h4 id=&#34;ordered-list&#34;&gt;Ordered List
&lt;/h4&gt;&lt;ol&gt;
&lt;li&gt;First item&lt;/li&gt;
&lt;li&gt;Second item&lt;/li&gt;
&lt;li&gt;Third item&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&#34;unordered-list&#34;&gt;Unordered List
&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;List item&lt;/li&gt;
&lt;li&gt;Another item&lt;/li&gt;
&lt;li&gt;And another item&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&#34;nested-list&#34;&gt;Nested list
&lt;/h4&gt;&lt;ul&gt;
&lt;li&gt;Fruit
&lt;ul&gt;
&lt;li&gt;Apple&lt;/li&gt;
&lt;li&gt;Orange&lt;/li&gt;
&lt;li&gt;Banana&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Dairy
&lt;ul&gt;
&lt;li&gt;Milk&lt;/li&gt;
&lt;li&gt;Cheese&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;other-elements--abbr-sub-sup-kbd-mark&#34;&gt;Other Elements — abbr, sub, sup, kbd, mark
&lt;/h2&gt;&lt;p&gt;&lt;abbr title=&#34;Graphics Interchange Format&#34;&gt;GIF&lt;/abbr&gt; is a bitmap image format.&lt;/p&gt;
&lt;p&gt;H&lt;sub&gt;2&lt;/sub&gt;O&lt;/p&gt;
&lt;p&gt;X&lt;sup&gt;n&lt;/sup&gt; + Y&lt;sup&gt;n&lt;/sup&gt; = Z&lt;sup&gt;n&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Press &lt;kbd&gt;CTRL&lt;/kbd&gt; + &lt;kbd&gt;ALT&lt;/kbd&gt; + &lt;kbd&gt;Delete&lt;/kbd&gt; to end the session.&lt;/p&gt;
&lt;p&gt;Most &lt;mark&gt;salamanders&lt;/mark&gt; are nocturnal, and hunt for insects, worms, and other small creatures.&lt;/p&gt;
&lt;h2 id=&#34;hyperlinked-image&#34;&gt;Hyperlinked image
&lt;/h2&gt;&lt;p&gt;&lt;a class=&#34;link&#34; href=&#34;https://google.com&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;&lt;img src=&#34;https://www.google.com/images/branding/googlelogo/1x/googlelogo_light_color_272x92dp.png&#34;
	
	
	
	loading=&#34;lazy&#34;
	
		alt=&#34;Google&#34;
	
	
&gt;&lt;/a&gt;&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
