<?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>Forem: Muriithi Gakuru</title>
    <description>The latest articles on Forem by Muriithi Gakuru (@muriithigakuru).</description>
    <link>https://forem.com/muriithigakuru</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%2F813379%2F46c03684-b25b-4c3c-8bd1-b1e75a489d68.jpeg</url>
      <title>Forem: Muriithi Gakuru</title>
      <link>https://forem.com/muriithigakuru</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/muriithigakuru"/>
    <language>en</language>
    <item>
      <title>5 X 5 Chess board UI using CSS Grid</title>
      <dc:creator>Muriithi Gakuru</dc:creator>
      <pubDate>Tue, 07 Jun 2022 11:06:58 +0000</pubDate>
      <link>https://forem.com/muriithigakuru/5-x-5-chess-board-ui-using-css-grid-1eb3</link>
      <guid>https://forem.com/muriithigakuru/5-x-5-chess-board-ui-using-css-grid-1eb3</guid>
      <description>&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/moreh-wa-chege/embed/QWQVvgG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>codepen</category>
    </item>
    <item>
      <title>Write articles using your voice using Bonga Editor.</title>
      <dc:creator>Muriithi Gakuru</dc:creator>
      <pubDate>Thu, 31 Mar 2022 11:51:02 +0000</pubDate>
      <link>https://forem.com/muriithigakuru/write-articles-using-your-voice-using-bonga-editor-324l</link>
      <guid>https://forem.com/muriithigakuru/write-articles-using-your-voice-using-bonga-editor-324l</guid>
      <description>&lt;p&gt;— &lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ Build Challenge ✨
&lt;/h2&gt;

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

&lt;p&gt;This application is written using Nodejs and Express. It enables a user to have their speech transcribed using their microphone onto a rich text editor. They now have a choice between using spoken or written text and can interchange the two depending on how they would like their final product to be formatted.&lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;Accessibility Advocates&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Code on GitHub
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/morehwachege/potential-memory.git" rel="noopener noreferrer"&gt;Link&lt;/a&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/morehwachege" rel="noopener noreferrer"&gt;
        morehwachege
      &lt;/a&gt; / &lt;a href="https://github.com/morehwachege/potential-memory" rel="noopener noreferrer"&gt;
        potential-memory
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Bonga is Swahili slang for speak/talk. Bonga Editor is a JavaScript application that is primarily meant to turn speech into text in real time hence it can be used to write an article or produce transcripts while a podcast is running in the background.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Bonga Editor&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;Bonga is Swahili slang for speak/talk
Bonga Editor is a JavaScript application that is primarily meant to turn speech into text in real time hence it can be used to write an article or produce transcripts while a podcast is running in the background.&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/morehwachege/potential-memory./public/assets/images/readme.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fmorehwachege%2Fpotential-memory.%2Fpublic%2Fassets%2Fimages%2Freadme.png" alt="Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;A little intro about the installation.&lt;/p&gt;
&lt;p&gt;Use the package manager &lt;a href="https://www.npmjs.com" rel="nofollow noopener noreferrer"&gt;npm&lt;/a&gt; to install Bonga.&lt;/p&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;$ git clone https://github.com/morehwachege/potential-memory.git
$ &lt;span class="pl-c1"&gt;cd&lt;/span&gt; ../path/to/the/folder
$ npm install
$ npm start&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Start the server at port 3100&lt;/p&gt;
&lt;div class="highlight highlight-source-powershell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;node index.js&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Contributions &amp;amp; Collaborations&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.&lt;/p&gt;
&lt;p&gt;Please make sure to update tests as appropriate.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Guidelines&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Be informative&lt;/strong&gt;. Format your pull requests nicely. Include screenshots if applicable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be a good citizen&lt;/strong&gt;. Try your best to adhere to the established styles of the project. This doesn't mean that you shouldn't…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/morehwachege/potential-memory" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Live Screen Editor Platform
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmrjlm0t07lzx3v2gro2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmrjlm0t07lzx3v2gro2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;—&lt;/p&gt;

&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Deepgram's Speech to text technology presents endless possibilities. The scope of products you can produce using speech are endless.&lt;/p&gt;

&lt;p&gt;I decided to enter this hackathon just to have a taste of automation and making work easier since tech mostly focuses on that.&lt;br&gt;
Speech to text == commands is a logic that has changed the world.&lt;/p&gt;

&lt;h3&gt;
  
  
  My Deepgram Use-Case
&lt;/h3&gt;

&lt;p&gt;A while back when I started out on writing articles. My goal was to document everything that I had learnt thus challenging me not to lag in my journey.&lt;/p&gt;

