<?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: Vishwa.R</title>
    <description>The latest articles on DEV Community by Vishwa.R (@codereaper08).</description>
    <link>https://dev.to/codereaper08</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%2F657473%2F64a29ceb-a04c-4ca6-b35b-900e059abe30.jpg</url>
      <title>DEV Community: Vishwa.R</title>
      <link>https://dev.to/codereaper08</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codereaper08"/>
    <language>en</language>
    <item>
      <title>HTML Features, probably you never knew existed.</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Sat, 28 Aug 2021 19:29:19 +0000</pubDate>
      <link>https://dev.to/codereaper08/html-features-you-never-knew-existed-54ii</link>
      <guid>https://dev.to/codereaper08/html-features-you-never-knew-existed-54ii</guid>
      <description>&lt;p&gt;Hello again from codereaper08!&lt;br&gt;
Thanks again to all my followers, who always motivate me to write blogs weekly, in spite of my tight academic schedules.&lt;/p&gt;

&lt;p&gt;Back again with a good article, I hope. In this post, we are going to discuss 5 features in HTML, which probably we never knew existed. So let's get into it.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. WBR Tag:
&lt;/h2&gt;

&lt;p&gt;Let's start from the first one in our list, &lt;code&gt;wordbreak&lt;/code&gt; tag, abbreviated as &lt;code&gt;&amp;lt;wbr&amp;gt;&lt;/code&gt;. You may think, what's the meaning of its existence, well It's not like the handy &lt;code&gt;br&lt;/code&gt; tags we use. &lt;code&gt;&amp;lt;wbr&amp;gt;&lt;/code&gt; just doesn't force words to break unless there's a necessary situation to do so. &lt;code&gt;wbr&lt;/code&gt; tag is an empty tag (Doesn't have a closing tag).&lt;/p&gt;

&lt;p&gt;We'll see a comparison between &lt;code&gt;&amp;lt;wbr&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;br&amp;gt;&lt;/code&gt;, resize the browser-window to see how &lt;code&gt;wbr&lt;/code&gt; breaks itself on necessary situations.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/VishwaR/3bsw7vq8/embedded/result,html,css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  2. address Tag:
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;div&lt;/code&gt;'s for enclosing contact info?&lt;br&gt;
HTML gives a good semantic way of doing that using &lt;code&gt;&amp;lt;address&amp;gt;&lt;/code&gt; tag. So what's different in using &lt;code&gt;&amp;lt;address&amp;gt;&lt;/code&gt; tags, well, It renders the text in &lt;em&gt;Italics&lt;/em&gt; with line-breaks above and below the &lt;code&gt;&amp;lt;address&amp;gt;&lt;/code&gt; tags. It also has a by default display property of &lt;code&gt;block&lt;/code&gt;. Take a look at the below JSFiddle.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/VishwaR/f2Lnpuhz//embedded/result,html,css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  3. optgroup Tag:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;optgroup&amp;gt;&lt;/code&gt; tag is used when you need to group the options into categories. This makes selecting an option from a very large list of options easy!&lt;br&gt;
User can look into the relevant category and select an option in that particular category. I've created a superhero &lt;code&gt;optgroup&lt;/code&gt; for demonstration in the below JSFiddle.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/VishwaR/vm9jnwe4//embedded/result,html,css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  4. portal Tag:
&lt;/h2&gt;

&lt;p&gt;Now things get interesting! What we are going to see is a tag called &lt;code&gt;&amp;lt;portal&amp;gt;&lt;/code&gt;. This was launched by &lt;strong&gt;Google&lt;/strong&gt; in I/O 2019 DevCon, where they mentioned that, &lt;code&gt;&amp;lt;portal&amp;gt;&lt;/code&gt; will be an upgrade to &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt;. &lt;code&gt;&amp;lt;portal&amp;gt;&lt;/code&gt; allows seamless navigation inside the embedded content, too!. One sad thing, It is not supported by many browsers, including the normal &lt;strong&gt;Google Chrome&lt;/strong&gt; too. Currently, only the &lt;a href="https://www.google.com/chrome/canary/" rel="noopener noreferrer"&gt;Chrome canary&lt;/a&gt; supports the &lt;code&gt;&amp;lt;portal&amp;gt;&lt;/code&gt; tag. Check out the demo video below.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/4JkipxFVE9k"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  5. capture attribute for Input element:
&lt;/h2&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%2Fimages.unsplash.com%2Fphoto-1488240339625-c4014e114224%3Fixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1079%26q%3D80" 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%2Fimages.unsplash.com%2Fphoto-1488240339625-c4014e114224%3Fixid%3DMnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8%26ixlib%3Drb-1.2.1%26auto%3Dformat%26fit%3Dcrop%26w%3D1079%26q%3D80" alt="camera"&gt;&lt;/a&gt;&lt;/p&gt;

Photo by &lt;a href="https://unsplash.com/@lucabravo?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Luca Bravo&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/camera?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;

  



&lt;p&gt;Lastly, we are going to see about &lt;code&gt;capture&lt;/code&gt; attribute for the input elements. &lt;code&gt;capture&lt;/code&gt; added as an attribute to an input element opens the camera for taking shots of the user(front camera) or the scene(rear camera). This tag only works on mobile, and it simply falls back to a file picker in Desktop. &lt;code&gt;capture&lt;/code&gt; attribute has two values,&lt;/p&gt;

&lt;p&gt;— user --&amp;gt; Opens User facing Camera (Front)&lt;br&gt;
— environment --&amp;gt; Opens Environment (Rear)&lt;/p&gt;

