<?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: TechLearners</title>
    <description>The latest articles on DEV Community by TechLearners (@techlearners).</description>
    <link>https://dev.to/techlearners</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%2Forganization%2Fprofile_image%2F3475%2Fee133056-3722-40f9-b311-00b5246185d6.png</url>
      <title>DEV Community: TechLearners</title>
      <link>https://dev.to/techlearners</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/techlearners"/>
    <language>en</language>
    <item>
      <title>Create A PDF From Multiple Images Using Python</title>
      <dc:creator>Rizwan Hasan</dc:creator>
      <pubDate>Sun, 17 Jan 2021 13:05:52 +0000</pubDate>
      <link>https://dev.to/techlearners/create-a-pdf-from-multiple-images-using-python-1l7o</link>
      <guid>https://dev.to/techlearners/create-a-pdf-from-multiple-images-using-python-1l7o</guid>
      <description>&lt;p&gt;In today's world PDF is a very popular file format among book readers, students, and officials, etc. Those who read books on their mobile phones or PC(Personal Computers) know the importance of PDF format in everyday life and many times need to make a single PDF from a bunch of images in order to share and read. As an example, it turned out to be a life-saving thing for me a couple of days ago. I love reading Manga. So, I downloaded a popular manga as a .zip file, after extracting there were 144 chapters as 144 folders and each folder has 19 to 32 images. So, I thought if I convert every chapter into a single PDF then it will be a lot easier to read and organize. I am going to share today how I did this thing easily using Python Programming Language.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwxkxcxdtitvp9zavyp6c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwxkxcxdtitvp9zavyp6c.png" alt="PDF" width="680" height="457"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;It happens often that our friends send us some class notes as images on Messenger or WhatsApp. Instead of reading those as images, it’s more convenient to make a PDF and read it. Many people love reading comics and mangas too. Like me, they download episode images and read them. But also creating a PDF is a more convenient solution if you’re going to read it offline. Moreover, developers need this too. Downloading multiple images from websites or web-scraping many times ended up creating PDFs from those scrapped images. In such cases where you need to create a PDF from a bunch of images one time then it’s good to go with free software available on the internet. But if you need to do it more than 10 times or I say 100 times respectively, then isn’t it annoying? Strongly, you need a solution here but instead of finding a solution on ready-made software, why not you make your own solution? I ended up writing a couple of lines in Python to achieve the goal I’ve told you about earlier.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbwxzbdg0uvxzr2ezxppf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbwxzbdg0uvxzr2ezxppf.png" alt="Code" width="700" height="753"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Explanation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The code is very straight forward. I’ve taken five images and created an object of that images using the PIL library’s Image module. To create PDF, the image must need to have in RGB mode. So, I converted their mode to RGB. Now comes the tricky part. I wish to create a specific order of five images in PDF and that’s why I need to specify the order of images. For that, I created a Python list and on the list, I put them in my wished order. I want to create an order like this "image1, image2, image3, image4, image5" but I didn’t add the image1 in the list because if I do that then the image1 will be shown 2 times. It will show 2 times because when I’m creating the PDF, I started it just by adding the image1. So, if the image1 is already in the list and for PDF creation if I use the save option from image1 then it means image1 is already in the list and also adding when creating the PDF. For this reason, never add the first image of your desire list of images ordered.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Rizwan-Hasan" rel="noopener noreferrer"&gt;
        Rizwan-Hasan
      &lt;/a&gt; / &lt;a href="https://github.com/Rizwan-Hasan/Python-Image-to-PDF-convert" rel="noopener noreferrer"&gt;
        Python-Image-to-PDF-convert
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Python Image to PDF convert&lt;/h1&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Module Dependencies&lt;/h3&gt;

&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/Pillow/" rel="nofollow noopener noreferrer"&gt;Pillow (Python Imaging Library)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Code execution&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/Rizwan-Hasan/python-image-to-pdf-convert/raw/master/screenshot-run.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FRizwan-Hasan%2Fpython-image-to-pdf-convert%2Fraw%2Fmaster%2Fscreenshot-run.png" alt="Code Running"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;PDF&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/Rizwan-Hasan/python-image-to-pdf-convert/raw/master/screenshot-pdf.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2FRizwan-Hasan%2Fpython-image-to-pdf-convert%2Fraw%2Fmaster%2Fscreenshot-pdf.png" alt="PDF"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;



&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Rizwan-Hasan/Python-Image-to-PDF-convert" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;





&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" alt="Best of Luck" width="474" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Share your opinion in the discussion section below and of course the questions if any.&lt;/em&gt; Don't forget to follow us.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Featured in DEV Community's Twitter&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1351201184166670351-569" src="https://platform.twitter.com/embed/Tweet.html?id=1351201184166670351"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1351201184166670351-569');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1351201184166670351&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>python</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>How to set up a Samba Server in Ubuntu and share files seamlessly</title>
      <dc:creator>Rizwan Hasan</dc:creator>
      <pubDate>Thu, 07 Jan 2021 21:14:57 +0000</pubDate>
      <link>https://dev.to/techlearners/how-to-set-up-a-samba-server-in-ubuntu-and-share-files-seamlessly-5foa</link>
      <guid>https://dev.to/techlearners/how-to-set-up-a-samba-server-in-ubuntu-and-share-files-seamlessly-5foa</guid>
      <description>&lt;p&gt;Before jumping into the topic, let me ask you a couple of questions. How you transfer your files from your one pc to another or pc to phone? You're probably gonna say about using a USB cable or Pendrive? Yeah, it's very common. But if I ask you how to share it through your local network where your every device is connected to your high-performance router with WiFi or LAN Cable. Can you share your files with one device to another simultaneously by using this local network? Can you stream and watch your favorite movie from your pc to your phone? I'll say yes, you can. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Some popular network protocol exists with this ability and maybe you've already heard of one or used one on your Windows PC or laptop already. Windows has a handy feature of drive sharing or a particular folder sharing across the local network which can be accessed from another device or the phone's also if they are on the same network. And Windows uses the SMB networking protocol or in short SAMBA. Using Samba on Windows is very easy with a couple of clicks and it'll up.&lt;/p&gt;
&lt;/blockquote&gt;



&lt;blockquote&gt;
&lt;p&gt;Accessing from Linux is also very easy but can we create this network in Linux? Yes, and it's not so tough because I'm here to break it down step by step. I'll only cover Ubuntu in this article because it's very popular and beginner-friendly. But if you need it on another distribution, you can comment me below and I'll glad to cover it. So, let's start with a basic definition of Samba.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  ✴️ &lt;strong&gt;What is Samba?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.samba.org/" rel="noopener noreferrer"&gt;Samba&lt;/a&gt; is a free software re-implementation of the &lt;a href="https://en.wikipedia.org/wiki/Server_Message_Block" rel="noopener noreferrer"&gt;SMB(Server Message Block)&lt;/a&gt; networking protocol which was originally developed by &lt;a href="https://en.wikipedia.org/wiki/Andrew_Tridgell" rel="noopener noreferrer"&gt;Andrew Tridgell&lt;/a&gt;. It is the standard Windows interoperability suite of programs for Linux and Unix. Samba provides secure, stable, and fast file and print services for all clients using the SMB(Server Message Block)/CIFS(Common Internet File System) protocol.&lt;/p&gt;




