<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lucky Adogun (ZenCoder)</title>
    <description>The latest articles on DEV Community by Lucky Adogun (ZenCoder) (@iam_zencoder).</description>
    <link>https://dev.to/iam_zencoder</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%2F333877%2Fd8e4623b-2b90-4f32-b0b0-8532518678fd.png</url>
      <title>DEV Community: Lucky Adogun (ZenCoder)</title>
      <link>https://dev.to/iam_zencoder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/iam_zencoder"/>
    <language>en</language>
    <item>
      <title>How to Quickly Setup a Hashnode Blog on an Existing Netlify app</title>
      <dc:creator>Lucky Adogun (ZenCoder)</dc:creator>
      <pubDate>Mon, 21 Dec 2020 07:11:46 +0000</pubDate>
      <link>https://dev.to/iam_zencoder/how-to-quickly-setup-a-hashnode-blog-on-an-existing-netlify-app-3d69</link>
      <guid>https://dev.to/iam_zencoder/how-to-quickly-setup-a-hashnode-blog-on-an-existing-netlify-app-3d69</guid>
      <description>&lt;p&gt;Originally posted on &lt;a href="https://blog.zencoder.xyz" rel="noopener noreferrer"&gt;https://blog.zencoder.xyz&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;How do you connect your exisiting app on Netlify with Hashnode?&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in to your  &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify &lt;/a&gt; Dashboard and select the app you want to connect.&lt;/li&gt;
&lt;/ul&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210089126%2F3Dv59AAiQ.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210089126%2F3Dv59AAiQ.png" alt="Screenshot 2020-12-17 135959.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on &lt;strong&gt;Domain Settings&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Under &lt;strong&gt;Custom Domains&lt;/strong&gt; section, select the DNS Panel from your primary domain options.&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210269249%2FDyJ9D0eb-.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210269249%2FDyJ9D0eb-.png" alt="Screenshot 2020-12-17 140311.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on "Add a New Record" and enter the following DNS Settings&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Record Type:  &lt;strong&gt;CNAME&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Name: &lt;strong&gt;blog&lt;/strong&gt; &lt;em&gt;or any subdomain of your choice&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Value: &lt;strong&gt;hashnode.network&lt;/strong&gt; &lt;/p&gt;
&lt;/blockquote&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210427417%2FjAmmOPdKp.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210427417%2FjAmmOPdKp.png" alt="Screenshot 2020-12-17 140641.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Silly me. There's a typo in the value field in the image, use&lt;/em&gt; &lt;strong&gt;hashnode.network&lt;/strong&gt;&lt;/p&gt;



&lt;br&gt;
&lt;br&gt;

&lt;p&gt;That wasn't hard. Now, let's head back to Hashnode and update your settings.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to your Hashnode dashboard &lt;strong&gt;Domain&lt;/strong&gt; section&lt;/li&gt;
&lt;/ul&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210712506%2FrG82KQZVX.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210712506%2FrG82KQZVX.png" alt="Screenshot 2020-12-17 141116.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update your domain name to fit with the settings from &lt;a href="https://www.netlify.com/" rel="noopener noreferrer"&gt;Netlify &lt;/a&gt;:&lt;/li&gt;
&lt;/ul&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210799728%2F7OAxohxtM.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1608210799728%2F7OAxohxtM.png" alt="Screenshot 2020-12-17 141226.png"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;p&gt;That's all. Easy breezy!&lt;/p&gt;

&lt;p&gt;Note that DNS propagation may take within 24 hours, or less. &lt;em&gt;Hit refresh on your new subdomain to check&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;If you found this post helpful. Please share and discuss with me in the comment session.&lt;/p&gt;

</description>
      <category>hashnode</category>
      <category>blog</category>
      <category>netlify</category>
    </item>
    <item>
      <title>Advanced Way to Search an Array in Python (for Self taught Devs)</title>
      <dc:creator>Lucky Adogun (ZenCoder)</dc:creator>
      <pubDate>Fri, 06 Nov 2020 19:19:53 +0000</pubDate>
      <link>https://dev.to/iam_zencoder/advanced-way-to-search-an-array-in-python-for-self-taught-devs-4bog</link>
      <guid>https://dev.to/iam_zencoder/advanced-way-to-search-an-array-in-python-for-self-taught-devs-4bog</guid>
      <description>&lt;p&gt;Imagine your new manager clamoring about the slow speed of your company's application.&lt;/p&gt;