&lt;p&gt;Take a look at the below JSFiddle.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://jsfiddle.net/VishwaR/7r0ec9g1//embedded/result,html,css//dark" width="100%" height="600"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;And, that's it for today, Feel I missed out something? Write down in comments, I'll be happy to include. Love it? Give a 💖 for the article. Thanks for reading and have a good time 😄&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>todayilearned</category>
      <category>html</category>
      <category>todayisearched</category>
    </item>
    <item>
      <title>Is it time to let go of Bootstrap?</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Wed, 18 Aug 2021 18:29:31 +0000</pubDate>
      <link>https://dev.to/codereaper08/is-it-time-to-let-go-of-bootstrap-347i</link>
      <guid>https://dev.to/codereaper08/is-it-time-to-let-go-of-bootstrap-347i</guid>
      <description>&lt;p&gt;Hello again!, After a short break, I am back again with a non-technical post. As Web-Dev's, we use and search all possible ways, to get our job done in the easy way. The most vital visual part of Web-Dev, the &lt;strong&gt;FRONT-END&lt;/strong&gt;, is very important to catch the eyes and to give a nice user-friendly experience for the user. To make this job easy, we use CSS frameworks like Bootstrap. So, after these many good years with many technical competitors, is Bootstrap still good to hang on with? &lt;br&gt;
Let's see about this in today's blog.&lt;/p&gt;

&lt;p&gt;So, we'll start with&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Bootstrap?
&lt;/h2&gt;

&lt;p&gt;Bootstrap is a CSS framework (Most popular), which uses class based Web-design. The official site of Bootstrap describes itself as,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And that's completely true, Bootstrap is fast and provide responsive mobile-first build classes to achieve what we Web-Dev's dream of as “RESPONSIVE DESIGN”. It provides an awesome grid system(Which I love) and JavaScript plugins(I hate them using jQuery, we'll get into it).&lt;/p&gt;

&lt;h2&gt;
  
  
  Competitors
&lt;/h2&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%2Fwww.tekkiwebsolutions.com%2Fwp-content%2Fuploads%2FTop-CSS-Frameworks.jpg" 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%2Fwww.tekkiwebsolutions.com%2Fwp-content%2Fuploads%2FTop-CSS-Frameworks.jpg" alt="CSS frameworks"&gt;&lt;/a&gt;&lt;/p&gt;
Image source: www.tekkiwebsolutions.com



&lt;p&gt;Bootstrap now faces a reasonable competition from similar UI kit based CSS frameworks like &lt;strong&gt;&lt;em&gt;Foundation&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Bulma&lt;/em&gt;&lt;/strong&gt;. Apart from these, It also faces a severe blow from &lt;strong&gt;&lt;em&gt;TailwindCSS&lt;/em&gt;&lt;/strong&gt;. Bootstrap is always criticized for its inflexibility. I would say, it's not inflexibility, but the huge amount of time taken for customizing the defaults provided by Bootstrap(It provides default UI components, because it's a UI Kit based CSS framework). Whereas in frameworks like &lt;strong&gt;&lt;em&gt;TailwindCSS&lt;/em&gt;&lt;/strong&gt;, Utility classes, which provide low-level flexibility, are provided.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should Bootstrap worry about competition?
&lt;/h2&gt;

&lt;p&gt;I would say Bootstrap was not made to work like &lt;strong&gt;TailwindCSS&lt;/strong&gt;. Bootstrap was made to provide developers of all levels, from beginners to advanced, the ability to quickly spin up a nice looking UI without worrying about responsiveness. Bootstrap's users are mostly beginners, who start their journey of using class based CSS utilities from pure CSS. It also has a good learning curve, so people get it better soon, as frameworks like &lt;strong&gt;TailwindCSS&lt;/strong&gt;, &lt;strong&gt;Foundation&lt;/strong&gt; and &lt;strong&gt;Bulma&lt;/strong&gt; comparatively has a steeper learning curve.&lt;/p&gt;

&lt;h2&gt;
  
  
  Should we use Bootstrap still in 2021?
&lt;/h2&gt;

&lt;p&gt;Of course, It is best in class for rapid web-deign, where you want a useful and nice looking site, without any brand colour pallets or pixel specific needs. Even today, more than 19% of websites use &lt;strong&gt;Bootstrap&lt;/strong&gt; as their CSS framework. I would say, it's the most probable gateway for learners, who get into class based CSS frameworks from pure CSS and HTML. If you want a quick site for a Boot camp you arrange next week, go for Bootstrap, It's faster to build, gives responsiveness.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bootstrap is gearing back again!
&lt;/h2&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%2Fgetbootstrap.com%2Fdocs%2F5.0%2Fassets%2Fbrand%2Fbootstrap-social.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%2Fgetbootstrap.com%2Fdocs%2F5.0%2Fassets%2Fbrand%2Fbootstrap-social.png" alt="Bootstrap 5"&gt;&lt;/a&gt;&lt;/p&gt;
Image source: getbootstrap.com



&lt;p&gt;As you all know, Bootstrap 5 came with a nice update from 4. It let go of jQuery and switched to Vanilla JavaScript. So, now how good is that!&lt;br&gt;
Bootstrap also managed to bring back the Bootstrap icon support.&lt;br&gt;
It also came up with some low level utility classes for added flexibility. Overall, Bootstrap is not going to be dead, but getting back on track.&lt;/p&gt;

&lt;p&gt;Thanks for Reading and following me!&lt;br&gt;
If you didn't, make sure to follow me, so we can learn and discuss tech-stuff.&lt;/p&gt;

&lt;h3&gt;
  
  
  Attributions:
&lt;/h3&gt;

&lt;p&gt;cover-image : &lt;a href="http://www.drupal.org" rel="noopener noreferrer"&gt;www.drupal.org&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>todayisearched</category>
      <category>html</category>
    </item>
    <item>
      <title>Just JavaScript things…</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Tue, 10 Aug 2021 18:40:43 +0000</pubDate>
      <link>https://dev.to/codereaper08/just-javascript-things-2klc</link>
      <guid>https://dev.to/codereaper08/just-javascript-things-2klc</guid>
      <description>&lt;p&gt;Hello again, my dear &lt;strong&gt;readers&lt;/strong&gt; and &lt;strong&gt;followers&lt;/strong&gt;👋. Here I am back with another blog on JavaScript. This time it's going to be much more like a knowledge sharing than a technical thing. So, let's begin with today's topic, “Just JS things”.&lt;/p&gt;

&lt;p&gt;We are going to discuss some peculiar features of JavaScript which, most of us, don't know. These peculiar things make JS a great language to learn, and for me, it's the most fun thing to do. So, let's &lt;strong&gt;BEGIN&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  undefined and null :
&lt;/h2&gt;