&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Installation&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Update repository cache
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install Samba package
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;samba
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Configurations&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Creating a folder for share
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;mkdir&lt;/span&gt; /home/&amp;lt;username&amp;gt;/sambashare/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Opening config file in terminal
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/samba/smb.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Config for sharing previously created folder &lt;/li&gt;
&lt;li&gt;Add this config at the end of the file
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;sambashare&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="s"&gt;comment = Samba on Ubuntu&lt;/span&gt;
    &lt;span class="s"&gt;path = /home/&amp;lt;username&amp;gt;/sambashare&lt;/span&gt;
    &lt;span class="s"&gt;read only = no&lt;/span&gt;
    &lt;span class="s"&gt;browsable = yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqrxwiwxpy9y46tt99v65.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqrxwiwxpy9y46tt99v65.png" alt="Configuration" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start the service
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;service smbd restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Configuring Firewall&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Add Samba allowance in &lt;a href="https://wiki.ubuntu.com/UncomplicatedFirewall" rel="noopener noreferrer"&gt;UFW (Uncomplicated Firewall)&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow samba
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftsz7cehtiiq82jcl26z0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftsz7cehtiiq82jcl26z0.png" alt="Alt Text" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Setting up a user account for Samba&lt;/strong&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Since Samba doesn’t use the system account password, we need to set up a Samba password for our user account.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;



&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Username used must belong to a system account, else it won’t save.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Setting up User Accounts and Connecting to Share
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;smbpasswd &lt;span class="nt"&gt;-a&lt;/span&gt; &amp;lt;username&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjf7tehtfqoyajfbk31i1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fjf7tehtfqoyajfbk31i1.png" alt="Alt Text" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Find your local IP&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I'm using ifconfig to know my local IP&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Solution for ifconfig command not found in the system&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;net-tools
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqkp5tcnek868k4n1el12.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqkp5tcnek868k4n1el12.png" alt="Ifconfig" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Samba status&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status smbd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbm0fnacjyhcb90rvgz8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbm0fnacjyhcb90rvgz8a.png" alt="Samba status" width="786" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Paste some file in the folder&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz1rlk6xvi4l5rl2rb8sj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz1rlk6xvi4l5rl2rb8sj.png" alt="Alt Text" width="800" height="551"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;Connect from Windows&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Write your devices IP address in the red marked area following this format
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\\IP_ADDRESS\\&amp;lt;FOLDER_NAME&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;\\192.168.1.41\sambashare
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpwm545yrs312ss6f5vzr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpwm545yrs312ss6f5vzr.png" alt="Alt Text" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💘 Connection successful&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnxt68hise67k4xe81p13.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnxt68hise67k4xe81p13.PNG" alt="Alt Text" width="800" height="540"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" alt="Best of Luck" width="474" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Share your opinion in the discussion section below and of course the questions if any.&lt;/em&gt; Don't forget to follow us.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>tutorial</category>
      <category>cloud</category>
    </item>
    <item>
      <title>How to interface Oracle Database with Python and execute queries</title>
      <dc:creator>Rizwan Hasan</dc:creator>
      <pubDate>Wed, 06 Jan 2021 21:21:48 +0000</pubDate>
      <link>https://dev.to/techlearners/how-to-interface-oracle-database-with-python-and-execute-queries-4bin</link>
      <guid>https://dev.to/techlearners/how-to-interface-oracle-database-with-python-and-execute-queries-4bin</guid>
      <description>&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Oracle_Corporation" rel="noopener noreferrer"&gt;&lt;strong&gt;Oracle&lt;/strong&gt;&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Python_(programming_language)" rel="noopener noreferrer"&gt;&lt;strong&gt;Python&lt;/strong&gt;&lt;/a&gt;, both two words are very familiar among the developers as well as every tech-related guy also. So, today you’re gonna learn how to attach these two words or in other words how to perform &lt;a href="https://en.wikipedia.org/wiki/Data_definition_language" rel="noopener noreferrer"&gt;&lt;strong&gt;DDL&lt;/strong&gt;&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Data_manipulation_language" rel="noopener noreferrer"&gt;&lt;strong&gt;DML&lt;/strong&gt;&lt;/a&gt; operations on &lt;a href="https://en.wikipedia.org/wiki/Oracle_Database" rel="noopener noreferrer"&gt;&lt;strong&gt;Oracle Database&lt;/strong&gt;&lt;/a&gt; through &lt;a href="https://en.wikipedia.org/wiki/Python_(programming_language)" rel="noopener noreferrer"&gt;&lt;strong&gt;Python Programming&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi64ekh7z40wvfmw42dml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi64ekh7z40wvfmw42dml.png" alt="Oracle Database" width="800" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Installation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You must need the Oracle Database installed on your PC. I’ve written an article about the guideline for installing Oracle Database on PC. You can check out that article &lt;a href="https://dev.to/rizwan486/how-to-setup-oracle-database-11g-xe-on-windows-and-unlock-the-hr-user-jih-temp-slug-8824709"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/techlearners" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__org__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F3475%2Fee133056-3722-40f9-b311-00b5246185d6.png" alt="TechLearners" width="200" height="200"&gt;
      &lt;div class="ltag__link__user__pic"&gt;
        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F264553%2F9f8c9487-b104-4956-94d1-9222099afbfb.jpg" alt="" width="800" height="845"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/techlearners/how-to-setup-oracle-database-11g-xe-on-windows-and-unlock-the-hr-user-37p3" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;How to setup Oracle Database 11g XE on Windows and unlock the "HR" user&lt;/h2&gt;
      &lt;h3&gt;Rizwan Hasan for TechLearners ・ Jan 6 '21&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#computerscience&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Now comes about the preparation of Python. I believe as you’re in this article; it means you are not noob enough to show you step by step installing python and modules via pip or anaconda. Anyway, you’ll need the &lt;a href="https://oracle.github.io/python-cx_Oracle/" rel="noopener noreferrer"&gt;&lt;strong&gt;"cx-Oracle"&lt;/strong&gt;&lt;/a&gt; module for this interfacing and it’s available via pip and anaconda officially.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I’ll use the &lt;strong&gt;"HR"&lt;/strong&gt; sample user account provided with &lt;strong&gt;Oracle Database&lt;/strong&gt; by default. Because this account comes up with some ready-made tables which I’m gonna use in the rest of the article as I’m not creating databases here.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Establishing a connection&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To perform any queries, a connection with the database is needed. For that, you need your database’s username, password, server(host), and service name. I’m using Express Edition of Oracle Database 11g. So, my service name is “XE”. After declaring the variables of this informations, you’re ready to connect. It’s important to keep the connection establishing code into the try-except block because it can generate errors and those errors are also needed to be handled carefully.&lt;/p&gt;

&lt;h4&gt;
  
  
  Code 1: Connection
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Variables
&lt;/span&gt;    &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HR&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;YOUR_PASSWORD&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;localhost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;XE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="c1"&gt;# Connection establishing
&lt;/span&gt;    &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{0}/{1}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Connection successful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DatabaseError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The output of this code is, &lt;strong&gt;"Connection successful"&lt;/strong&gt; if it connects. Otherwise, the try-except block will catch the error and print it into the terminal.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmdgrx2t98nljx5zo7zkk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmdgrx2t98nljx5zo7zkk.png" alt="The output of Connection Establishing Code" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Data Definition Langauge (DDL)&lt;/strong&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;strong&gt;data definition&lt;/strong&gt; or &lt;strong&gt;data description language (DDL)&lt;/strong&gt; is a syntax for defining &lt;strong&gt;data structures&lt;/strong&gt;, especially database schemas. &lt;strong&gt;DDL&lt;/strong&gt; only care for data reading as it’s a data definition language.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Code 2: Reading data from Database (1)
&lt;/h4&gt;

