<?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: Segun Olumide</title>
    <description>The latest articles on Forem by Segun Olumide (@wonexo).</description>
    <link>https://forem.com/wonexo</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%2F32390%2Fb792f60d-d10a-4573-886a-3849a1d1f6d8.png</url>
      <title>Forem: Segun Olumide</title>
      <link>https://forem.com/wonexo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/wonexo"/>
    <language>en</language>
    <item>
      <title>QuickSort Algorithm Simplified</title>
      <dc:creator>Segun Olumide</dc:creator>
      <pubDate>Wed, 09 Feb 2022 16:34:06 +0000</pubDate>
      <link>https://forem.com/wonexo/quicksort-algorithm-simplified-5ep3</link>
      <guid>https://forem.com/wonexo/quicksort-algorithm-simplified-5ep3</guid>
      <description>&lt;p&gt;QuickSort is a sorting algorithm that uses a divide and conquer strategy to sort out elements in an array. This strategy uses the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Selects a pivot element from the array, which can be picked in various ways.

&lt;ul&gt;
&lt;li&gt;Pivot set from the first element.&lt;/li&gt;
&lt;li&gt;Pivot set from the last element.&lt;/li&gt;
&lt;li&gt;Set a random element as a pivot.&lt;/li&gt;
&lt;li&gt;Use median as the pivot.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Uses the pivot to divide the array into subarrays. This process is called partitioning. The pivots partitions elements less than itself to the left side, and elements that are greater are to the right of the pivot.&lt;/li&gt;
&lt;li&gt;Recursively splits the left and right subarrays using the 1st and the 2nd step until each subarray has one element left.&lt;/li&gt;
&lt;li&gt;Once the process is complete, the element already gets sorted. Finally, combines the sorted elements back to an array.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  QuickSort Partitioning Algorithm with Javascript
&lt;/h2&gt;

&lt;p&gt;Here is an example of a quicksort function in javascript with a breakdown process of each statement.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;qSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; 
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nx"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;newArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;  &lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
     &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
     &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
         &lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
          &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;newArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;qSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;qSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;First, an array of unsorted elements are created.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//nums is the given array&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Then the function &lt;code&gt;qSort&lt;/code&gt;, to perform the quicksort algorithm. With the &lt;code&gt;arr&lt;/code&gt; parameter to receive the array.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//QuickSort Function&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;qSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A condition is then set to make sure the array (&lt;code&gt;arr&lt;/code&gt;) provided is not empty and does not contain only one element. &lt;em&gt;If&lt;/em&gt; the array has less than one element, it will &lt;em&gt;return&lt;/em&gt; that array but proceeds to the next step if it includes more than one element.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;qSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
      &lt;span class="c1"&gt;// if array contains less than one element, return the array&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; 
        &lt;span class="c1"&gt;// if array contains more than one element, proceed to next statement&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The next step is to choose a pivot. In this case, the pivot is set to pick only the last element in the array with the &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;right&lt;/code&gt; array for partitioning. &lt;code&gt;newArray&lt;/code&gt; will append all elements to a new sorted array.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nx"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;newArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
&lt;/code&gt;&lt;/pre&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%2Fz6el31b0hnia6pbat94p.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%2Fz6el31b0hnia6pbat94p.png" alt="Selecting last element as pivot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;left&lt;/code&gt; and &lt;code&gt;right&lt;/code&gt; array are created to partition the elements for the pivot. The pivot position lesser elements to the left and greater elements to the right.&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%2Fzhxd3fbut1ow0i6dcyjx.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%2Fzhxd3fbut1ow0i6dcyjx.png" alt="Pivot positioning"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nx"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;newArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="c1"&gt;// push elements less than pivot to the left&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
      &lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="c1"&gt;// push elements higher than pivot to the right&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This process continuous and breaks into partitions until one element is left.&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%2Fgp2vgm83dpjtxbnu7d5l.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%2Fgp2vgm83dpjtxbnu7d5l.png" alt="Partition breakdown"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;At this point, all elements in the array are finally sorted. The last step returns all sorted elements to the &lt;code&gt;newArray&lt;/code&gt; by concatenating the &lt;code&gt;left&lt;/code&gt;, the &lt;code&gt;pivot&lt;/code&gt;, and the &lt;code&gt;right&lt;/code&gt; array.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="nx"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;newArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;
 &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="c1"&gt;// push elements less than pivot to the left&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c1"&gt;// push elements higher than pivot to the right&lt;/span&gt;
   &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;newArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;qSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;left&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;pivot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;qSort&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;right&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can test the code using this link - &lt;a href="https://jsfiddle.net/wonexo/dk2qynts/4/" rel="noopener noreferrer"&gt;Run quicksort  with javascript&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How long it takes to run QuickSort Algorithm