&lt;p&gt;Most of us would have come across the JS data types&lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt;. But we don't know the real difference between both of them. Let's start with &lt;code&gt;undefined&lt;/code&gt;,&lt;/p&gt;

&lt;h3&gt;
  
  
  undefined :
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;undefined&lt;/code&gt; type is an object, which represents that the  declaration of the variable done, but it is not assigned. This comes under the &lt;code&gt;undefined&lt;/code&gt;, as its name suggests. This is literally &lt;strong&gt;lack of value for the variable&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  null :
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;null&lt;/code&gt; is a value assigned to a variable. Unlike &lt;code&gt;undefined&lt;/code&gt; it's not the lack of value, as we know that &lt;code&gt;null&lt;/code&gt; by itself is a value. &lt;code&gt;null&lt;/code&gt; is voluntary absence of the value for the variable.&lt;/p&gt;

&lt;p&gt;The below picture clearly explains the difference.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xGtkeX0q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.stack.imgur.com/T9M2J.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xGtkeX0q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.stack.imgur.com/T9M2J.png" alt="Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We'll see how they compare with each other in the below gist, where we use a simple conditional statement to know how &lt;code&gt;undefined&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt; work.&lt;/p&gt;


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


&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;&lt;/em&gt;: Line numbers referred as L below.&lt;/p&gt;

&lt;p&gt;Here, we only get to run L4 and L8 in our code. Which means that the variable &lt;code&gt;a&lt;/code&gt; is not assigned a value and thus gives &lt;code&gt;undefined&lt;/code&gt;, whereas variable &lt;code&gt;b&lt;/code&gt; is assigned the value of &lt;code&gt;null&lt;/code&gt; which make the L8 to execute.&lt;/p&gt;

&lt;p&gt;You can also use this JSFiddle &lt;a href="https://jsfiddle.net/Vishwa_R/ha8tqL69/5/"&gt;https://jsfiddle.net/Vishwa_R/ha8tqL69/5/&lt;/a&gt; for execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  First class citizens, FUNCTIONS!
&lt;/h2&gt;

&lt;p&gt;In the JavaScript world, functions enjoy many privileges as first class objects. We can pass one function as an argument for another function and can also return the same if needed for later execution. YES! That's possible in JS. These are called as &lt;strong&gt;“Callback functions”.&lt;/strong&gt; They are commonly used in JS world. We use callback functions in asynchronous programming, to wait for execution until a previous function gets its job done.&lt;/p&gt;

&lt;p&gt;Let's see a simple example, let us take the operation of reading a file and displaying its size. Here we have two functions to perform, they are,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reading a file.&lt;/li&gt;
&lt;li&gt;Displaying size.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This must be done in sequence, we cannot display the size first without reading the file. Scenarios like this, make Callback functions “&lt;strong&gt;HEROES&lt;/strong&gt;”.&lt;/p&gt;

&lt;p&gt;We'll see an example where we mimic the above operation (we are not going to actually read a file and display the size). Let us take a look at the below gist.&lt;/p&gt;


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


&lt;p&gt;So here in this example, we have two functions, namely &lt;code&gt;Readfile&lt;/code&gt; and &lt;code&gt;sizefinder&lt;/code&gt;. As per our sequence of execution, we want &lt;code&gt;Readfile&lt;/code&gt; to be first executed, So, we call the &lt;code&gt;sizefinder&lt;/code&gt; inside the &lt;code&gt;Readfile&lt;/code&gt; function as an argument. Finally, we can asynchronously do two functions using callbacks. This makes Callback functions to be widely used.&lt;/p&gt;

&lt;p&gt;You can also use this JSFiddle &lt;a href="https://jsfiddle.net/Vishwa_R/hce58f39/9/"&gt;https://jsfiddle.net/Vishwa_R/hce58f39/9/&lt;/a&gt; to have a look at execution.&lt;/p&gt;

&lt;p&gt;And that's it for today, I think these two things are great in JavaScript and that's why folks like us LOVE JS 📜✨. JavaScript dominates all the possible domains of technology, from Web to Native (A big thanks to NodeJS), and reigns as the most famous programming language. Let us love JS, as we all do every time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks for reading and give a 💖 if you liked the content, have some feedbacks? Put them down in the comments. Have a great time😄🎉
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Attributions:
&lt;/h3&gt;

&lt;p&gt;Cover image : &lt;a href="https://wallpaperaccess.com/javascript"&gt;https://wallpaperaccess.com/javascript&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>todayilearned</category>
      <category>programming</category>
    </item>
    <item>
      <title>Time and Space, but not relativity :-)</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Wed, 04 Aug 2021 18:55:51 +0000</pubDate>
      <link>https://dev.to/codereaper08/time-and-space-but-not-relativity-2hd5</link>
      <guid>https://dev.to/codereaper08/time-and-space-but-not-relativity-2hd5</guid>
      <description>&lt;p&gt;Before starting this short and brief blog, I have one important thing to do, guessed it?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A BIG THANKS TO ALL MY FOLLOWERS&lt;/strong&gt;, you guys just encourage me to share my little knowledge far and wide. Thanks once again!&lt;/p&gt;

&lt;p&gt;So, let us get into today's topic &lt;strong&gt;Space&lt;/strong&gt; and &lt;strong&gt;Time&lt;/strong&gt; Complexity.(Yeah, it's not physics). We'll see What are they?, Why are they used? And How to use them?&lt;/p&gt;

&lt;p&gt;Let's start with our first question,&lt;/p&gt;

&lt;h2&gt;
  
  
  What are they?
&lt;/h2&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%2Fbitxorbyteshome.files.wordpress.com%2F2019%2F11%2Fblog-cover.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%2Fbitxorbyteshome.files.wordpress.com%2F2019%2F11%2Fblog-cover.png" alt="Example illustration"&gt;&lt;/a&gt;&lt;/p&gt;
Image source : https://bitxorbytes.home.blog