&lt;p&gt;Here the code starting from line no &lt;strong&gt;22&lt;/strong&gt; to &lt;strong&gt;28&lt;/strong&gt; is added and the rest of the code is as same as &lt;strong&gt;Code 1&lt;/strong&gt; because without creating a connection you can’t do anything. Getting back into the code, always you need a cursor for executing any query whether the query is for reading or writing, and after every successful connection, you can get the cursor from the connection object variable. For every single query you want to execute; you just need to get a new cursor object and the return of the query’s output can be grabbed from the cursor object of that query. By the way, you don’t need to reconnect every time to get a new cursor. Every time create a new cursor object from an existing connection object variable. So, after getting the cursor object, I executed a simple query to get all the &lt;strong&gt;First Name&lt;/strong&gt; and &lt;strong&gt;Last Name&lt;/strong&gt; data from the table named &lt;strong&gt;Employee&lt;/strong&gt;. And after getting the data I just printed it all.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Variables
&lt;/span&gt;    &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HR&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;YOUR_PASSWORD&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;localhost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;XE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="c1"&gt;# Connection establishing
&lt;/span&gt;    &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{0}/{1}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Connection successful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DatabaseError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Executing DDL
&lt;/span&gt;    &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Printing output
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;        

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The output of this code is all the &lt;strong&gt;First&lt;/strong&gt; &amp;amp; &lt;strong&gt;Last&lt;/strong&gt; name stored in the &lt;strong&gt;Employee&lt;/strong&gt; table.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftx6fka72l8c2phy2ge0u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftx6fka72l8c2phy2ge0u.png" alt="The output of Reading data from Database (1) Code" width="700" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Code 3: Reading data from Database (2)
&lt;/h4&gt;

&lt;p&gt;The reason I’ve put another example is to show you how to write lengthy queries and use variables inside a query. Because if you wish to use the variable in cursor execution braces you’ve to follow the below syntax. But you can also build your query on a string variable and then put that into the cursor execution braces and it will work. But Oracle’s documentation of the &lt;strong&gt;"cx-Oracle"&lt;/strong&gt; module recommends the first way.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Variables
&lt;/span&gt;    &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HR&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;YOUR_PASSWORD&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;localhost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;XE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="c1"&gt;# Connection establishing
&lt;/span&gt;    &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{0}/{1}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Connection successful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DatabaseError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Executing DDL
&lt;/span&gt;    &lt;span class="n"&gt;minSalary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;15000&lt;/span&gt;
    &lt;span class="n"&gt;maxManagerID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;200&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES
            WHERE SALARY &amp;gt; :sal AND MANAGER_ID &amp;lt; :man&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;sal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;minSalary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;man&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;maxManagerID&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Printing output
&lt;/span&gt;    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;fname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lname&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{0} {1}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;lname&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;    

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The output of this code is, all those names from the &lt;strong&gt;Employee&lt;/strong&gt; table who has a &lt;strong&gt;minimum salary&lt;/strong&gt; of &lt;strong&gt;15000&lt;/strong&gt; and &lt;strong&gt;manager id&lt;/strong&gt; is smaller than &lt;strong&gt;200&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgul9xz9ipv5afotp7j80.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgul9xz9ipv5afotp7j80.png" alt="The output of Reading data from Database (2) Code" width="700" height="426"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Data Manipulation Langauge (DML)&lt;/strong&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;strong&gt;data manipulation language (DML)&lt;/strong&gt; is some command that deals with the manipulation of data present in the database. &lt;strong&gt;DML&lt;/strong&gt; only care for data writing as it’s a data manipulation language.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Code 4
&lt;/h4&gt;

&lt;p&gt;Here in this code, I want to add a record on the table named &lt;strong&gt;Country&lt;/strong&gt;. On line &lt;strong&gt;27&lt;/strong&gt;, I’ve executed an insertion query to add &lt;strong&gt;Bangladesh&lt;/strong&gt; to the &lt;strong&gt;Country&lt;/strong&gt; table. The country table has three columns; &lt;strong&gt;Country code&lt;/strong&gt;, &lt;strong&gt;Country name&lt;/strong&gt;, and &lt;strong&gt;Region id&lt;/strong&gt;. But there is an important thing. Have you noticed on line &lt;strong&gt;33&lt;/strong&gt;? In the previous three examples, I didn’t use commit. Are you thinking that I already executed the query so the changes are done? Actually no. Changes have done temporarily but not permanently. If you log in to the Oracle database now, you won’t see the newly added record &lt;strong&gt;Bangladesh&lt;/strong&gt; in the &lt;strong&gt;Country&lt;/strong&gt; table. To make changes permanent, I also committed the changes. And now my changes have made into the database permanently. So far, I was only concerned about getting data thus I didn’t need to use commit because there were no changes to make. So, after performing every &lt;strong&gt;DML&lt;/strong&gt; operation, you must commit it or the changes won’t be made into the database.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Before running the code there is no record of &lt;strong&gt;Bangladesh&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7koi7sqq5wfs13iemlik.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7koi7sqq5wfs13iemlik.png" alt="No record of Bangladesh" width="700" height="573"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Now, run the code&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="c1"&gt;# Variables
&lt;/span&gt;    &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HR&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;&amp;lt;YOUR_PASSWORD&amp;gt;&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;localhost&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;XE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="c1"&gt;# Connection establishing
&lt;/span&gt;    &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;connection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;{0}/{1}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;service&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Connection successful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="n"&gt;cx_Oracle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;DatabaseError&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;# Executing DML
&lt;/span&gt;    &lt;span class="n"&gt;countryCode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;BD&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;countryName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bangladesh&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;regionID&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;INSERT INTO COUNTRIES
        (COUNTRY_ID, COUNTRY_NAME, REGION_ID)
        VALUES (:cCode, :cName, :rId)&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;cCode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;countryCode&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cName&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;countryName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;rId&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;regionID&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Insertion successful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The output of this code is positive if insertion becomes successful.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbi3g5sn2x1hy526anuoo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbi3g5sn2x1hy526anuoo.png" alt="The output of Data Inserting Code" width="800" height="487"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;See? The changes have made to the database.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fezjw2upgd5f10rvrdgu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fezjw2upgd5f10rvrdgu4.png" alt="Added record Bangladesh" width="800" height="655"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So far, I’ve tried to give you the basic interfacing of the &lt;strong&gt;Oracle database&lt;/strong&gt; with &lt;strong&gt;Python&lt;/strong&gt;. But it’s not enough. I suggest you checkout &lt;strong&gt;cx_Oracle&lt;/strong&gt;’s official documentation &lt;a href="https://cx-oracle.readthedocs.io/" rel="noopener noreferrer"&gt;&lt;strong&gt;https://cx-oracle.readthedocs.io&lt;/strong&gt;&lt;/a&gt;. And I believe if you understood all the codes I showed, then the documentation will be easily understandable to you.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" alt="Best of Luck" width="474" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Share your opinion in the discussion section below and of course the questions if any.&lt;/em&gt; Don't forget to follow us.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>beginners</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to setup Oracle Database 11g XE on Windows and unlock the "HR" user</title>
      <dc:creator>Rizwan Hasan</dc:creator>
      <pubDate>Wed, 06 Jan 2021 21:14:19 +0000</pubDate>
      <link>https://dev.to/techlearners/how-to-setup-oracle-database-11g-xe-on-windows-and-unlock-the-hr-user-37p3</link>
      <guid>https://dev.to/techlearners/how-to-setup-oracle-database-11g-xe-on-windows-and-unlock-the-hr-user-37p3</guid>
      <description>&lt;p&gt;For &lt;a href="https://en.wikipedia.org/wiki/Database#Database_management_system" rel="noopener noreferrer"&gt;Database Management System&lt;/a&gt;, Oracle’s position is very strong and also popular among the developers and companies. The version of Oracle Database 11g Express Edition is widely used among the students and database beginners. It’s very lightweight and unlike the previous version 10g, it’s improved in many ways. However, today you will be learning how to install the Oracle Database 11g XE version on Windows PC and unlocking the ‘HR’ account.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Download the Oracle Database 11g Express Edition from the official link &lt;a href="https://www.oracle.com/database/technologies/xe-prior-releases.html" rel="noopener noreferrer"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;. It’s a zip file that is about 350 MB more or less.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Extracting the ZIP&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After finishing the downloading extract the zip file and for extracting a popular opensource program called &lt;a href="https://7-zip.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;7-Zip&lt;/strong&gt;&lt;/a&gt; can be used or you can use any proprietory programs like WinRAR, WinZip, etc.&lt;/p&gt;