&lt;/h2&gt;

&lt;p&gt;There are three different time cases it will take the algorithm to run. The best case, worst case and average case.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Best Case&lt;/strong&gt; &lt;em&gt;[O(nlog n)]&lt;/em&gt;: The algorithm runs faster than other cases when the pivot is always selected at the middle element.  &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%2Fbxv5po6xkai33qvq886v.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%2Fbxv5po6xkai33qvq886v.png" alt="Best case"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Worst Case&lt;/strong&gt; &lt;em&gt;[O(n2)]&lt;/em&gt;: This happens when the pivot selected is the largest or smallest element leaving one of the sub-arrays always empty.&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%2Fkathyjfl17a7py1b3fhd.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%2Fkathyjfl17a7py1b3fhd.png" alt="Worst Case"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Average Case&lt;/strong&gt; &lt;em&gt;[O(n*log n)]&lt;/em&gt;: This case happens when none of the above occur.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To get more information about quicksort algorithm you can check the following links below:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.programiz.com/dsa/quick-sort" rel="noopener noreferrer"&gt;Quicksort algorithm by programiz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/quick-sort/" rel="noopener noreferrer"&gt;Quicksort algorithm by geeksforgeeks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/quick-sort/" rel="noopener noreferrer"&gt;Quicksort from wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>algorithms</category>
      <category>quicksort</category>
    </item>
    <item>
      <title>How to Create a Style Guide as a Technical Writer</title>
      <dc:creator>Segun Olumide</dc:creator>
      <pubDate>Sun, 09 Jan 2022 21:29:56 +0000</pubDate>
      <link>https://forem.com/wonexo/how-to-create-a-style-guide-as-a-technical-writer-317b</link>
      <guid>https://forem.com/wonexo/how-to-create-a-style-guide-as-a-technical-writer-317b</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Having a style guide is a very useful way of having a clear and consistent form of writing that can be improved over time. This guide is mostly useful for technical writers. I'll be sharing a few things I learned so far, writing for an open-source community (&lt;a href="http://fastify.io"&gt;Fastify&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;There are a few things you need to know and consider when writing your style guide.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Why am I writing this?
&lt;/h2&gt;

&lt;p&gt;Even though it is necessary to have a style guide, knowing &lt;em&gt;why&lt;/em&gt; can help you figure what needs documenting. Speaking with your community members, developers, or a lead (Could be a program/project manager or a developer advocate if there is one), can help you identify your organisation needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Who am I writing this for?
&lt;/h2&gt;

&lt;p&gt;Perhaps, you want a style guide for open-source community members who contribute to existing documentations or intended for developers who write API documentation and requirements. Describing what the Guide focuses on helps the reader identify which style guide to follow. You can save them the time of reading through the whole thing before they realise it, even some may not figure it out eventually. Do make sure you include a clear description of the guide.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. What should I consider when writing one?
&lt;/h2&gt;

&lt;p&gt;There is a lot to consider when writing a style guide, here are lists of things you may need to include in yours.&lt;/p&gt;

&lt;h3&gt;
  
  
  Guide requirements
&lt;/h3&gt;

&lt;p&gt;A guide requirement tells the reader what they need to know before writing specific documentations. Take this example. A user finds an open-source project built with React Javascript framework they want to contribute to on Github but does not know the requirements needed. In this case, you can provide a requirement in a style guide that notes their need to understand specific tools and programming languages like Javascript, HTML, CSS and may also need to be familiar with Markdown.&lt;/p&gt;

&lt;h3&gt;
  
  
  Fonts
&lt;/h3&gt;