&lt;p&gt;&lt;strong&gt;Time complexity&lt;/strong&gt;:&lt;br&gt;
Time complexity is nothing but the amount of time taken by an algorithm for its execution. It is a Time Function (Don't mind a bit of maths here and there).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Space complexity&lt;/strong&gt;:&lt;br&gt;
Space complexity is nothing but the amount of memory used by the algorithm for its execution. Here, one should not include the actual program size, but should consider only the space or memory needed for execution with respect to the inputs passed.&lt;/p&gt;

&lt;p&gt;So with this we proceed to our next question, what is the need for these, let's see about it below.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why are they used?
&lt;/h2&gt;

&lt;p&gt;So why the need for these Time and Space complexities? Are they that important?&lt;br&gt;
The answer is &lt;strong&gt;YES&lt;/strong&gt;, they are very important and are vital deciding factors in terms of efficiency of the algorithm we design. &lt;/p&gt;

&lt;p&gt;Time complexity calculations shows us some great insights, regarding time, like how much amount of time the algorithm will take and is it suitable for processing large inputs and real word data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
One should note that, time complexity does not give the exact time of execution, as it depends on many factors like OS, programming language and Hardware used. Time complexity gives a time function from which we can infer some valuable insights.&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%2Fi.imgur.com%2FIQ6O9NQ.jpeg" 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%2Fi.imgur.com%2FIQ6O9NQ.jpeg" alt="Illustraion2"&gt;&lt;/a&gt;&lt;/p&gt;
Image source : tutflix.org



&lt;p&gt;Whereas, space complexity tells us a different aspect of the algorithm regarding how much memory or space it'll utilize, and thus it helps in predicting the suitability of its execution on real hardware prior to actual execution.&lt;/p&gt;
&lt;h2&gt;
  
  
  How to use them?
&lt;/h2&gt;

&lt;p&gt;I'll make it clear that, I won't be diving into exact mathematics behind these, but I'll try to explain as brief as possible here. (If you are really interested to know the maths, just comment on the blog, I would be happy to prepare a series explaining exact steps easily)&lt;/p&gt;

&lt;p&gt;So here we sprinkle some exotic JavaScript programs 🎉 for our understanding. Let's start with this simple program,&lt;/p&gt;


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


&lt;p&gt;So here in this program, we are swapping the values of &lt;strong&gt;a&lt;/strong&gt; and &lt;strong&gt;b&lt;/strong&gt;, for that we use a temporary variable called &lt;strong&gt;temp&lt;/strong&gt;. Let's find the Time and Space complexities for this simple program.&lt;/p&gt;

&lt;h3&gt;
  
  
  Time Complexity:
&lt;/h3&gt;

&lt;p&gt;Here I mention each line with line numbers like &lt;em&gt;L1&lt;/em&gt; and &lt;em&gt;L5&lt;/em&gt;. We can also ignore the function definition and function call, as we only care about the logic part. Because, we perform time and space analysis only on algorithms and algorithms only care about logics. So we start from &lt;strong&gt;L3&lt;/strong&gt;, we are doing an initialization here, so it will take less time compared to loops.(loops run over and over and spend high amount of time). We know that the initialization statement uses a constant unit of time (the smallest possible unit, we take it as 1). So the next statement at &lt;strong&gt;L4&lt;/strong&gt; performs an assignment operation, and it also uses a constant time (we take it as 1). And next we at last do another assignment operation at &lt;strong&gt;L5&lt;/strong&gt;, which also uses a constant time, like the previous statements.&lt;/p&gt;

&lt;p&gt;So that's it pretty simple right!, now we just add all those, and we get &lt;strong&gt;1+1+1 = 3&lt;/strong&gt; which is also a constant. So we infer that this program runs in constant time. We also write the time function as, &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;         T(n) = O(1) → here 1 represents constant.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;There are many notations we could use to better represent the time function, we'll see them in a series of blogs, if you guys are interested.&lt;/p&gt;

&lt;p&gt;So, that is all with time. Let's jump into space complexity.&lt;/p&gt;

&lt;h3&gt;
  
  
  Space complexity:
&lt;/h3&gt;

&lt;p&gt;Here, we take account for all the variables used, as variables are the memory occupiers. In our very short swapping program, we've got 3 variables. Let us list them below,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      1. a → occupies 1 space
      2. b → occupies 1 space
      3. temp → occupies 1 space
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;As all the variables occupy 1 space for each of themselves, which means they occupy constant amount of space or memory for their execution. We add all those values &lt;strong&gt;1+1+1 = 3&lt;/strong&gt; and we get 3, which is also a constant value, so we can write the space function as below.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;         S(n) = O(1) → Here also 1 represents constant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So that's it, we've found the time and space functions for a simple swapping program. It would be a little more work, if the program involves arrays and loops. We'll see about loops maybe in the next blog.&lt;/p&gt;

&lt;p&gt;Hope you enjoyed the blog, if you have any comments, just comment, I would be happy to see them, if you like the blog then give a 💖.&lt;br&gt;
Want a whole series on Time and Space complexity? Please leave a comment about your opinion. Thanks for reading and have a nice day!&lt;/p&gt;

&lt;h3&gt;
  
  
  Attributions :
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Cover image&lt;/strong&gt; : &lt;br&gt;
Photo by &lt;a href="https://unsplash.com/@bamin?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Pierre Bamin&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/time-and-space?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;br&gt;
 Combined by &lt;strong&gt;ME&lt;/strong&gt; for better context to the title :-)&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@aldebarans?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Aldebaran S&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/space?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>javascript</category>
      <category>todayilearned</category>
      <category>programming</category>
    </item>
    <item>
      <title>Array rotation, a simple approach using JS</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Tue, 27 Jul 2021 18:47:04 +0000</pubDate>
      <link>https://dev.to/codereaper08/array-rotation-a-simple-approach-using-js-327o</link>
      <guid>https://dev.to/codereaper08/array-rotation-a-simple-approach-using-js-327o</guid>
      <description>&lt;h2&gt;
  
  
  What's an array?
&lt;/h2&gt;

&lt;p&gt;An array is a type of linear data structure containing a collection of elements of similar data type. Arrays are one of the most important data structures. The elements in the array are stored in contiguous memory locations.&lt;/p&gt;

&lt;h2&gt;
  
  
  what's array rotation?
&lt;/h2&gt;

&lt;p&gt;Array rotation is nothing but shifting elements of the array in a specified direction with a rotation factor. No worries, this will be made clear with an example below,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Reversal algorithm for array rotation
&lt;/h2&gt;