&lt;p&gt;After extracting there is a folder named &lt;strong&gt;[DISK1]&lt;/strong&gt; and inside that folder, there’s a [&lt;strong&gt;setup.exe&lt;/strong&gt;] file and that’s needed for the installation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7dp1tkax9k7qjs6jllh9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7dp1tkax9k7qjs6jllh9.png" alt="Screenshot of extracted folder and setup files" width="500" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo4z6j5qna6n1zmf1f1vv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo4z6j5qna6n1zmf1f1vv.png" alt="Screenshot of extracted folder and setup files" width="500" height="377"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Installation&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To begin the installation, double click on the &lt;strong&gt;"setup.exe"&lt;/strong&gt; file, and a window like the below screenshot will appear.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv6sy7x4bmimlzgya9mqu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv6sy7x4bmimlzgya9mqu.png" alt="Starting Window" width="500" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Accept the license and click on the &lt;strong&gt;"Next"&lt;/strong&gt; button like below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffo23dxacxgfunaffak2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ffo23dxacxgfunaffak2m.png" alt="License Window" width="500" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you wish to install it in another directory you can do so but I’m leaving it as default. I suggest unless you’re running out of space in the &lt;strong&gt;"C"&lt;/strong&gt; drive, follow the program’s suggestion like below. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcs8qlafi4fn25za2jlic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcs8qlafi4fn25za2jlic.png" alt="Destination Location Window" width="500" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You need to set a password for the database system user which is used for the &lt;strong&gt;"SYS"&lt;/strong&gt; &amp;amp; &lt;strong&gt;"SYSTEM"&lt;/strong&gt; user account in the Oracle DBMS environment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhttflbiti0atiww14wor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhttflbiti0atiww14wor.png" alt="Database Password Window" width="500" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this step, check whether all the information is correct or not. If negative you can go back and make changes. It’s important to remember the port information showed on this window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi2ni0jne0g3q702qeksi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fi2ni0jne0g3q702qeksi.png" alt="Final Configuration Checking Window" width="500" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the installation has begun, you can grab a cup of coffee as a waiting material. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo7wuja1hzb8werg82hwz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fo7wuja1hzb8werg82hwz.png" alt="Installation Progress Window" width="500" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After a couple of minutes, if the below window appears then &lt;strong&gt;Congratulations&lt;/strong&gt;. You have installed the database successfully. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frevwoxq5dd8iv96jfti6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frevwoxq5dd8iv96jfti6.png" alt="Installation Complete Window" width="500" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although the installer won’t tell you about the restarting of pc. But it’s very important. After restarting, you can start exploring the database and also be able to follow the further procedure of unlocking the “HR” user account.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;By default &lt;strong&gt;Oracle Database XE&lt;/strong&gt; comes with a sample user named &lt;strong&gt;"HR"&lt;/strong&gt; and under this user’s territory there are several database tables in a sample schema. These pre-given databases and tables are playgrounds for beginners. However, for security reasons, the &lt;strong&gt;"HR"&lt;/strong&gt; account is locked by default.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Unlocking the "HR" user&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To unlock the account you need to go through some commands in CMD (&lt;a href="https://en.wikipedia.org/wiki/Cmd.exe" rel="noopener noreferrer"&gt;&lt;strong&gt;Command Prompt&lt;/strong&gt;&lt;/a&gt;). Also, you can use programs like &lt;a href="https://en.wikipedia.org/wiki/PowerShell" rel="noopener noreferrer"&gt;&lt;strong&gt;PowerShell&lt;/strong&gt;&lt;/a&gt; for this procedure.&lt;/p&gt;

&lt;p&gt;So, Open up your CMD and execute the below command for connecting to the Oracle Database with CMD.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;SQLPLUS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;/&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;SYSDBA&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbt8qe3zdpl9uimx8kpmm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fbt8qe3zdpl9uimx8kpmm.png" alt="Command Prompt Connecting Database" width="700" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alter the &lt;strong&gt;HR&lt;/strong&gt; user to unlock,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;ALTER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;USER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;HR&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ACCOUNT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;UNLOCK&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, unlock the user and assign a password,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;ALTER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;USER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;HR&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;IDENTIFIED&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;strong&gt;""&lt;/strong&gt; with your desired one and the changes will be made for the &lt;strong&gt;"HR"&lt;/strong&gt; account only.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F70g5qko0gfs07w7cujpv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F70g5qko0gfs07w7cujpv.png" alt="Command Prompt " width="700" height="401"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Type the exit command for exiting from the database environment. You can use this same command for exiting from &lt;a href="https://en.wikipedia.org/wiki/Cmd.exe" rel="noopener noreferrer"&gt;&lt;strong&gt;Command Prompt&lt;/strong&gt;&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/PowerShell" rel="noopener noreferrer"&gt;&lt;strong&gt;PowerShell&lt;/strong&gt;&lt;/a&gt;, and similar applications also.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="kr"&gt;exit&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" alt="Best of Luck" width="474" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Share your opinion in the discussion section below and of course the questions if any.&lt;/em&gt; Don't forget to follow us.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Is C Programming Knowledge A Must To Learn Python or Any Other Programming Languages?</title>
      <dc:creator>Muhammad Sakib Khan Inan</dc:creator>
      <pubDate>Tue, 05 Jan 2021 12:53:42 +0000</pubDate>
      <link>https://dev.to/techlearners/is-c-programming-knowledge-a-must-to-learn-python-or-any-other-programming-languages-p5b</link>
      <guid>https://dev.to/techlearners/is-c-programming-knowledge-a-must-to-learn-python-or-any-other-programming-languages-p5b</guid>
      <description>&lt;p&gt;&lt;strong&gt;Nowadays, there is an ongoing myth among some people,&lt;/strong&gt; who are complete beginners in the programming world or coding world that without learning languages like "C" or basically "C", you won't be able to learn modern high-level programming languages like "Python" well. It can be simplified like this that before learning any other language you must need to learn "C'. I decided to write about this when one of my classmates reached me with the same type of problem which I mentioned in the very beginning. She asked me for suggestions on how to learn "Python" as a complete beginner. After I gave her some suggestions, she said that she is confused that if she needs to learn C Programming first in a good manner to cope up with learning Python or not. I told her that it isn't necessary to learn the C programming language to learn Python. But she acclaimed that she has heard that without learning C first, her basics of programming won't be clear in a full manner, and for this, she believes she should learn C before learning the others. So, I am going to share my thoughts on this topic today.&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%2Fi%2Flabzwzrbtd8dwzy9darw.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%2Fi%2Flabzwzrbtd8dwzy9darw.png" alt="Programming Languages"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python is a high-level programming language.&lt;/strong&gt; It is one of the most popular and widely used programming languages in today's world. Data Science, Machine Learning, Artificial Intelligence, etc fields are mostly dominated by Python now. If you are a complete beginner in coding and want to learn Python, then I will say without thinking twice you should start learning Python. Don't get worried about the confusion that you need to learn C first. If you have the basics of C or any other programming languages then it will boost up your learning speed but if you don't have it, need not worry much about it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Programming Languages&lt;/strong&gt; are just a medium or a way to make the machines understand what we want them to do. The main concepts like loops, conditional logic, functions, or methods are quite similar in all languages, just the syntax and code writing styles are different from language to language. In Python, the syntax is quite English alike, so it's quite easy to understand and learn.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;When you will begin to learn Python&lt;/strong&gt;, you will find programming very easy and interesting as you won't have to work hard with declaring variables before using them, etc. Just learn and understand how functions, loops, conditions, etc main basic things work in Python and practice more and more. Many programmers have learned Python as their first language and they are doing a lot of good works in the coding field. One of my friends has also learned Python first and then learned C, his favorite language is Python and he understands very well the coding basics. The main thing is you must need to learn one programming language in a good manner to understand the basics of coding, no matter whether it's Python or C or Java or Pascal or Swift or JavaScript, whatever it is.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When you will have a good experience as a beginner with any programming language, you won't find it very much hard to learn a new one. There are a lot of resources present online on Python.&lt;/p&gt;

