<?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: Daniel</title>
    <description>The latest articles on Forem by Daniel (@dashingdaniel).</description>
    <link>https://forem.com/dashingdaniel</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%2F313633%2F1e4644ef-aab5-410b-812b-64e7b92c6679.jpg</url>
      <title>Forem: Daniel</title>
      <link>https://forem.com/dashingdaniel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dashingdaniel"/>
    <language>en</language>
    <item>
      <title>Algorithms Day 2- Naive String Search</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Thu, 23 Apr 2020 06:16:14 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/algorithms-day-2-naive-string-search-19kn</link>
      <guid>https://forem.com/dashingdaniel/algorithms-day-2-naive-string-search-19kn</guid>
      <description>&lt;p&gt;This algorithm works if you wanna search a smaller string inside a longer string. And they'll return the no of occurrences of that small string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Naive Search - Pseudocode&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a function that accepts a long string and a shorter string&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Loop over the longer string. Inside that, we should loop over the smaller string.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the string characters don't match we should break out from the inner loop&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the string matches we need to continue the loop for the rest of the smaller string&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the match was found we should increment the no of matches&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Finally, we need to return the count.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The code is mentioned below&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Thanks for reading. Hope you'll find it useful&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>javascript</category>
      <category>naivesearch</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Algorithms Day 1- Linear and Binary Search</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Fri, 17 Apr 2020 13:32:34 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/algorithms-day-1-linear-and-binary-search-54ni</link>
      <guid>https://forem.com/dashingdaniel/algorithms-day-1-linear-and-binary-search-54ni</guid>
      <description>&lt;p&gt;So Along with the 100daysofcode challenge, I started to practice algorithms and data structures. So this is my first post about it&lt;/p&gt;

&lt;h2&gt;
  
  
  Linear Search
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Linear Search is one of the common practices that we use almost every time to search inside an array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Just loop through the Array and find the match simple. That's a linear search.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Linear Search - Pseudocode&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a function that accepts an array and a value to be searched.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Loop through the array and check the condition if the current element of the iteration is equal to the value to be checked. If found return the index. Else return - 1&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The code is mentioned below&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Binary Search
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It's faster compared with the linear search method. Rather than comparing and eliminating one by one we can eliminate half of the array elements in a single time&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;But it only works on sorted arrays. It takes two inputs a sorted array and the value to be searched.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Binary Search - Pseudocode&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a function that accepts a sorted array and the value to be searched.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create start pointer and ending pointer. When the start pointer is less than the ending pointer. Create a pointer between the two.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the value in the middle is smaller in comparison move the start pointer over the middle pointer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If it's smaller move the ending pointer down to the middle pointer&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Return the index.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The code is mentioned below&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;I believe that's it. Thanks for reading will keep you guys posted&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>javascript</category>
      <category>binarysearch</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Big O for Array Methods</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Sun, 12 Apr 2020 19:44:31 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/big-o-for-array-methods-p82</link>
      <guid>https://forem.com/dashingdaniel/big-o-for-array-methods-p82</guid>
      <description>&lt;p&gt;&lt;strong&gt;Push and Pop&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Adding or removing data to the array using these two operations is always constant.&lt;/p&gt;

&lt;p&gt;So this has a BigO of 1 "O()".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shift and Unshift&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shifting and Unshifting always will take its own time. As the array has to reindex itself after doing this. So the complexity increases with the no of items&lt;/p&gt;

&lt;p&gt;So this has a BigO of N "O(N)".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Concat&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Its a simple operation of merging two arrays into one but as we know that indexing takes its own time. So this is also the same as shift.&lt;/p&gt;

&lt;p&gt;So this has a BigO of N "O(N)".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Slice&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Slice returns the copy of an array from starting index to the ending index as the number of elements grows this'll also grow based on the size of the array&lt;/p&gt;

&lt;p&gt;So this has a BigO of N "O(N)".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Splice&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With splice we can insert, remove or modify the elements in an array using index. But at the end we are left with indexing. So even this operation grows with the number of elements&lt;/p&gt;

&lt;p&gt;So this has a BigO of N "O(N)".&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
    <item>
      <title>The set and get methods from lodash</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Thu, 19 Mar 2020 08:18:27 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/the-set-and-get-methods-from-lodash-421k</link>
      <guid>https://forem.com/dashingdaniel/the-set-and-get-methods-from-lodash-421k</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is lodash?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lodash simplifies our work by providing lots of methods to handle arrays and objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;_.get()&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The get method gets the value from the path that’s been provided as an argument. The first argument is the object, the second is the path of the object and the third is the optional argument discussed which returns the default value&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;So, What if the path doesn’t exist or the path returns ‘undefined’. No worries Lodash allows us to pass an optional third argument which is the default value. In those situations, the default value is returned.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;_.set()&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The set method as the name suggests sets the value to the path of the object. There are three arguments. The first is the object itself, second is the path and the third one is the value.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;So, What if the path doesn’t exist. The set() automatically creates a path for us. Here the ‘c’ path doesn’t exist but its automatically created.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>javascript</category>
      <category>lodash</category>
      <category>shortcuts</category>
    </item>
    <item>
      <title>#Day5 and #Day6 of "100daysofcode" Challenge</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Wed, 18 Mar 2020 01:46:23 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/day5-and-day6-of-100daysofcode-challenge-3cio</link>
      <guid>https://forem.com/dashingdaniel/day5-and-day6-of-100daysofcode-challenge-3cio</guid>
      <description>&lt;p&gt;Hi, I hope everyone's doing great.&lt;/p&gt;