&lt;p&gt;My problem was that sometimes after a long coding sessions and debugging my hands got too tired to type hence often opted to procrastinate on both the article and my personal standups till I had more time to spare.&lt;/p&gt;

&lt;p&gt;Having that I can't cut out coding time I skipped most sessions.&lt;br&gt;
I was so excited to start this project because it closely relates to a problem that I have faced and providing a solution to that is intriguing for me.&lt;br&gt;
During this process I have encountered so many different technologies, most of which are new to me including Deepgram.&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenges
&lt;/h3&gt;

&lt;p&gt;I wanted to learn Nodejs and Express which I dedicated to this project. Integrating Deepgram was a breeze.&lt;/p&gt;

&lt;p&gt;However, the editor has overall been the greatest challenge yet.&lt;br&gt;
I went over very many rich text editors but I couldn't seem to understand how to get the transcribed text into the editor's inner frame.&lt;/p&gt;

&lt;p&gt;Editor APIs considered in development:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CKEditor&lt;/li&gt;
&lt;li&gt;TinyMCE&lt;/li&gt;
&lt;li&gt;Joomla&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of these worked for me at the time so I ventured to find a way to create my own. I now prefer this version since I can build on it as I go. Languages used for the editor are html, css and javascript.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deep Dive and Details
&lt;/h3&gt;

&lt;p&gt;This application works for content creators or anyone who finds it easier to speak than type at any moment.&lt;/p&gt;

&lt;p&gt;Using the wysiwyg editor you can get your speech transcribed and formatted and only copy when you are satisfied with the results.&lt;/p&gt;

&lt;p&gt;For the most part Content Creators would benefit the most from this product. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Podcasts and radio sessions can instantly be turned into blogs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Article writers can speed up their production since speech is faster than typing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Users may use the product to transcribe meetings with plausible formatting to produce easily readable material through Voice Activity Detection. This is just like real time minute recording, only a lot less effort is involved.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Since you don't really need hands on this one, people with disabilities can now make a few more dollars on online content. It gives them a 'voice' in the industry.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Learning platforms - Teachers can publish academic papers off of material they teach. Learners can have a record of club proceedings.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I have learnt a lot in terms of speech-to-text technology and speech recognition AI. &lt;/p&gt;

&lt;p&gt;Some of the problems such as the mic picking up ambient noise and surrounding sounds may sometimes distort a transcript. Deepgram has given me an in depth introduction and my research into natural language processing has been eye opening.&lt;/p&gt;

&lt;p&gt;Some of the features offered help to separate between age groups. A younger age group will have enforced profanity filters whilst an adult age group will have a choice between activating the filters or not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Participating in this Hackathon has been an amazing experience overall. Learning by doing increases retention rate and I appreciate this platform for such a chance.&lt;/p&gt;

&lt;p&gt;—&lt;/p&gt;

</description>
      <category>hackwithdg</category>
      <category>deeplearning</category>
      <category>javascript</category>
      <category>deepgram</category>
    </item>
    <item>
      <title>Who do you ask?</title>
      <dc:creator>Muriithi Gakuru</dc:creator>
      <pubDate>Thu, 03 Mar 2022 20:11:45 +0000</pubDate>
      <link>https://forem.com/muriithigakuru/who-do-you-ask-poo</link>
      <guid>https://forem.com/muriithigakuru/who-do-you-ask-poo</guid>
      <description>&lt;p&gt;Do you have a person whom you reach out to to get honest opinions about your creations? Who are they to you?&lt;br&gt;
Mine is my best friend Goretti who has had amazing input into my growth over the years.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to Data Structures and Algorithms with JavaScript.</title>
      <dc:creator>Muriithi Gakuru</dc:creator>
      <pubDate>Mon, 21 Feb 2022 21:00:37 +0000</pubDate>
      <link>https://forem.com/muriithigakuru/introduction-to-data-structures-and-algorithms-with-javascript-oab</link>
      <guid>https://forem.com/muriithigakuru/introduction-to-data-structures-and-algorithms-with-javascript-oab</guid>
      <description>&lt;p&gt;In this post we're going to be looking into data structures and algorithms. &lt;br&gt;