&lt;p&gt;💘 So don't be late, start learning, start coding.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;strong&gt;At last, I want to say to the beginners of the coding world,&lt;/strong&gt; "To learn to code, you must do coding. Without writing codes on your own, you won't be able to learn it well."&lt;br&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%2Fi%2Fqm2u6bsds1vjr1ci47b4.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%2Fi%2Fqm2u6bsds1vjr1ci47b4.png" alt="Best of Luck"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Share your opinion in the discussion section below and of course the questions if any.&lt;/em&gt; Don't forget to follow us.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>python</category>
    </item>
    <item>
      <title>What is Hyper Parameter Tuning in Machine Learning?</title>
      <dc:creator>Muhammad Sakib Khan Inan</dc:creator>
      <pubDate>Mon, 28 Dec 2020 12:14:10 +0000</pubDate>
      <link>https://dev.to/techlearners/what-is-hyper-parameter-tuning-in-machine-learning-32kg</link>
      <guid>https://dev.to/techlearners/what-is-hyper-parameter-tuning-in-machine-learning-32kg</guid>
      <description>&lt;p&gt;If you are new to the field of Machine Learning and Data Science and have already done some implementations of some of the Machine Learning algorithms, you might have heard the term &lt;strong&gt;Hyper Parameter Tuning&lt;/strong&gt;. Yet, if you have not heard the term, I would like to take the privilege to ensure you that you are going to hear it soon when you will focus on the optimization of the performance of your algorithm or ML model. So, let's dive into today's discussion. &lt;/p&gt;

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

&lt;h3&gt;
  
  
  ✴️ &lt;strong&gt;What is Hyper Parameter?&lt;/strong&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Hyper Parameters&lt;/strong&gt; are those parameters of a machine learning algorithm that controls the learning process and efficiency of the machine learning algorithm in its training phase and of course can be set and optimized manually. It basically determines how the algorithm is going to take the different learning approaches in the different steps of its learning process. The wrong choice of Hyper Parameters can make your machine learning model vulnerable to overfitting or underfitting, resulting in poor performance. Therefore determining hyperparameter setting wisely can certainly make your machine learning model better.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  ➡️ &lt;strong&gt;What are the Hyperparameters of KNN?&lt;/strong&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Let's take the example of one of the simplest machine learning algorithms that beginners tend to understand easily, KNN (K Nearest Neighbour).&lt;/p&gt;

&lt;p&gt;If you have implemented the KNN algorithm using the popular Scikit Learn Library in Python, you may have noticed that the KNN class object can take some arguments (values of parameters) at the time of creation according to the documentation of scikit learn. If you don't pass values to these parameters on your own, they would be set to their default values as per documentation. &lt;br&gt;
Let's see how we create a KNN object in scikit learn. Here, some of the hyperparameters in KNN are "n_neighbours" (the value of K), "metric" (distance metrics to be used, for example, manhattan or euclidean distance, etc).&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sklearn.neighbors&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;KNeighborsClassifier&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;KNeighborsClassifier&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Here, I didn't pass any values of the parameters manually. But if do it like this;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sklearn.neighbors&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;KNeighborsClassifier&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;KNeighborsClassifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n_neighbours&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;metric&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'manhattan'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Now, I have passed 9 to the parameter "n_neighbours", and so the K value for this KNN would be 9, and also as I have passed "manhattan" to the parameter "metric", the manhattan distance will be used in certain calculations of the training phase. There are some other hyperparameters for KNN also which you can learn by referring to the documentation of scikit learn. Just like this, in Random Forest Classifier you can manually set the number of trees to be used or built for classification through the "n_estimators" parameter, and the splitting criterion through "criterion".&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;sklearn.ensemble&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;RandomForestClassifier&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;RandomForestClassifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n_estimators&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;criterion&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"gini"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  ✴️ &lt;strong&gt;What is Hyperparameter Tuning?&lt;/strong&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;There are a bunch of hyperparameters that can be set manually to optimize the performances of the different machine learning algorithms (Linear Regression, Logistic Regression, Decision Trees, Adaboost, K Means Clustering, etc). But there are no fixed universal best settings of hyperparameters of a machine learning algorithm. You might need to experiment over a set of possible values to choose the best settings according to your dataset and criteria. And this process of choosing the best set of values of hyperparameters is called hyperparameter tuning. For example, trying different values of K in KNN, or choosing the best splitting criterion, decreasing or increasing the number of trees in Random Forest Classifiers. Hyperparameter tuning is one of the most essential knowledge for machine learning engineers and data scientists. Hyperparameter tuning is also important in Deep Learning algorithms like CNN (Convolutional Neural Networks), RNN(Recurrent Neural Networks). &lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Don't forget to follow us. And share your thoughts with us in the discussion section.  &lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;Subscribing to our YouTube Channel&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;and Telegram&lt;/strong&gt; &lt;a href="https://t.me/TechLearners"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;will be amazing.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>beginners</category>
      <category>datascience</category>
    </item>
    <item>
      <title>Facts To Know Before Starting Python!</title>
      <dc:creator>Muhammad Sakib Khan Inan</dc:creator>
      <pubDate>Sun, 27 Dec 2020 17:12:02 +0000</pubDate>
      <link>https://dev.to/techlearners/facts-to-know-before-starting-python-5436</link>
      <guid>https://dev.to/techlearners/facts-to-know-before-starting-python-5436</guid>
      <description>&lt;p&gt;Hello everyone! Hope you are doing fine! Today I am going to discuss some facts of &lt;strong&gt;Python Programming Language&lt;/strong&gt; that you should know and understand as a &lt;strong&gt;Python&lt;/strong&gt; beginner. So, let’s dive into it!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--K2ybA6Tw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ov8akhumz6791i1quzc5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--K2ybA6Tw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ov8akhumz6791i1quzc5.jpg" alt="Thumbnail" width="880" height="538"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt; is a high-level, multi-paradigm, interpreted, general-purpose programming language. Its syntax is designed to focus on &lt;strong&gt;readability&lt;/strong&gt; through the use of significant indentation and white-space rules. Don’t get worried to see such complex-looking words because I am going to explain these things in a while!&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;➡️ High-level Language:&lt;/strong&gt; Language like Python, C, C++, C#, Java, or Kotlin, in which it is easier to read and write codes using natural language elements with strong abstraction from the details of computer are called high-level programming languages. In contrast, a language like “Assembly Language” used to write codes for microprocessors are low-level programming languages.&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;➡️ Multi-Paradigm:&lt;/strong&gt; This programming language supports multiple paradigms of programming. For example, Python supports &lt;strong&gt;structured programming&lt;/strong&gt; paradigm like &lt;strong&gt;C&lt;/strong&gt; (Programming Language) and &lt;strong&gt;object oriented programming&lt;/strong&gt; paradigm like &lt;strong&gt;Java&lt;/strong&gt;(Programming Language). In contrast, &lt;strong&gt;C&lt;/strong&gt; does not support object oriented programming paradigm and &lt;strong&gt;Java&lt;/strong&gt; does not support the structured programming paradigm. Besides many of Python’s feature also supports functional programming, aspect-oriented programming, etc.&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;➡️ General Purpose Programming Language:&lt;/strong&gt; According to &lt;a href="https://en.wikipedia.org/wiki/General-purpose_programming_language"&gt;Wikipedia&lt;/a&gt;, a general purpose programming language means it is designed to be writing software in the widest variety of application domains. It means you can use this language in various domains, it is not bounded to be used for some specific regions or domains.&lt;/li&gt;