&lt;p&gt;There are many ways to rotate an array, you may use a temporary array to store values and then replace them in the actual array, or you may store the first element of the array in a temporary variable. Shift the other elements to the left, and we have to do this for &lt;code&gt;d&lt;/code&gt; times (where &lt;code&gt;d&lt;/code&gt; is the rotation factor). We are going to use &lt;em&gt;Reversal algorithm&lt;/em&gt; for rotating the array in left direction.&lt;/p&gt;

&lt;h2&gt;
  
  
  How the Reversal algorithm works?
&lt;/h2&gt;

&lt;p&gt;Unlike other methods mentioned above, Reversal algorithm don't use any temporary variable or array for the rotation process. This makes it more space efficient. This algorithm works on &lt;em&gt;3 steps&lt;/em&gt;. They are,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;reverse &lt;code&gt;d&lt;/code&gt; elements.&lt;/li&gt;
&lt;li&gt;reverse &lt;code&gt;n-d&lt;/code&gt; elements.&lt;/li&gt;
&lt;li&gt;And finally, reverse &lt;code&gt;n&lt;/code&gt; elements.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
So, with these steps in mind, let us dive right into JavaScript and make the magic happen ✨
&lt;h2&gt;
  
  
  Code it in JS
&lt;/h2&gt;

&lt;p&gt;First, we need a function to rotate the array from a given index to the end. So it takes 3 parameters like &lt;code&gt;samparr&lt;/code&gt;, &lt;code&gt;begin&lt;/code&gt;, &lt;code&gt;end&lt;/code&gt;. We use a &lt;code&gt;while&lt;/code&gt; loop and assign the starting value of &lt;code&gt;samparr&lt;/code&gt; to a temporary variable called &lt;code&gt;temp&lt;/code&gt;. &lt;br&gt;
We then assign the starting value of &lt;code&gt;samparr&lt;/code&gt; to the ending value of &lt;code&gt;samparr&lt;/code&gt;. And, finally, we assign the ending value of &lt;code&gt;samparr&lt;/code&gt; to the &lt;code&gt;temp&lt;/code&gt; again. We use this &lt;code&gt;temp&lt;/code&gt; variable to dynamically change the starting and ending values of the &lt;code&gt;samparr&lt;/code&gt;. We then increment the start with 1 and decrement the end with 1. This is going to be our main function, which we would call with respect to the above-mentioned 3 steps.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We, then, need a function to actually rotate the array to the left using the rotation factor &lt;code&gt;d&lt;/code&gt;. For that, we create another function which takes the &lt;code&gt;samparr&lt;/code&gt;, &lt;code&gt;d&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt; as parameters and return the rotated array. We return the function if we have d=0, which means the array is empty. Going good till now, but wait!, What if the &lt;code&gt;d&lt;/code&gt; is greater than &lt;code&gt;n&lt;/code&gt;, &lt;em&gt;step 2&lt;/em&gt; will become broken, to fix that, we just update &lt;code&gt;d&lt;/code&gt; as &lt;code&gt;d % n&lt;/code&gt;. We'll look at an example in a minimum scale to better understand this &lt;code&gt;d % n&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
After, refactoring, we give &lt;em&gt;Step1&lt;/em&gt;, &lt;em&gt;Step2&lt;/em&gt; and &lt;em&gt;Step3&lt;/em&gt; to the &lt;code&gt;Reverse&lt;/code&gt; function. This will finally return a nicely rotated array as a result.&lt;br&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;So, Finally, we have to console log the rotated array. For that, we create a function called &lt;code&gt;Logger&lt;/code&gt;, which will console log the rotated array. This function takes two parameters, &lt;code&gt;samparr&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt;. It is a simple function which loops through all elements in the array and log them onto console.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Hurray 🎉
&lt;/h2&gt;

&lt;p&gt;It's done. The last and final thing we do is pass inputs to our functions, to see them in action.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Use this *&lt;a href="https://jsfiddle.net/Vishwa_R/kn5Lv0qw/26/"&gt;JSFiddle&lt;/a&gt; to change rotation factor and input array.&lt;/p&gt;

&lt;h2&gt;
  
  
  Acknowledgements:
&lt;/h2&gt;

&lt;p&gt;Cover image : Photo by &lt;a href="https://unsplash.com/@marekpiwnicki?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Marek Piwnicki&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/rotation?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thanks for reading, give a 💖 if you like.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>todayilearned</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Substring and stuff with JavaScript</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Sat, 24 Jul 2021 18:28:08 +0000</pubDate>
      <link>https://dev.to/codereaper08/substring-and-stuff-with-javascript-ham</link>
      <guid>https://dev.to/codereaper08/substring-and-stuff-with-javascript-ham</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3Bffk0L6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kvx6usqx5b9mbtdtdb2a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3Bffk0L6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kvx6usqx5b9mbtdtdb2a.png" alt="Sub-string-example"&gt;&lt;/a&gt;&lt;/p&gt;
Image source: Wikipedia



&lt;h2&gt;
  
  
  What is a string?
&lt;/h2&gt;

&lt;p&gt;A string is a thin wire, you used to hang your clothes to dry. &lt;strong&gt;Just kidding !&lt;/strong&gt; &lt;br&gt;
A string in computer terms is a sequence of characters, we use strings to represent words or a sequence of characters in programming. Here's an example for a string,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  So, What is a substring, then?
&lt;/h2&gt;

&lt;p&gt;A substring is nothing but a string inside a string. But remember, substrings are contiguous!. If it isn't clear, don't worry, we'll get it right. Have a look at the below gist.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h3&gt;
  
  
  Bonus insight
&lt;/h3&gt;

&lt;p&gt;Let a given string has a length of 5, let us take it as a variable &lt;code&gt;n&lt;/code&gt;, then the total number of possible substrings is given by,&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Total possible substrings = n*(n+1)/2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;for example, let us take &lt;code&gt;n&lt;/code&gt; as 5 as we assumed above, then&lt;/p&gt;