&lt;p&gt;Your fonts determine the quality and standards of your documentation.&lt;br&gt;
According to &lt;a href="https://cs.anu.edu.au/courses/comp2300/assets/manuals/zimmer-technical-writing.pdf"&gt;Uwe R. Zimmer&lt;/a&gt;,  good typesetting is the technical skill that enables your reader to take in your material smoothly, fast, and efficiently.&lt;br&gt;
Knowing when to use bold and emphasis, what font size to use and how much line space is needed, encourages better readability for your readers and improve the content design in general. If you want to know more about font selection, check out the &lt;em&gt;&lt;a href="https://ugurakinci.medium.com/4-basic-rules-of-using-fonts-properly-in-a-technical-document-fdab154c1008"&gt;4 Basic Rules of Using Fonts Properly in a Technical Document by Ugur Akinci&lt;/a&gt;&lt;/em&gt; on medium.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual content
&lt;/h3&gt;

&lt;p&gt;Some documentation doesn't require images. Most documentation tends to avoid Images to optimise storage and avoid the need to keep changing them when updates come up. It's okay to include them in product guides or documents that depend upon Images for a better description. You can also refer to an Image/Video linked separately (Youtube, Cloudinary, Vimeo.), which you can update without directly altering the docs.&lt;/p&gt;

&lt;h3&gt;
  
  
  Writing style
&lt;/h3&gt;

&lt;p&gt;Including a writing style can help your reader know what type of document should be formal or informal. In my case, I find docs like references, terms &amp;amp; conditions in a formal tone, while guides, tutorials, and articles use a more friendly approach. Identify what writing style is needed before you conclude on which to employ.&lt;/p&gt;

&lt;h3&gt;
  
  
  Condescending terms
&lt;/h3&gt;

&lt;p&gt;Condescending words give off a feeling of superiority to your readers. Using condescending tones are very sensitive. Words like "obviously", "him/he", "simply", or "master" are forms of condescending terms that can affect users who are not so confident or knowledgable about a particular topic. You might tend to lose them along the way. It's not a good reputation to let any of your readers feel like they are too dumb to understand or feel it's not for them. You can include a list of words to avoid in your guide (example: Use Primary ✅ not Master ❌, Use They ✅ not Him❌).&lt;/p&gt;

&lt;p&gt;To get more insight, you can read an article by &lt;a href="https://dev.to/unmock/setting-up-the-alex-js-language-linter-in-your-project-3bpl"&gt;Carolyn Stransky - How to remove condescending language from the documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use of verbs
&lt;/h3&gt;

&lt;p&gt;Verbs play a vital role in making the reader take action, and to take action, I mean to start your sentence with a verb. Highlighting when and how these verbs are applied can help improve the documentation, especially when it requires the user to take action. This approach is widely adopted in how-to guides because it requires the user to follow specific instructions.&lt;br&gt;
Here's an example of where this can be used and compared to a less effective one:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Example:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Plain: To install all dependencies, you need to type in "npm install" in your terminal.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use of verb: Open your terminal and type in "npm install" to install all dependencies.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Plain: There is a need to delete the folder called "Back up" so that the hard drive space can be saved.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Use of verb: Delete the folder name "Back up" to save hard drive space.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Code indentation
&lt;/h3&gt;

&lt;p&gt;If your documentation might entail some form of code examples, providing a standard indentation style is essential to keep your code structured, neat and consistent. There are three indentation styles I know of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two spaces&lt;/li&gt;
&lt;li&gt;Four spaces&lt;/li&gt;
&lt;li&gt;Tabs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Developers have been debating on which indentation is best. "Spaces" always take the win due to &lt;a href="https://www.php-fig.org/psr/psr-2/#24-indenting"&gt;PSR-2 standards.&lt;/a&gt; If your team already have a standard they follow, then you can include that in your guide.&lt;/p&gt;

&lt;p&gt;There are many more things to consider. This guide will put you on the right track. I hope this gives you some direction to making the most effective style guide for your team.&lt;/p&gt;

&lt;p&gt;Here are also some pointers that can help:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.gatsbyjs.com/contributing/gatsby-style-guide/"&gt;Gatsby style guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/style"&gt;Google developer documentation style guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.writethedocs.org/guide/writing/style-guides/"&gt;Write the docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://help.apple.com/applestyleguide/#/"&gt;Apple style guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-gb/style-guide/welcome/"&gt;Microsoft writing style guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you find this article helpful, a like from you will be awesome. It'll help push this article forward to those who might need this.&lt;/p&gt;

&lt;p&gt;Happy writing and cheers.&lt;/p&gt;