&lt;/ul&gt;




&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;➡️ Significant Indentations:&lt;/strong&gt; Language like C, C++, C#, Java, etc have a significant role of semi-colons(;) and curly brackets{} in most of the part of codes which becomes a horror for programmers sometimes because you may get an error just because you forgot to put a semi-colon at the end of a line, but the good news is, in Python, we don’t need to use a semi-colon(;) at the end of lines and curly brackets to define scopes of functions, methods, loops, etc. Meanwhile, the bad news is, you need to maintain the indentations and white-space rules correctly here in Python to write a valid or correct code that you didn’t need to maintain compulsorily in C or Java. It means you might even get errors for extra or unnecessary white-spaces. In a nutshell, you get rid of those semi-colons and curly brackets in Python but you need to maintain indentations and white-spaces according to the rules of Python correctly. Python focuses on indentations to increase the readability of code. To understand this you can see an example Python code from &lt;a href="https://en.wikipedia.org/wiki/Python_(programming_language)#Python_programming_examples"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Besides all these features, Python has a huge and rich collection of libraries for different purposes like machine learning, artificial intelligence, etc. It has also many other features like dynamic typing, garbage collecting, memory management, and more, which will you get to know as you will dive more deeply into the sea of Python.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Best wishes to everyone! Keep learning and keep sharing! and don't forget to share your opinion and of course the questions if any. Don't forget to follow us. ✌️&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Binary Search Algorithm Explained</title>
      <dc:creator>Muhammad Sakib Khan Inan</dc:creator>
      <pubDate>Sun, 27 Dec 2020 15:16:59 +0000</pubDate>
      <link>https://dev.to/techlearners/binary-search-algorithm-explained-2nn5</link>
      <guid>https://dev.to/techlearners/binary-search-algorithm-explained-2nn5</guid>
      <description>&lt;p&gt;In the world of computer science, Binary Search Algorithm is the ground of the &lt;strong&gt;“ Divide &amp;amp; Conquer”&lt;/strong&gt; algorithmic paradigm. This algorithm is the easiest illustration of how “Divide and Conquer” works. Using this algorithm searching can be done in O(log(n)) time where linear search takes O(n) time in the worst case. It saves time and makes the number of comparisons to perform fewer.&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%2Fi%2F5hsod7t93v85b23rk671.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%2Fi%2F5hsod7t93v85b23rk671.png" alt="Thumbnail"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let us consider a scenario. Suppose, you have a book of 1000 pages and we need to go to page number 580 and check whether the page exists or not. By using the linear search algorithm, you can start looking for the desired page from the beginning or the end. In both ways, you have to search over a large number of pages to find page number 580 as we are checking every page on our way. But, can we do it better? Can we find our desired page by making fewer comparisons? The answer is: Yes, we can do it in a faster way. We can do the improvement in less time by using the &lt;strong&gt;“Binary Search Algorithm”&lt;/strong&gt;. First, we need to keep in mind that this algorithm can be correctly applied if the data is sorted. In the case of page numbers of a book, the data is sorted. Here, we have page numbers from 1 to 1000 in a sorted manner. We need to find page number 580. Let’s divide our searching area into two halves. Get the midpoint of range 1 to 1000 like this, mid-index = (ending index+starting index-1)/2. So, it goes like this,(1000 / 2) = 500. Compare 500 (mid-index) with 580 (searching index). 580 is larger than 500 so it cannot be present in the range (1- 500). So, let’s exclude it from our searching area. Now, we have (501–1000) numbered pages for searching. Repeat the previous process and get the midpoint of the range (501 -1000). It will be 750. Compare 580 again with 750. And fix the new searching area as (501 -750) and exclude the range in which the number cannot be present. Keep repeating the process until you find the exact number or reach a situation when there are no numbers left to search. In this process, you can find the desired number in log(n) time and you need to perform a very fewer number of comparisons than linear search as after every comparison we are making our searching area small by excluding areas in which searching is unnecessary. So, the method is very simple when you have a sorted data set and need to find something in the data set rather than keep checking every element in the data set one by one, keep dividing the data set into two halves and compare the value with mid-value.&lt;/p&gt;

&lt;p&gt;This algorithm is frequently used in small to big tasks in computer science. Some other important algorithms like &lt;strong&gt;Merge Sort&lt;/strong&gt; also use the concept of divide and conquer. If you understand this algorithm well, you will get the basic idea of the &lt;strong&gt;“Divide &amp;amp; Conquer”&lt;/strong&gt; paradigm which is surely going to help you in learning more complex algorithms in the future. The most important thing to remember is, whenever you are going to apply the binary search algorithm the data must be placed in a sorted manner otherwise you cannot apply binary search. If you are going to start competitive programming must know the binary search algorithm as you will find problems that needed to be solved by directly using the binary search algorithm or using the concept of the binary search algorithm.&lt;/p&gt;




&lt;p&gt;⭐ &lt;strong&gt;I have attached here my code implementation of the binary search algorithm in Python &amp;amp; C++ programming language&lt;/strong&gt; ⭐&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;✴️ Code Implementation in Python&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;given_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;1&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;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;11&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;find&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;  &lt;span class="c1"&gt;# Number to search.
&lt;/span&gt;    &lt;span class="n"&gt;number_found&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;  &lt;span class="c1"&gt;# Determines if the number is found or not.
&lt;/span&gt;    &lt;span class="n"&gt;start_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="n"&gt;end_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;given_array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;end_index&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;start_index&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;mid_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;end_index&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;start_index&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;given_array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mid_index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;number_found&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;given_array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;mid_index&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;end_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid_index&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;start_index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mid_index&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;number_found&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The Desired Element Is Present!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The Desired Element Is Not Present&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;✴️ Code Implementation in C++&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;