&lt;p&gt;&lt;code&gt;5*(5+1)/2&lt;/code&gt; which turns into &lt;code&gt;(5*6)/2&lt;/code&gt;, eventually yields the value of &lt;code&gt;15&lt;/code&gt; (which is the total number of possible substrings for a string of length 5). &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;⚡Note:&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
Notice that the substrings are contiguous, notice how &lt;code&gt;wa&lt;/code&gt; or &lt;code&gt;wd&lt;/code&gt; are not substrings of &lt;code&gt;wsad&lt;/code&gt;. Only adjoining sequence characters are taken from the string, and are called as substrings.&lt;/p&gt;

&lt;p&gt;Now take a deep breath, we are going to dive into the JavaScript ocean🥽&lt;/p&gt;
&lt;h2&gt;
  
  
  JavaScript code for slicing substrings
&lt;/h2&gt;

&lt;p&gt;So, let us look at the JavaScript code step-by-step for printing (I mean console logging) all the substrings for a given string.&lt;br&gt;
Let us start by initializing the input string and the length of the input string.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
These two will be passed to a function called &lt;code&gt;FindSubstring&lt;/code&gt;, which contains 3 nested &lt;code&gt;for&lt;/code&gt; loops. The first &lt;code&gt;for&lt;/code&gt; loop is to identify the starting point of the string passed to the function. We use iterator &lt;code&gt;i&lt;/code&gt; looping from &lt;em&gt;0 to &amp;lt;n&lt;/em&gt;.&lt;br&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
&lt;br&gt;
After this, we move on to the second &lt;code&gt;for&lt;/code&gt; loop, where we iterate using iterator &lt;code&gt;j&lt;/code&gt; from &lt;em&gt;i to &amp;lt;n&lt;/em&gt;. Using this second &lt;code&gt;for&lt;/code&gt; loop, we determine the ending point. Take a look at the below gist,&lt;br&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Now, after determining the starting and ending point of the input string, we use a third &lt;code&gt;for&lt;/code&gt; loop to &lt;code&gt;console log&lt;/code&gt; the sequence of characters from starting point to ending point. For that, we loop using iterator &lt;code&gt;k&lt;/code&gt; from &lt;em&gt;i to &amp;lt;j+1&lt;/em&gt;. Inside the loop we &lt;code&gt;console log&lt;/code&gt; the sequence of characters as follows,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;We use &lt;code&gt;charAt&lt;/code&gt; method above to pass in the string index, i.e &lt;code&gt;k&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Do you think it's over?
&lt;/h3&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;NO!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Not until we call our &lt;code&gt;FindSubstring&lt;/code&gt; function and pass it both &lt;code&gt;inpstring&lt;/code&gt; and &lt;code&gt;n&lt;/code&gt; values. Let us do that to wrap it up,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Awesome ✨🎉, we've done it.
&lt;/h2&gt;

&lt;p&gt;You can also take a look at this &lt;a href="https://jsfiddle.net/Vishwa_R/z81e7h32/"&gt;JSFiddle&lt;/a&gt; to change input strings to your wish.&lt;/p&gt;

&lt;p&gt;Feel free to correct me if I am wrong, give a 💖 if you like the content. Thanks for reading and have a nice day.&lt;/p&gt;

&lt;h3&gt;
  
  
  Acknowledgements:
&lt;/h3&gt;

&lt;p&gt;Cover image : Photo by &lt;a href="https://unsplash.com/@timothymuza?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Timothy Muza&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/piece?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>Sieve of Eratosthenes, What is it?</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Wed, 21 Jul 2021 18:52:40 +0000</pubDate>
      <link>https://dev.to/codereaper08/sieve-of-eratosthenes-what-is-it-2o3g</link>
      <guid>https://dev.to/codereaper08/sieve-of-eratosthenes-what-is-it-2o3g</guid>
      <description>&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%2Fwww.famousmathematicians.net%2Fphotos%2Feratosthenes.jpg" 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%2Fwww.famousmathematicians.net%2Fphotos%2Feratosthenes.jpg" alt="Eratosthenes"&gt;&lt;/a&gt;&lt;/p&gt;
Image source : famousmathematicians.net



&lt;h2&gt;
  
  
  What is it?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Sieve of Eratosthenes&lt;/strong&gt; is an algorithm devised by the &lt;strong&gt;Eratosthenes of Cyrene&lt;/strong&gt;. It does the job of finding all the prime numbers within a given upper limit. This ancient algorithm is efficient and smart till the upper limit is a few billions. So we'll discuss the process and JavaScript code for the same, below.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works?
&lt;/h2&gt;

&lt;p&gt;The algorithm starts with generating a list of all numbers starting from &lt;em&gt;2 to n&lt;/em&gt; (where &lt;strong&gt;n&lt;/strong&gt; is the upper limit), with the assumption of all the numbers in the list are prime. It starts from 2 and removes all the multiples of 2 in the list by traversing the list in the interval of 2.&lt;/p&gt;

&lt;p&gt;So, now we consider &lt;strong&gt;n&lt;/strong&gt; as 10&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sample_array&lt;/span&gt; &lt;span class="o"&gt;=&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;3&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="mi"&gt;5&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;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&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;10&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Starting from 2, it removes the multiples of 2 by traversing the above list in a step count of 2.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note&lt;/em&gt;&lt;/strong&gt;: '*' below means removed from list.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sample_array&lt;/span&gt; &lt;span class="o"&gt;=&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;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;*&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;6&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;*&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;10&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After removing all the multiples of 2, we move to the next non-removed number (that is 3), now from 3, we traverse the list with the step count of 3 and remove its multiples.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sample_array&lt;/span&gt; &lt;span class="o"&gt;=&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;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;*&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;6&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We then proceed to the next non-removed number, which is 5. But here's the thing, the multiples of 5 are already removed from the list. We just make sure when to end this cycle of traversal and removal by calculating the square of 5, that is 5*5 = 25, which is obviously greater than &lt;strong&gt;n&lt;/strong&gt; that is 10. So we stop the process and get the remaining elements, which are prime.&lt;/p&gt;

&lt;p&gt;Here's the final list we get,&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sample_array&lt;/span&gt; &lt;span class="o"&gt;=&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;3&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;7&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Hurray!, we've done with the theory part, let's get our hands dirty with some JS to actually code it.&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%2F2247gqevr4odteacp7gz.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%2F2247gqevr4odteacp7gz.png" alt="Hurray"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Execution in JS 💻
&lt;/h2&gt;

