<?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: Naime Molla </title>
    <description>The latest articles on DEV Community by Naime Molla  (@naimeahmed).</description>
    <link>https://dev.to/naimeahmed</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%2F778891%2F9658a4bf-1245-4945-9282-670ec6d1c3e6.jpeg</url>
      <title>DEV Community: Naime Molla </title>
      <link>https://dev.to/naimeahmed</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/naimeahmed"/>
    <language>en</language>
    <item>
      <title>Introduction to Dynamic programming</title>
      <dc:creator>Naime Molla </dc:creator>
      <pubDate>Thu, 26 Jan 2023 17:15:55 +0000</pubDate>
      <link>https://dev.to/naimeahmed/introduction-to-dynamic-programming-3neo</link>
      <guid>https://dev.to/naimeahmed/introduction-to-dynamic-programming-3neo</guid>
      <description>&lt;p&gt;You will learn about dynamic programming in this tutorial using a beginner's approach. Why DP is so important for writing effective code? And two essential techniques for solving dynamic problems. Let's start with a great and powerful technique for writing beautiful and efficient code.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is dynamic programming?
&lt;/h2&gt;

&lt;p&gt;Dynamic programming is a method of solving problems by breaking them down into smaller, overlapping subproblems. The solutions to these subproblems are then stored in a table so that they can be reused instead of recalculating them each time they are needed. This can greatly reduce the time and space complexity of a problem, making it much more efficient to solve.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why we need to know about dynamic programming technic?
&lt;/h2&gt;

&lt;p&gt;Many problems that seem intractable at first glance can be solved relatively easily with dynamic programming. This is because dynamic programming breaks down a problem into smaller, overlapping subproblems, and stores the solutions to these subproblems in a table, making it possible to reuse them instead of recomputing them each time they are needed.&lt;/p&gt;

&lt;p&gt;Dynamic programming can often be used to find optimal solutions to problems, rather than just any solution. For example, dynamic programming can be used to find the shortest path between two nodes in a graph, or the longest common subsequence between two strings.&lt;/p&gt;

&lt;p&gt;Many problems that are NP-hard can be solved in polynomial time using dynamic programming. This is because dynamic programming reduces the time complexity of a problem by breaking it down into smaller subproblems, and reusing the solutions to these subproblems instead of recomputing them each time they are needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the difference between a Dynamic programming technic and recursion?
&lt;/h2&gt;

&lt;p&gt;Dynamic programming and recursion are two different techniques used to solve problems. The main difference between them is the way they approach a problem and store the solutions to subproblems. Dynamic programming stores the solutions to subproblems in a table, so they can be reused instead of recomputing them each time they are needed. This greatly reduces the time complexity of a problem, making it more efficient to solve. Recursion, on the other hand, breaks down a problem into smaller subproblems and solves them recursively, without storing the solutions. This can lead to a lot of duplicate work, and can make a problem very slow to solve, but it's often simpler to implement. Both methods have their own advantages and disadvantages and a problem can be solved using both methods, the choice of which method to use depends on the specific problem and the desired trade-off between time complexity and ease of implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Identify if it is a Dynamic programming problem?
&lt;/h2&gt;

&lt;p&gt;There are several ways to identify if a problem is a dynamic programming problem. One way is to look for overlapping subproblems, which occur when the same subproblem is solved multiple times with different inputs. Another way is to look for a problem that can be broken down into smaller subproblems, where the solution to the original problem can be constructed from the solutions to the subproblems.&lt;/p&gt;

&lt;h2&gt;
  
  
  Techniques to solve Dynamic Programming Problems.
&lt;/h2&gt;

&lt;p&gt;There are several techniques that can be used to solve dynamic programming problems, including memoization, tabulation, and the use of recurrence relations. These techniques involve storing the solutions to subproblems in a table and reusing them instead of computing them each time they are needed. I will write more details about these technic next time. stay connected. &lt;/p&gt;

&lt;p&gt;Let's take the example of Fibonacci series. The Fibonacci series is a series of numbers in which each number is the sum of the two preceding ones, usually starting with 0 and 1. The sequence goes 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Fibonacci series using Dynamic programming (python code)
def fib(n, lookup):
  if n &amp;lt;= 0:
    lookup[n] = 0
    return 0
  if n == 1:
    lookup[n] = 1
    return 1
  if lookup[n] == None:
    lookup[n] = fib(n-1, lookup) + fib(n-2, lookup)
    return lookup[n]
n = 70
lookup = [None]*(101)
print("Fibonacci Number is : " , fib(n, lookup))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, we are using the technique of memoization to store the solutions to subproblems in a table, and reusing them instead of recomputing them each time they are needed. This greatly reduces the time complexity of the problem, making it much more efficient to solve. Your computer will can't calculate the Fibonacci number of 70 with commonly used techniques. This is the power of dynamic programming.&lt;/p&gt;