&lt;span class="cp"&gt;#include&lt;/span&gt;&lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt;&lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;arr&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="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&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;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;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// given array.&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Element to search is stored in variable y.&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;l&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="c1"&gt;// l = Lower Index&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// h = Higher Index&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// m = Middle Index&lt;/span&gt;

    &lt;span class="c1"&gt;// Start of the loop to perform "Binary Search Algorithm".&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// The loop will run until there is one element left in array.&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&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="c1"&gt;// Find the mid to divide the array into two almost equal parts.&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;// If the element is in the mid, we found it!&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Break the loop.&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="n"&gt;y&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="c1"&gt;// If search element is lesser than element at the mid, cut the higher part of the array.&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;h&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;          &lt;span class="c1"&gt;// Else cut the lower part of the array.&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"%d not found&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="s"&gt;"%d found!"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;y&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;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So far, I’ve tried to show everything steps by step, and below, the discussion section is open for your opinion to share and of course the questions if any. And don't forget to follow us. &lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;🌟 Thank you for reading. Keep coding, keep sharing! 🌟&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Featured in DEV Community's Twitter&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1343583239768846336-330" src="https://platform.twitter.com/embed/Tweet.html?id=1343583239768846336"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1343583239768846336-330');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1343583239768846336&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>tutorial</category>
      <category>python</category>
      <category>cpp</category>
    </item>
    <item>
      <title>What is JSON? And why do you need it?</title>
      <dc:creator>Rizwan Hasan</dc:creator>
      <pubDate>Fri, 25 Dec 2020 20:57:34 +0000</pubDate>
      <link>https://dev.to/techlearners/what-is-json-and-why-do-you-need-it-21nd</link>
      <guid>https://dev.to/techlearners/what-is-json-and-why-do-you-need-it-21nd</guid>
      <description>&lt;p&gt;Before going on to the topic &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt;, I would like to discuss a simple example because it will be a lot easier to explain &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; after the example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7niixed6bqqc1a7a5pns.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7niixed6bqqc1a7a5pns.png" alt="Thumbnail" width="512" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Suppose we are developing desktop software or a web application. So, for the desktop software we need to save the changes of settings that users have made so that when he/she opens the software again at another time, he/she doesn’t need to change the settings again as he/she changed it earlier. Also, it’s a very annoying thing for a user to config the same changes at every start. Now, what about web applications? Web apps have one or more databases to store changes. Let’s think about a drawback here. Web apps need to store many temporary configuration or data to serve the user with a good experience for that session. And it’s an obvious thing that, developers can’t let an app to make the database busy for some temporary session data. Now, the question comes about how we store these changes or temporary data on storage? Confused? Again thinking about using &lt;a href="https://en.wikipedia.org/wiki/Database" rel="noopener noreferrer"&gt;databases&lt;/a&gt; like &lt;a href="https://en.wikipedia.org/wiki/Oracle_Database" rel="noopener noreferrer"&gt;Oracle&lt;/a&gt;, &lt;a href="https://en.wikipedia.org/wiki/MariaDB" rel="noopener noreferrer"&gt;Mariadb&lt;/a&gt;? Of course, we can do that but it’s not an efficient solution here. Ok, Keep down your thinking a bit and I’m keeping all the hard things aside, just store the data as a &lt;a href="https://en.wikipedia.org/wiki/Text_file" rel="noopener noreferrer"&gt;Text&lt;/a&gt; file. Wow, our storing problem is solved. But a new problem is knocking at the door, how to retrieve the data and get the same &lt;a href="https://en.wikipedia.org/wiki/Data_structure" rel="noopener noreferrer"&gt;data structures&lt;/a&gt; in the same manner that we had applied in the application? On a simple text file, there are lackings of data formation for the &lt;a href="https://en.wikipedia.org/wiki/Data_structure" rel="noopener noreferrer"&gt;data structures&lt;/a&gt; that we use in any program. Here comes the life-saving concept of data serialization, also we are very close to jumping on &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;What is Data Serialization?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Data Serialization is the process of converting structured data to a format that allows sharing or storage of the data in a form that allows recovery of its original structure when needed. The reason for serializing data is finding some sort of universal format that can be easily shared across different applications.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is JSON?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; is a data interchanging format that uses human-readable text to transmit data objects consisting of data structure and it’s the most widespread format for data serialization. Simply &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; is text, written with JavaScript object notation. &lt;strong&gt;“JavaScript Object Notation”&lt;/strong&gt; is the full form of &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt;. Many developers don’t like &lt;a href="https://en.wikipedia.org/wiki/JavaScript" rel="noopener noreferrer"&gt;JavaScript&lt;/a&gt; because of their perspectives. But don’t worry, it’s alright if your knowledge is empty about &lt;a href="https://en.wikipedia.org/wiki/JavaScript" rel="noopener noreferrer"&gt;JavaScript&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpwcvsq0ui9w5zzfvz6dc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fpwcvsq0ui9w5zzfvz6dc.png" alt="JSON Example" width="415" height="268"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why JSON?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; is mainly intended for data interchanging among the applications. Parsing data from one application to another through &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; is so much easy because of its &lt;a href="https://en.wikipedia.org/wiki/Language-independent_specification" rel="noopener noreferrer"&gt;language-independent&lt;/a&gt; data format. Almost every programming language has JSON support through official and 3rd party. Now, referencing my example, &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; can be used as a configuration or temporary data storing file also for any application. There is an important fact that &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; lacks &lt;a href="https://en.wikipedia.org/wiki/Abstract_data_type" rel="noopener noreferrer"&gt;Abstract Data Type&lt;/a&gt; (ADT) feature because of its data serialization format which breaks the opacity of &lt;a href="https://en.wikipedia.org/wiki/Abstract_data_type" rel="noopener noreferrer"&gt;ADT&lt;/a&gt; by potentially exposing private implementation details.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;A very popular database named “MongoDB” uses JSON-like documents with the schema.&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Basics of JSON&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; uses “.json” for filename extension. You can write JSON file using normal text editors like &lt;a href="https://en.wikipedia.org/wiki/Microsoft_Windows" rel="noopener noreferrer"&gt;Windows&lt;/a&gt;’s built-in Notepad. &lt;a href="https://en.wikipedia.org/wiki/JSON" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; supports String, Number, Object (JSON object)/Hashmap, Array/List, Boolean and N*ull* data types.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Let’s see some examples&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  String
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rizwan Hasan"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Number
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;JSON names require double quotes ("").&lt;/li&gt;
&lt;li&gt;JSON uses a colon (“:”) for separating names and values.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Objects / Hashmap
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"student"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rizwan Hasan"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"sex"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Male"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Here key “student” has an object value and that object has some names.&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;JSON uses curly braces (“{}”) for object separation and commas (“,”) for names separation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Array / List
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"students"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Rizwan"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Sakib"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"Natsu"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Here key “student” have an array value and that array has some name element.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;JSON uses square brackets (“[]”) for array declaring and commas (“,”) for element separation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Boolean
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"answer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Null
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"nickname"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Data types in Nested manner&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"students"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Rizwan Hasan"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"department"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"CSE"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"sex"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Male"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"paid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"cgpa"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;2.13&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;102&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Faria Hasan"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"department"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BBA"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"sex"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Female"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"paid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"cgpa"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;3.56&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Explanation:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Here we are storing some student's information. First, there is an object which’s key is named “students” and the value is an array blocked with square brackets. In the array, there is two student’s information. Every element of the array is also an object and they contain some information name, age, department, sex, paid, and GPA. Name, department, and sex are strings. Id, age, and, GPA is numbers. Lastly paid is boolean.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;So far I discussed JSON but still, there are a lot of things to know about like how to use it with different programming languages and how to do data interchanging between two or more languages. Here I only focused on giving the basics because after this pretty basic you are ready to go with JSON more advanced and also with the upgraded version of JSON called &lt;a href="https://en.wikipedia.org/wiki/YAML" rel="noopener noreferrer"&gt;YAML&lt;/a&gt;. To learn more about JSON, I suggest this free online tutorial from Tutorialspoint &lt;a href="https://www.tutorialspoint.com/json/index.htm" rel="noopener noreferrer"&gt;here&lt;/a&gt;. In the future, I will try to cover how to use JSON with popular programming languages like Python, Java, Kotlin, and C++.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Share your opinion in the discussion section below and of course the questions if any.&lt;/em&gt; Don't forget to follow us.&lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Featured in DEV Community's Twitter&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1342887402197708803-480" src="https://platform.twitter.com/embed/Tweet.html?id=1342887402197708803"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1342887402197708803-480');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1342887402197708803&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Get more than 30X speedup on your Python code</title>
      <dc:creator>Rizwan Hasan</dc:creator>
      <pubDate>Thu, 24 Dec 2020 12:16:32 +0000</pubDate>
      <link>https://dev.to/techlearners/get-more-than-30x-speedup-on-your-python-code-23ol</link>
      <guid>https://dev.to/techlearners/get-more-than-30x-speedup-on-your-python-code-23ol</guid>
      <description>&lt;p&gt;Python is the world's best programming language. But wait for a minute. Really? Some people will say in the comment that, "Bro, It's so slower than others in the market". By the way, I'm not going to argue with anyone about this best programming language selection war. But those who become upset after having a defeat from the war only based on the point of Python is slow, I'm here to give them a push. So, let's jump into the mission of making Python 30X faster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://cython.org/" rel="noopener noreferrer"&gt;&lt;img alt="Cython Logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fgb0raf3y2d1wdf2f5iwi.png" width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is Cython?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://cython.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;Cython&lt;/strong&gt;&lt;/a&gt; is an optimizing static compiler for both the Python programming language and the extended Cython programming language based on well-known &lt;a href="https://en.wikipedia.org/wiki/Pyrex_(programming_language)" rel="noopener noreferrer"&gt;Pyrex&lt;/a&gt;. It makes writing C extensions for Python as easy as Python itself. In other words, Cython is an intermediate step between Python and C/C++. It allows writing pure Python code with some minor modifications, which translates into the C code directly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;How Cython boosts?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Cython aims to become a superset of Python which gives it high-level, object-oriented, functional, and dynamic programming features. Source codes written in Python gets translated into optimized C/C++ code. This code is executed within the CPython runtime environment, but at the speed of compiled C and with the ability to call directly into C libraries. At the same time, it keeps the original interface of the Python source code, which makes it directly usable from Python code. Thus it compiled as a Python extension module as well as keeping up the high productivity of Python which is worshipped by the developers.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;How to Cythonize your Python code?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;✴️ &lt;strong&gt;First I'm creating a python file named "hello.pyx"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;➡️ A .pyx file is compiled by Cython to a .c file, containing the code of a Python extension module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# hello.pyx