&lt;p&gt;Based on your observation, &lt;em&gt;a little optimization of the codebase which was "written in a hurry" would increase efficiency.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You decided to do exactly that.&lt;/p&gt;

&lt;p&gt;A few hours later, you found a function that searches an array with hundreds of items from the database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The problem with this function is that it runs linearly. And searching for a single item isn't different from looking for a needle in a haystack.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Cutting the time the function runs by half will make you the hero of the day.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;But how would you do that?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Well, here comes...&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Binary Search&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;What's Binary Search?&lt;/p&gt;

&lt;p&gt;Binary Search is a search algorithm that belongs to a group of algorithmic design patterns called &lt;strong&gt;Divide and Conquer&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Binary Search is an efficient algorithm for finding an item in a sorted list of items. The magic behind it lies in its ability to cut the list or array by half (logarithmic time) every time it does a search.&lt;/p&gt;

&lt;p&gt;For example, an array with a length of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10 will take approximately 3 steps to find 1 item.
100 will take approximately  7 steps to find 1 item.
1000 will take approximately  10 steps to find 1 item.
10,000 will take approximately  13 steps to find 1 item.
1,000,000 will take approximately  20 steps to find 1 item.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wow!&lt;/p&gt;

&lt;p&gt;That is really fast! And would truly help you save the day.&lt;/p&gt;

&lt;p&gt;But how do you implement it?&lt;/p&gt;

&lt;p&gt;Well, first, you have to understand how it is designed.&lt;/p&gt;

&lt;p&gt;The concept is simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* Make sure your array is sorted.
* Find the start index of the array ~ (usually 0)
* Find the end index of the array ~ (usually length of array - 1)
* Find the middle of the array
* If your item is in the middle, return it.
* If your item is greater than the middle item, update the middle as the new start
* If your item is lower than the middle item, update the middle as the new end.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's see how it looks in code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def binary_search(array, target):
     array = sorted(array) #sort the array
     start = 0
     end = len(array) - 1
     while start &amp;lt;= end:
        middle = start + (end - start) // 2 #find the middle
        item = array[middle]
        if target == item:
            return middle
        if target &amp;lt; item:
            end = middle - 1
        else:
            start = middle + 1
     return None
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You did it!&lt;/p&gt;

&lt;p&gt;At the end of the workday, you successfully optimized your code saving your organization extra run time. Your manager enters the standup call smiling ear to ear...and &lt;em&gt;thanked you for it!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Your users are happier now. That function was really slowing things down for them.&lt;/p&gt;

&lt;p&gt;You were named the hero of the week during the next day's standup!&lt;/p&gt;

&lt;p&gt;And it ended happily ever after!&lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
      <category>arrays</category>
    </item>
    <item>
      <title>How to loop through an array with a range in VueJS</title>
      <dc:creator>Lucky Adogun (ZenCoder)</dc:creator>
      <pubDate>Mon, 02 Nov 2020 06:48:29 +0000</pubDate>
      <link>https://dev.to/iam_zencoder/how-to-loop-through-an-array-with-a-range-in-vuejs-44p6</link>
      <guid>https://dev.to/iam_zencoder/how-to-loop-through-an-array-with-a-range-in-vuejs-44p6</guid>
      <description>&lt;p&gt;Imagine you have an array with 10 items and wanted to divide it up into a set of five's to fit with your design objective.&lt;/p&gt;

&lt;p&gt;Several common solutions to this problem I've seen in the wild include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Hard-coding the solution &lt;/li&gt;
&lt;li&gt;Creating two separate arrays&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, here's a simpler and better solution to do it with one array in VueJS:&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;p 
    v-for="(item, index) in yourArray.slice(start, end)" 
    :key="index"&amp;gt;

    {{ item.topic }}
&amp;lt;/p&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The best thing about this solution is, you can dynamically set the &lt;code&gt;start&lt;/code&gt; and &lt;code&gt;end&lt;/code&gt; values, for example, using inputs from the user.&lt;/p&gt;

&lt;p&gt;Hope that helps, cheers!&lt;/p&gt;

</description>
      <category>vue</category>
      <category>nuxt</category>
      <category>node</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