</description>
      <category>technicalwriting</category>
      <category>productivity</category>
      <category>styleguide</category>
    </item>
    <item>
      <title>Understanding How AMP Stories Work</title>
      <dc:creator>Segun Olumide</dc:creator>
      <pubDate>Mon, 22 Jun 2020 15:30:36 +0000</pubDate>
      <link>https://forem.com/wonexo/understanding-how-amp-stories-work-11fj</link>
      <guid>https://forem.com/wonexo/understanding-how-amp-stories-work-11fj</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uS4jqDhv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4o7pouaxc8fwovaoj4yu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uS4jqDhv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4o7pouaxc8fwovaoj4yu.png" alt="AMP"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;AMP has been around since 2015 and has gradually become a very powerful framework in terms of optimisation and performance. Since my main topic is focused on AMP stories, I'll assume you already know what it is all about, but not to worry I'll start with an introduction just to be on the same page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Is AMP&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AMP which stands for Accelerated Mobile Page, is an open-source web component framework built to make websites fast, easy to create and also mobile-friendly. To get started with AMP, just visit &lt;a href="https://amp.dev"&gt;amp.dev&lt;/a&gt;, trust me it is easy to learn and adopt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How AMP Work Basically&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AMP replaces your HTML tags with AMP components also referred to as &lt;code&gt;amp-script&lt;/code&gt; which enables you to add specific properties and values which give you more control over them just the same way Jquery provides a high-order functionality to Javascript, AMP does the same to HTML. &lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;amp-component 
property= "value"&amp;gt;
&amp;lt;/amp-component&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Components are run by small bits of AMP's JavaScript which discourages you from writing any javascript code unless when necessary and it works seamlessly with the backend. Click &lt;a href="https://amp.dev/documentation/components/"&gt;this link&lt;/a&gt; to learn more about their component.&lt;/p&gt;




&lt;p&gt;Now let's dive into AMP Stories&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What Are AMP Stories&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;AMP stories focus on delivering media content, such as text/captions, images and videos. It is similar to what we have with on Facebook stories, WhatApp Status or Snapchat. Stories have emerged as one of the most delightful content types on our phones and now with just a few lines of code, we now have a tool for building our own.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fsHxs8yI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/or3uon1rsihf3n65zx5z.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fsHxs8yI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/or3uon1rsihf3n65zx5z.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ever since it was launched in February 2018, it has become one of the most interesting features of AMP as it feels very native and looks great on both desktops and mobile.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How AMP Stories Work&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;These Stories are made up of different &lt;em&gt;pages&lt;/em&gt;, in those pages are &lt;em&gt;layers&lt;/em&gt;. Layers contain certain &lt;em&gt;elements&lt;/em&gt; like video, images and texts which enables you to express your storytelling experience.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tD7EH6PD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/onh4314x1cx8ah4ll689.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tD7EH6PD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/onh4314x1cx8ah4ll689.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before you create a story, you need the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have basic knowledge of &lt;a href="https://www.w3schools.com/html/"&gt;HTML&lt;/a&gt;, &lt;a href="https://www.w3schools.com/css/"&gt;CSS&lt;/a&gt; and &lt;a href="https://www.w3schools.com/js"&gt;Javascript&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Understand the core concept of AMP (&lt;a href="https://amp.dev/documentation/guides-and-tutorials/start/converting/?format=websites"&gt;get started here&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Have a &lt;a href="https://www.w3schools.com/js/default.asp"&gt;Chrome web server&lt;/a&gt; and &lt;a href="https://chrome.google.com/webstore/detail/amp-validator/nmoffdblmcmgeicmolmhobpoocbbmknc?hl=en"&gt;AMP Validator&lt;/a&gt; installed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You may as well follow along by downloading a demo I created in my &lt;a href="https://github.com/wonexo/DevFest-AMPDEMO"&gt;Github repo&lt;/a&gt; for one of my speaker sessions at &lt;a href="https://twitter.com/wonexo/status/1186402022830022657"&gt;GDGDevFest&lt;/a&gt;. The folder contains two different HTML files which are, start.html and finish.html. Open the start.html to follow from scratch or you can see the complete result on finish.html&lt;/p&gt;