&lt;p&gt;Let's start by creating an empty array called &lt;code&gt;Boolarray&lt;/code&gt;, why naming 'Bool', because we are going for a Boolean array. We also initialize the value of &lt;strong&gt;n&lt;/strong&gt; as 20.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;Boolarray&lt;/span&gt; &lt;span class="o"&gt;=&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;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Remember, we first made an assumption that all the numbers in the list (here array) are prime. So we use &lt;code&gt;true&lt;/code&gt; for &lt;code&gt;is prime&lt;/code&gt; and &lt;code&gt;false&lt;/code&gt; for &lt;code&gt;not a prime&lt;/code&gt;, with this in mind we first fill the empty array with boolean values of all &lt;code&gt;True&lt;/code&gt; (based on our assumption). We use a &lt;code&gt;for&lt;/code&gt; loop with iterator &lt;code&gt;i&lt;/code&gt; to iterate from 1 to n and fill the array with &lt;code&gt;True&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;Boolarray&lt;/span&gt; &lt;span class="o"&gt;=&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;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&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;var&lt;/span&gt; &lt;span class="nx"&gt;i&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;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;Boolarray&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="kc"&gt;true&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;p&gt;Now, we have an array of length 20 with &lt;code&gt;true&lt;/code&gt; on all indexes. We now follow the procedure of &lt;strong&gt;Sieve of Eratosthenes&lt;/strong&gt; by starting the &lt;code&gt;for&lt;/code&gt; with iterator &lt;code&gt;j&lt;/code&gt; from &lt;em&gt;2 to j*j&amp;lt;=n&lt;/em&gt; (j*j&amp;lt;=n checks when to end the looping). If the current element in the array is &lt;code&gt;true&lt;/code&gt;, we then loop over its multiples with iterator &lt;code&gt;k&lt;/code&gt;and a step count, (according to the current element) and mark them &lt;code&gt;false&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;Boolarray&lt;/span&gt; &lt;span class="o"&gt;=&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;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&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;var&lt;/span&gt; &lt;span class="nx"&gt;i&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;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;Boolarray&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="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
 &lt;span class="p"&gt;}&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;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="o"&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;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Boolarray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&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;k&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;k&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;k&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;j&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="nx"&gt;Boolarray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;k&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After this execution, we are left with a Boolean array, which contains &lt;code&gt;true&lt;/code&gt; in places of prime (remember &lt;code&gt;true&lt;/code&gt; → is prime) and &lt;code&gt;false&lt;/code&gt; in places of non-prime numbers in the array.&lt;/p&gt;
&lt;h3&gt;
  
  
  Now it's all logging it onto the console 🎉
&lt;/h3&gt;

&lt;p&gt;We use another &lt;code&gt;for&lt;/code&gt; loop to iterate on &lt;code&gt;Boolarray&lt;/code&gt; with iterator &lt;code&gt;num&lt;/code&gt;, starting from &lt;em&gt;2 to num&amp;lt;=n&lt;/em&gt;. We console log only the &lt;code&gt;num&lt;/code&gt;'s which contains &lt;code&gt;true&lt;/code&gt; in the &lt;code&gt;Boolarray&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&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;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="o"&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;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Boolarray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;num&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;num&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;So, we end with this final code,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;You can also use the JSFiddle, to change the hard-coded input &lt;code&gt;n&lt;/code&gt; to your wish.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://jsfiddle.net/Vishwa_R/t20acbsj/" rel="noopener noreferrer"&gt;JSFiddle link&lt;/a&gt;
&lt;/h4&gt;

&lt;h3&gt;
  
  
  Attributions:
&lt;/h3&gt;

&lt;p&gt;Cover-image : Photo by &lt;a href="https://unsplash.com/@jaanam9?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Jaanam Haleem&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/mesh?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks for reading ✨
&lt;/h3&gt;

&lt;p&gt;Feel free to correct and give feedbacks. Like it?, then 💖 it.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>todayilearned</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>What is Jina?</title>
      <dc:creator>Vishwa.R</dc:creator>
      <pubDate>Mon, 19 Jul 2021 18:36:20 +0000</pubDate>
      <link>https://dev.to/codereaper08/what-is-jina-4deg</link>
      <guid>https://dev.to/codereaper08/what-is-jina-4deg</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6j3WfUVk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/jina-ai/jina/master/.github/logo-only.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6j3WfUVk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/jina-ai/jina/master/.github/logo-only.gif" alt="Jina-AI-Logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This Post discusses &lt;a href="https://jina.ai/"&gt;Jina&lt;/a&gt;, a neural search framework from Jina-AI, in layman terms.&lt;/p&gt;

&lt;h2&gt;
  
  
  How is search going now ?
&lt;/h2&gt;

&lt;p&gt;We search the internet for a variety of needs, from finding the lyrics of your favourite song to ordering food online. We use search engines like google to search and get the desired data based on a query. Now what is a query ?&lt;/p&gt;

&lt;h3&gt;
  
  
  Query :
&lt;/h3&gt;

&lt;p&gt;It is a precise request for information retrieval with database and information systems.&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__wikipedia--container"&gt;
  &lt;div class="ltag__wikipedia--header"&gt;
    &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Sew3uq9H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/wikipedia-logo-0a3e76624c7b1c3ccdeb9493ea4add6ef5bd82d7e88d102d5ddfd7c981efa2e7.svg" class="ltag__wikipedia--logo" alt="Wikipedia Logo"&gt;
    &lt;a href="https://en.wikipedia.org/wiki/Query" rel="noopener noreferrer"&gt;Query&lt;/a&gt;
  &lt;/div&gt;
  &lt;div class="ltag__wikipedia--extract"&gt;&lt;p&gt;In general, a &lt;b&gt;query&lt;/b&gt; is a form of questioning, in a line of inquiry.&lt;/p&gt;&lt;/div&gt;
  &lt;div class="ltag__wikipedia--btn--container"&gt;
    
      &lt;a href="https://en.wikipedia.org/wiki/Query" rel="noopener noreferrer"&gt;View on Wikipedia&lt;/a&gt;
    
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Now, after we give a query to a search engine, it begins it's work and responds to our query with the results matching. For example, imagine you search for the new film releasing this weekend, you google it like, &lt;code&gt;New movie this week release&lt;/code&gt; or &lt;code&gt;new film near me&lt;/code&gt;. These two phrases we use for searching about the to be released film is the query we give to search engine. Now search engine uses this and retrieve and present us information/data related to the query we gave. This is how the process works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Traditional query:
&lt;/h3&gt;