Hopefully this will help to improve your skills and understanding.&lt;br&gt;
Let's start with a good old fashioned definition&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Data Structures&lt;/strong&gt; - this is an organization of data so that it can be used efficiently. It provides a way so that data can be stored, organized, retrieved and used efficiently.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is an introduction to Data Structures(&lt;strong&gt;DS&lt;/strong&gt;) so we'll get straight into it.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Arrays&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Similar to other programming languages, array objects in JavaScript enable storing a collection of multiple items under a single variable name. One important factor about arrays in js are not &lt;strong&gt;primitives&lt;/strong&gt; meaning that the data are not objects and have no underlying methods.&lt;br&gt;
Examples of primitive types in js are; string, number, bigint, boolean, undefined, symbol, and null.&lt;br&gt;
Let's give some characteristics of arrays.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;JavaScript arrays are resizable and can contain a mix of different data types.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Arrays must be accessed using integer indices. Elements cannot be accessed using strings because they are not associative.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The first element of the array is always 0. One might think that this is common knowledge but in some languages the first element is 1.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;- FORTRAN&lt;/li&gt;
&lt;li&gt;- COBOL&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Constructor&lt;/strong&gt;&lt;br&gt;
Array()&lt;br&gt;
This creates a new &lt;code&gt;Array&lt;/code&gt; object&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Initializing while declaring
// Creates an array having elements 10, 20, 30, 40, 50
var house = new Array(10, 20, 30, 40, 50);

//Creates an array of 5 undefined elements
var house1 = new Array(5);

//Creates an array with element 1BHK
var home = new Array("!BHK");

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;How to create and array&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;// 'fruits' array created using array literal notation.
const fruits = ['Apple', 'Banana'];
console.log(fruits);
// ['Apple', 'Banana']
console.log(fruits.length);
// 2

// 'fruits' array created using the Array() constructor.
const fruits = new Array('Apple', 'Banana');
console.log(fruits);
//  ['Apple', 'Banana']
console.log(fruits.length);
// 2

// 'fruits' array created using String.prototype.split().
const fruits = 'Apple, Banana'.split(', ');
console.log(fruits);
 ['Apple', 'Banana']
console.log(fruits.length);
// 2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The above example shows how to create an array from a string separated using a comma. We can also create a string from an array using the &lt;code&gt;join()&lt;/code&gt; method and add a comma separator.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fruits = ['Apple', 'Banana'];
const fruitsString = fruits.join(', ');
console.log(fruitsString);
// "Apple, Banana"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Functions to use with Array&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Array.isArray()&lt;/strong&gt;&lt;br&gt;
Returns true if the argument is an array, or false otherwise.&lt;br&gt;
&lt;strong&gt;Array.prototype.reverse()&lt;/strong&gt;&lt;br&gt;
  Reverses the order of the elements of an array in place. (First becomes the last, last becomes first.)&lt;br&gt;
&lt;strong&gt;Array.prototype.unshift()&lt;/strong&gt;&lt;br&gt;
  Adds one or more elements to the front of an array, and returns the new length of the array.&lt;br&gt;
&lt;strong&gt;Array.prototype.splice()&lt;/strong&gt;&lt;br&gt;
  Adds and/or removes elements from an array.&lt;br&gt;
This is just the tip of the iceberg. There is more to arrays and to their uses &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Queue
&lt;/h2&gt;