&lt;p&gt;First, you need to add the script responsible for the amp-Story component to work, this component handles the creation of the  UI Shell which includes the gestures and the navigations as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;head&amp;gt;
&amp;lt;script async custom-element="amp-story"
        src="https://cdn.ampproject.org/v0/amp-story-1.0.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Second, is to add the amp-story element to the body and specify the standalone attribute which is very important, this acts as the container and it only needs one amp-story element to do the trick.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;body&amp;gt;
  &amp;lt;amp-story standalone&amp;gt;
  &amp;lt;/amp-story&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you may also add tags like the title, publisher, logo as so to give it more detailed information about your story&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;amp-story standalone
    title="example"
    publisher="AMP example"
    publisher-logo-src="example.svg"
    poster-portrait-src="assets/example.jpg"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, is to create a page and amp-story-page inside the amp story element with a unique ID.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;amp-story standalone
     title="example"
    publisher="AMP example"
    publisher-logo-src="example.svg"
    poster-portrait-src="assets/example.jpg"&amp;gt;
   &amp;lt;amp-story-page id="cover"&amp;gt;
     &amp;lt;!-- layers go here --&amp;gt; 
   &amp;lt;/amp-story-page&amp;gt;
&amp;lt;/amp-story&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can then go ahead to add the layers which contain the main contents. you may choose the type of template you want your layer to be in, fill, vertical, horizontal or thirds (&lt;a href="https://amp.dev/documentation/guides-and-tutorials/start/visual_story/create_cover_page/?format=stories"&gt;more info here&lt;/a&gt;) and can add more layers to your page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;amp-story-grid-layer template="fill"&amp;gt;
  &amp;lt;amp-img src="example.png"
      width="xxxx" height="xxxx"
      layout="responsive"&amp;gt;
  &amp;lt;/amp-img&amp;gt;
&amp;lt;/amp-story-grid-layer&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After completing a page with your layers you can add as many pages as you want on to your amp-story. &lt;/p&gt;

&lt;p&gt;AMP-Story can also be used as an advertisement for your product, templates are also provided by AMP to help you find more creative options for your ads.&lt;/p&gt;

&lt;p&gt;Thanks for reading&lt;br&gt;
I hope this gave you an understanding of AMP Stories and how you can use them. Do feel free to ask me any question here or on twitter.&lt;/p&gt;

</description>
      <category>amp</category>
      <category>story</category>
    </item>
    <item>
      <title>7 things you need to know about building a Developer Community</title>
      <dc:creator>Segun Olumide</dc:creator>
      <pubDate>Tue, 21 Jan 2020 10:56:42 +0000</pubDate>
      <link>https://forem.com/wonexo/7-things-you-need-to-know-about-building-a-developer-community-5h61</link>
      <guid>https://forem.com/wonexo/7-things-you-need-to-know-about-building-a-developer-community-5h61</guid>
      <description>

&lt;p&gt;Starting a Developer Community can feel overwhelming, well, it was for me. I joined my first community in 2013 back in college, it was a small group of about thirty to fifty members and was quite an active one, active until the lead graduated and the group became a memory, but what I learned over those years volunteering in various communities (like ALC, Ingressive and GDG) and being part of their growth gave me a solid foundation of what I needed to get mine started.&lt;br&gt;
Photo by Perry Grone on Unsplash&lt;/p&gt;




&lt;p&gt;If you want to develop a platform for people who are interested in technology and want to make sure everyone gets the best out of it, this is what I have to share with you. Kindly note that this might not be a 100% accurate for everyone and it's mainly based on my experience so far over time, I believe it is something to be looked out for.&lt;br&gt;
So, let's get straight to it, shall we?&lt;br&gt;
Here are things you should have in mind.&lt;/p&gt;

&lt;h1&gt;
  
  
  Aim of your community
&lt;/h1&gt;

&lt;p&gt;This is the very foundation of why you are starting it in the first place. You want to create opportunities for people to learn, collaborate, contribute to open source or even build a project around a particular technology, or maybe to provide Jobs opportunities for them. Whatever the reason could be, you need to know why you are doing this in the first place. This question set a clear path for you and help you communicate better with your community. You need a clear view of how you want things to go.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Just like Maya Angelou said - "If you don't know where you've come from, you don't know where you're going."&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Community Audience and how to reach them
&lt;/h1&gt;