&lt;p&gt;Another small update on the "100daysofcode" challenge.&lt;/p&gt;

&lt;p&gt;This is about Day 5 and 6.&lt;/p&gt;

&lt;p&gt;Finally completed the whole structure for files and folders. Started writing queries with all validations. I got a strong knowledge of statics and methods on mongoose Also, with express-validators (which is a lifesaver).&lt;/p&gt;

&lt;p&gt;I will update the code and the explanations with my next post.&lt;/p&gt;

&lt;p&gt;Also, I've decided to add these two things on my challenge&lt;/p&gt;

&lt;p&gt;1 - I should at least network with one developer per day. As I don't have that many contacts.&lt;/p&gt;

&lt;p&gt;2 - I found out code wars to be interesting. If I feel bored I should at least complete one problem and post the solution with an explanation on social networks. &lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>#Day3 and #Day4 of "100daysofcode" Challenge</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Sun, 15 Mar 2020 19:06:30 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/day3-and-day4-of-100daysofcode-challenge-12id</link>
      <guid>https://forem.com/dashingdaniel/day3-and-day4-of-100daysofcode-challenge-12id</guid>
      <description>&lt;p&gt;Hi, I hope everyone's doing great.&lt;/p&gt;

&lt;p&gt;Just a small update on my "100daysofcode" Challenge.&lt;/p&gt;

&lt;p&gt;This is regarding Day 3 and 4. In my previous post, I stated that I have decided to work on Instagram clone and React native.&lt;/p&gt;

&lt;p&gt;I had some trouble doing that. The main issue was I was struck with tutorial hell without even realizing it.&lt;/p&gt;

&lt;p&gt;For some of you who were not aware of tutorial hell, Its a mistake that all junior developers make when learning to code. They'll simply start from scratch for learning each language or frameworks without even realizing it. This happened with me on react native as I completed two tutorials but still haven't understood some of the core concepts.&lt;/p&gt;

&lt;p&gt;So, As far as react is concerned I'm just going to build the Instagram clone and going to learn those concepts along the way.&lt;/p&gt;

&lt;p&gt;Also, On the backend side of things (MongoDB). Things are going smoothly just now completed the DB modeling.&lt;/p&gt;

&lt;p&gt;So, yeah Don't get obsessed with tutorials just build it.&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>mongodb</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>#Day1 of my "100daysofcode" challenge</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Thu, 12 Mar 2020 18:42:41 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/day1-of-my-100daysofcode-challenge-ji</link>
      <guid>https://forem.com/dashingdaniel/day1-of-my-100daysofcode-challenge-ji</guid>
      <description>&lt;p&gt;Day 1 of my "100daysofcode" challenge.&lt;/p&gt;

&lt;p&gt;Hi, I hope everyone is doing great.&lt;/p&gt;

&lt;p&gt;Just a quick update on my first day. Everything went great, the day was very productive, But I ended up spending a lot of time setting up things for programming.&lt;/p&gt;

&lt;p&gt;I Spent 2 hours on learning and 1.5 hours on the actual programming. I decided to clone Instagram as a side project so that I could improve my skills in React.&lt;/p&gt;

&lt;p&gt;These are the topics that I've completed learning today (Sounds basic)&lt;/p&gt;

&lt;p&gt;On React Native&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Flexbox&lt;/li&gt;
&lt;li&gt;Use State hook&lt;/li&gt;
&lt;li&gt;Basic overview of components and how to use them&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;On MongoDB&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setting up schema&lt;/li&gt;
&lt;li&gt;Relational data and population with Mongoose&lt;/li&gt;
&lt;li&gt;How to use methods and statics in Mongoose&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I think this is probably the best decision that I've ever made with my career. Because after starting this challenge I find a lot of time to code and learn. I usually find excuses to skip something.&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>react</category>
      <category>mongodb</category>
    </item>
    <item>
      <title>Starting my "100 days of code" challenge</title>
      <dc:creator>Daniel</dc:creator>
      <pubDate>Wed, 11 Mar 2020 16:18:17 +0000</pubDate>
      <link>https://forem.com/dashingdaniel/starting-my-100-days-of-code-challenge-5g55</link>
      <guid>https://forem.com/dashingdaniel/starting-my-100-days-of-code-challenge-5g55</guid>
      <description>&lt;p&gt;Hi, Hope everyone's doing great&lt;/p&gt;

&lt;p&gt;I'm just starting my "100 days of coding" challenge.&lt;/p&gt;

&lt;p&gt;These are the ground rules that I made to myself just to avoid confusion&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Learning new stuff or working at the office will not be included in the challenge&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The coding only should include my side projects or anything that I'm working on for my portfolio. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I should also spend at least 30 mins a day to post my daily records on social networks and LinkedIn&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;These are the technologies that I'm focussing on React, Node, Mongo, Algorithms and data structures.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At the end of this challenge, I should be having at least 6 to 7 projects in hand and have my portfolio ready.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today I thought of making a refresher on React native.&lt;/p&gt;

&lt;p&gt;Let's see how it goes and I'll keep you guys posted&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