&lt;p&gt;In conclusion, dynamic programming is a powerful method of solving problems that can greatly reduce the time and space complexity of a problem. By breaking a problem down into smaller, overlapping subproblems, and storing the solutions to these subproblems in a table, we can greatly improve the efficiency of our algorithms. Feel free to reachout me to discus about problem solving.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>problemsolving</category>
      <category>dynamicprogramming</category>
    </item>
    <item>
      <title>Simple overview of MySQL (Relational Database)</title>
      <dc:creator>Naime Molla </dc:creator>
      <pubDate>Fri, 24 Dec 2021 13:26:09 +0000</pubDate>
      <link>https://dev.to/naimeahmed/simple-overview-of-mysql-relational-database-3nk7</link>
      <guid>https://dev.to/naimeahmed/simple-overview-of-mysql-relational-database-3nk7</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is MySQL:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MySQL is a Widely used relational database management system. It's free and open-source and ideal for both small and large applications. It's very fast,  reliable, scalable and easy to use. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who uses MySQL?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most popular websites like Facebook, Twitter, Airbnb, Uber, YouTube, GitHub, etc. Content Management Systems like Wordpress, Joomla, Drupal, Contao, etc. A huge number of web developers around the world use MySQL as a database management system. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Show Data on your website:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to show data in your website from a database, you will need: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An RDBMS database program like MySQL.&lt;/li&gt;
&lt;li&gt;A server-side scripting language, like PHP.&lt;/li&gt;
&lt;li&gt;To use SQL to get the data you want.&lt;/li&gt;
&lt;li&gt;To use HTML/ CSS to style the page. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;RDBMS:&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;RDBMS stands for Relational Database Management system. It's a program used to maintain a relational database. RDBMS is the basis for all modern database systems such as MySQL, Oracle, Microsoft SQL server and Microsoft Access. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Database Table:&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;A table is a collection of related data entries, and it consists of columns and rows. A column holds specific information about every record in the table. A Record or row is each individual entry that exists in a table. &lt;br&gt;
Look at this table: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZQONSm57--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/znhfq8xe12fnu8ps0ucc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZQONSm57--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/znhfq8xe12fnu8ps0ucc.png" alt="Table image" width="880" height="337"&gt;&lt;/a&gt; &lt;br&gt;
The columns in the table above are: CustomerID, CustomerName, ContactName, Address, City, PostalCode and Country. The table has 5 records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explain Relational Database:&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;A Relational database defines database relationships in the form of tables. The tables are related to each other - based on data common to each. &lt;/p&gt;

&lt;p&gt;Look at the following three tables "Customers", "Orders" and "Shippers" database&lt;/p&gt;

&lt;p&gt;Customers Table&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XvstZ3kU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7j8oxh5siadrbbzah4kt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XvstZ3kU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7j8oxh5siadrbbzah4kt.png" alt="customer table" width="880" height="342"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The relationship between the "Customers" table and the "Orders" table is the CustomerID column.&lt;/p&gt;

&lt;p&gt;Orders Table&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QCKaAY0c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbr981fwx2zrh6oj2i9f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QCKaAY0c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kbr981fwx2zrh6oj2i9f.png" alt="users ordered table" width="880" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The relationship between the "Orders" table and the "Shippers" table is the SipperID column. &lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Some Most important SQL Commands:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;INSERT - Insert new data into a database&lt;/li&gt;
&lt;li&gt;SELECT - extract data from a database &lt;/li&gt;
&lt;li&gt;UPDATE - updates data in a database&lt;/li&gt;
&lt;li&gt;DELETE - deletes data from database&lt;/li&gt;
&lt;li&gt;CREATE DATABASE - creates a new database&lt;/li&gt;
&lt;li&gt;AlTER DATABASE - modifies a database&lt;/li&gt;
&lt;li&gt;CREATE TABLE - creates a new table&lt;/li&gt;
&lt;li&gt;ALTER TABLE - modifies a table&lt;/li&gt;
&lt;li&gt;DROP TABLE - deletes a table&lt;/li&gt;
&lt;li&gt;DROP INDEX - deletes an index &lt;/li&gt;
&lt;li&gt;CREATE INDEX - creates an index &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>sql</category>
      <category>database</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What's new changes and features in React Router v6.</title>
      <dc:creator>Naime Molla </dc:creator>
      <pubDate>Wed, 22 Dec 2021 12:42:19 +0000</pubDate>
      <link>https://dev.to/naimeahmed/whats-new-changes-and-features-in-react-router-v6-1o0c</link>
      <guid>https://dev.to/naimeahmed/whats-new-changes-and-features-in-react-router-v6-1o0c</guid>
      <description>&lt;p&gt;In the React ecosystem, React Router is the most used and popular library. It's downloaded about 3.6 million times a week, according to npm. This amount is almost half of React's 7.6 mmillion weekly downloads. That means React Router used almost half of the React project. The latest version of  React Router 6 has created a lots of buzz in the React community. So, Without further ado, Let's explore some new changes and features of React Router.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Routes Replaces Switch:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In latest version  is replaced with . Routes component has a new prop called element, where you can pass the component it needs to render.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example:  