&lt;p&gt;Knowing your audience will help you identify ways to reach them, Google, for example, has various Google Developer Groups that organise events and workshops for those interested in using their product. Let's take TensorFlow for instance, Tensor as an AI technology will have an audience centred around people who are into Machine learning or Data Science, you could even be a developer, someone into Robotics or just curious about Artificial Intelligence and wants to build a career out of it. The engagement will be a solid one since the majority of your audience have a common interest. You might not figure out completely who your audience might be but with time, getting feedback and working on that feedback will give you a clearer view of what you are dealing with.&lt;br&gt;
Once you have that pretty much figured out then we can talk about what to finally look out for and how to get this community started.&lt;/p&gt;

&lt;h1&gt;
  
  
  Gather Your Squad
&lt;/h1&gt;

&lt;p&gt;You need to also consider one thing in making this work. You choose to become a superman and try doing everything yourself, I mean handling publicity, social media, emails, banners, phone calls, venues and other resources that may arise, oh wait a minute…"You mean you can do all that yourself at the same time even with your other activities? you really must be superman", even superman had a justice league and batman had a butler but hey, you could as well find out for yourself. The key part of making this work is having a strong team, a team who shares the same vision and level of passion as you do, who will take it as their own and take necessary measures in making it a success, that's the kind of team you should look out for, the success of your community also depends on your team. So find one.&lt;/p&gt;

&lt;h1&gt;
  
  
  Engage the Community
&lt;/h1&gt;

&lt;p&gt;Now let's talk about growth. This might not be full time but you can send frequent Newsletters to keep them updated on things centred around a common interest, it could be through an email or a community group (Slack, Telegram Whatsapp e.t.c). Have a social media platform lets people know what is happening in the community, which will also help you reach more people interested in becoming a part of it.&lt;/p&gt;

&lt;h1&gt;
  
  
  ORGANISING MEETUPS
&lt;/h1&gt;

&lt;p&gt;Key things to consider when organizing meetups&lt;/p&gt;

&lt;h2&gt;
  
  
  Agenda
&lt;/h2&gt;

&lt;p&gt;Time is a very essential value not to be taken for granted. You want to make sure you achieve the key things your meetup is set to accomplish at the time frame you provide, and of course, it's fine to give a few minutes before the event or even after but no longer than it should be. Normally it shouldn't matter if everyone is having fun, I mean learning is fun, but it can also make one lose track of time. so don't give in to that temptation. Make your meetup something to remember, it's not just what you say to them but it's mostly how you make them feel so make them feel they are in the right place, you want to impact and not let them depart.&lt;br&gt;
oh, also make sure you have a hashtag on twitter to let people know what is going on at your event, after all, you want the world to know you exist right?&lt;/p&gt;

&lt;h2&gt;
  
  
  Publicity
&lt;/h2&gt;

&lt;p&gt;I know of a few platforms that let you create events for people to register, websites like Eventbrite, Meetup and Attending among many others are the major ones I know of. Take advantage of the social media as well, Twitter to Facebook, to your Whatsapp groups that's if the group admin does not mind. Be creative and that also include a not so terrible banner for people to read online, trust me I won't look twice.&lt;br&gt;
Lastly, it is best to always publicize months before the actual date at least a minimum of two weeks, set a date you know people to can be available to come and also venues that can easily be located.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Sponsors
&lt;/h2&gt;

&lt;p&gt;Want to get sponsors to support your event? I thought as much. This is the part where you hone your communication skills. There are companies looking for an audience like yours to reach out to, but it's not just as easy as that, it depends on your audience, you want to give them a win-win or they will see no reason to provide support. Imagine you set up an event for dog lovers, knowing they love dogs, only for you to reach out to sponsors making cat food. if you were that company would you want to spend your money on that? I didn't think so. Companies want to target people who can be of benefit to them. Reach out to those you think can benefit from it while you get more support for your event while making it fun for everyone at the same time, you see? Win-Win.&lt;br&gt;
I hope you get to build a community people can't wait to be a part of, try to be accessible to your community and team, do that and growth will become accessible to you. Be creative, try new ways to make your community a useful one, not just for food, drinks or the swags but of value and impact.&lt;/p&gt;

&lt;p&gt;Thanks for your attention so far 😁, kindly share to those who might need this.&lt;br&gt;
Cheers&lt;/p&gt;

</description>
      <category>community</category>
      <category>developer</category>
      <category>developers</category>
    </item>
  </channel>
</rss>