&lt;p&gt;Think of a queue in a bank. It's probably a 20th century example but applicable. The first person to join the queue gets served first and leaves. Only then do people who joined after are served, first one in first one out.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4-Qq904J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqyno73jb7iq39p0ccqv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4-Qq904J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqyno73jb7iq39p0ccqv.png" alt="Queue at a bank" width="624" height="264"&gt;&lt;/a&gt;&lt;br&gt;
This data structure uses the First In First Out(FIFO) principle. Where the dequeue is the removal of the first element and the enqueue is the addition of an element onto the queue as shown below.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Md4UkC2J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eskw7701l1dsis110uqw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Md4UkC2J--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eskw7701l1dsis110uqw.png" alt="Queue stack" width="300" height="196"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Queue has the following methods&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;enqueue&lt;/code&gt; - adds an element at the end.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// enqueue function
enqueue(element)
{   
    // adding element to the queue
    this.items.push(element);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This function adds an element at the back of a queue. We have used push() method of array to add an element at the end of the queue.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dequeue&lt;/code&gt; - removes an element at the front of the queue.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// dequeue function
dequeue()
{
    // removing element from the queue
    // returns underflow when called
    // on empty queue
    if(this.isEmpty())
        return "Underflow";
    return this.items.shift();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This function removes an element from the front of a queue . We have used shift method of an array to remove an element from the queue.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;front&lt;/code&gt; - this gets the first element.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// front function
front()
{
    // returns the Front element of
    // the queue without removing it.
    if(this.isEmpty())
        return "No elements in Queue";
    return this.items[0];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This function returns the front element of the queue. We simply return the 0th element of an array to get the front of a queue.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;size&lt;/code&gt; - gets the number of elements in the queue&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;isEmpty&lt;/code&gt; - shows whether the queue is empty.
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// isEmpty function
isEmpty()
{
    // return true if the queue is empty.
    return this.items.length == 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this function we have used the length property and if the array length is 0 then the queue is empty.&lt;/p&gt;
&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;p&gt;The name stack comes from the analogy to a set of physical items. Let's use books for instance. I'll drop an image just for context.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CyC3zp-e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hsvo2zir6c621wmp8wof.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CyC3zp-e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hsvo2zir6c621wmp8wof.jpg" alt="A stack of books" width="300" height="228"&gt;&lt;/a&gt;&lt;br&gt;
We start by placing one book and then each consequent book is placed on top of the other. When we need to access the first book placed, we'll have to take each book out starting with the one that was placed last. &lt;br&gt;
Some pancakes would suffice too! Let's &lt;strong&gt;stack&lt;/strong&gt; them up ;)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_VGEPU-D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q16cb7ucuksrt7jm5uta.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_VGEPU-D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q16cb7ucuksrt7jm5uta.gif" alt="Pancakes" width="444" height="333"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the Last In First Out (LIFO) principle.&lt;/p&gt;

&lt;p&gt;JavaScript Array type provides the push() and pop() methods that allow you to use an array as a stack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;push()&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;push()&lt;/code&gt;method allows you to add one or more elements to the end of the array. The push() method returns the value of the length property that specifies the number of elements in the array.&lt;/p&gt;

&lt;p&gt;If you consider an array as a stack, the push() method adds one or more element at the top of the stack. The following example creates an empty array named stack and adds five numbers, one by one, at the end of the stack array. It is like to push each number into the top of the stack.&lt;/p&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    


  &lt;/code&gt;
  &lt;code&gt;
    
let stack = [];

stack.push(1);
console.log(stack); // [1]

stack.push(2);
console.log(stack); // [1,2]

stack.push(3);
console.log(stack); // [1,2,3]

stack.push(4);
console.log(stack); // [1,2,3,4]

stack.push(5);
console.log(stack); // [1,2,3,4,5]

  &lt;/code&gt;
&lt;/div&gt;



&lt;p&gt;Try it out. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pop()&lt;/strong&gt;&lt;br&gt;
The pop() method removes the element at the end of the array and returns the element to the caller. If the array is empty, the pop() method returns undefined.&lt;/p&gt;

&lt;p&gt;The following example shows how to pop elements from the top of the stack using the pop() method.&lt;/p&gt;


&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    


  &lt;/code&gt;
  &lt;code&gt;
    
console.log(stack.pop()); //  5
console.log(stack); // [1,2,3,4];

console.log(stack.pop()); //  4
console.log(stack); // [1,2,3];

console.log(stack.pop()); //  3
console.log(stack); // [1,2];

console.log(stack.pop()); //  2
console.log(stack); // [1];

console.log(stack.pop()); //  1
console.log(stack); // []; -&amp;gt; empty

console.log(stack.pop()); //  undefined

  &lt;/code&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Linked List
&lt;/h2&gt;

&lt;p&gt;A linked list or a singly linked list is a representation of a list of values like an array, but each item in the list consists of a single object that has two properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The value property stored inside the object&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The next property(node) that points to the next object&lt;br&gt;
It is a collection of nodes in which each node is pointing to next node and last node points to null.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--McAeHDG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wdvulv8xwf79iifuj52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--McAeHDG0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3wdvulv8xwf79iifuj52.png" alt="singly-linked-list" width="769" height="178"&gt;&lt;/a&gt;&lt;br&gt;
The linked list data structure value can be of any valid JavaScript data types (string, number, boolean, object, etc)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Declaration of type node for Linked List&lt;/strong&gt;&lt;br&gt;
We have to create a data structure or Node which contains two parts i.e, first part will contain the data to be stored and second will store address of next such node. We can create this by using user defined data type.&lt;br&gt;
&lt;/p&gt;
&lt;div class="runkit-element"&gt;
  &lt;code&gt;
    


  &lt;/code&gt;
  &lt;code&gt;
    
class Node {
  constructor(data) {
    this.data = data;
    this.next = null;
  }
}

  &lt;/code&gt;
&lt;/div&gt;


&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jx_Jhn5L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ii5x2u2abcvm7do9ee5v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jx_Jhn5L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ii5x2u2abcvm7do9ee5v.png" alt="node" width="441" height="201"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Linked lists is a more superior data structure. I'll update this post once my understanding is good enough to give conclusive information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
"Data structures is fun" may be a statement you may not want to hear but they are very interesting. The have grown on me, to be honest. &lt;br&gt;
If you're one for solving puzzles I may, or may not have a challenge for you ;)&lt;br&gt;
Let me not go there though.&lt;br&gt;
Please don't google the &lt;code&gt;Tower of Hanoi&lt;/code&gt; challenge. It's too easy for your level.&lt;br&gt;
Coffee break!!&lt;br&gt;
Cheers!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>BC30420 'Sub Main' was not found error in a Windows Form app: Quick Fix.</title>
      <dc:creator>Muriithi Gakuru</dc:creator>
      <pubDate>Sat, 19 Feb 2022 17:57:20 +0000</pubDate>
      <link>https://forem.com/muriithigakuru/bc30420-sub-main-was-not-found-error-in-a-windows-form-app-quick-fix-3f89</link>
      <guid>https://forem.com/muriithigakuru/bc30420-sub-main-was-not-found-error-in-a-windows-form-app-quick-fix-3f89</guid>
      <description>&lt;p&gt;It's safe to say that Visual Basic has become one of the hardest languages to find content about online ever since Microsoft announced that there won't be any more features added to it in .NET CORE/ .NET 5.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt; “ Going forward, we do not plan to evolve Visual Basic as a language ” &lt;br&gt;
&lt;a href="https://devblogs.microsoft.com/vbteam/visual-basic-support-planned-for-net-5-0/"&gt;.NET Team&lt;/a&gt; &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That explained a lot when I tried to troubleshoot an error I'd gotten and the whole of the internet was almost blank, for an error I'd call trivial and noob level. I've recreated the above error so as to show you how to solve it. Save you time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aYHLVLZi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270019932/_hgc0uASD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aYHLVLZi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270019932/_hgc0uASD.png" alt="Screenshot (46).png" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every time I tried the compile and run the project, i got and error that the &lt;code&gt;Sub Main()&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;was not found.&lt;br&gt;
The solution to this is to check that the startup form isn't referencing to an old method. You can find that in your project properties.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;All you have to do is right-click on your main project in the top-right area of the visual basic working area.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gfDlHgFi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270427882/eOSU85D13.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gfDlHgFi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270427882/eOSU85D13.png" alt="Screenshot (47).png" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scroll to the bottom and click on properties.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EI7ve13f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270525726/8kFgBc-6_.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EI7ve13f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270525726/8kFgBc-6_.png" alt="Screenshot (48).png" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the new window right at the Startup Project section is where you're going to change from &lt;br&gt;
Sub Main&lt;/p&gt;

&lt;p&gt;to the name of your Form.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--C6Iwrjxt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270705624/sM383pFF2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--C6Iwrjxt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270705624/sM383pFF2.png" alt="Screenshot (49).png" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
Once you're done, you can exit that tab and re-run your project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0C_HzsHk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270970816/DaOjr644B.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0C_HzsHk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1645270970816/DaOjr644B.png" alt="Screenshot (51).png" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Everything should be working fine and you can notice that the error is gone.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Every day is a coding challenge. If you feel that the content was inadequate please comment about it or contact me. Keep coding.  &lt;strong&gt;Cheers !!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JS 101:Introduction to modern JavaScript.</title>
      <dc:creator>Muriithi Gakuru</dc:creator>
      <pubDate>Mon, 14 Feb 2022 16:49:40 +0000</pubDate>
      <link>https://forem.com/muriithigakuru/js-101introduction-to-modern-javascript-2jnm</link>
      <guid>https://forem.com/muriithigakuru/js-101introduction-to-modern-javascript-2jnm</guid>
      <description>&lt;p&gt;JavaScript is the most used programming language. It is used alongside HTML(Hypertext Markup Language) and CSS(Cascading Stylesheet) on the World Wide Web. It is used on the client side to manipulate webpage behavior.&lt;br&gt;
JavaScript is Multi-paradigm. This means that it is event-driven, functional, imperative and incorporates object-oriented programming.&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting Started.
&lt;/h2&gt;

&lt;p&gt;We're going to print a Hello World statement. JavaScript uses the console on the browser to print statements. You don't need to install JavaScript since it is interpreted by the browser. We just have to write code on a file with a dot js extension as such;&lt;br&gt;
&lt;code&gt;myFile.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcuorwfqgtrilv0othrj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqcuorwfqgtrilv0othrj.png" alt="Console log image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On your browser, navigate to the location of your project. Right-click and select inspect. Click on the console tab to get your console.&lt;br&gt;
We can achieve the same result using an Integrated Development Environment.&lt;br&gt;
 We just have to write code on a file with a dot js extension as such;&lt;br&gt;
&lt;code&gt;myFile.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwar6upuqihf38urrrel1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwar6upuqihf38urrrel1.png" alt="Visual Studio Code"&gt;&lt;/a&gt;&lt;br&gt;
We get the same print statement when we refresh the browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfs098e943g3rfhb9pfr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfs098e943g3rfhb9pfr.png" alt="Hello World on the browser"&gt;&lt;/a&gt;&lt;br&gt;
The hello world statement is a bit distorted to show the difference.&lt;br&gt;
&lt;strong&gt;Comments&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;// This is a single line comment
/* This
    is
    a multi-line
    comment
*/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Variables
&lt;/h2&gt;

&lt;p&gt;We assign variables using various keywords such as &lt;code&gt;var&lt;/code&gt;, &lt;code&gt;let&lt;/code&gt; or &lt;code&gt;const&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Var&lt;/strong&gt; - var is used to declare variables. It is flexible in that the data can be reassigned later in the code. Var is functional scoped It is able to run in the older browser versions.&lt;br&gt;
&lt;strong&gt;Let&lt;/strong&gt; - it's used to declare variables much like var. The difference is let can not be redeclared later on. Let has a block scope. Get more information &lt;a href="https://www.educative.io/edpresso/what-is-the-let-keyword-in-javascript" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;strong&gt;Const&lt;/strong&gt; - These are constant that are block scoped much like &lt;code&gt;let&lt;/code&gt; declared variables. Values cannot be reassigned but the can be redeclared through &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#declarations" rel="noopener noreferrer"&gt;variable declaration&lt;/a&gt;. However, if a constant is an object or array its properties or items can be updated or removed.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;
&lt;h2&gt;
  
  
  Data Types
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
&lt;strong&gt;Strings&lt;/strong&gt; - Js support string assignment. This is used to print statements and store words or variables that are required to be processed as strings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let name = "Muriithi Gakuru";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The value is enclosed by quotation marks and the end of the statement has to be a semi-colon.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integers&lt;/strong&gt; - These are assigned decimal numbers&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let b = 210;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Extra large or extra small numbers can be written with scientific (exponential) notation&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 123e5;      // 12300000
let d = 123e-5;     // 0.00123
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Floating Point numbers&lt;/strong&gt; - These are declared much like integers only that these have decimal points.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const temperature = 13.4;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Boolean Values&lt;/strong&gt; - These are assigned values that show whether a condition or values is &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let isAlive = true;
// reassign to false
isAlive = false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;BigInt&lt;/strong&gt; - Used to represent an manipulate primitive bigint values which are too big to be represented by a number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const MaxSafeInteger = 9007199254740991n

const alsoHuge = BigInt(9007199254740991)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Arithmetics&lt;/strong&gt; - JavaScript supports all mathematical arithmethic and logical operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Arrays
&lt;/h2&gt;

&lt;p&gt;An array is a special variable, which can hold more than one value. The values are enclosed in 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;const cars = ["volvo", "mercedes", "Rolls Royce"]
// They can contain different data types
let details = ["Muriithi Gakuru", 23, "Wisconsin", 72.4 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt; for an array is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]];
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Objects
&lt;/h2&gt;

&lt;p&gt;JavaScript objects are containers for named values called properties.&lt;br&gt;
These store values that can be accessed using name:value pairs. They are variables enclosed using curly braces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const car = {
   type:"Fiat", 
   model:"500", 
   color:"white"
};
// You can access the value by using the key ie. property name `car.key`
console.log(car.type) // this will print Fiat

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conditional Statements
&lt;/h2&gt;

&lt;p&gt;Conditional statements are used to perform different actions based on different conditions.&lt;br&gt;
Use if to specify a block of code to be executed, if a specified condition is true&lt;br&gt;
Use else to specify a block of code to be executed, if the same condition is false&lt;br&gt;
Use else if to specify a new condition to test, if the first condition is false&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (condition) {
  //   executed if the condition is true
}else if(condition){
 //    executed if the first condition failed
}
else{
  // executed if the previous conditions failed
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Loops
&lt;/h2&gt;

&lt;p&gt;JavaScript supports different kinds of loops:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;for -&lt;/strong&gt; loops through a block of code a number of times&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (statement 1; statement 2; statement 3) {
  // code block to be executed
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;for/in&lt;/strong&gt; - loops through the properties of an object&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (key in object) {
  // code block to be executed
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;for/of&lt;/strong&gt; - loops through the values of an iterable object&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (variable of iterable) {
  // code block to be executed
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;while&lt;/strong&gt; - loops through a block of code while a specified condition is true&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while (condition) {
  // code block to be executed
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;do/while&lt;/strong&gt; - also loops through a block of code while a specified condition is true&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;do {
  // code block to be executed
}
while (condition);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More information on the loops is shared &lt;a href="https://www.w3schools.com/js/js_loop_for.asp" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;p&gt;A JavaScript function is a block of code designed to perform a particular task.&lt;br&gt;
A JavaScript function is executed when "something" invokes it (calls it). It is called using the function name, either to print or to return a value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function printName(){
   name = "Muriithi Gakuru";
   console.log("My name is", name);
}
//call the function
printName()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A function may take arguments making calling JS functions more dynamic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function printName(name){
   console.log("My name is", name)
}
// call the function using an argument
printName("Muriithi Gakuru")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just an introduction into the vastness of JavaScript. It is a very robust language hence its uses both in the client side and the server side. Keeplearning and Follow for more content. &lt;strong&gt;Cheers&lt;/strong&gt;!!&lt;br&gt;
&lt;strong&gt;credits&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;&lt;a href="//w3schools.com"&gt;w3schools&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;em&gt;&lt;a href="//developer.mozilla.com"&gt;mozilla&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction To Modern Python</title>
      <dc:creator>Muriithi Gakuru</dc:creator>
      <pubDate>Mon, 14 Feb 2022 07:32:18 +0000</pubDate>
      <link>https://forem.com/muriithigakuru/introduction-to-modern-python-2ilf</link>
      <guid>https://forem.com/muriithigakuru/introduction-to-modern-python-2ilf</guid>
      <description>&lt;h2&gt;
  
  
  What is Python
&lt;/h2&gt;

&lt;p&gt;Python is an interpreted high-level general-purpose &lt;strong&gt;programming language&lt;/strong&gt;. Its design philosophy emphasizes code readability with its use of significant indentation. Its language constructs as well as its object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects. That's according to our good friend Wikipedia.&lt;br&gt;
Python is best used for automation. It's uses extend to Web,  Mobile and Game Development, Machine Learning and Data Science. This is because python can be ran on multiple platforms; windows, linus and mac os.&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;First things first.&lt;br&gt;
We'll start by downloading a python interpreter for our machine by navigating to &lt;a href="//python.org"&gt;here&lt;/a&gt;. Funny story, I had written down how to configure your development environment and installation process but decided it wasn't comprehensive enough and would make this lengthy. Please refer &lt;a href="https://dev.to/abogejr/python-101-introduction-to-modern-python-10bj"&gt;here&lt;/a&gt; then come back for an in depth introduction.&lt;/p&gt;
&lt;h3&gt;
  
  
  Writing your first program
&lt;/h3&gt;

&lt;p&gt;We'll start with the ceremonial starter program, Hello World.&lt;br&gt;
You should be able to work on the command prompt REPL(Read–eval–print loop) environment&lt;br&gt;
This is what I mean.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--D2G7SzUe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocvsdnhjgbhm1t6uf1dx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--D2G7SzUe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocvsdnhjgbhm1t6uf1dx.png" alt="Image description" width="880" height="459"&gt;&lt;/a&gt;&lt;br&gt;
If you can get that on cmd then we're ready to go, Hurray!&lt;/p&gt;
&lt;h2&gt;
  
  
  Hello World
&lt;/h2&gt;

&lt;p&gt;Type a print statement to print.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print('Hello World')
# This is a comment
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python is simple like that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Comments
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This is a single line comment
"""
    This is a multi-line comment
"""
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Variable declaration
&lt;/h2&gt;

&lt;p&gt;We declare variables to reuse them later right? Python requires us to assign a value to the variable. You don't need a type identifier since python detects it right away.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_name = "Muriithi Gakuru"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The snake case is more preferred. This is done by joining variables with an undercase as done above.&lt;/p&gt;

&lt;h2&gt;
  
  
  Variable types in python
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Strings&lt;/strong&gt; - Strings in python are surrounded by either single quotation marks, or double quotation marks. 'hello world' is the same as "hello world"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Numbers&lt;/strong&gt; - There are three numeric types in python;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integer -  is a whole number, positive or negative, without decimals.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a = 251
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Float - is a number, negative or positive containing one or more decimal points.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b = 19.5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Complex -  these are written with a "j" as the imaginary part.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c = 15j
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Booleans - These store an output of either &lt;code&gt;True&lt;/code&gt; or &lt;code&gt;False&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Lists
&lt;/h2&gt;

&lt;p&gt;Python lists are used to store data in array format. Different data types can be stored in the same list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_list = ['name', 210, 'age', 33.5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can call a list's contents using their indices&lt;br&gt;
&lt;code&gt;my_list[0]&lt;/code&gt; will give an output of the string 'name' at index 0.&lt;br&gt;
You can use the slicing operation &lt;code&gt;[:]&lt;/code&gt; to get an item or a range of items. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name = [120, 'savor', 32.4, 'title']
# if we want to access items from index 1 to the end of the list 
print(name[1:]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will give an out put of a list;&lt;br&gt;
&lt;code&gt;['savor',32.4, 'title']&lt;/code&gt;&lt;br&gt;
if we want to access all items in the list non-inclusive of the last item, we add a negative sign to the slice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(name[:-1]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will give an out put of a list;&lt;br&gt;
&lt;code&gt;[120, 'savor', 32.4]&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Tuples
&lt;/h2&gt;

&lt;p&gt;Tuples store data much like lists only that values in a tuple are &lt;strong&gt;unchangeable&lt;/strong&gt;. A tuple is ordered and enclosed in round brackets. They are mostly used to store sensitive data that should not be reassigned later in the program such as user information.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_tuple = ("Ken", 23)
print(my_tuple)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Sets
&lt;/h2&gt;

&lt;p&gt;They are used to store multiple items in a single variable. Sets contain unique items and there cannot be any duplicates or else they will be eliminated.&lt;br&gt;
Set contents are unchangeable but you can remove or add items to the set. They are enclosed by curly braces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_set = {"apple", "banana", "cherry"}
print(my_set)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Dictionaries
&lt;/h2&gt;

&lt;p&gt;Dictionaries store data in key:value pairs. They are enclosed in curly braces. They do not allow duplicates since a value can only be accessed using a single, distinct key. &lt;code&gt;dict&lt;/code&gt; is a keyword that refers to a dictionary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my_dict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(my_dict)
print(my_dict.keys())
print(my_dict.values())
print(my_dict.items())
# try these out
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Loops
&lt;/h2&gt;

&lt;p&gt;Loops take care of indentation according to &lt;a href="https://www.python.org/dev/peps/pep-0008/"&gt;PEP8&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;If - Else&lt;/strong&gt;
Python supports all logical operations in mathematics
Equals: &lt;code&gt;a == b&lt;/code&gt;
Not Equals: &lt;code&gt;a != b&lt;/code&gt;
Less than: &lt;code&gt;a &amp;lt; b&lt;/code&gt;
Less than or equal to: &lt;code&gt;a &amp;lt;= b&lt;/code&gt;
Greater than: &lt;code&gt;a &amp;gt; b&lt;/code&gt;
Greater than or equal to: &lt;code&gt;a &amp;gt;= b&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b = 13
c = 300
if c &amp;gt; b:
  print("c is greater than b")
else:
    print("The else clause was called")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;While Loop&lt;/strong&gt;
This executes a list of statements provided the condition is true.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;i = 1
while i &amp;lt; 6:
  print(i)
  i += 1
# Note: if i is not incremented, the loop will continue infinitely.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;For Loop&lt;/strong&gt;
For loops are used for iterationg through a sequence. This may be a list, dictionary, set or tuple.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fruits = ["apple", "banana", "cherry"]
for x in fruits:
  print(x)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This prints the contents of fruits one after the other.&lt;br&gt;
You may also iterate through a string.&lt;/p&gt;
&lt;h2&gt;
  
  
  Functions
&lt;/h2&gt;

&lt;p&gt;A function is a block of code that only runs when it's called.&lt;br&gt;
Functions enable the resuse of repetitive parts of the program.&lt;br&gt;
Below is a function to print a user's name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def print_name():
    my_name = "Muriithi Gakuru"
    print('My name is ', my_name)

# functions are called by typing the function name and parentheses

print_name()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A function can take an argument or two so as to receive data dynamically later in the program.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def print_name(my_name):
    print('My name is ', my_name)
# the argument is placed between the parentheses

# call the function by adding the argument in the function
print_name("Muriithi Gakuru")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All these take practice to have them at your fingertips. These are the fundamentals of modern python. I hope you had fun in the journey of being a techie.&lt;br&gt;
&lt;em&gt;credits to &lt;a href="//w3schools.com/python"&gt;w3schools&lt;/a&gt; and &lt;a href="//unsplash.com"&gt;Unsplash&lt;/a&gt;&lt;/em&gt;&lt;br&gt;
&lt;strong&gt;Cheers&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