&lt;/span&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello World!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✴️ &lt;strong&gt;Now I'm creating a python file named "launch.py" for calling the "hello.pyx" module&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;➡️ This code will always interpret like normal Python&lt;br&gt;
➡️ It won't be compiled to C&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# launch.py
&lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;

&lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;say_hello&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✴️ &lt;strong&gt;Now I'm writing a setuptools named "setup.py" for compiling the "hello.pyx" module&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;➡️ This is the normal and recommended way from the &lt;a href="https://cython.readthedocs.io/en/latest/src/quickstart/build.html" rel="noopener noreferrer"&gt;Cython Documentation&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# setup.py
&lt;/span&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;setuptools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;setup&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;Cython.Build&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;cythonize&lt;/span&gt;

&lt;span class="nf"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Hello world app&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
    &lt;span class="n"&gt;ext_modules&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nf"&gt;cythonize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;*.pyx&lt;/span&gt;&lt;span class="sh"&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;✴️ &lt;strong&gt;Finally, I'm running this command on the terminal for building&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 python setup.py build_ext &lt;span class="nt"&gt;--inplace&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧮 &lt;strong&gt;Compilation Workflow of build command&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fj67idoeog62ap343dqfq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fj67idoeog62ap343dqfq.png" alt="Compilation Workflow" width="379" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;✴️ &lt;strong&gt;Let's launch the code for testing&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 python launch.py
 Hello World!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🌟 &lt;strong&gt;&lt;em&gt;You can cythonize your code with just one step using&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://github.com/TechLearnersInc/cythonizer" rel="noopener noreferrer"&gt;&lt;strong&gt;Cythonizer&lt;/strong&gt;&lt;/a&gt; 🌟
&lt;/h2&gt;




&lt;p&gt;Cythonizer is a Python module written by us &lt;a href="https://github.com/TechLearnersInc" rel="noopener noreferrer"&gt;🔗&lt;/a&gt;. The whole philosophy of writing this module is to make Cythonizing faster by taking less number of steps. That's why the slogan is &lt;strong&gt;&lt;em&gt;"Cythonize one step faster"&lt;/em&gt;&lt;/strong&gt; 💘.&lt;/p&gt;

&lt;p&gt;➡️ Cythonizer is available on PyPi &lt;a href="https://pypi.org/project/cythonizer/" rel="noopener noreferrer"&gt;🔗&lt;/a&gt;&lt;br&gt;
➡️ This means that you can install it via pip&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 pip &lt;span class="nb"&gt;install &lt;/span&gt;cythonizer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;➡️ Now in the terminal, just type&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;💲 cythonizer YOUR_PY_OR_PYX_FILE
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AND DONE 😇,&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;For more details visit Cythonizer's PyPi Page &lt;a href="https://pypi.org/project/cythonizer/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;So far, I’ve tried to show everything steps by step, and below, the discussion section is open for your opinion to share and of course the questions if any. And don't forget to follow us. &lt;/p&gt;

&lt;p&gt;💡 &lt;strong&gt;&lt;em&gt;AND SUBSCRIBING to our YouTube&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://www.youtube.com/c/TechLearnersInc" rel="noopener noreferrer"&gt;&lt;strong&gt;TechLearnersInc&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;and Telegram&lt;/em&gt;&lt;/strong&gt; &lt;a href="https://t.me/TechLearners" rel="noopener noreferrer"&gt;&lt;strong&gt;t.me/TechLearners&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;&lt;em&gt;will be amazing.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Add custom domain in a GitHub page with Cloudflare</title>
      <dc:creator>Rizwan Hasan</dc:creator>
      <pubDate>Tue, 22 Dec 2020 19:38:18 +0000</pubDate>
      <link>https://dev.to/techlearners/add-custom-domain-in-a-github-page-with-cloudflare-3goa</link>
      <guid>https://dev.to/techlearners/add-custom-domain-in-a-github-page-with-cloudflare-3goa</guid>
      <description>&lt;p&gt;Most of the time, a beginner git user’s big question is about how to attach a custom domain to a Github page. And it was the same for me also. But now it’s not and that’s why I’ve started writing to them about how you can use a custom domain in your Github page and add Cloudflare also. So, Let’s get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 1: Get a domain&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;You need a domain to attach. Buy a domain from any good places like &lt;a href="https://www.xeonbd.com/" rel="noopener noreferrer"&gt;Xeonbd&lt;/a&gt;, &lt;a href="https://www.godaddy.com/" rel="noopener noreferrer"&gt;Godaddy&lt;/a&gt;, or any places that you like but make sure it supports a custom nameserver. I haven’t found any provider that doesn’t support custom nameserver but also I’d try to mention every bit of information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F07p0y08k3bl16magr5ij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F07p0y08k3bl16magr5ij.png" alt="Alt Text" width="700" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 2: Set custom nameserver&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Your domain needs to point to the Cloudflare server. So, you need to update the nameserver of your domain’s default to below two and make sure the other nameserver’s field remains empty without the first two.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arnold.ns.cloudflare.com

pola.ns.cloudflare.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnsxymvqe98fi2s2e9zss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fnsxymvqe98fi2s2e9zss.png" alt="Alt Text" width="700" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 3: Create a Cloudflare account and add domain&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you don’t have a Cloudflare account create one. And from ‘add site’ add your domain in Cloudflare. Don’t worry it’s completely free.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftoc50dv86ih11rnmgvvf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftoc50dv86ih11rnmgvvf.png" alt="Alt Text" width="700" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Update Domain’s DNS from Cloudflare&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now you need to update your domain’s DNS from Cloudflare’s DNS Panel. For every entry, click on ‘Add record’, Select Type ‘A’, enter the domain name in the ‘Name’ field, and in the ‘IPv4 address’ field you need to add these four IPs like in the screenshots below. I collected the IP’s from GitHub’s documentation &lt;a href="https://help.github.com/en/github/working-with-github-pages/managing-a-custom-domain-for-your-github-pages-site" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

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

185.199.109.153

185.199.110.153

185.199.111.153
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F28bimk72imsowsfn63ae.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F28bimk72imsowsfn63ae.png" alt="Alt Text" width="700" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Step 4: Finally add your domain to your GitHub page&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Go to your Github Repository and from the repository settings, go to Github Pages and there you will have an option for adding a custom domain like the picture below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn0e24jj6f7ss1pwel4pl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fn0e24jj6f7ss1pwel4pl.png" alt="Alt Text" width="700" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s working!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3efveqmi3jqxoagppnmk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3efveqmi3jqxoagppnmk.png" alt="Alt Text" width="700" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;So far, I’ve tried to show everything steps by step. If you liked my writing you can follow me here. Don’t forget to share your opinions in the discussion section below and also the questions if any.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Featured in CodeNewbie's Twitter&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1354444324315017218-993" src="https://platform.twitter.com/embed/Tweet.html?id=1354444324315017218"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1354444324315017218-993');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1354444324315017218&amp;amp;theme=dark"
  }



&lt;/p&gt;

</description>
      <category>github</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