&lt;p&gt;In our day-to-day life, we search (I mean query) search engines using plain text mostly. This approach is traditional. Search engines like Google are for general purpose and cannot be tailored for the business needs. Moreover, this traditional approach is error-prone (User can misspell the queries or some words mean different in different context) This poses a void for Jina to enter the scene.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--umsQfKuK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5c06e16a5bdc7bce10059cc3/5e5540cfdd9a4a409a6ba476_43qyMsRomMThG3bDbaGcFTTcJvTm0xGSbQgqudgVNND6DrfIHrTbVyDbfV0i8-ebnoNNc_snTNTIoA_QL7VcNhr1u0LDeK_0y5iETvjs-ZKZtHfskvcu2b9iT1adp0dXxi0cCfwC.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--umsQfKuK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://uploads-ssl.webflow.com/5c06e16a5bdc7bce10059cc3/5e5540cfdd9a4a409a6ba476_43qyMsRomMThG3bDbaGcFTTcJvTm0xGSbQgqudgVNND6DrfIHrTbVyDbfV0i8-ebnoNNc_snTNTIoA_QL7VcNhr1u0LDeK_0y5iETvjs-ZKZtHfskvcu2b9iT1adp0dXxi0cCfwC.png" alt="Traditional-query"&gt;&lt;/a&gt;&lt;/p&gt;
Image source : growhackscale.com


&lt;h2&gt;
  
  
  How Jina works?
&lt;/h2&gt;

&lt;p&gt;Jina, on the other hand, is a neural search framework, meaning it uses a deep learning based Neural Search approach to provide out of the box features. One clear advantage of Jina is that it enables users to query with unstructured data, like images, audio, video, and maps. Sounds cool right? If it didn't awe you, here's another plus, it is &lt;strong&gt;fully customizable and Open-Source&lt;/strong&gt;. This means one can easily tailor their search needs with Jina and provide a highly accurate search results for unstructured query.&lt;/p&gt;
&lt;h3&gt;
  
  
  Structured and Unstructured data:
&lt;/h3&gt;

&lt;p&gt;Ordered data is known as structured data, for example CSV and XML files. Here, data is categorized and ordered, in the form of rows and columns. Whereas in Unstructured data, such orderliness and categorization is difficult and not found.&lt;/p&gt;

&lt;p&gt;Now here Jina wins as it enables users to query with unstructured data like images, videos and more. This is possible because of the fundamental development of Jina is strongly rooted on Neural Search and deep learning. This makes Jina trainable for different use-cases.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xYRUCFct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lawtomated.com/wp-content/uploads/2019/04/structuredVsUnstructuredIgneos.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xYRUCFct--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://lawtomated.com/wp-content/uploads/2019/04/structuredVsUnstructuredIgneos.png" alt="Different-datas"&gt;&lt;/a&gt;&lt;/p&gt;
Image source : lawtomated.com


&lt;h2&gt;
  
  
  Traditional Search VS Neural Search:
&lt;/h2&gt;

&lt;p&gt;Chill, This is not going to be a fight between two ways. Both has their own pros and cons. Like, Neural Search has low query matching capabilities compared to Traditional Search. But Neural Search wins in scalability and customizable factor.&lt;/p&gt;
&lt;h2&gt;
  
  
  Using Jina:
&lt;/h2&gt;

&lt;p&gt;We just install Jina using &lt;code&gt;pip install jina&lt;/code&gt; in a venv. &lt;br&gt;
Jina works on &lt;code&gt;flows&lt;/code&gt;, a fundamental component, which manages things to get your application running, each flow takes care of real world task. A flow contains &lt;code&gt;executor&lt;/code&gt;, executors are like elements which do data processing for our application.&lt;/p&gt;


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


&lt;p&gt;We add these executors called MyTransformer and MyIndexer for data encoding and indexing purpose respectively&lt;/p&gt;


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


&lt;p&gt;We can visualize this flow using plot function&lt;/p&gt;


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


&lt;p&gt;this generates an SVG like below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TEv6_DqP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jina.ai/assets/images/blog/tutorials/plot_flow1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TEv6_DqP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jina.ai/assets/images/blog/tutorials/plot_flow1.png" alt="Generated-SVG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We now add a name to the executors like below, so that the generated SVG is readable,&lt;/p&gt;


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


&lt;p&gt;This now generates a more readable SVG like below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TKz-O3F7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jina.ai/assets/images/blog/tutorials/plot_flow2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TKz-O3F7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jina.ai/assets/images/blog/tutorials/plot_flow2.png" alt="Generated-SVG2"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We then add executors needed for our purpose and begin our work. More detailed explanations are given in &lt;a href="https://docs.jina.ai/"&gt;Jina-Docs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contribute to Jina:
&lt;/h2&gt;

&lt;p&gt;Jina adores Open-Source as it's crown and works on community level to get features onboard. Any type of contributions are welcomed, and they have a diverse and inclusive community too. Head over to the &lt;a href="https://github.com/jina-ai/jina/"&gt;GitHub page&lt;/a&gt; and start working on issues. If you want to spread a word about Jina, Awesome, do it soon!&lt;br&gt;
Any type of contribution is welcomed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Love Jina? Read these blogs too
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/alexcg/what-is-neural-search-and-why-should-i-care-2gpd"&gt;https://dev.to/alexcg/what-is-neural-search-and-why-should-i-care-2gpd&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.kdnuggets.com/2021/05/what-neural-search.html"&gt;https://www.kdnuggets.com/2021/05/what-neural-search.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jina.ai/2021/06/28/tutorial.html"&gt;https://jina.ai/2021/06/28/tutorial.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Correct me if I am wrong, forgive me if my English is bad.&lt;/p&gt;

</description>
      <category>python</category>
      <category>ai</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