&amp;lt;Routes&amp;gt;
  &amp;lt;Route path="user/:id" element={&amp;lt;User /&amp;gt;} /&amp;gt;
  &amp;lt;Route path="users/new" element={&amp;lt;NewUsers /&amp;gt;} /&amp;gt;
&amp;lt;/Routes&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this change, we don't need to concern about the order anymore because Routes picks the most specific routes fisrt based on the current URL. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use "useNavigate" instead of "useHistory":&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The old useHistory hook has been removed and replaced with a suspense-ready navigate API. Now you should use "useNavigate" to programmatically navigate around your application. To redirect your user, they expose a navigate comonent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Exaple: 

import { Navigate, useNavigate } from 'react-router-dom';

function Redirect() {
  return &amp;lt;Navigate to="/home" replace /&amp;gt;;
}

function GoHomeButton() {
  let navigate = useNavigate();
  function handleClick() {
    navigate('/home')
  }
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;button onClick={handleClick}&amp;gt;Go to home page&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Replace "useRouteMatch" with "useMatch":&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;useMatch is to mush similar to v5's useRouteMatch, with a few key differences: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It uses new path pattern matching algorithm&lt;/li&gt;
&lt;li&gt;The pattern argument is now required&lt;/li&gt;
&lt;li&gt;No longer accepts an array of patterns&lt;/li&gt;
&lt;li&gt;When passing a pattern as an object, some of the options have been renamed to better align with other APIs in v6&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;useRouteNatch({strict}) is now useMatch({end})&lt;/li&gt;
&lt;li&gt;useRouteMatch({sensitive}) is now useMatch({caseSensitive})&lt;/li&gt;
&lt;li&gt;It returns a match object with a different shape&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Nested Route:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nested Route is the most important and useful feature in react router. We use it so many time specially in larg and complex application. In latetst version of react router dom, we notice some changes on it. Look at this code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import {
  BrowserRouter,
  Routes,
  Route,
  Link,
  Outlet
} from 'react-router-dom';

function App() {
  return (
    &amp;lt;BrowserRouter&amp;gt;
      &amp;lt;Routes&amp;gt;
        &amp;lt;Route path="/" element={&amp;lt;Home /&amp;gt;} /&amp;gt;
        &amp;lt;Route path="users" element={&amp;lt;Users /&amp;gt;}&amp;gt;
          &amp;lt;Route path="/" element={&amp;lt;UsersIndex /&amp;gt;} /&amp;gt;
          &amp;lt;Route path=":id" element={&amp;lt;UserProfile /&amp;gt;} /&amp;gt;
          &amp;lt;Route path="me" element={&amp;lt;OwnUserProfile /&amp;gt;} /&amp;gt;
        &amp;lt;/Route&amp;gt;
      &amp;lt;/Routes&amp;gt;
    &amp;lt;/BrowserRouter&amp;gt;
  );
}

function Users() {
  return (
    &amp;lt;div&amp;gt;
      &amp;lt;nav&amp;gt;
        &amp;lt;Link to="me"&amp;gt;My Profile&amp;lt;/Link&amp;gt;
      &amp;lt;/nav&amp;gt;

      &amp;lt;Outlet /&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you compare this code with previous nested route system code, you will notice few things: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In latest version we are using  to coecify nested routes! The URL paths nest along with the route elements, so /users/me renders  .&lt;/li&gt;
&lt;li&gt;We used an  element as a placeholder. Here  define how the User component renders its child routes. Depending on the current location,  will render either a  or  element. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Smaller Bundle Size:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The React Router authority claims that the new version is a lot smaller than the previous versions. Authority estimate that it's about 70% smaller. Your application loads faster, especially over slow/poor network connections and content to your user faster for smaller bundles.&lt;/p&gt;

&lt;p&gt;Hopefully this post has given you some clear-sightedness into the latest version of React Router v6. I hope it has also given you some ideas about how you can get started with it and use it in your application. If there is any mistake. Please let me know. &lt;/p&gt;

</description>
      <category>reactrouter</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>react</category>
    </item>
  </channel>
</rss>
