<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Md. Fahim Bin Amin - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Md. Fahim Bin Amin - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sun, 24 May 2026 16:29:43 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/author/FahimFBA/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up CUDA and WSL2 for Windows 11 (including PyTorch and TensorFlow GPU) ]]>
                </title>
                <description>
                    <![CDATA[ If you’re working on complex Machine Learning projects, you’ll need a good Graphics Processing Unit (or GPU) to power everything. And Nvidia is a popular option these days, as it has great compatibility and widespread support. If you’re new to Machin... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-set-up-cuda-and-wsl2-for-windows-11-including-pytorch-and-tensorflow-gpu/</link>
                <guid isPermaLink="false">69309b9e8c594b8177306456</guid>
                
                    <category>
                        <![CDATA[ Machine Learning ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows ]]>
                    </category>
                
                    <category>
                        <![CDATA[ WSL ]]>
                    </category>
                
                    <category>
                        <![CDATA[ GPU ]]>
                    </category>
                
                    <category>
                        <![CDATA[ cuda ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Deep Learning ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Wed, 03 Dec 2025 20:20:46 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1764786287487/f0c28401-ce77-4873-b238-59fc6b737ce7.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you’re working on complex Machine Learning projects, you’ll need a good Graphics Processing Unit (or GPU) to power everything. And Nvidia is a popular option these days, as it has great compatibility and widespread support.</p>
<p>If you’re new to Machine Learning and are just getting started, then a free <a target="_blank" href="https://www.kaggle.com/">Kaggle</a> or <a target="_blank" href="https://colab.research.google.com/">Colab</a> might be enough for you. But that won’t be the case when you want to go deeper. You’ll need a GPU, which can get costly if you’re continuously using it on the cloud.</p>
<p>But there’s some good news: you can utilize your computer’s Nvidia GPU (GTX/RTX) quite easily and perform machine learning-related tasks right on your local machine. The cool thing is, it won’t cost you anything other than the electricity it uses!</p>
<p>When you’re running Machine Learning models on your local machines, the most suitable operating system is a Linux-based one, like Ubuntu. But Windows has improved a lot for this purpose. If you’re using the latest Windows 11, you can leverage Windows Subsystem for Linux (WSL) and use your GPU directly for Machine Learning-related workflows.</p>
<p>This process can be quite tricky, though, as can making two popular Machine Learning frameworks, TensorFlow and PyTorch, compatible with your system GPU in Windows 11. That’s why I have written this comprehensive guide to ease your pain.</p>
<p>In it, I’ll help you set up CUDA on Windows Subsystem for Linux 2 (WSL2) so you can leverage your Nvidia GPU for machine learning tasks.</p>
<p>By following these steps, you’ll be able to run ML frameworks like TensorFlow and PyTorch with GPU acceleration on Windows 11.</p>
<p>Keep in mind that this guide assumes you have a compatible Nvidia GPU. Make sure to check <a target="_blank" href="https://developer.nvidia.com/cuda-gpus">Nvidia's official compatibility list</a> before proceeding.</p>
<p>I have also prepared a video for you that’ll help you follow proper guidelines throughout this article.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/qOJ49nkU4rY" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<p>Also, if this tutorial helps you, then don’t forget to add a star to the GitHub repository <a target="_blank" href="https://github.com/FahimFBA/CUDA-WSL2-Ubuntu-v2">CUDA-WSL2-Ubuntu-v2</a>. If you face any issues or have any suggestions/improvements, then please raise an issue in the GitHub repository. Currently, the live website is available at <a target="_blank" href="https://ml-win11-v2.fahimbinamin.com/">ml-win11-v2.fahimbinamin.com</a>.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><p><a class="post-section-overview" href="#heading-prerequisites">Prerequisites</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-windows-terminal">Windows Terminal</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-windows-powershell-latest-amp-greatest">Windows PowerShell (Latest &amp; Greatest)</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-configure-windows-terminal">Configure Windows Terminal</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-configuration-of-my-computer">Configuration of my computer</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-cpu-virtualization">CPU Virtualization</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-wsl2">Install WSL2</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-latest-lts-ubuntu-via-wsl2">Install Latest LTS Ubuntu via WSL2</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-update-amp-upgrade-ubuntu-packages">Update &amp; Upgrade Ubuntu Packages</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-and-configure-miniconda">Install and Configure Miniconda</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-jupyter-amp-ipykernel">Install Jupyter &amp; Ipykernel</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-nvidia-driver">Nvidia Driver</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-cuda-dependencies">Install CUDA dependencies</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-cuda-toolkit">CUDA Toolkit</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-add-path-to-shell-profile-for-cuda">Add Path to Shell Profile for CUDA</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-nvcc-version">nvcc Version</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-cudnn-sdk">cuDNN SDK</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-tensorflow-gpu">TensorFlow GPU</a></p>
<ul>
<li><a class="post-section-overview" href="#heading-check-tensorflow-gpu">Check TensorFlow GPU</a></li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-pytorch-gpu">PyTorch GPU</a></p>
<ul>
<li><p><a class="post-section-overview" href="#heading-check-pytorch-gpu">Check PyTorch GPU</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-check-pytorch-amp-tensorflow-gpu-inside-jupyter-notebook">Check PyTorch &amp; TensorFlow GPU inside Jupyter Notebook</a></p>
</li>
</ul>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ol>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>Before you begin, make sure you have the following requirements met:</p>
<ul>
<li><p>Windows 11 operating system</p>
</li>
<li><p>Nvidia GPU (GTX/RTX series)</p>
</li>
<li><p>Administrator access to your PC</p>
</li>
<li><p>At least 30 GB of free disk space</p>
</li>
<li><p>Internet connection for downloads</p>
</li>
<li><p>Latest Nvidia drivers installed</p>
</li>
</ul>
<h2 id="heading-windows-terminal">Windows Terminal</h2>
<p>First, you’ll need to ensure that you have Windows Terminal installed properly in your operating system. It is the newest terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and WSL. You can download it from the <a target="_blank" href="https://apps.microsoft.com/detail/9N0DX20HK701?hl=en-us&amp;gl=BD&amp;ocid=pdpshare">Microsoft Store</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094104150/c73ae561-6888-4eea-9419-186c6659a62f.png" alt="Preview of Windows Terminal on Windows 11" class="image--center mx-auto" width="1133" height="641" loading="lazy"></p>
<p>After ensuring that it’s installed properly, you can proceed to the next steps.</p>
<h2 id="heading-windows-powershell-latest-amp-greatest">Windows PowerShell (Latest &amp; Greatest)</h2>
<p>Windows PowerShell is a modern and updated command-line shell from Microsoft. You can use some Linux specific commands directly on it. It comes with built-in command suggestions. You can download it from the <a target="_blank" href="https://github.com/PowerShell/PowerShell/releases/">official GitHub page</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094138179/78315197-f4f2-4df4-b022-37cb9e74cda2.png" alt="Preview of Windows PowerShell on GitHub" class="image--center mx-auto" width="1519" height="904" loading="lazy"></p>
<p>Download the latest x64 installer and install it. After ensuring that it is installed properly, you can proceed to the next steps.</p>
<h2 id="heading-configure-windows-terminal">Configure Windows Terminal</h2>
<p>Now you’ll need to configure your Windows Terminal to use PowerShell as the default shell. It’s optional and you might skip this step. But I recommend doing it for a better experience.</p>
<p>Open Windows Terminal. Click on the down arrow icon in the title bar and select "Settings".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094162440/6ea767c8-da3b-4280-84f8-0eb2b0647a46.png" alt="Preview of Windows PowerShell settings window" class="image--center mx-auto" width="1166" height="660" loading="lazy"></p>
<p>In the Settings tab, under "Startup", find the "Default profile" dropdown menu. Select "PowerShell" from the list.</p>
<p>Now for the "Default terminal application", select "Windows Terminal".</p>
<p>By default, Windows PowerShell always shows the version number in the title bar. If you want to disable it, select the "PowerShell" profile from the left sidebar. Click on the "Command Line" field and add an <code>--nologo</code> argument at the end of the command. After this, the line becomes <code>"C:\Program Files\PowerShell\7\pwsh.exe" --nologo</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094185648/3641d5f0-ba34-44b9-8a63-86b53068d02e.png" alt="Preview of Windows PowerShell --nologo setting" class="image--center mx-auto" width="1170" height="654" loading="lazy"></p>
<p>If you don’t use other shells frequently and want to hide them in the dropdown, then you’ll need to select those profiles one by one from the left sidebar. Scroll down to the bottom and find the "Hide profile from dropdown" toggle and enable it. It will hide that specific shell from the dropdown menu.</p>
<p>For example, I am hiding the <strong>Azure Cloud Shell</strong> profile as I don't use it frequently:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094214632/73add1b7-bcdd-4368-86a6-975fa2f72b54.png" alt="Preview of hiding profiles in Windows Terminal" class="image--center mx-auto" width="1151" height="657" loading="lazy"></p>
<p>Now click on the "Save" button at the bottom right corner to apply the changes. Close the Windows Terminal for now.</p>
<h2 id="heading-configuration-of-my-computer">Configuration of My Computer</h2>
<p>I figured it’d be helpful to share my current computer’s configuration so you can have a clear idea of which setup I’m using in this guide. Here are the details:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Component</strong></td><td><strong>Specification</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Processor</strong></td><td>AMD Ryzen 7 7700 8-Core Processor (8 Core 16 Threads)</td></tr>
<tr>
<td><strong>RAM</strong></td><td>64GB DDR5 6000MHz</td></tr>
<tr>
<td><strong>Storage</strong></td><td>1 TB Samsung 980 NVMe SSD, 4 TB HDD, 2 TB SATA SSD</td></tr>
<tr>
<td><strong>GPU</strong></td><td>NVIDIA GeForce RTX 3060 12GB GDDR6</td></tr>
<tr>
<td><strong>Operating System</strong></td><td>Windows 11 Pro Version 25H2</td></tr>
</tbody>
</table>
</div><p>Now that you have an idea about my computer’s configuration, we can proceed to the next steps.</p>
<h2 id="heading-cpu-virtualization">CPU Virtualization</h2>
<p>As we are going to use WSL2, we’ll need to make sure that the CPU virtualization is enabled. To check whether virtualization is enabled or not from Windows, simply open the Windows Task Manager. Go to the Performance tab and select CPU from the left sidebar. In the bottom right corner, you will see the Virtualization status. If it shows "Enabled", then you are good to go. If it shows "Disabled", then you need to enable it from the BIOS.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094252181/29efa40c-ec0a-4d99-adb7-50596348a1aa.png" alt="Preview of Virtualization enabled status in Windows Task Manager" class="image--center mx-auto" width="824" height="760" loading="lazy"></p>
<p>⚠️ You have to ensure that CPU Virtualization is enabled in your BIOS settings. Different manufacturers have different ways to access the BIOS. Usually, you can access the BIOS by pressing the Delete or F2 key during the boot process. Once in BIOS, look for settings related to "Virtualization Technology" or "Intel VT-x"/"AMD-V" and make sure it is enabled. Save the changes and exit the BIOS.</p>
<h2 id="heading-install-wsl2">Install WSL2</h2>
<p>Open the Windows Terminal or Windows PowerShell as an administrator. Run the following command to install WSL2 along with the latest Ubuntu LTS distribution:</p>
<pre><code class="lang-powershell">wsl.exe -<span class="hljs-literal">-install</span>
</code></pre>
<p>It will install Windows Subsystem for Linux 2 (WSL2). After the installation is complete, you will be prompted to restart your computer. Do so to finalize the installation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094306994/41db30c0-ecb9-4436-a425-8a059b199c42.png" alt="Preview of WSL installation in Windows PowerShell" class="image--center mx-auto" width="1295" height="656" loading="lazy"></p>
<p>⚠️ If you encounter any issues during installation, refer to the <a target="_blank" href="https://learn.microsoft.com/en-us/windows/wsl/troubleshooting">official Microsoft documentation</a> for troubleshooting WSL installation problems.</p>
<h2 id="heading-install-latest-lts-ubuntu-via-wsl2">Install Latest LTS Ubuntu via WSL2</h2>
<p>Open the Windows Terminal or Windows PowerShell again with the administrator privileges. If you want to check the available Linux distributions to install via WSL, run the following command:</p>
<pre><code class="lang-powershell">wsl.exe -<span class="hljs-literal">-list</span> -<span class="hljs-literal">-online</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094455888/8f1f2382-41cc-410f-a7b9-a47d3bb634b6.png" alt="Preview of available WSL distributions in Windows PowerShell" class="image--center mx-auto" width="1291" height="660" loading="lazy"></p>
<p>For installing any specific distribution, run the following command:</p>
<pre><code class="lang-powershell">wsl.exe -<span class="hljs-literal">-install</span> &lt;DistroName&gt;
</code></pre>
<p>We are going to install the latest LTS Ubuntu distribution. As of now, the latest LTS version is Ubuntu 24.04. But I prefer to install the <code>Ubuntu</code> directly as it always points to the latest LTS version. So, run the following command:</p>
<pre><code class="lang-powershell">wsl.exe -<span class="hljs-literal">-install</span> Ubuntu
</code></pre>
<p>You need to give it a default user account name. For me, I am going with <code>fahim</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094505280/9beb24de-54da-4e0c-993d-b15f985867e3.png" alt="Preview of Ubuntu installation in Windows PowerShell" class="image--center mx-auto" width="1666" height="858" loading="lazy"></p>
<p>It also comes with a nice GUI management tool for WSL.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094530944/89073fb9-881f-48bd-b5ef-a0b08f74e4c5.png" alt="Preview of WSL GUI management tool" class="image--center mx-auto" width="1114" height="724" loading="lazy"></p>
<p>You can configure a lot of stuff in it including restricting core, RAM, disk space and a lot of specifications from the settings GUI window.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094551095/66aea1e1-e204-4115-80e0-b3dea2d7a2ac.png" alt="Preview of WSL GUI settings window (Memory &amp; Processor)" class="image--center mx-auto" width="1919" height="1024" loading="lazy"></p>
<h2 id="heading-update-amp-upgrade-ubuntu-packages">Update &amp; Upgrade Ubuntu Packages</h2>
<p>Open your Ubuntu terminal from Windows Terminal. First, we need to update and upgrade the existing packages to their latest versions.</p>
<p>To update the Ubuntu system, simply use the following command:</p>
<pre><code class="lang-bash">sudo apt update -y
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094594281/be41e056-7e55-4139-b84b-6b7921a2d435.png" alt="Preview of apt update command in Ubuntu terminal" class="image--center mx-auto" width="1649" height="888" loading="lazy"></p>
<p>To upgrade all the packages at once, simply use the following command:</p>
<pre><code class="lang-bash">sudo apt upgrade -y
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094627958/b1c17b1c-5290-470b-aafe-5b89bb03bd01.png" alt="Preview of apt upgrade command in Ubuntu terminal" class="image--center mx-auto" width="1659" height="934" loading="lazy"></p>
<p>⚠️ Make sure that you have a stable internet connection during the update and upgrade process to avoid any interruptions.</p>
<h2 id="heading-install-and-configure-miniconda">Install and Configure Miniconda</h2>
<p>In Machine Learning, we need to manage multiple environments with different package versions. Conda is a popular package and environment management system that makes it easy to create and manage isolated environments for different projects. We will install Miniconda, a minimal installer for Conda, to manage our Python environments. But if you prefer Anaconda, you can install it instead.</p>
<p>Go to the official website of Miniconda. Currently the Miniconda installer is inside Anaconda <a target="_blank" href="https://www.anaconda.com/docs/getting-started/miniconda/install">here</a>. If the official website gets updated, you can always search for "Miniconda installer" on Google to find the latest version. Also, you can create an issue in the <a target="_blank" href="https://github.com/FahimFBA/CUDA-WSL2-Ubuntu-v2/issues">official GitHub repository of this project</a> to notify me about it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094667031/7ee2c854-88b6-49ce-8c04-41bf0a052c90.png" alt="Preview of Miniconda official website" class="image--center mx-auto" width="1895" height="935" loading="lazy"></p>
<p>As we are installing it inside WSL, we have to select the macOS/Linux Installation. Then select Linux Terminal Installer and choose Linux x86 for downloading the installer.</p>
<pre><code class="lang-bash">wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
</code></pre>
<p>It will download the installer to your WSL directory. Then use the following command to install it properly:</p>
<pre><code class="lang-bash">bash ~/Miniconda3-latest-Linux-x86_64.sh
</code></pre>
<p>⚠️ Make sure that you are in the correct directory where the installer is downloaded. If you downloaded it to a different location, adjust the path accordingly. Also, replace bash with zsh or sh if you are using a different shell.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094706995/3a317eb9-0340-4a84-8826-45324c93dd2f.png" alt="Preview of Miniconda installation in WSL Ubuntu terminal" class="image--center mx-auto" width="1794" height="922" loading="lazy"></p>
<p>Make sure to choose the initialization option properly. I prefer to keep the conda env active whenever I open a new shell. Therefore, I chose "Yes".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094727839/f3fc8902-0c37-432c-a912-a92810e89fd1.png" alt="Preview of Miniconda initialization option during installation" class="image--center mx-auto" width="1656" height="924" loading="lazy"></p>
<p>Make sure that the installation succeeds without any errors.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094754454/53dfd998-62c9-4c2a-a71e-0d33e123e027.png" alt="Preview of successful Miniconda installation in WSL Ubuntu terminal" class="image--center mx-auto" width="1652" height="914" loading="lazy"></p>
<p>For the changes to take effect, you can close and reopen the current shell. But you can also do that without closing and reopening the shell by applying the command below.</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> ~/.bashrc
</code></pre>
<p>⚠️ If you’re using a different shell like zsh or fish, make sure to source the appropriate configuration file (e.g., ~/.zshrc for zsh).</p>
<h2 id="heading-install-jupyter-amp-ipykernel">Install Jupyter &amp; Ipykernel</h2>
<p>I prefer to use Jupyter Notebook for running my machine learning experiments. It provides an interactive environment for coding and data analysis. We’ll install Jupyter Notebook and Ipykernel to run Jupyter notebooks in our conda environment. We will do that in all conda environments starting with the <strong>base</strong> environment. It also helps us to keep the conda environment kernel inside Jupyter Notebook.</p>
<p>First, make sure that you are in the base conda environment. You will see (base) on the left side of the terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094812122/66ad5de8-7553-42da-b920-78d20c3bdc9a.png" alt="Preview of conda base environment in WSL Ubuntu terminal" class="image--center mx-auto" width="1917" height="1027" loading="lazy"></p>
<p>Now install Jupyter and Ipykernel both by applying the following command:</p>
<pre><code class="lang-bash">conda install jupyter ipykernel -y
</code></pre>
<p>Make sure that you accept the terms of service of Conda.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094839808/90fe3dcf-053d-4bc7-a031-22f81eb706ca.png" alt="Preview of Jupyter and Ipykernel installation in WSL Ubuntu terminal" class="image--center mx-auto" width="1659" height="927" loading="lazy"></p>
<p>Now, I will create a separate conda environment for both TensorFlow and the PyTorch GPU. You can directly install them in the base environment or in any other environment as per your preference. I am not specifying any specific Python version while creating the environment. It will automatically install the latest stable version of Python.</p>
<pre><code class="lang-bash">conda create -name ml -y
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094865498/ac9ef1f1-4494-4221-8376-5e257c4f9243.png" alt="Preview of creating a new conda environment named 'ml' in WSL Ubuntu terminal" class="image--center mx-auto" width="1659" height="925" loading="lazy"></p>
<p>To activate any specific conda environment, you have to use the following command:</p>
<pre><code class="lang-bash">conda activate &lt;conda-env-name&gt;
</code></pre>
<p>For example, if I want to activate my newly created <strong>ml</strong> environment, I will use this command:</p>
<pre><code class="lang-bash">conda activate ml
</code></pre>
<p>If you’re not sure which conda environments are installed in your system, you can check all available and installed conda environments in your system by running the following command:</p>
<pre><code class="lang-bash">conda env list
</code></pre>
<h2 id="heading-nvidia-driver">Nvidia Driver</h2>
<p>Ensure that you have the latest Nvidia drivers installed on Windows. WSL2 uses the Windows driver, so no separate driver installation is needed in Ubuntu. You can download the latest drivers from the <a target="_blank" href="https://www.nvidia.com/Download/index.aspx">official Nvidia website</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764094915617/cd9b0bfc-77a1-45f1-9dab-4349c8f489ef.png" alt="Preview of Nvidia driver download page" class="image--center mx-auto" width="1750" height="916" loading="lazy"></p>
<p>If you are just installing the latest GPU driver, then after installing the drivers, restart your computer to ensure the changes take effect. You can either use the GeForce Game Ready Driver or the NVIDIA Studio Driver. But I recommend using the Studio Driver for better stability with creative and ML applications.</p>
<h2 id="heading-install-cuda-dependencies">Install CUDA Dependencies</h2>
<p>You might face some issues if you do not have the CUDA dependencies installed properly. I recommend that you install the required dependencies before proceeding further:</p>
<pre><code class="lang-bash">sudo apt install gcc g++ build-essential
</code></pre>
<p>After installing the dependencies, you can then verify the CUDA installation if you had any issues earlier.</p>
<h2 id="heading-cuda-toolkit">CUDA Toolkit</h2>
<p>TensorFlow GPU is very picky about the CUDA version. So we need to install a specific version of CUDA Toolkit that is compatible with the TensorFlow version we are going to install.</p>
<p>To understand exactly which CUDA version is compatible with which TensorFlow version, you can check the official TensorFlow GPU support matrix <a target="_blank" href="https://www.tensorflow.org/install/pip">here</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095089103/87a44961-9426-4d20-95ac-cde06961b41a.png" alt="Preview of TensorFlow GPU support in official docs" class="image--center mx-auto" width="1879" height="931" loading="lazy"></p>
<p>At the time I’m writing this article, the TensorFlow GPU documentation says that we should have CUDA Toolkit 12.3. So I will ensure that I install exactly that version. You can simply click on that version link in the official docs and it will redirect you to the official Nvidia CUDA Toolkit download page. But if the link gets updated in the future, you can always search for "Nvidia CUDA Toolkit" on Google to find the latest version.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095106589/19689d63-5ebd-4783-8da4-e3dedd277efb.png" alt="Preview of Nvidia CUDA Toolkit official website" class="image--center mx-auto" width="1620" height="925" loading="lazy"></p>
<p>As TensorFlow GPU is asking for exact Version 12.3, I will select version 12.3.0 exactly.</p>
<p>In the CUDA Toolkit download page, make sure to choose the operating system as Linux, Architecture as x86_64, Distribution as WSL-Ubuntu, Version as 2.0 and the Installer type as runfile(local).</p>
<p>⚠️ As we are using Ubuntu in our WSL2, you can also choose Ubuntu as your operating system. But I prefer to choose WSL-Ubuntu for better compatibility.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095151533/b6996611-d4ce-4e07-9c73-30bdc93dbf19.png" alt="Preview of CUDA Toolkit 12.3 download page for WSL-Ubuntu" class="image--center mx-auto" width="1311" height="898" loading="lazy"></p>
<p>After selecting those, it will give you the download commands. You have to apply them sequentially. Make sure that you <strong>don't keep the checkmark in "Kernel Objects" during installing CUDA</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095169368/c2f81594-536f-4788-b765-1aab3b040fa7.png" alt="Preview of CUDA Toolkit 12.3 download commands for WSL-Ubuntu" class="image--center mx-auto" width="1895" height="1001" loading="lazy"></p>
<p>⚠️ Make sure to copy and paste the commands one by one in your WSL Ubuntu terminal to download and install the CUDA Toolkit properly. If you face any issues related to CUDA dependency, then quickly go through the <a class="post-section-overview" href="#heading-install-cuda-dependencies">Install CUDA dependencies</a> section, where I have explained how to install the CUDA dependencies properly.</p>
<h2 id="heading-add-path-to-shell-profile-for-cuda">Add Path to Shell Profile for CUDA</h2>
<p>After installing CUDA Toolkit, we need to add the CUDA binaries to our shell profile for easy access. This will allow us to run CUDA commands from any directory in the terminal.</p>
<p>Note that, depending on the shell you are using (bash, zsh, and so on), you need to add the CUDA path to the appropriate configuration file. Make sure to replace <strong>.bashrc</strong> with <strong>.zshrc</strong> or other configuration files if you are using a different shell.</p>
<p>To add the CUDA binary path, follow the command below:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">'export PATH=/usr/local/cuda-12.3/bin:$PATH'</span> &gt;&gt; ~/.bashrc
</code></pre>
<p>You have to use the updated path where you installed it. Your terminal will show it after installing the CUDA:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095215437/15768563-c956-472e-9633-95b3dd1cb7a3.png" alt="Preview of CUDA installation path in WSL Ubuntu terminal" class="image--center mx-auto" width="1912" height="1011" loading="lazy"></p>
<p>Now, you need to add the path inside the Library path. Just use the exact path where you installed CUDA. Your terminal will list the path properly.</p>
<pre><code class="lang-bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">'export LD_LIBRARY_PATH=/usr/local/cuda-12.3/lib64:$LD_LIBRARY_PATH'</span> &gt;&gt; ~/.bashrc
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095242744/3c708db4-d267-4043-aa11-d04d890904f9.png" alt="Preview of CUDA library path in WSL Ubuntu terminal" class="image--center mx-auto" width="1284" height="693" loading="lazy"></p>
<p>After adding those paths, you need to source the shell profile for the changes to take effect. You can do that by running the following command:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> ~/.bashrc
</code></pre>
<h2 id="heading-nvcc-version">nvcc Version</h2>
<p>NVCC stands for Nvidia CUDA Compiler. It is basically a compiler driver for the CUDA platform that allows developers to write parallel programs to run on Nvidia GPUs. As we have already installed the CUDA toolkit, we need to see whether the compiler is also properly activated. To check that, we need to verify the version.</p>
<p>Verify that CUDA is properly installed by checking the version:</p>
<pre><code class="lang-bash">nvcc --version
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095277858/2d1ded0a-01ac-4f78-9f6c-ac499d623207.png" alt="Preview of nvcc version check in WSL Ubuntu terminal" class="image--center mx-auto" width="1839" height="946" loading="lazy"></p>
<p>If the output shows the correct CUDA version, then you have successfully installed CUDA Toolkit in your WSL2 Ubuntu environment.</p>
<h2 id="heading-cudnn-sdk">cuDNN SDK</h2>
<p>The cuDNN (CUDA Deep Neural Network) SDK is a <a target="_blank" href="https://developer.nvidia.com/cudnn">GPU accelerated library of primitives for deep neural networks</a>, developed by Nvidia. It provides highly optimized building blocks for common deep learning operations, significantly speeding up the training and inference processes of AI models on Nvidia GPUs.</p>
<p>Note: Even though TensorFlow GPU suggests a specific cuDNN version, it’s often compatible with multiple versions. Because of this, I recommend downloading the latest cuDNN version that is compatible with your installed CUDA version. You can find the cuDNN download page <a target="_blank" href="https://developer.nvidia.com/cudnn-downloads">here</a>.</p>
<p>Select the Operating System as Linux, Architecture as x86_64, Distribution as Ubuntu, Version as 24.04, Installer Type as deb (local), Configuration as FULL. After selecting those, it will give you the download commands. You have to apply them sequentially.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095312370/1fca5959-f492-4160-8027-deec0674863b.png" alt="Preview of cuDNN download commands for Ubuntu 24.04" class="image--center mx-auto" width="1543" height="938" loading="lazy"></p>
<p>⚠️ Make sure to copy and paste the commands one by one in your WSL Ubuntu terminal to download and install the cuDNN SDK properly. If you face any issues related to CUDA dependency, then quickly go through the <a class="post-section-overview" href="#heading-install-cuda-dependencies">Install CUDA dependencies</a> section, where I have explained how to install the CUDA dependencies properly.</p>
<h2 id="heading-tensorflow-gpu">TensorFlow GPU</h2>
<p>Now, we are going to install TensorFlow GPU in our conda environment. Make sure that you have activated the conda environment where you want to install it. I’m going to install it in my previously created <strong>ml</strong> environment. To activate it, I’ll use the following command:</p>
<pre><code class="lang-bash">conda activate ml
</code></pre>
<p>⚠️ Make sure that you have activated the correct conda environment before installing TensorFlow GPU. You will see the environment name in the terminal prompt.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095398777/0c7d8813-eb6c-4e2e-bad9-1fc7d344d7a2.png" alt="Preview of activating 'ml' conda environment in WSL Ubuntu terminal" class="image--center mx-auto" width="1227" height="692" loading="lazy"></p>
<p>I will install ipykernel and jupyter in this new environment.</p>
<pre><code class="lang-bash">conda install jupyter ipykernel -y
</code></pre>
<p>Now, to install TensorFlow GPU, I will simply use the following command:</p>
<pre><code class="lang-bash">pip install tensorflow[and-cuda]
</code></pre>
<p>It might take a couple of minutes depending on the internet speed you have. Just have patience and wait for it to finish the installation.</p>
<h3 id="heading-check-tensorflow-gpu">Check TensorFlow GPU</h3>
<p>After installing TensorFlow GPU, we need to verify that it is working properly with GPU support. Open a Python shell in your Ubuntu terminal and run the following commands:</p>
<pre><code class="lang-bash">python3 -c <span class="hljs-string">"import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"</span>
</code></pre>
<p>If the output shows a list of available GPU devices, then TensorFlow GPU is successfully installed and working properly.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095453933/ccda58fc-9ae9-4185-9c78-6196c98d8b7c.png" alt="Preview of TensorFlow GPU check in WSL Ubuntu terminal" width="1903" height="1029" loading="lazy"></p>
<h2 id="heading-pytorch-gpu">PyTorch GPU</h2>
<p>Now, we’re going to install PyTorch GPU in our conda environment. Make sure that you have activated the conda environment where you want to install it. I’m going to install it in my previously created ml environment. To activate it, I will use the following command:</p>
<pre><code class="lang-bash">conda activate ml
</code></pre>
<p>Installing PyTorch GPU is very straightforward. You can use the official PyTorch installation command generator <a target="_blank" href="https://pytorch.org/get-started/locally/">here</a>.</p>
<p>Make sure to select PyTorch Build as the latest Stable one, Your OS as Linux, Package as Pip, Language as Python. For the Compute Platform, select the CUDA version that matches your installed CUDA Toolkit. For me, it is CUDA 12.3. But, if you can not find the exact one then choose the closest. As CUDA 12.3 is not available for me now, I am choosing CUDA 12.6.</p>
<p>After selecting those, it will give you the installation command. You have to apply it in your WSL Ubuntu terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095511862/6f631369-c8db-4681-9d1c-669ad88df69d.png" alt="Preview of PyTorch installation command generator" class="image--center mx-auto" width="1618" height="911" loading="lazy"></p>
<p>It might take a couple of minutes depending on the internet speed you have. Just have patience and wait for it to finish the installation.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095532246/56232263-36ea-4043-9881-df162965c514.png" alt="Preview of PyTorch GPU installation in WSL Ubuntu terminal" class="image--center mx-auto" width="1280" height="689" loading="lazy"></p>
<h3 id="heading-check-pytorch-gpu">Check PyTorch GPU</h3>
<p>After installing PyTorch GPU, verify that it is working properly with GPU support. Open a Python shell in your Ubuntu terminal and run the following commands:</p>
<pre><code class="lang-bash">python3 - &lt;&lt; <span class="hljs-string">'EOF'</span>
import torch
<span class="hljs-built_in">print</span>(torch.cuda.is_available())
<span class="hljs-built_in">print</span>(torch.cuda.device_count())
<span class="hljs-built_in">print</span>(torch.cuda.current_device())
<span class="hljs-built_in">print</span>(torch.cuda.device(0))
<span class="hljs-built_in">print</span>(torch.cuda.get_device_name(0))
EOF
</code></pre>
<p>The output should look similar to the screenshot, showing:</p>
<ul>
<li><p><strong>True</strong>: GPU is available for PyTorch</p>
</li>
<li><p><strong>1</strong>: Number of detected CUDA devices</p>
</li>
<li><p><strong>0</strong>: Index of the current active CUDA device</p>
</li>
<li><p>A device object representation</p>
</li>
<li><p><strong>NVIDIA GeForce RTX 3060</strong> (or your GPU name)</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095584921/69269152-7ea6-404b-b1ca-8534b51f2491.png" alt="Preview of PyTorch GPU check in WSL Ubuntu terminal" class="image--center mx-auto" width="1917" height="937" loading="lazy"></p>
<h3 id="heading-check-pytorch-amp-tensorflow-gpu-inside-jupyter-notebook">Check PyTorch &amp; TensorFlow GPU inside Jupyter Notebook</h3>
<p>Now that the environment is fully configured, we will verify GPU support directly inside Jupyter Notebook. This ensures both PyTorch and TensorFlow can successfully detect and use your GPU.</p>
<h4 id="heading-1-test-pytorch-gpu">1. Test PyTorch GPU</h4>
<p>Create a new Jupyter Notebook and run the following commands one by one:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> torch

print(torch.cuda.is_available())
print(torch.cuda.device_count())
print(torch.cuda.current_device())
print(torch.cuda.device(<span class="hljs-number">0</span>))
print(torch.cuda.get_device_name(<span class="hljs-number">0</span>))
</code></pre>
<p>If everything is configured correctly, you will see your GPU (for example <strong>NVIDIA GeForce RTX 3060</strong>) detected properly:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095624229/f94c97a0-2e44-45ad-a2a8-52f40c922482.png" alt="Preview of PyTorch GPU check inside Jupyter Notebook" class="image--center mx-auto" width="1861" height="743" loading="lazy"></p>
<h4 id="heading-2-test-tensorflow-gpu">2. Test TensorFlow GPU</h4>
<p>Next, run the following code to check whether TensorFlow detects your GPU:</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

print(tf.config.list_physical_devices(<span class="hljs-string">'GPU'</span>))
</code></pre>
<p>You can also check the number of GPUs detected:</p>
<pre><code class="lang-python">print(<span class="hljs-string">"Num GPUs Available:"</span>, len(tf.config.list_physical_devices(<span class="hljs-string">'GPU'</span>)))
</code></pre>
<p>Finally, run TensorFlow’s built-in GPU validation (warnings are normal):</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-keyword">assert</span> tf.test.is_gpu_available()
<span class="hljs-keyword">assert</span> tf.test.is_built_with_cuda()
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764095666216/f9017979-b5c9-4b86-9f60-d9aaa2fe8ac1.png" alt="TensorFlow GPU initialization and CUDA validation output" class="image--center mx-auto" width="1638" height="935" loading="lazy"></p>
<p>If TensorFlow logs show your GPU model (such as <strong>RTX 3060</strong>), then TensorFlow GPU is successfully installed and fully working inside Jupyter Notebook.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thank you so much for reading all the way through. I hope you have been able to configure your Windows 11 computer properly for running almost any kind of Machine Learning-based experiments.</p>
<p>To get more content like this, you can follow me on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a> and <a target="_blank" href="https://x.com/Fahim_FBA">X</a>. You can also check <a target="_blank" href="https://www.fahimbinamin.com/">my website</a> and follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> if you are into open source and development.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Create and Style Tables with Vanilla JavaScript ]]>
                </title>
                <description>
                    <![CDATA[ Tables are one of the most useful ways to display structured data, whether you’re showing a list of users, sales figures, or project reports. In this tutorial, you will learn how to: Build tables using plain HTML Style them using CSS Create and ma... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-create-and-style-tables-with-vanilla-javascript/</link>
                <guid isPermaLink="false">68f7d9011382e7a69eb7903e</guid>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Design ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Tue, 21 Oct 2025 19:03:29 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1761066375438/ad2ff6f1-336c-4d32-89f7-3294a4bfebbd.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Tables are one of the most useful ways to display structured data, whether you’re showing a list of users, sales figures, or project reports.</p>
<p>In this tutorial, you will learn how to:</p>
<ul>
<li><p>Build tables using plain HTML</p>
</li>
<li><p>Style them using CSS</p>
</li>
<li><p>Create and manipulate tables dynamically using <strong>vanilla JavaScript</strong></p>
</li>
</ul>
<p>By the end, you’ll understand not just how to do this, but why it matters. You’ll also learn about separating data from presentation, which is at the heart of modern web development.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><p><a class="post-section-overview" href="#heading-creating-a-simple-table-with-html">Creating a Simple Table with HTML</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-understanding-and-styling-borders">Understanding and Styling Borders</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-when-to-use-html-vs-javascript-for-tables">When to Use HTML vs JavaScript for Tables</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-build-a-table-dynamically-with-javascript">How to Build a Table Dynamically with JavaScript</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-step-by-step-explanation">Step-by-Step Explanation</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-add-css-classes-for-styling">How to Add CSS Classes for Styling</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-turn-it-into-a-reusable-function">How to Turn It Into a Reusable Function</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-final-thoughts-amp-conclusion">Final Thoughts &amp; Conclusion</a></p>
</li>
</ol>
<h2 id="heading-creating-a-simple-table-with-html">Creating a Simple Table with HTML</h2>
<p>Before we involve JavaScript, let’s first understand how a standard HTML table works.</p>
<p>A table in HTML is built from a few key tags:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Tag</strong></td><td><strong>Description</strong></td></tr>
</thead>
<tbody>
<tr>
<td><code>&lt;table&gt;</code></td><td>Defines the main table container</td></tr>
<tr>
<td><code>&lt;thead&gt;</code></td><td>Groups the header rows</td></tr>
<tr>
<td><code>&lt;tbody&gt;</code></td><td>Contains the table’s data rows</td></tr>
<tr>
<td><code>&lt;tr&gt;</code></td><td>Defines a row</td></tr>
<tr>
<td><code>&lt;th&gt;</code></td><td>Defines a header cell (bold and centered by default)</td></tr>
<tr>
<td><code>&lt;td&gt;</code></td><td>Defines a data cell</td></tr>
</tbody>
</table>
</div><p>Here is a minimal example:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">table</span> <span class="hljs-attr">border</span>=<span class="hljs-string">"1"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">thead</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">tr</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">th</span>&gt;</span>Name<span class="hljs-tag">&lt;/<span class="hljs-name">th</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">th</span>&gt;</span>Age<span class="hljs-tag">&lt;/<span class="hljs-name">th</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">th</span>&gt;</span>Occupation<span class="hljs-tag">&lt;/<span class="hljs-name">th</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">tr</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">thead</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">tbody</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">tr</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">td</span>&gt;</span>Fahim<span class="hljs-tag">&lt;/<span class="hljs-name">td</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">td</span>&gt;</span>25<span class="hljs-tag">&lt;/<span class="hljs-name">td</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">td</span>&gt;</span>Software Engineer<span class="hljs-tag">&lt;/<span class="hljs-name">td</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">tr</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">tbody</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">table</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760798670028/487aa67e-67db-4d78-b37e-6824ea7cb366.png" alt="Output of the code" class="image--center mx-auto" width="426" height="113" loading="lazy"></p>
<p>Let me break down that code snippet properly:</p>
<ul>
<li><p><code>&lt;table&gt;</code> starts the table.</p>
</li>
<li><p><code>&lt;thead&gt;</code> defines the table header section.</p>
</li>
<li><p>Inside <code>&lt;thead&gt;</code>, we have a <code>&lt;tr&gt;</code> (table row), which contains <code>&lt;th&gt;</code> elements (these are column headers).</p>
</li>
<li><p><code>&lt;tbody&gt;</code> holds the actual data. Each <code>&lt;tr&gt;</code> inside it is one record, and each <code>&lt;td&gt;</code> inside that row is a cell.</p>
</li>
</ul>
<p>The <code>border="1"</code> attribute gives a thin outline around the cells. It’s useful for visualization when you’re learning about tables.</p>
<h2 id="heading-understanding-and-styling-borders">Understanding and Styling Borders</h2>
<p>You might have noticed the <code>border</code> attribute in the <code>&lt;table&gt;</code> tag:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">table</span> <span class="hljs-attr">border</span>=<span class="hljs-string">"1"</span>&gt;</span>
</code></pre>
<p>This is a quick way to add visible outlines. You can even make them thicker, like so:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">table</span> <span class="hljs-attr">border</span>=<span class="hljs-string">"5"</span>&gt;</span>
</code></pre>
<p>The above will render thicker borders, like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760798709116/7225688d-1a13-4199-a527-2001df5705c2.png" alt="Output where border=5" class="image--center mx-auto" width="453" height="148" loading="lazy"></p>
<p>But there is a catch as well…</p>
<h3 id="heading-why-using-border-is-not-a-best-practice">Why Using <code>border</code> Is Not a Best Practice</h3>
<p>The <code>border</code> attribute is an old, inline styling technique. Modern web development separates structure (HTML) from presentation (CSS). That means we now use CSS for all visual styling.</p>
<p>Here’s the modern equivalent:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">table</span> {
  <span class="hljs-attribute">border-collapse</span>: collapse; <span class="hljs-comment">/* prevents double borders */</span>
  <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#444</span>;
}

<span class="hljs-selector-tag">th</span>, <span class="hljs-selector-tag">td</span> {
  <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#666</span>;
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">8px</span>;
  <span class="hljs-attribute">text-align</span>: left;
}
</code></pre>
<h2 id="heading-when-to-use-html-vs-javascript-for-tables">When to Use HTML vs JavaScript for Tables</h2>
<p>You can absolutely create tables entirely in HTML, but only if the data is static.</p>
<p>Use <strong>HTML</strong> only when:</p>
<ul>
<li><p>The data does not change often (like a static price list).</p>
</li>
<li><p>You know the exact number of rows and columns.</p>
</li>
<li><p>You are not fetching data from an external source.</p>
</li>
</ul>
<p>Use <strong>JavaScript</strong> when:</p>
<ul>
<li><p>The data is dynamic (for example, fetched from an API).</p>
</li>
<li><p>You want to update the table based on user input.</p>
</li>
<li><p>You want to sort, filter, or paginate your table interactively.</p>
</li>
</ul>
<p>JavaScript lets you build tables programmatically by defining data in an array or object and letting code handle the rendering.</p>
<h2 id="heading-how-to-build-a-table-dynamically-with-javascript"><strong>How to Build a Table Dynamically with JavaScript</strong></h2>
<p>We will now create a dynamic table using JavaScript. First, I’ll show you the complete code, and then we’ll break it down step-by-step so you can understand exactly what’s happening.</p>
<h3 id="heading-code-example">Code Example:</h3>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>JS Table Example<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"table-container"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="javascript">
  <span class="hljs-comment">// Step 1: Define your data</span>
  <span class="hljs-keyword">const</span> data = [
    { <span class="hljs-attr">name</span>: <span class="hljs-string">"Fahim"</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">25</span>, <span class="hljs-attr">job</span>: <span class="hljs-string">"Software Engineer"</span> },
    { <span class="hljs-attr">name</span>: <span class="hljs-string">"Sara"</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">29</span>, <span class="hljs-attr">job</span>: <span class="hljs-string">"Designer"</span> },
    { <span class="hljs-attr">name</span>: <span class="hljs-string">"David"</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">31</span>, <span class="hljs-attr">job</span>: <span class="hljs-string">"Manager"</span> }
  ];

  <span class="hljs-comment">// Step 2: Create a table element</span>
  <span class="hljs-keyword">const</span> table = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"table"</span>);
  table.border = <span class="hljs-string">"1"</span>; <span class="hljs-comment">// for visibility only</span>

  <span class="hljs-comment">// Step 3: Add headers</span>
  <span class="hljs-keyword">const</span> headers = [<span class="hljs-string">"Name"</span>, <span class="hljs-string">"Age"</span>, <span class="hljs-string">"Job"</span>];
  <span class="hljs-keyword">const</span> headerRow = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"tr"</span>);

  headers.forEach(<span class="hljs-function"><span class="hljs-params">text</span> =&gt;</span> {
    <span class="hljs-keyword">const</span> th = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"th"</span>);
    th.textContent = text;
    headerRow.appendChild(th);
  });
  table.appendChild(headerRow);

  <span class="hljs-comment">// Step 4: Add data rows</span>
  data.forEach(<span class="hljs-function"><span class="hljs-params">item</span> =&gt;</span> {
    <span class="hljs-keyword">const</span> row = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"tr"</span>);
    <span class="hljs-built_in">Object</span>.values(item).forEach(<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> {
      <span class="hljs-keyword">const</span> cell = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"td"</span>);
      cell.textContent = value;
      row.appendChild(cell);
    });
    table.appendChild(row);
  });

  <span class="hljs-comment">// Step 5: Insert the table into the DOM</span>
  <span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"table-container"</span>).appendChild(table);
</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1760798906301/10a7abdf-364a-4b9d-9691-17113ef4229a.png" alt="Table Output" class="image--center mx-auto" width="443" height="215" loading="lazy"></p>
<h3 id="heading-step-by-step-explanation">Step-by-Step Explanation</h3>
<h4 id="heading-step-1-define-the-data-separating-data-from-presentation">Step 1: Define the Data – Separating Data from Presentation</h4>
<p>In web development, data and presentation should be kept separate. In this context, data is the content (like names, ages, jobs) and presentation is how that data looks (HTML table layout, colors, and so on).</p>
<p>We define our data as an array of objects:</p>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> data = [
  { <span class="hljs-attr">name</span>: <span class="hljs-string">"Fahim"</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">25</span>, <span class="hljs-attr">job</span>: <span class="hljs-string">"Software Engineer"</span> },
  { <span class="hljs-attr">name</span>: <span class="hljs-string">"Sara"</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">29</span>, <span class="hljs-attr">job</span>: <span class="hljs-string">"Designer"</span> },
  { <span class="hljs-attr">name</span>: <span class="hljs-string">"David"</span>, <span class="hljs-attr">age</span>: <span class="hljs-number">31</span>, <span class="hljs-attr">job</span>: <span class="hljs-string">"Manager"</span> }
];
</code></pre>
<p>This structure keeps our data flexible. If you later fetch it from an API or database, your table-rendering logic stays the same.</p>
<p>It also mirrors how modern frameworks (like React or Vue) work: your UI simply renders what is in your data.</p>
<h4 id="heading-step-2-create-the-table-element">Step 2: Create the Table Element</h4>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> table = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"table"</span>);
table.border = <span class="hljs-string">"1"</span>;
</code></pre>
<p>Here we are using <code>document.createElement()</code>, a DOM API method that programmatically creates elements. We have not added it to the page yet. It’s just stored in memory.</p>
<p>So why build it in memory first? Well, it’s faster. Appending many elements to the DOM one-by-one causes reflows (browser recalculating layout). Building the structure first and appending once at the end reduces layout recalculations and improves performance.</p>
<h4 id="heading-step-3-add-the-header-row">Step 3: Add the Header Row</h4>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> headers = [<span class="hljs-string">"Name"</span>, <span class="hljs-string">"Age"</span>, <span class="hljs-string">"Job"</span>];
<span class="hljs-keyword">const</span> headerRow = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"tr"</span>);

headers.forEach(<span class="hljs-function"><span class="hljs-params">text</span> =&gt;</span> {
  <span class="hljs-keyword">const</span> th = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"th"</span>);
  th.textContent = text;
  headerRow.appendChild(th);
});
table.appendChild(headerRow);
</code></pre>
<p>Here, we loop through the header labels and dynamically create <code>&lt;th&gt;</code> cells.</p>
<p>We generate headers automatically because if you later load data from a JSON file, you can automatically extract column names using <code>Object.keys(data[0])</code>. This avoids hardcoding and makes your table generation more flexible.</p>
<h4 id="heading-step-4-populate-the-data-rows">Step 4: Populate the Data Rows</h4>
<pre><code class="lang-js">data.forEach(<span class="hljs-function"><span class="hljs-params">item</span> =&gt;</span> {
  <span class="hljs-keyword">const</span> row = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"tr"</span>);
  <span class="hljs-built_in">Object</span>.values(item).forEach(<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> {
    <span class="hljs-keyword">const</span> cell = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"td"</span>);
    cell.textContent = value;
    row.appendChild(cell);
  });
  table.appendChild(row);
});
</code></pre>
<p>We loop through every data object, create a <code>&lt;tr&gt;</code> for each, and then fill in <code>&lt;td&gt;</code> cells for each value. <code>textContent</code> ensures we safely insert text (no HTML injection).</p>
<h4 id="heading-step-5-insert-the-table-into-the-dom">Step 5: Insert the Table into the DOM</h4>
<pre><code class="lang-js"><span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">"table-container"</span>).appendChild(table);
</code></pre>
<p>This is where our table finally appears on the page. We select the empty <code>&lt;div&gt;</code> (our placeholder) and append the built table to it.</p>
<p>JavaScript does not automatically add tables. It only creates them because we told it to. The <code>appendChild()</code> call is what actually adds it to the live DOM.</p>
<h3 id="heading-why-this-approach-is-better">Why This Approach Is Better</h3>
<p>Using JavaScript to generate tables has several benefits:</p>
<ol>
<li><p><strong>Reusability:</strong> You can reuse the same code for any dataset – just change the array.</p>
</li>
<li><p><strong>Separation of concerns:</strong> Data (JS), structure (HTML), and design (CSS) are all handled independently.</p>
</li>
<li><p><strong>Performance:</strong> Building tables in memory before appending avoids costly DOM reflows.</p>
</li>
<li><p><strong>Interactivity:</strong> You can easily add features like sorting, filtering, or highlighting rows.</p>
</li>
<li><p><strong>Dynamic data:</strong> It is the natural approach when fetching JSON data from APIs.</p>
</li>
</ol>
<h2 id="heading-how-to-add-css-classes-for-styling">How to Add CSS Classes for Styling</h2>
<p>Instead of inline styling, we’ll use classes for better organization:</p>
<pre><code class="lang-js">table.classList.add(<span class="hljs-string">"data-table"</span>);
</code></pre>
<p>Then we’ll define our styles in CSS:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.data-table</span> {
  <span class="hljs-attribute">border-collapse</span>: collapse;
  <span class="hljs-attribute">border</span>: <span class="hljs-number">2px</span> solid <span class="hljs-number">#333</span>;
  <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
}

<span class="hljs-selector-class">.data-table</span> <span class="hljs-selector-tag">th</span>, <span class="hljs-selector-class">.data-table</span> <span class="hljs-selector-tag">td</span> {
  <span class="hljs-attribute">border</span>: <span class="hljs-number">1px</span> solid <span class="hljs-number">#888</span>;
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">10px</span>;
}
</code></pre>
<p>When we say “use them,” we are referring to CSS class names – reusable identifiers that let you style your elements separately from your JavaScript logic.</p>
<h2 id="heading-how-to-turn-it-into-a-reusable-function">How to Turn It Into a Reusable Function</h2>
<p>Finally, let’s make this process reusable. We can wrap everything in a function that generates any table given some data and headers.</p>
<pre><code class="lang-js"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">createTable</span>(<span class="hljs-params">data, headers, containerId</span>) </span>{
  <span class="hljs-keyword">const</span> table = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"table"</span>);

  <span class="hljs-keyword">const</span> headerRow = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"tr"</span>);
  headers.forEach(<span class="hljs-function"><span class="hljs-params">text</span> =&gt;</span> {
    <span class="hljs-keyword">const</span> th = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"th"</span>);
    th.textContent = text;
    headerRow.appendChild(th);
  });
  table.appendChild(headerRow);

  data.forEach(<span class="hljs-function"><span class="hljs-params">item</span> =&gt;</span> {
    <span class="hljs-keyword">const</span> row = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"tr"</span>);
    <span class="hljs-built_in">Object</span>.values(item).forEach(<span class="hljs-function"><span class="hljs-params">value</span> =&gt;</span> {
      <span class="hljs-keyword">const</span> td = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"td"</span>);
      td.textContent = value;
      row.appendChild(td);
    });
    table.appendChild(row);
  });

  <span class="hljs-built_in">document</span>.getElementById(containerId).appendChild(table);
}
</code></pre>
<p>Then use it like this:</p>
<pre><code class="lang-js">createTable(data, [<span class="hljs-string">"Name"</span>, <span class="hljs-string">"Age"</span>, <span class="hljs-string">"Job"</span>], <span class="hljs-string">"table-container"</span>);
</code></pre>
<h3 id="heading-when-and-why-to-use-a-function">When and Why to Use a Function</h3>
<p>This pattern is ideal when you need to generate multiple tables on one page, you want cleaner, modular, and testable code, or you plan to integrate with dynamic data sources (like APIs).</p>
<h2 id="heading-final-thoughts-amp-conclusion">Final Thoughts &amp; Conclusion</h2>
<p>We have covered a lot! In this article, so let’s recap what you learned:</p>
<ul>
<li><p>How to create a table with HTML</p>
</li>
<li><p>How to style it properly using CSS</p>
</li>
<li><p>When to use HTML vs JavaScript</p>
</li>
<li><p>How to separate data from presentation</p>
</li>
<li><p>How to generate tables dynamically with JavaScript</p>
</li>
<li><p>How to make your code reusable and efficient</p>
</li>
</ul>
<p>With these foundations, you can now build tables that are dynamic, styled, and data-driven – using nothing but vanilla JavaScript.</p>
<p>Thank you for reading the entire article. I hope you have gained some insight into how to make a subtle transition from typical HTML tables to dynamic JavaScript-based tables. To get more content like this, you can follow me on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a> and <a target="_blank" href="https://x.com/Fahim_FBA">X</a>. You can also check <a target="_blank" href="https://www.fahimbinamin.com/">my website</a> and follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> if you are into open source and development.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Set Up Coolify in AWS EC2 and Have the Power to Do Anything in the Cloud ]]>
                </title>
                <description>
                    <![CDATA[ Coolify is an open-source, self-hostable platform that serves as an alternative to services like Heroku, Netlify, and Vercel. It lets developers deploy and manage applications, databases, and services on their own infrastructure, providing greater co... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-set-up-coolify-in-aws-ec2/</link>
                <guid isPermaLink="false">6862962d9dc534abcc4c7eae</guid>
                
                    <category>
                        <![CDATA[ AWS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ hosting ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Open Source ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Mon, 30 Jun 2025 13:50:37 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1751291416644/05d052cc-dc58-49b4-ac16-3064001fd816.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Coolify is an open-source, self-hostable platform that serves as an alternative to services like Heroku, Netlify, and Vercel. It lets developers deploy and manage applications, databases, and services on their own infrastructure, providing greater control and flexibility.</p>
<p>If you want to use Coolify, you have two options. You can purchase their cloud plan, which costs you money. On the other hand, you can self-host it for free and have unlimited usage without any limitations.</p>
<p>In this article, I will show you how to self-host Coolify directly in an AWS EC2 instance and use its features. I will also show you how to deploy any website directly into it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1747932644011/206603be-4687-4e0d-ab96-6c1271006cf5.png" alt="206603be-4687-4e0d-ab96-6c1271006cf5" class="image--center mx-auto" width="2880" height="1800" loading="lazy"></p>
<p>This article includes a step-by-step video walkthrough that I made for you. You can watch the video on my <a target="_blank" href="https://www.youtube.com/@FahimAmin">YouTube channel</a>.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/LADT0Y_IcNU" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-requirements-for-self-hosting-coolify">Requirements For Self-Hosting Coolify</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-set-up-an-aws-ec2-instance-for-coolify">Set Up an AWS EC2 Instance For Coolify</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-security-group-of-aws-ec2">Security Group of AWS EC2</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-coolify-in-aws-ec2">Install Coolify In AWS EC2</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-access-coolify-from-anywhere-using-the-public-ip">Access Coolify From Anywhere Using The Public IP</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-how-to-deploy-a-website-via-coolify">How to Deploy A Website Via Coolify</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-requirements-for-self-hosting-coolify">Requirements For Self-Hosting Coolify</h2>
<p>Since we’re going to self-host Coolify in the cloud for this article, you’ll need to make sure that you have at least the minimum specification of the server. According to Coolify, currently, the minimum requirements are given below:</p>
<h3 id="heading-server-requirements">Server Requirements</h3>
<ul>
<li><p>A VPS (Virtual Private Server)</p>
</li>
<li><p>A Dedicated Server</p>
</li>
<li><p>A Virtual Machine (VM)</p>
</li>
<li><p>A Raspberry Pi (see our <a target="_blank" href="https://coolify.io/docs/knowledge-base/how-to/raspberry-pi-os#prerequisites"><strong>Raspberry Pi OS Setup Guide</strong></a>)</p>
</li>
<li><p>Or any other server with SSH access</p>
</li>
</ul>
<h3 id="heading-supported-operating-system">Supported Operating System</h3>
<ul>
<li><p>Debian-based (for example, Debian, Ubuntu)</p>
</li>
<li><p>Redhat-based (for example, CentOS, Fedora, Redhat, AlmaLinux, Rocky, Asahi)</p>
</li>
<li><p>SUSE-based (for example, SLES, SUSE, openSUSE)</p>
</li>
<li><p>Arch Linux</p>
</li>
<li><p>Alpine Linux</p>
</li>
<li><p>Raspberry Pi OS 64-bit (Raspbian)</p>
</li>
</ul>
<h3 id="heading-supported-architectures"><strong>Supported Architectures</strong></h3>
<p>Coolify runs on 64-bit systems:</p>
<ul>
<li><p>AMD64</p>
</li>
<li><p>ARM64</p>
</li>
</ul>
<h3 id="heading-minimum-hardware-requirements"><strong>Minimum Hardware Requirements</strong></h3>
<ul>
<li><p><strong>CPU</strong>: 2 cores</p>
</li>
<li><p><strong>Memory (RAM)</strong>: 2 GB</p>
</li>
<li><p><strong>Storage</strong>: 30 GB of free space</p>
</li>
</ul>
<p>Coolify may function properly on servers with lower specs than those mentioned above, but they recommend slightly higher minimum requirements. This ensures that users have sufficient resources to deploy multiple applications without performance issues.</p>
<p>I recommend that you check the <a target="_blank" href="https://coolify.io/docs/get-started/installation">official documents,</a> as there might be an update regarding the specifications, and you do not want to miss that part!</p>
<p>I am going to use <strong>AWS EC2</strong> as my server for this guide.</p>
<h2 id="heading-set-up-an-aws-ec2-instance-for-coolify">Set Up an AWS EC2 Instance for Coolify</h2>
<p>Create a new EC2 instance in AWS.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003070325/e9f40038-12d7-4918-828a-3114d43f8185.png" alt="Create EC2" class="image--center mx-auto" width="1641" height="790" loading="lazy"></p>
<p>Give it any suitable name you want. I am going with <code>coolify-yt</code> for the purpose of this article.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003129368/d9726de2-f5e9-4d87-abbd-15660438c510.png" alt="EC2 name" class="image--center mx-auto" width="1631" height="796" loading="lazy"></p>
<p>For the Amazon Machine Image (AMI), I will use the latest LTS of Ubuntu (Ubuntu Server 24.04 LTS).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003224058/cf23f6b2-c099-40b8-bec1-a39fb0384907.png" alt="AMI Type" class="image--center mx-auto" width="1649" height="804" loading="lazy"></p>
<p>The architecture will be 64-bit (x86).</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003299729/06970567-5523-4976-9156-d621ccf19899.png" alt="AMI Architecture" class="image--center mx-auto" width="1632" height="756" loading="lazy"></p>
<p>For the instance type, I can’t go with the free tier because that wouldn’t meet the minimum specification. So I’m going with the <code>t2.medium</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003366450/465a7aad-c049-486a-baf4-6fb9a8ee1537.png" alt="Instance Type" class="image--center mx-auto" width="1335" height="784" loading="lazy"></p>
<p>I will create a new key pair for key pair. I will go with RSA, and the file format will be <code>.pem</code>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003554621/6ea1ccba-aeb9-496f-a207-37bf9d554e17.png" alt="Key Pair" class="image--center mx-auto" width="1082" height="653" loading="lazy"></p>
<p>When you click on <code>Create key pair</code>, it will download a <code>.pem</code> file. Make sure to keep that safely.</p>
<p>For the storage, I am taking a 50 GB block storage. But you can follow Coolify’s minimum specification storage (30GB) for now if you want.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003637365/4238a847-271e-4f4b-a96f-5a84ec9bdf74.png" alt="Storage configuration" class="image--center mx-auto" width="1557" height="773" loading="lazy"></p>
<p>If I want to use my Coolify from anywhere, I have to check the three boxes in the Network settings.</p>
<ul>
<li><p>Allow SSH traffic from (Anywhere)</p>
</li>
<li><p>Allow HTTPS traffic from the internet</p>
</li>
<li><p>Allow HTTP traffic from the internet</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003752198/d67af805-bef4-4273-b592-dd1703e56cfd.png" alt="Network settings" class="image--center mx-auto" width="1163" height="574" loading="lazy"></p>
<p>Now, simply click on “Launch instance.” It will create our new EC2 server. It might take a few seconds to half a minute. So just be patient and wait for it to finish its task.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003903936/277c79c0-f393-4d0f-a78e-5614915f9359.png" alt="Launch instance" class="image--center mx-auto" width="1641" height="809" loading="lazy"></p>
<h2 id="heading-security-group-of-aws-ec2">Security Group of AWS EC2</h2>
<p>Go to the instance tab and find the name of your newly created EC2 instance. Then, find its security group name.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751003959839/d85e30ba-c75d-4c70-afb1-d21765e03045.png" alt="instances" class="image--center mx-auto" width="1660" height="791" loading="lazy"></p>
<p>I have the security group name for my newly created EC2 as “launch-wizard-7”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004072271/0a1294e6-ae5c-4f61-ab55-6fc3cb1db6be.png" alt="Security Group" class="image--center mx-auto" width="1611" height="612" loading="lazy"></p>
<p>Now, go to the security group tab and find out which security group is associated with your newly created EC2.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004120094/3a328a4b-3da6-4012-928e-0cc8a9414b29.png" alt="security group" class="image--center mx-auto" width="1642" height="805" loading="lazy"></p>
<p>As my EC2’s security group name was “launch-wizard-7”, I will click on that security group ID.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004179202/9919cb9f-a77d-47bd-a47d-52ac51f8a9f2.png" alt="Security group ID" class="image--center mx-auto" width="1620" height="671" loading="lazy"></p>
<p>It will take me to its configuration page. Now, click on “Edit inbound rules”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004258702/da5ea5a7-ecdf-4358-8e0b-f428bf61bf85.png" alt="Inbound rules" class="image--center mx-auto" width="1587" height="647" loading="lazy"></p>
<p>Add a new rule. The type will be “Custom TCP”. The port will be “8000”. The source will be “Anywhere-IPv4”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004306106/249b91f7-c0fe-4797-80a0-6d059d55f922.png" alt="Edit inbound rules" class="image--center mx-auto" width="1627" height="743" loading="lazy"></p>
<p>Now save the rules.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004359517/fbaf4dc7-c608-424b-a890-e8c106971097.png" alt="save changes" class="image--center mx-auto" width="1637" height="747" loading="lazy"></p>
<p>Now, go to the EC2 page and make sure that the newly created EC2 is running.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004404168/0321f546-a40e-4ba6-8815-414547e93346.png" alt="EC2 status" class="image--center mx-auto" width="1636" height="673" loading="lazy"></p>
<p>If you want to connect to the EC2 server from your local machine, you have to use the <code>.pem</code> key. For that, you have to go to the “SSH Client” tab in the connect settings.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004603377/99a0a7ac-0d99-433d-bae8-e357cdedd2f2.png" alt="SSH Client" class="image--center mx-auto" width="1645" height="719" loading="lazy"></p>
<p>For now, I am not going to go through that much hassle, so I’ll use the browser to connect to my server using the “Connect” button.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004526291/a56fe27c-2b7f-400d-94f7-b26dc66ad4a4.png" alt="Connect EC2" class="image--center mx-auto" width="1635" height="730" loading="lazy"></p>
<p>Make sure to note the Public IPv4 address of the EC2. Now click on “Connect”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004626331/f5b8e5a5-5cef-4137-bbf7-807695b79e67.png" alt="Connect" class="image--center mx-auto" width="1645" height="772" loading="lazy"></p>
<p>It will open a new tab with the EC2 connection in your browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004654940/951377a0-7c3d-4e88-bc38-bc73b53da337.png" alt="Connect EC2" class="image--center mx-auto" width="1653" height="766" loading="lazy"></p>
<p>It will be ready to use within a few seconds.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004678704/b1313149-61ed-42d9-9a80-03c7a6f84c32.png" alt="EC2" class="image--center mx-auto" width="1658" height="819" loading="lazy"></p>
<h2 id="heading-install-coolify-in-aws-ec2">Install Coolify in AWS EC2</h2>
<p>There are many ways to install Coolify directly on our EC2. But I usually follow the recommended <a target="_blank" href="https://coolify.io/docs/get-started/installation">installation script of Coolify</a>.</p>
<p><code>curl -fsSL</code> <a target="_blank" href="https://cdn.coollabs.io/coolify/install.sh"><code>https://cdn.coollabs.io/coolify/install.sh</code></a> <code>| sudo bash</code></p>
<p>Use <code>sudo zsh</code> instead of <code>sudo bash</code> if you are running the command from a “ZSH” terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004776360/3f7ca4e5-e819-4c06-bf91-1b4b04edae9a.png" alt="Coolify script" class="image--center mx-auto" width="777" height="418" loading="lazy"></p>
<p>It will start installing Coolify into your server. Follow their prompts in the EC2 terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004847716/1994a54b-29ae-44a3-94dd-953c2bc9ffc5.png" alt="install coolify in EC2" class="image--center mx-auto" width="1658" height="705" loading="lazy"></p>
<p>Depending on your EC2 specification, it might take several minutes. Be patient and let it do its job until it reaches the “Congratulations!” screen.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751004975296/c99da698-0e14-41b3-a32e-761d44edca29.png" alt="finish installation" class="image--center mx-auto" width="1655" height="778" loading="lazy"></p>
<h2 id="heading-access-coolify-from-anywhere-using-the-public-ip">Access Coolify from Anywhere Using the Public IP</h2>
<p>After the installation, open a new tab and use that public IP with an ending <code>:8000</code> port. It will take you to the Coolify account registration page for the first time.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005087901/473c8834-e8dd-497e-bb29-ed56e50f9d07.png" alt="Register" class="image--center mx-auto" width="1212" height="750" loading="lazy"></p>
<p>Register your account. The first one becomes the admin by default. But you can change the role afterwards anytime you want.</p>
<p>You can follow their instructions during the onboarding. But for now, I am simply skipping it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005149629/fb3bcf68-d897-44f4-b210-4896ac630651.png" alt="Skip onboarding" class="image--center mx-auto" width="1168" height="666" loading="lazy"></p>
<p>Your coolify is now completely ready to go!</p>
<h2 id="heading-how-to-deploy-a-website-via-coolify">How to Deploy a Website Via Coolify</h2>
<p>Now, I want to show you how you can easily deploy a static website directly from your GitHub repository in Coolify.</p>
<p>Go to ”Project” and click on “+Add”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005414046/2b21ea04-e90c-4f88-b853-81f10142f6b1.png" alt="Add new project" class="image--center mx-auto" width="1315" height="578" loading="lazy"></p>
<p>Give it a name and a suitable description.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005442344/dab216e0-10c9-4a05-8528-bfd662dc3094.png" alt="Name and description for the project" class="image--center mx-auto" width="1008" height="560" loading="lazy"></p>
<p>I will use <a target="_blank" href="https://github.com/FahimFBA/RainyRoof_Restaurant_Website">one of my public repositories</a> from GitHub for this trial.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005496252/a4c01732-3f38-4fa3-b3ba-d40ca3a4feba.png" alt="GitHub Repo" class="image--center mx-auto" width="1385" height="752" loading="lazy"></p>
<p>You can also deploy from private repositories. To do so, select “Private repository with GitHub App” or “With deploy key”.</p>
<p>Now, click on Production.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005567995/6908baa5-8305-4f3e-a30f-f4adceda5e06.png" alt="Project" class="image--center mx-auto" width="1152" height="419" loading="lazy"></p>
<p>Now, we need to add a resource from which it will pull the data.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005595787/123b4efe-a664-435a-9b26-88a14b636473.png" alt="Add new resource" class="image--center mx-auto" width="1461" height="433" loading="lazy"></p>
<p>As this repository is already public, I will select “Public Repository” as my project source.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005668775/f050c0d5-4c49-499a-895d-b3329c143440.png" alt="Public repo" class="image--center mx-auto" width="1625" height="747" loading="lazy"></p>
<p>Now, provide the public repo URL in the Repository URL field. Then click on “Check repository”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005713819/4923f951-4776-4442-9ced-6774b5ee05c7.png" alt="Public repo URL" class="image--center mx-auto" width="1444" height="683" loading="lazy"></p>
<p>It will show you the project's basic configuration. Check to ensure that everything is correct.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005789227/ca3fa656-a00c-4ba4-ab07-b892755b0335.png" alt="Project config" class="image--center mx-auto" width="1455" height="709" loading="lazy"></p>
<p>If everything is alright, then click on “Continue”.</p>
<p>As this is just a static website, I will change the build pack to “Static” and click on “Continue.”</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005858468/9b1c5a9c-db49-4648-a53f-c5cfec1d4f6c.png" alt="Update project spec" class="image--center mx-auto" width="1457" height="695" loading="lazy"></p>
<p>Now, deploy the application by clicking on the “Deploy” button.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005901660/737fc56a-390b-407a-b41b-fe7f7ce0d986.png" alt="Deploy application" class="image--center mx-auto" width="1442" height="768" loading="lazy"></p>
<p>You can enable/disable the debug log as well.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005931517/659f4812-2762-4e18-b543-2678a1b3e09b.png" alt="Debug log" class="image--center mx-auto" width="1426" height="813" loading="lazy"></p>
<p>After the deployment is finished successfully, you can find the website's autogenerated URL from the Links tab.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751005979512/99b6f561-2d4a-4d24-b6a6-ea025857e909.png" alt="Link" class="image--center mx-auto" width="1431" height="720" loading="lazy"></p>
<p>The site will appear just fine!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751006003870/eab0135a-0c3d-4e17-bbe8-1a0df996d58e.png" alt="Live site" class="image--center mx-auto" width="1638" height="837" loading="lazy"></p>
<p>You can also auto-generate a new domain or add your own domain/subdomain from the project settings at any time.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751006064485/3a7c6a99-f2c8-43f8-82a9-b4ef3bbbcfcb.png" alt="Change domain" class="image--center mx-auto" width="1443" height="811" loading="lazy"></p>
<p>The project settings will contain all other necessary configuration/environment variables, and so on. Whenever you change any information/settings/configuration in the configuration section, you just need to redeploy the application to reflect the changes.</p>
<p>You can add new team members, change the Coolify domain to something else (your domain/subdomain) and make it a generic, publicly accessible server.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1751006188731/0d8471f4-7a74-4413-8cc2-81a42da410e9.png" alt="Team" class="image--center mx-auto" width="1439" height="715" loading="lazy"></p>
<p>So, this is the generic procedure to install Coolify in an AWS EC2 instance without any hassle.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thanks for reading this short tutorial. I hope it helped you install Coolify on your favourite server and increase your productivity.</p>
<p>To get more content like this, you can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a>, <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>, and <a target="_blank" href="https://youtube.com/@FahimAmin">YouTube</a>. My <a target="_blank" href="https://www.fahimbinamin.com/">website</a> is always available, too.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Run LaTeX Projects Locally (for Free) On Windows ]]>
                </title>
                <description>
                    <![CDATA[ LaTeX is a high-quality typesetting system that is widely used in technical, academic, and scientific writing. It’s very popular in academia, especially in fields like mathematics, physics, computer science, and engineering. LaTeX is not a word proce... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-run-latex-projects-locally-for-free-on-windows/</link>
                <guid isPermaLink="false">67bde54468de46f577ed25f8</guid>
                
                    <category>
                        <![CDATA[ latex ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Mathematics ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows ]]>
                    </category>
                
                    <category>
                        <![CDATA[ research ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Tue, 25 Feb 2025 15:44:04 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/upload/v1740494599916/ce7cfadb-985c-4245-9cc8-1ccba483ba69.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>LaTeX is a high-quality typesetting system that is widely used in technical, academic, and scientific writing. It’s very popular in academia, especially in fields like mathematics, physics, computer science, and engineering.</p>
<p>LaTeX is not a word processor like Microsoft Word – rather, it’s a document preparation system that allows you to focus on the content of your writing while it handles the formatting. If you use LaTeX to write your formal documents (like a CV, résumé, or research paper), then you don’t need to worry about the formatting and structure, as everything can be done using LaTeX scripts.</p>
<p>If you use LaTeX to write your academic or research papers, you might be familiar with website-based applications like <a target="_blank" href="https://www.overleaf.com/">Overleaf</a>. Overleaf is a website that allows anyone to read, write, and compile LaTeX scripts online.</p>
<p>These sites are okay for small tasks or compilations, or if you need only a little bit of free collaboration. But if you need to work on bigger projects or need to conduct many collaborative tasks, then the free tier may be insufficient. And in my opinion, the paid subscription costs too much.</p>
<p>But don’t worry: running LaTeX locally may be the perfect solution for you. I know this because I also faced a similar situation, and this simply changed my life! I also keep all of the tracks in Git (GitHub, GitLab, and so on) along with unlimited collaboration opportunities and compilation. And the great thing is, all of these are completely free as it’s all happening on my local machine.</p>
<p>So in this article, I am going to discuss the methods in detail. I have also created an in-depth video for you to understand how this works.</p>
<h3 id="heading-video-tutorial">Video Tutorial</h3>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/A45lWrndVHA" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<h2 id="heading-resources-youll-need">Resources You’ll Need:</h2>
<h3 id="heading-1-github-repository">1. GitHub Repository</h3>
<p>This entire guide is available in one of my GitHub projects named <a target="_blank" href="https://github.com/FahimFBA/Install-LaTeX">Install-LaTeX</a>. The live website is available <a target="_blank" href="https://fahimfba.github.io/install-latex/">here</a> (<a target="_blank" href="https://fahimfba.github.io/Install-LaTeX/">fahimfba.github.io/Install-LaTeX</a>) as well. I would highly appreciate it if you star (⭐) the repository. Also, you can create issues <a target="_blank" href="https://github.com/FahimFBA/Install-LaTeX/issues">there</a> if you face any problems. Any kind of good contribution is also welcome here.</p>
<h3 id="heading-2-operating-system">2. Operating System</h3>
<p>You can install LaTeX on any major operating system (Windows, MacOS, and Linux-based OSes). But in this article, I am only going to talk about the Windows operating system.</p>
<p>Here, I’m using the latest Windows 11 operating system, but the same procedure should be applicable to all of the Windows-based operating systems that are going to come out in the future. Windows 10 should also be okay too.</p>
<h3 id="heading-3-editor">3. Editor</h3>
<p>I am going to use the popular <a target="_blank" href="https://code.visualstudio.com/">Visual Studio Code</a> as my editor. It is a 100% free and robust editor that’s very popular among devs all over the world. If you don’t already have it, go ahead and install it before proceeding further.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972339481/729ecab1-b87e-43d6-baf5-dbda170bcefc.png" alt="VS Code" class="image--center mx-auto" width="1761" height="921" loading="lazy"></p>
<h3 id="heading-4-latex-compileride">4. LaTeX Compiler/IDE</h3>
<p>To work on LaTeX files, you’ll need a specific compiler. I am going to use <a target="_blank" href="https://miktex.org/">MikTeX</a>. There are other tools out there, but this is the best tool right now (according to me!). It is completely free and supports all major operating systems as well. It also has a built-in IDE, but we are going to use VS Code as our main editor.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972305065/8119b362-3c95-42a0-9458-be211d2ead35.png" alt="MiKTeX" class="image--center mx-auto" width="1631" height="905" loading="lazy"></p>
<p>Download the Windows executable file from the Download section.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972408494/71b39032-3adc-426e-8bd9-3a18dc454cf5.png" alt="Download MiKTeX" class="image--center mx-auto" width="1312" height="838" loading="lazy"></p>
<p>After the download is finished, install the executable. At the end of the installation, keep the tick in “Check for updates now”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972492255/a59f7000-8137-46c5-89f1-4f7151a751b6.png" alt="Check for update" class="image--center mx-auto" width="524" height="403" loading="lazy"></p>
<p>You will find the MikTeX console in your taskbar. Open that.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972541856/e7bad89a-4920-4175-a361-ba8fb51f6b20.png" alt="MiKTeX console" class="image--center mx-auto" width="856" height="669" loading="lazy"></p>
<p>Go to the “Updates” tab and click “Update now”. It will install all of those packages.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972581283/6d585388-0218-4792-b78e-798c75dee6a6.png" alt="6d585388-0218-4792-b78e-798c75dee6a6" class="image--center mx-auto" width="821" height="645" loading="lazy"></p>
<p>At the end, it will prompt you to close the console. Click “OK”. Open MiKTeX again.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972610846/926b5aba-0a3a-4c80-a103-fef5a5aafc38.png" alt="926b5aba-0a3a-4c80-a103-fef5a5aafc38" class="image--center mx-auto" width="841" height="663" loading="lazy"></p>
<p>That’s it for this tool.</p>
<h3 id="heading-5-perl">5. Perl</h3>
<p>The commands we are going to execute for building the LaTeX files are dependent on Perl. As the Windows operating system doesn’t come with a built-in Perl compiler, we are going to install the <a target="_blank" href="https://strawberryperl.com/">Strawberry Perl</a>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972724660/7a6ad623-c2cc-45bd-bac6-08afdd5512c1.png" alt="Perl" class="image--center mx-auto" width="1902" height="897" loading="lazy"></p>
<p>Download the latest MSI package from it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972749178/33c95897-37af-4be7-a24f-3520c3c1486e.png" alt="Download Strawberry perl" class="image--center mx-auto" width="1361" height="815" loading="lazy"></p>
<p>Install the executable after it gets finished downloading the application.</p>
<p>We need to add Perl’s path to the system environment. To do that, go into the location where it has been installed. By default, it gets installed inside <code>C:\Strawberry\perl\bin</code> directory. Copy the path.</p>
<p>Now search for “env” in the Windows search bar until you find something called “Edit the system environment variable”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972898818/7cfdab3a-9ad0-47a7-b0ed-7721b589de97.png" alt="env" class="image--center mx-auto" width="810" height="678" loading="lazy"></p>
<p>Now click on “Environment Variables…”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739972945973/832e011b-0841-4318-a9b8-8b7a8ae42819.png" alt="System Properties" class="image--center mx-auto" width="434" height="485" loading="lazy"></p>
<p>Now select “Path” from “System variables” and click “Edit”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739973034756/df3d91f0-907e-42bf-9f1d-883172abd268.png" alt="System variables" class="image--center mx-auto" width="656" height="605" loading="lazy"></p>
<p>Click “New”. Paste the path. Now exit every windows sequentially by clicking on “OK” in each window.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739973087965/b73dd5e2-5c35-4399-a645-cb92ba43fe7b.png" alt="add var inside system path" class="image--center mx-auto" width="541" height="497" loading="lazy"></p>
<h2 id="heading-visual-code-studio-extensions">Visual Code Studio Extensions</h2>
<p>We need some extensions in VS Code to streamline our workflow.</p>
<p>First, let’s get <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop">LaTeX Workshop</a>. It is the core extension for working with LaTeX files inside VS Code Studio.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739973174197/2311c19b-d56e-4363-a3c0-75a9b0a323ee.png" alt="2311c19b-d56e-4363-a3c0-75a9b0a323ee" class="image--center mx-auto" width="791" height="518" loading="lazy"></p>
<p>Next, you’ll need <a target="_blank" href="https://marketplace.visualstudio.com/items?itemName=stkb.rewrap">Rewrap</a>. It is an amazing tool that lets you wrap longer lines. It helps you work in a long line in separate lines without breaking any structure or sentence.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739973216887/86bacaa6-77ff-441c-acca-08ee6a74d354.png" alt="86bacaa6-77ff-441c-acca-08ee6a74d354" class="image--center mx-auto" width="797" height="641" loading="lazy"></p>
<h2 id="heading-build-the-latex-file">Build the LaTeX File</h2>
<p>Whenever you want to build any LaTeX file inside VS Code studio, simply open that file in it. Then open the command palette using <code>Ctrl</code> + <code>Shift</code> + <code>P</code>.</p>
<p>Search for “LaTeX Workshop: Build with recipe” and go there. It will start building the file. Whenever it prompts you to install any missing package, untick the box that says “Always show this dialog” and press “Install”. I do this because clicking on “Install” on hundreds of prompt windows for building a LaTeX file is very difficult for me.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1739973393900/0ec3a626-38bb-4fbd-8f98-658cb6bc4853.png" alt="package installation" class="image--center mx-auto" width="516" height="371" loading="lazy"></p>
<p>After it finishes building the LaTeX file, you will get the output PDF file inside VS Code. You can open the PDF file directly in VS Code.</p>
<p>If you want to go into any specific line in the code from the output PDF file like Overleaf, simply click on that specific portion in the PDF by pressing the <code>Ctrl</code> key. It will immediately take you to the code part where it belongs.</p>
<p>That’s it! It’s now running on your local machine and there are no restrictions or limitation to it, literally! Also, for collaboration and keeping track of the history, using Git is the best option, like I do.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thanks for reading this short tutorial. I hope it helped you interact more easily with LaTeX.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a>, <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>, and <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">You</a><a target="_blank" href="https://youtube.com/@FahimAmin">Tube</a> to get more content like this. Also, my <a target="_blank" href="https://www.fahimbinamin.com/">website</a> is always available for you!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Install and Configure XAMPP Properly to Avoid Errors When You Close the App ]]>
                </title>
                <description>
                    <![CDATA[ XAMPP is popular software for those who use MySQL databases and PHP. It’s free software, and it supports Windows, Linux OS, and MacOS. This makes it quite popular among developers even though it can also present us with many challenges. One common is... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-install-and-configure-xampp-properly-to-avoid-errors-when-you-close-the-app/</link>
                <guid isPermaLink="false">67360e398a8e3a6a2f6c32cd</guid>
                
                    <category>
                        <![CDATA[ Xampp ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Tutorial ]]>
                    </category>
                
                    <category>
                        <![CDATA[ MySQL ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Thu, 14 Nov 2024 14:50:33 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/cckf4TsHAuw/upload/ab4deba46100e61a5425d817f6406742.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>XAMPP is popular software for those who use MySQL databases and PHP. It’s free software, and it supports Windows, Linux OS, and MacOS. This makes it quite popular among developers even though it can also present us with many challenges.</p>
<p>One common issue you may have faced is the errors you can get when you want to exit the application. You can easily mitigate that issue by opening the application launcher as Administrator. But opening the launcher via administrator correctly can also be troublesome. This means that you’ll need to configure a setting so that it asks for administrator access each time you want to launch it.</p>
<p>In this quick tutorial, I’ll walk you through this process so you don’t have to struggle with it.</p>
<h2 id="heading-video-guide">Video Guide</h2>
<p>I have prepared a complete video where I show you how to download and install the client. I also teach you how to make some changes so that you don’t encounter any issues when you want to quit the application.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/3viM71-ULAw" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p> </p>
<h2 id="heading-step-by-step-process">Step-By-Step Process</h2>
<p>If you keep the default installation directory during the installation, it will install it inside the <code>C</code> drive of your Windows operating system.</p>
<p>So simply enter into the “C” drive and go inside the “xampp” directory.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731566127539/9964e362-0f79-4a08-9799-7ea17bd3740e.png" alt="Find the &quot;xampp&quot; directory" class="image--center mx-auto" width="733" height="508" loading="lazy"></p>
<p>Scroll down until you find the “xampp-control.exe” file.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731566176798/8a529579-5545-4a97-b32d-6fdbffe15a95.png" alt="Find the &quot;xampp-control.exe&quot; file" class="image--center mx-auto" width="835" height="625" loading="lazy"></p>
<p>Right-click after selecting the file and open the <strong>Properties</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731566236620/dfaa3a6c-795a-4dab-a03a-66b73a7d5de5.png" alt="Properties tab" class="image--center mx-auto" width="485" height="629" loading="lazy"></p>
<p>Next, go to the <strong>Compatibility</strong> section. Make sure to add a check mark by clicking on the checkbox by “Run the program as an administrator”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731566287073/53bf3e86-1a4b-47b3-83e9-96caf1a4195d.png" alt="Configure properties" class="image--center mx-auto" width="487" height="626" loading="lazy"></p>
<p>Click “Apply”, and “OK”.</p>
<p>That’s it!</p>
<p>Now, whenever you want to open the XAMPP launcher, it will always open with administrator access.</p>
<h3 id="heading-quitting-the-application">Quitting the application</h3>
<p>When you want to quit the application, you need to click the “Quit” button instead of using the “X” exit button at the upper right side of the window.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1731566387255/316d1778-dd5b-4a61-9efe-cbbaf8fc7552.png" alt="Quit the application" class="image--center mx-auto" width="705" height="484" loading="lazy"></p>
<p>And now you shouldn’t get any errors when exiting the control panel anymore!</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thanks for reading this short tutorial. I hope it helped you interact more easily with XAMPP.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a>, <a target="_blank" href="https://github.com/FahimFBA">Linke</a><a target="_blank" href="https://www.linkedin.com/in/fahimfba/">dIn</a>, <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">and You</a><a target="_blank" href="https://youtube.com/@FahimAmin">Tube</a> <a target="_blank" href="https://youtube.com/@FahimAmin">to get</a> more content like this. Also, my <a target="_blank" href="https://www.fahimbinamin.com/">website</a> <a target="_blank" href="https://www.fahimbinamin.com/">is alwa</a>ys available for you!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Remove All Saved Posts from Facebook Using JavaScript ]]>
                </title>
                <description>
                    <![CDATA[ If you're an avid Facebook user, you've probably saved countless posts, videos, and links to revisit later. But sometimes, these saved posts accumulate and become overwhelming. You may decide to un-sa ]]>
                </description>
                <link>https://www.freecodecamp.org/news/remove-all-saved-posts-from-facebook-using-javascript/</link>
                <guid isPermaLink="false">67228665c48a2523d1dedb0a</guid>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Wed, 30 Oct 2024 19:17:57 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/PTiQqAKzbmM/upload/94f3490edcd662844a0bf56f2e6b0ce2.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you're an avid Facebook user, you've probably saved countless posts, videos, and links to revisit later.</p>
<p>But sometimes, these saved posts accumulate and become overwhelming. You may decide to un-save them all at once rather than manually unchecking each one, especially if you've amassed a large collection.</p>
<p>Here's a step-by-step guide to bulk un-saving all your saved items on Facebook.</p>
<p><strong>Warning:</strong> Before proceeding, note that this method will un-save all the displayed items on the page permanently. Once unsaved, the items will no longer appear in your saved list. There’s no way to retrieve them unless you manually save each post again. Please use this method with caution.</p>
<p>Also, You might need to use <code>allow pasting</code> and hit the Enter key if Facebook warns you before applying any JavaScript commands in the console.</p>
<h3 id="heading-step-1-scroll-through-your-saved-items"><strong>Step 1: Scroll Through Your Saved Items</strong></h3>
<p>Start by heading over to your Facebook saved items section. You can access this by clicking the menu icon (three horizontal lines) on the mobile app or the saved section on the left-hand side of the homepage on the desktop version.</p>
<p>Scroll down to load and display all the saved items that you want to un-save. Facebook only loads a few items at a time as you scroll, so ensure you've loaded everything you wish to unsave.</p>
<h3 id="heading-step-2-open-the-developer-console"><strong>Step 2: Open the Developer Console</strong></h3>
<p>To start the bulk un-saving process, you’ll need to use your browser’s developer console. Here’s how to do that:</p>
<ul>
<li><p>On <strong>Google Chrome</strong>: Press <code>Ctrl + Shift + J</code> (Windows) or <code>Cmd + Option + J</code> (Mac) to open the console.</p>
</li>
<li><p>On <strong>Firefox</strong>: Press <code>Ctrl + Shift + K</code> (Windows) or <code>Cmd + Option + K</code> (Mac).</p>
</li>
</ul>
<p>Once the console is open, you can start running the necessary JavaScript commands.</p>
<h3 id="heading-step-3-open-the-context-menu-for-each-item"><strong>Step 3: Open the Context Menu for Each Item</strong></h3>
<p>You’ll first need to open the contextual menu (the three dots beside each saved post) for every item on the page. This is where Facebook allows you to un-save individual posts.</p>
<p>Copy and paste the following command into the console and press <strong>Enter</strong>:</p>
<pre><code class="language-javascript">Array.from(document.querySelector('[role="main"]')?.querySelectorAll('[aria-label="More options for saved item"]') || []).slice(1).forEach(el =&gt; el.click());
</code></pre>
<p>This command finds all the “More” buttons on the page and opens the contextual menu for each saved item.</p>
<h3 id="heading-step-4-un-save-each-item"><strong>Step 4: Un-save Each Item</strong></h3>
<p>Once the contextual menus have been opened for each saved post, it’s time to bulk un-save them. For that, run the following command in the console:</p>
<pre><code class="language-javascript">Array.from(document.querySelectorAll('[role=menuitem]')).map(e =&gt; e.click())
</code></pre>
<p>This command clicks on the "Un-save" option in every contextual menu that has been opened, removing the items from your saved list.</p>
<h3 id="heading-important-reminder"><strong>Important Reminder:</strong></h3>
<p>All the items that are displayed on the page will be unsaved <strong>permanently</strong>. Ensure that you’ve reviewed the items before proceeding with this method.</p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>This method saves you the hassle of manually un-saving items one by one. Just remember to scroll through and load all the saved items before running the script to ensure nothing is left behind.</p>
<p>Also, since this method affects only the currently displayed items, you may need to scroll and repeat the process if you have a lot of saved posts.</p>
<p>By following these steps, you can easily declutter your Facebook saved items and keep only what truly matters.</p>
<p>You can follow me on <a href="https://github.com/FahimFBA">GitHub</a>, <a href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>, and <a href="https://youtube.com/@FahimAmin">YouTube</a> to get more content like this. Also, my <a href="https://www.fahimbinamin.com/">website</a> is always available for you!</p>
<p>Resource: <a href="https://github.com/bouiboui/facebook-saved/issues/6#issuecomment-755982611">GitHub Comment</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Run R Programs Directly in Jupyter Notebook Locally ]]>
                </title>
                <description>
                    <![CDATA[ R is a popular programming language that’s now widely used in research-related fields like Bioinformatics. And to use R, you’ll need to install the R Compiler and R Studio. But did you know that you can also directly run your R code right in a Jupyte... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-run-r-programs-directly-in-jupyter-notebook-locally/</link>
                <guid isPermaLink="false">66feeca1dbd895463237bf4b</guid>
                
                    <category>
                        <![CDATA[ R ]]>
                    </category>
                
                    <category>
                        <![CDATA[ R Language ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Jupyter Notebook  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ jupyterhub ]]>
                    </category>
                
                    <category>
                        <![CDATA[ jupyter ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Miniconda ]]>
                    </category>
                
                    <category>
                        <![CDATA[ anaconda ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Thu, 03 Oct 2024 19:12:33 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/res/hashnode/image/stock/unsplash/pUAM5hPaCRI/upload/d8014cab22d10f9bade9077d0d4af34b.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>R is a popular programming language that’s now widely used in research-related fields like Bioinformatics.</p>
<p>And to use R, you’ll need to install the R Compiler and R Studio. But did you know that you can also directly run your R code right in a Jupyter Notebook? This helps in so many ways if you are already used to using Jupyter Notebook for Machine Learning-related tasks using Python.</p>
<p>In this tutorial, I’ll show you exactly how you can set up your local machine to run the R programming language directly in Jupyter Notebook. The processes I am going to show you today are equally applicable to all major operating systems (Windows, MacOS, and Linux OSes).</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ul>
<li><p><a class="post-section-overview" href="#heading-install-conda">Install Conda</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-create-a-new-environment">Create a New Environment</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-activate-your-conda-environment">Activate Your Conda Environment</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-ipykernel-and-jupyter">Install ipykernel and jupyter</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-install-r-in-the-conda-environment">Install R in the Conda Environment</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-open-the-jupyter-notebook">Open the Jupyter Notebook</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-run-r-in-jupyter-notebook">Run R in Jupyter Notebook</a></p>
</li>
<li><p><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></p>
</li>
</ul>
<h2 id="heading-install-conda">Install Conda</h2>
<p>You’d normally use Conda to handle multiple environments in Python. And here, we’re going to use the same Conda program to install R in our environment. You can either use <a target="_blank" href="https://www.anaconda.com/">Anaconda</a> or <a target="_blank" href="https://docs.anaconda.com/miniconda/">Miniconda</a>.</p>
<p>I prefer Miniconda as it’s so lightweight. You’ll also get the opportunity to install the latest packages directly using Miniconda. But you can simply go with the Anaconda if you are already comfortable with that.</p>
<h2 id="heading-create-a-new-environment">Create a New Environment</h2>
<p>Many people tend to use the Base environment. But I never like to use the Base environment directly as you typically need multiple environments for handling different package and versions of packages as well.</p>
<p>So I’ll create a new environment where I’ll work on my R programming language-related tasks using Jupyter Notebook.</p>
<p>To create a new Conda environment, simply use the following command:</p>
<pre><code class="lang-bash">conda create --name r-conda
</code></pre>
<p>Here, <code>r-conda</code> is my Conda environment’s name. You can choose any other name, but keep in mind that the conda env name can not have any whitespaces in it.</p>
<p>It will create a new Conda environment named <code>r-conda</code> for me.</p>
<h2 id="heading-activate-your-conda-environment">Activate Your Conda Environment</h2>
<p>If you want to work on a separate conda environment, you’ll need to make sure that you’re activating that specific conda environment before starting to do anything.</p>
<p>I want to work on the <code>r-conda</code> conda environment. So I can simply activate the conda environment using the following command:</p>
<pre><code class="lang-bash">conda activate r-conda
</code></pre>
<p>You need to use the exact conda env name that you want if it’s different than <code>r-conda</code> in the command.</p>
<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Keep in mind that you need to activate the conda environment successfully before proceeding further.</div>
</div>

<p>You will see the conda environment’s name as <code>(conda-env-name)</code> at the left side of your terminal.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898007890/f8bf9ced-6c9e-4198-9116-63a32e7d0f03.png" alt="activate conda env" class="image--center mx-auto" width="1097" height="553" loading="lazy"></p>
<h2 id="heading-install-ipykernel-and-jupyter">Install <code>ipykernel</code> and <code>jupyter</code></h2>
<p>I always like to install the <code>ipykernel</code> and <code>jupyter</code> in all of my conda environments as they help manage different conda environments’ Jupyter notebooks/labs separately.</p>
<p>So I’m going to install them together in my conda env by using the command below:</p>
<pre><code class="lang-bash">conda install ipykernel jupyter
</code></pre>
<p>This will install both <code>ipykernel</code> and <code>jupyter</code> in the activated conda environment.</p>
<h2 id="heading-install-r-in-the-conda-environment">Install R in the Conda Environment</h2>
<p>To install R directly in the conda environment, simply use the following command:</p>
<pre><code class="lang-bash">conda install -c r r-irkernel
</code></pre>
<p>This will install the necessary components that enable your local computer to run the R program in your Jupyter Notebook.</p>
<h2 id="heading-open-the-jupyter-notebook">Open the Jupyter Notebook</h2>
<p>Now you can open the Jupyter Notebook either by using <code>jupyter notebook</code> or <code>jupyter notebook --ip=0.0.0.0 --port=8889 --no-browser --allow-root --NotebookApp.token=''</code>. Just make sure to modify the IP, port, root configuration, and token as you see fit for your work.</p>
<p>Open the given link in the terminal to open Jupyter Notebook in your web browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898291254/b932284e-05af-4eec-a6aa-f6b9ad50dd1c.png" alt="Open Jupyter Notebook" class="image--center mx-auto" width="1094" height="541" loading="lazy"></p>
<h2 id="heading-run-r-in-jupyter-notebook">Run R in Jupyter Notebook</h2>
<p>After opening Jupyter Notebook in your web browser, when you want to create a new notebook for R, you will get <code>R</code> directly in the “New” menu like the image given below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898368089/a2d22b41-8ddd-480b-aaa4-65aeafb12f69.png" alt="R in notebook" class="image--center mx-auto" width="357" height="268" loading="lazy"></p>
<p>Now, you can use the R language directly in your Jupyter Notebook!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1727898457072/05015331-742c-49c5-9325-b1d1cb1fc6cd.png" alt="Run &quot;R&quot; in Jupyter Notebook" class="image--center mx-auto" width="1244" height="524" loading="lazy"></p>
<p>You can also see the R programming language logo at the top right side of your Notebook.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thank you for reading the entire article. I hope you have learned something new here.</p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would appreciate it if you could endorse me for some relevant skillsets on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would also recommend that you subscribe to my <a target="_blank" href="https://youtube.com/@FahimAmin">YouTube channel</a> for regular programming-related content.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> as well.</p>
<p>Thank you so much! 😀</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Create Notice Blocks in Markdown ]]>
                </title>
                <description>
                    <![CDATA[ Markdown is a very popular lightweight markup language. It is used for writing documentation and even for creating a complete website. Therefore, almost all of us frequently use this markup language every once in a while. However, there are some limi... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-create-notice-blocks-in-markdown/</link>
                <guid isPermaLink="false">66b902c6472b70138041a576</guid>
                
                    <category>
                        <![CDATA[ markdown ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Mon, 10 Jun 2024 09:00:51 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/06/Note--Tip--Warning---Caution-specific-blocks-in-MarkDown-1.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Markdown is a very popular lightweight markup language. It is used for writing documentation and even for creating a complete website. Therefore, almost all of us frequently use this markup language every once in a while.</p>
<p>However, there are some limitations to this language. In some cases, we can not add that much styling or modifications. </p>
<p>Luckily for us, there are five highlighting features for specific segment blocks such as notice, tip, caution, important, and warning. These are also applicable in GitHub Markdown as well. </p>
<p>In this article, I am going to talk about these features in detail.</p>
<h2 id="heading-video-walkthrough">Video Walkthrough</h2>
<p>If you would like to watch a complete video with step-by-step guidelines, then you can watch the video right now!</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/HMeCXobi90E" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-how-to-create-a-note-block-in-markdown">How to Create a Note Block in Markdown</h2>
<p>Use a Note block if you want to highlight information that users should take into account – even when they are just skimming the text.</p>
<p>To write any Note related segment, you need to start it with an angle bracket ( <code>&gt;</code> ), and then you need to specify the highlighting block as Note with <code>[!NOTE]</code>.</p>
<p>After that, you need to add an angle bracket ( <code>&gt;</code> ) in each new line that you want to include in your specific Note block.</p>
<p>If you want to close the Note block, then remove the additional angle bracket in the new line.</p>
<pre><code class="lang-markdown"><span class="hljs-quote">&gt; [!NOTE]</span>
<span class="hljs-quote">&gt; I want the readers to read it carefully as it contains many important docs.</span>
</code></pre>
<p>Output:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/06/Screenshot-2024-06-09-085135.png" alt="Image" width="600" height="400" loading="lazy">
<em>Note block</em></p>
<p>You see that the preview already has a nice Note related symbol.</p>
<h2 id="heading-how-to-create-a-tip-block-in-markdown">How to Create a Tip Block in Markdown</h2>
<p>Use a Tip block if you want to provide optional information to help a user be more successful.</p>
<p>To write any Tip related segment, you need to start it with an angle bracket ( <code>&gt;</code> ), and then you need to specify the highlighting block as Tip with <code>[!TIP]</code>.</p>
<p>After that, you need to add an angle bracket ( <code>&gt;</code> ) in each new line that you want to include in your specific Tip block.</p>
<p>If you want to close the Tip block, then remove the additional angle bracket in the new line. </p>
<pre><code class="lang-markdown"><span class="hljs-quote">&gt; [!TIP]</span>
<span class="hljs-quote">&gt; Use the command line to detect and resolve the errors!</span>
</code></pre>
<p>Output:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/06/Screenshot-2024-06-09-085600.png" alt="Image" width="600" height="400" loading="lazy">
<em>Tip block</em></p>
<p>You see that the preview already has a nice Tip related symbol.</p>
<h2 id="heading-how-to-create-a-warning-block-in-markdown">How to Create a Warning Block in Markdown</h2>
<p>Use a Warning block if you want to provide critical content that demands immediate user attention due to potential risks.</p>
<p>To write any Warning related segment, you need to start it with an angle bracket ( <code>&gt;</code> ), and then you need to specify the highlighting block as a Warning with <code>[!WARNING]</code>.</p>
<p>After that, you need to add an angle bracket ( <code>&gt;</code> ) in each new line that you want to include in your specific Warning block.</p>
<p>If you want to close the Warning block, then remove the additional angle bracket in the new line. </p>
<pre><code class="lang-markdown"><span class="hljs-quote">&gt; [!WARNING]</span>
<span class="hljs-quote">&gt; DON'T DELETE THE `package.json` file!</span>
</code></pre>
<p>Output:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/06/Screenshot-2024-06-09-085842.png" alt="Image" width="600" height="400" loading="lazy">
<em>Warning block</em></p>
<p>You see that the preview already has a nice Warning related symbol.</p>
<h2 id="heading-how-to-create-a-caution-block-in-markdown">How to Create a Caution Block in Markdown</h2>
<p>Use a caution block if you want to make users aware of the potential negative consequences of an action.</p>
<p>To write any Caution related segment, you need to start it with an angle bracket ( <code>&gt;</code> ), and then you need to specify the highlighting block as a Warning with <code>[!CAUTION]</code>.</p>
<p>After that you need to add an angle bracket ( <code>&gt;</code> ) in each new line that you want to include in your specific Caution block.</p>
<p>If you want to close the Caution block, then remove the additional angle bracket in the new line. </p>
<pre><code class="lang-markdown"><span class="hljs-quote">&gt; [!CAUTION]</span>
<span class="hljs-quote">&gt; Don't execute the code without commenting the test cases.</span>
</code></pre>
<p>Output:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/06/Screenshot-2024-06-09-090155.png" alt="Image" width="600" height="400" loading="lazy">
<em>Caution block</em></p>
<p>You see that the preview already has a nice Caution related symbol.</p>
<h2 id="heading-how-to-create-an-important-block-in-markdown">How to Create an Important Block in Markdown</h2>
<p>Use an important block if you want to provide crucial information that is necessary for users to succeed.</p>
<p>To write any Important related segment, you need to start it with an angle bracket ( <code>&gt;</code> ), and then you need to specify the highlighting block as a Warning with <code>[!IMPORTANT]</code>.</p>
<p>After that, you need to add an angle bracket ( <code>&gt;</code> ) in each new line that you want to include in your specific Important block.</p>
<p>If you want to close the Important block, then remove the additional angle bracket in the new line.</p>
<pre><code class="lang-markdown"><span class="hljs-quote">&gt; [!IMPORTANT]  </span>
<span class="hljs-quote">&gt; Read the contribution guideline before adding a pull request.</span>
</code></pre>
<p>Output:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/06/Screenshot-2024-06-09-090430.png" alt="Image" width="600" height="400" loading="lazy">
<em>Important block</em></p>
<p>You see that the preview already has a nice Important related symbol.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thank you for reading the entire article. I hope you have learned something new here.</p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would appreciate it if you could endorse me for some relevant skillsets on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would also recommend you to subscribe to my <a target="_blank" href="https://youtube.com/@FahimAmin">YouTube channel</a> for regular programming related content.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> as well.</p>
<p>Thank you so much! 😀</p>
<h3 id="heading-reference">Reference</h3>
<p><a target="_blank" href="https://github.com/orgs/community/discussions/16925">[Markdown] An option to highlight a "Note" and "Warning" using blockquote (Beta) #16925</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Set a Different Location to Save All Screenshots on macOS ]]>
                </title>
                <description>
                    <![CDATA[ If you're coming to macOS from a different operating system (like Windows or Linux), it might feel odd that, by default, macOS saves screenshots in the Desktop folder. This make the desktop look messy after a while if you take a lot of screenshots! B... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-set-a-different-location-to-save-screenshots-on-mac/</link>
                <guid isPermaLink="false">66b902fd05ed142b6e64c271</guid>
                
                    <category>
                        <![CDATA[ configuration ]]>
                    </category>
                
                    <category>
                        <![CDATA[ macOS ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Productivity ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Wed, 17 Apr 2024 22:02:43 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/04/iewek-gnos-hhUx08PuYpc-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you're coming to macOS from a different operating system (like Windows or Linux), it might feel odd that, by default, macOS saves screenshots in the Desktop folder. This make the desktop look messy after a while if you take a lot of screenshots!</p>
<p>But it doesn't look messy if you create a specific directory for saving all the screenshots and your MacBook saves all the screenshots there automatically. </p>
<p>Configuring the settings might seem tricky for new MacBook users. So I will show you how you can do this within a few minutes with this step-by-step guide.</p>
<p>Keep in mind that although I am choosing the <code>Pictures/Screenshots</code> directory as my specific directory for saving all my screenshots, you can choose any directory you want.</p>
<p>For this article, I am using my newly purchased MacBook M1 Air (8/256) which is currently running on macOS Sonoma 14.4.1. But the same procedure is applicable for all the latest macOS versions as well.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/04/change-default-save-location-screenshots-mac-os-x-for-cleaner-desktop.w1456.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>A messy desktop full of screenshots :( (Source: <a target="_blank" href="https://macos.gadgethacks.com/how-to/change-default-save-location-screenshots-mac-os-x-for-cleaner-desktop-0160154/">Internet</a>)</em></p>
<h2 id="heading-how-to-choose-a-different-location">How to Choose a Different Location</h2>
<p>Firstly, you need to select a specific location where you want to save all the screenshots directly. </p>
<p>In my case, I created a separate folder for saving screenshots inside my "Pictures" directory.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/04/Screenshot-2024-04-15-at-6.24.07-PM.png" alt="Image" width="600" height="400" loading="lazy">
<em>Directory where I want to save the screenshots automatically</em></p>
<h2 id="heading-how-to-configure-the-screenshot-tool">How to Configure the Screenshot Tool</h2>
<p>Now we need to configure the default screenshot tool on macOS so that it automatically saves the screenshot images to our desired location. Here's how you can do that:</p>
<ol>
<li>Use <code>Shift</code> + <code>Command</code> + <code>5</code> to open the screenshot tool.</li>
<li>Click on "Options". Then click "Other Location...".</li>
<li>Select that specific location that you created earlier. </li>
<li>Now click "Ok", or "Open", or whatever it says to confirm that new location.</li>
</ol>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/04/IMG_20240415_175823.jpg" alt="Image" width="600" height="400" loading="lazy">
<em>Screenshot tool's options. I captured it using my phone. :)</em></p>
<p>That's it! From now on, whenever you use the default screenshot tool, it will automatically save all the screenshots in that newly specified location. This will help your desktop remain clutter free!</p>
<h2 id="heading-screenshot-shortcut">Screenshot Shortcut</h2>
<p>There are many people who still open the Screenshot tool using Spotlight or the launchpad. But there is a dedicated shortcut key for that!</p>
<p>You can use <code>Shift</code> + <code>Command</code> + <code>3</code> to take screenshot directly and save yourself a little time.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>I hope you have learned something new from this article.</p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would appreciate it if you could endorse me for some relevant skillsets on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> (<a target="_blank" href="https://fahimbinamin.com/">https://fahimbinamin.com/</a>) as well.</p>
<p>Thank you so much! 😀</p>
<p>Cover image: Photo by <a target="_blank" href="https://unsplash.com/@imkirk?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Iewek Gnos</a> on <a target="_blank" href="https://unsplash.com/photos/macbook-pro-on-white-wooden-desk-hhUx08PuYpc?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Unsplash</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Compress Files to ".gz" on the Windows Operating System ]]>
                </title>
                <description>
                    <![CDATA[ You may often need to compress files and folders for various reasons. And "Gzip" compression is a good choice for many scenarios.  Recently, I have faced an issue where I needed to compress a lot of files individually, and manual intervention to comp... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-convert-files-to-gzip-on-windows/</link>
                <guid isPermaLink="false">66b902c3558588891017dd82</guid>
                
                    <category>
                        <![CDATA[ compression ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Windows ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Fri, 01 Mar 2024 19:15:53 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/02/freeCodeCamp---Fahim.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>You may often need to compress files and folders for various reasons. And "Gzip" compression is a good choice for many scenarios. </p>
<p>Recently, I have faced an issue where I needed to compress a lot of files individually, and manual intervention to compress each file one by one using traditional 7zip became a hassle.</p>
<p>If you are in love with the Windows operating system like I am (I know, I know, sometimes Windows can become quite a pain. Maybe I like the pain and also like to resolve issues all by myself, who knows!), then you may also face issues in batch processing compressing multiple files to the <code>.gzip</code> format.</p>
<p>There are multiple ways to compress a file into the <code>.gzip</code> format. The main issue is that most of the ways do not support batch processing the conversion. In this article, I will talk about two of the decent ways you can do this.</p>
<h2 id="heading-method-1-using-7zip-no-batch-processing">Method 1: Using 7zip (No Batch Processing)</h2>
<p><a target="_blank" href="https://www.7-zip.org/">7zip</a> is a free software available for Windows, Linux, and ARM64. Installing 7zip in the Windows operating system is very simple and straightforward.</p>
<p>If you simply want to compress any single file to <code>.gzip</code> format, you need to simply select that file and add it to the 7zip archive. In the GUI, you can select the Archive format as "gzip" and that's it!</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-21_12-36.png" alt="Image" width="600" height="400" loading="lazy">
<em>gzip in 7zip</em></p>
<h2 id="heading-method-2-using-gzip-from-chocolatey-batch-processing-is-the-main-benefit-of-this">Method 2: Using <code>gzip</code> from Chocolatey (Batch Processing is the Main Benefit of This)</h2>
<p>There are several tools that we can use to compress files and folders on our computers. However, Linux-based operating systems come with a lot of tools and there are a lot of CLI (Command Line Interface) type tools that we can also use to compress multiple files altogether in a batch. </p>
<p>If you use Linux based operating system, then you might have also used GZip. Gzip is a file format and software application that compresses and decompresses files. It also makes files smaller and allows for faster network transfers. However, there are not any official installers of GZip for the Windows operating system.</p>
<p>But, we can install "gzip" directly on Windows and work like we're in a Linux OS. I prefer to download GZip via <a target="_blank" href="https://chocolatey.org/">Chocolatey</a>, a very good package manager for the Windows operating system. </p>
<blockquote>
<p>Chocolatey is a machine-level, command-line package manager and installer for software on Microsoft Windows. It uses the NuGet packaging infrastructure and Windows PowerShell to simplify the process of downloading and installing software.</p>
</blockquote>
<p>If you are using Chocolatey for the first time, then you need to install it first. All of the methods are explained in detail on their official website: <a target="_blank" href="https://chocolatey.org/install">https://chocolatey.org/install</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-21_12-48.png" alt="Image" width="600" height="400" loading="lazy">
<em>Chocolatey Installation</em></p>
<p>Open your Terminal and run the command for installing "gzip".</p>
<pre><code class="lang-powershell">choco install gzip
</code></pre>
<p>Write "Yes" when it asks for your permission. After a few seconds, you should be ready to use it.</p>
<p>Let's say I want to batch-compress a lot of files into ".gzip". I can open my terminal and go to that directory (where my raw files are that I want to compress using gzip) using the <code>cd path/to/where/I/have/the/files</code> command. </p>
<p>Or, I can simply open my terminal directly using the "Open In Terminal" context menu in that specific directory where I have the files that I want to compress using gzip. Then I can simply use the following command.</p>
<pre><code class="lang-powershell">gzip * <span class="hljs-literal">-r</span>
</code></pre>
<p>This will iterate through every folder and subfolder in that specific location and compress all of the files to <code>.gzip</code> recursively (the <code>-r</code> flag). Keep in mind that it will <strong>replace</strong> all your files to <code>.gzip</code> in that directory.</p>
<p><strong>But</strong>, if you also want to keep the original files side by side during the batch compression process, you can use the command below.</p>
<pre><code class="lang-bash">gzip * -r -k
</code></pre>
<p>Here, the <code>-k</code> flag indicates the <code>--keep</code> option to keep the original files.</p>
<p><strong>If</strong> you want to use all your CPU cores in parallel, then follow the command below.</p>
<pre><code class="lang-bash">parallel gzip ::: *
</code></pre>
<p>You have to add the necessary suffixes to suit your needs obviously in this process.</p>
<p>That's it!</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>I hope you have gained some valuable insights from this article.</p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. I would appreciate it if you could endorse me for some relevant skillsets of mine on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> (<a target="_blank" href="https://fahimbinamin.com/">https://fahimbinamin.com/</a>) as well.</p>
<p>Thank you so much!</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Download a Kaggle Dataset Directly to a Google Colab Notebook ]]>
                </title>
                <description>
                    <![CDATA[ Kaggle is a popular data science-based competition platform that has a large online community of data scientists and machine learning engineers. The platform contains a ton of datasets and notebooks that you can use to learn and practice your data sc... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-download-kaggle-dataset-to-google-colab/</link>
                <guid isPermaLink="false">66b902cb941d2f900bad52a6</guid>
                
                    <category>
                        <![CDATA[ Data Science ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Google Colab ]]>
                    </category>
                
                    <category>
                        <![CDATA[ kaggle ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Machine Learning ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Thu, 08 Feb 2024 19:39:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2024/02/Kaggle-to-Colab.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p><a target="_blank" href="https://www.kaggle.com/">Kaggle</a> is a popular data science-based competition platform that has a large online community of data scientists and machine learning engineers.</p>
<p>The platform contains a ton of datasets and notebooks that you can use to learn and practice your data science and machine learning skills. They even have competitions you can participate in.</p>
<p>Kaggle offers a 100% free platform for all users – but there are some restrictions depending on the resources you're using. </p>
<p>For example, you can use their CPU system for an unlimited amount of time. But there are strict limitations on GPU and TPU usage. You can use their GPU for 30 hours and TPU for 20 hours in a week. It gets resets each week, and then you get a fresh 30 hours GPU usage and 20 hours TPU usage at the start of the new week.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_14-21.png" alt="Image" width="600" height="400" loading="lazy">
<em>Kaggle Website</em></p>
<p>Alongside Kaggle, there are another popular platforms for machine learning engineers and data scientists – like <a target="_blank" href="https://colab.google/">Google Colaboratory</a>, or Google Colab for short.</p>
<p>In Google Colab, you can also use their CPU and GPU, but the free versions have more limitations than the free Kaggle account. In Google Colab, you can not get any GPU computational power until they allocate it from their free units. You don't know how many hours you can use, and you don't even know if you have any chance to get units over the next few days. </p>
<p>In order to get all the features, you need to subscribe to their pro plans which are quite expensive.</p>
<p>But sometimes you still may want to use Colab, in most cases for short tasks. In Colab, you can directly connect your Google Drive and use your datasets from there. You can also store your output from the notebook to Google Drive if you want.</p>
<p>When you're working on a project, though, sometimes you'll want to use datasets from Kaggle in Google Colab. So you'll need to download the dataset from Kaggle and upload that to Colab's temporary storage or your Google Drive. </p>
<p>You can probably guess that this is a very time-consuming process. </p>
<p>But there is a way that you can directly download a Kaggle dataset using an API call in the Google Colab's notebook! In this article, I am going to show you how you can do that.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<p>I've broken this tutorial down into separate parts for better understanding. You can get a clear overview of the entire article here:</p>
<ul>
<li><a class="post-section-overview" href="#heading-types-of-kaggle-datasets">Types of Kaggle datasets</a></li>
<li><a class="post-section-overview" href="#heading-prerequisites">Prerequisites</a></li>
<li><a class="post-section-overview" href="#setup-google-colab-for-using-kaggle-api">Setup Google Colab for using Kaggle API</a></li>
<li><a class="post-section-overview" href="#install-kaggle-library">Install Kaggle library</a></li>
<li><a class="post-section-overview" href="#heading-mount-google-drive-to-colab">Mount Google Drive to Colab</a></li>
<li><a class="post-section-overview" href="#add-the-kaggle-api-token-to-colab-notebook">Add the Kaggle API Token to Colab Notebook</a></li>
<li><a class="post-section-overview" href="#download-kaggle-dataset">Download Kaggle dataset</a></li>
<li><a class="post-section-overview" href="#download-kaggle-competition-dataset">Download Kaggle Competition dataset</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/p/906afd5c-ae59-4f19-9fe3-662d110d63a7/download-specifc-file-from-kaggle-competition-dataset">Download Specifc file from Kaggle Competition dataset</a></li>
<li><a class="post-section-overview" href="#heading-conclusion">Conclusion</a></li>
</ul>
<h2 id="heading-video">Video</h2>
<p>If you would like to watch all of the steps from a video, you're in luck – I made this video just for you:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/7Z0s-XDXR1E" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-types-of-kaggle-datasets">Types of Kaggle Datasets</h2>
<p>Normally Kaggle provides two types of datasets: typical datasets that anyone can upload, and competition datasets. In the competition datasets, the competition organizers typically add/upload the datasets. </p>
<p>Even though you can download a Kaggle dataset easily, you can't download a competition dataset if you don't participate in that competition. But some competitions remain open, and you can access their datasets via "Late Submission". So just make sure to check.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>To go through this tutorial and get the most ouf of it, you'll need a Kaggle account, and that is completely free. Simply head over to the official website of <a target="_blank" href="https://www.kaggle.com/">Kaggle</a>, and create an account if you don't have one already.</p>
<p>You'll also need Kaggle's API. Head over to the <a target="_blank" href="https://www.kaggle.com/settings">settings</a> of your Kaggle account. Go to the API section, and click "Create New Token". Keep in mind that Kaggle does not allow you to keep multiple tokens. You can use only one active token for your Kaggle account.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_14-52.png" alt="Image" width="600" height="400" loading="lazy">
<em>Kaggle API Token</em></p>
<p>This will give you a <code>kaggle.json</code> file. Keep it safe, as you'll need to use it later.</p>
<p>You also need a Google account if you want to use Google Colab. You may already have one, but if you don't, go ahead and create a new account in Google.</p>
<p>Now, you can store your Kaggle JSON in your Google drive. I prefer to create a new folder and keep my JSON file there so that I can call that in Colab whenever I want.</p>
<h2 id="heading-how-to-setup-google-colab-to-use-the-kaggle-api">How to Setup Google Colab to Use the Kaggle API</h2>
<p>You can simply open any Colab notebook where you want to use the Kaggle API to download the dataset.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_15-45.png" alt="Image" width="600" height="400" loading="lazy">
<em>Google Colab</em></p>
<h3 id="heading-install-the-kaggle-library">Install the Kaggle library</h3>
<p>You need to install the Kaggle Python library before you start working with Kaggle. You can simply install it in the colab notebook using the command <code>! pip install kaggle</code>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_15-46.png" alt="Image" width="600" height="400" loading="lazy">
<em>Install Kaggle library in colab</em></p>
<h3 id="heading-mount-google-drive-to-colab">Mount Google Drive to Colab</h3>
<p>Now you need to mount your Google Drive to the Colab notebook, since you've uploaded your <code>kaggle.json</code> file inside your Google drive.</p>
<p>You can simply do that by using the two lines of code given below:</p>
<pre><code class="lang-python"><span class="hljs-keyword">from</span> google.colab <span class="hljs-keyword">import</span> drive
drive.mount(<span class="hljs-string">'/content/drive'</span>)
</code></pre>
<p>Make sure to give it permission to access your Google Drive:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_15-48.png" alt="Image" width="600" height="400" loading="lazy">
<em>Give access to Google Drive</em></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_15-49.png" alt="Image" width="600" height="400" loading="lazy">
<em>Mount Google Drive</em></p>
<p>If you refresh the mounted folder icon, you will see your Google Drive and all of the content in the notebook.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_15-49_1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Find MyDrive in Notebook</em></p>
<h3 id="heading-add-the-kaggle-api-token-to-the-colab-notebook">Add the Kaggle API Token to the Colab Notebook</h3>
<p>Now you need to add the Kaggle API token to the notebook. But before that, you can simply create a temporary directory for Kaggle at the temporary instance location on the Colab drive by using the command <code>! mkdir ~/.kaggle</code>.</p>
<p>Now you need to copy your uploaded JSON file to that temporary Kaggle directory. You need the URL where you uploaded your JSON file earlier. You can grab that link directly from the drive folder in the notebook.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/Screenshot-2024-02-08-155504.png" alt="Image" width="600" height="400" loading="lazy">
<em>Copy JSON file location</em></p>
<p>You can get the path directly like this. </p>
<p>Then you can use the copy command like below:</p>
<pre><code class="lang-bash">! cp kaggle_json_path ~/.kaggle/
</code></pre>
<p>For example, my JSON file is located at "/content/drive/MyDrive/Kaggle_API/kaggle.json", so my command would be:</p>
<pre><code class="lang-bash">! cp /content/drive/MyDrive/Kaggle_API/kaggle.json ~/.kaggle/
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_15-58_1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Copy JSON file</em></p>
<p>Now you need to change the file permissions to read/write to the owner only for safety.</p>
<p>You can use the command below to achive that:</p>
<pre><code class="lang-bash">! chmod 600 ~/.kaggle/kaggle.json
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_15-59.png" alt="Image" width="600" height="400" loading="lazy">
<em>Change file permission of kaggle.json file</em></p>
<h2 id="heading-how-to-download-the-kaggle-dataset">How to Download the Kaggle Dataset</h2>
<p>For downloading a typical Kaggle dataset, you have to find the dataset on Kaggle first.</p>
<p>Let's say I want to download the following dataset from Kaggle:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-01.png" alt="Image" width="600" height="400" loading="lazy">
<em>Sample dataset</em></p>
<p>Check the complete URL of the dataset, which in this case is:</p>
<p><a target="_blank" href="https://www.kaggle.com/datasets/mdfahimbinamin/fastsurfer-processed-3d-brain-mri-from-adni">https://www.kaggle.com/datasets/mdfahimbinamin/fastsurfer-processed-3d-brain-mri-from-adni</a></p>
<div class="embed-wrapper"><div class="embed-loading"><div class="loadingRow"></div><div class="loadingRow"></div></div><a class="embed-card" href="https://www.kaggle.com/datasets/mdfahimbinamin/fastsurfer-processed-3d-brain-mri-from-adni">https://www.kaggle.com/datasets/mdfahimbinamin/fastsurfer-processed-3d-brain-mri-from-adni</a></div>
<p>We need the "account_name_of_the_dataset_owner/dataset_path" string. From the URL, the account name of the dataset owner is mdfahimbinamin. The dataset path is fastsurfer-processed-3d-brain-mri-from-adni.</p>
<p>So to download this exact dataset from Kaggle to your Google colab, your command would be:</p>
<pre><code class="lang-bash">! kaggle datasets download mdfahimbinamin/fastsurfer-processed-3d-brain-mri-from-adni
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-06.png" alt="Image" width="600" height="400" loading="lazy">
<em>Downloading the Kaggle dataset to your Colab notebook</em></p>
<p>The entire process happens on Google's Cloud PC. So the downloading speed should be quite fast.</p>
<p>By default, the datasets come as <code>.zip</code> file. So if you need to unzip that, you can simply use the command below:</p>
<pre><code class="lang-bash">! unzip dataset-path.zip
</code></pre>
<p>For example, my dataset name/path was "fastsurfer-processed-3d-brain-mri-from-adni". So I will use the following command:</p>
<pre><code class="lang-bash">! unzip fastsurfer-processed-3d-brain-mri-from-adni.zip
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-09.png" alt="Image" width="600" height="400" loading="lazy">
<em>Unzip Kaggle Dataset</em></p>
<p>That's it! 😊</p>
<h2 id="heading-how-to-download-a-kaggle-competition-dataset">How to Download a Kaggle Competition Dataset</h2>
<p>Before downloading a Competition dataset, you need to make sure that either you have joined that competition or that you've selected "Late Submission" using the same Kaggle account that you're using for Kaggle API token.</p>
<p>Suppose I'm joining the ConnectX competition on Kaggle.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-15.png" alt="Image" width="600" height="400" loading="lazy">
<em>Connect X competition</em></p>
<p>I need to click "Join Competition" to get access to their dataset.</p>
<p>But if I want to download a dataset from a past competition, I need to join their "Late Submission" to gain their dataset.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-16.png" alt="Image" width="600" height="400" loading="lazy">
<em>Join a past competition</em></p>
<p>After clicking on "Late Submission", I need to grab the URL. This time, I'm using the Binary Classification with a Bank Churn Dataset. The complete URL is: <a target="_blank" href="https://www.kaggle.com/competitions/playground-series-s4e1/overview">https://www.kaggle.com/competitions/playground-series-s4e1/overview</a></p>
<p>From the URL, I can see that the dataset is located at "playground-series-s4e1". So I will use the following command to download the dataset to my Google Colab notebook:</p>
<pre><code class="lang-bash">! kaggle competitions download playground-series-s4e1
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-19.png" alt="Image" width="600" height="400" loading="lazy">
<em>Download dataset</em></p>
<p>That's it! 😊</p>
<h2 id="heading-how-to-download-a-specific-file-from-a-kaggle-competition-dataset">How to Download a Specific File from a Kaggle Competition Dataset</h2>
<p>Let's say, I want to download a specific file from a Kaggle competition dataset. I can also do that.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-21.png" alt="Image" width="600" height="400" loading="lazy">
<em>dataset</em></p>
<p>In the dataset used above, you can see that there are 3 files. Let's say I want to download the <code>test.csv</code> file only. </p>
<p>To do this, the command would be strucutred like this: <code>! kaggle competitions download dataset-path -f file_name_with_extension</code>.</p>
<p>So my command would be:</p>
<pre><code class="lang-bash">! kaggle competitions download playground-series-s4e1 -f test.csv
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2024/02/2024-02-08_16-23.png" alt="Image" width="600" height="400" loading="lazy">
<em>Download specific file</em></p>
<p>That's it! 😊</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>I hope you have gained some valuable insights from the article.</p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> (<a target="_blank" href="https://fahimbinamin.com/">https://fahimbinamin.com/</a>) as well!</p>
<p>If you like to watch programming and technology-related videos, then you can check my <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">YouTube channel</a>, too. You can also check my other writings on <a target="_blank" href="https://dev.to/fahimfba">Dev.to</a>.</p>
<p>All the best for your programming and development journey. 😊</p>
<p>You can do it! Don't give up, never! ❤️</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Comment Your JavaScript Code ]]>
                </title>
                <description>
                    <![CDATA[ Writing comments in JavaScript is crucial for code readability, maintainability, and developer collaboration. Comments serve as notes within the codebase, explaining its functionality and logic, or providing context.  In this article, I will explain ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/comment-your-javascript-code/</link>
                <guid isPermaLink="false">66b902ae472b70138041a570</guid>
                
                    <category>
                        <![CDATA[ best practices ]]>
                    </category>
                
                    <category>
                        <![CDATA[ code comments ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Mon, 11 Dec 2023 21:55:46 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/12/Comment-Your-JS-Code-fCC.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Writing comments in JavaScript is crucial for code readability, maintainability, and developer collaboration. Comments serve as notes within the codebase, explaining its functionality and logic, or providing context. </p>
<p>In this article, I will explain the significance of commenting your code, best practices to follow, and examples showcasing effective commenting in JavaScript.</p>
<h2 id="heading-why-comments-are-important-in-javascript">Why Comments are Important in JavaScript</h2>
<h3 id="heading-they-enhance-code-readability">They enhance code readability:</h3>
<p>Comments provide clarity to code, making it easier for developers to understand the code's purpose and functionality. Comments act as a guide, especially when you need to revisit older code after a period of time.</p>
<p>Consider this un-commented code:</p>
<pre><code class="lang-javascript"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">calculateTotal</span>(<span class="hljs-params">price, quantity</span>) </span>{
    <span class="hljs-keyword">return</span> price * quantity;
}

<span class="hljs-keyword">let</span> totalPrice = calculateTotal(<span class="hljs-number">25</span>, <span class="hljs-number">5</span>);
<span class="hljs-built_in">console</span>.log(totalPrice); <span class="hljs-comment">// Output: 125</span>
</code></pre>
<p>It is quite difficult for us to understand what the code does, right? Now, let's add comments for clarity:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Calculates the total cost by multiplying the price per item with the quantity</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">calculateTotal</span>(<span class="hljs-params">price, quantity</span>) </span>{
    <span class="hljs-keyword">return</span> price * quantity;
}

<span class="hljs-comment">// Example usage: Calculates the total price for 5 items at $25 each by multiplying the price per item ($25) with the quantity (5), and stores the result in the totalPrice variable.</span>
<span class="hljs-keyword">let</span> totalPrice = calculateTotal(<span class="hljs-number">25</span>, <span class="hljs-number">5</span>);
<span class="hljs-built_in">console</span>.log(totalPrice); <span class="hljs-comment">// Output: 125</span>
</code></pre>
<p>With comments, it is quite understandable what each part of the code does, and it also enhances its readability.</p>
<h3 id="heading-they-facilitate-collaboration">They facilitate collaboration:</h3>
<p>In a team environment, comments aid collaboration by allowing developers to comprehend each other's code, making it easier to work together on projects.</p>
<p>Imagine working in a team where different developers handle various parts of a project. Clear comments aid in understanding each other's code. Here's an example:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Validates the format of the provided email address using a regular expression, which checks for the presence of "@" symbol, domain name, and top-level domain (TLD) in the email</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">validateEmail</span>(<span class="hljs-params">email</span>) </span>{
    <span class="hljs-comment">// Regular expression pattern to match the standard email format</span>
    <span class="hljs-keyword">const</span> emailRegex = <span class="hljs-regexp">/^[^\s@]+@[^\s@]+\.[^\s@]+$/</span>;
    <span class="hljs-keyword">return</span> emailRegex.test(email);
}
</code></pre>
<p>In a collaborative setting, another developer can quickly comprehend the purpose of the <code>validateEmail</code> function due to the comment, enabling smoother teamwork. This would've been very difficult without the comments indicating what the code block does.</p>
<h3 id="heading-they-make-maintenance-and-debugging-easier">They make maintenance and debugging easier:</h3>
<p>Well-commented code simplifies maintenance and debugging. Comments can highlight potential issues, outline the reasoning behind specific solutions, and aid in locating bugs.</p>
<p>Comments assist in debugging and maintaining code. Consider the following commented code:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Finds the maximum number between num1 and num2 using a ternary operator for comparison and returns the larger number</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">findMax</span>(<span class="hljs-params">num1, num2</span>) </span>{
    <span class="hljs-comment">/* Using ternary operator to compare num1 and num2
       and return the larger number */</span>
    <span class="hljs-keyword">return</span> (num1 &gt; num2) ? num1 : num2;
}
</code></pre>
<p>If a bug arises or modifications are needed, the comment clarifies the logic used, aiding in swift debugging or updates.</p>
<h2 id="heading-best-practices-for-commenting-in-javascript">Best Practices for Commenting in JavaScript</h2>
<h3 id="heading-use-descriptive-comments">Use descriptive comments:</h3>
<p>Explain the purpose of functions, variables, or complex logic using descriptive comments. This helps other developers, including your future self, understand the code's intention.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Calculates the area of a circle using the provided radius by multiplying the square of the radius by the mathematical constant π (pi)</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">calculateCircleArea</span>(<span class="hljs-params">radius</span>) </span>{
    <span class="hljs-keyword">return</span> <span class="hljs-built_in">Math</span>.PI * radius * radius;
}
</code></pre>
<p>Descriptive comments like this explain the purpose of functions or operations, aiding in understanding the code's intention.</p>
<h3 id="heading-avoid-over-commenting">Avoid over-commenting:</h3>
<p>While comments are beneficial, excessive commenting can clutter the code. Aim for a balance where comments add value without stating the obvious.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Variable to store user data</span>
<span class="hljs-keyword">let</span> userData = fetchUserData(); <span class="hljs-comment">// Fetch user data from the server</span>
</code></pre>
<p>In this case, the comment merely reiterates what the code already expresses clearly. Avoiding over-commenting maintains code clarity.</p>
<h3 id="heading-update-comments-regularly">Update comments regularly:</h3>
<p>As code evolves, ensure comments remain accurate and aligned with the code changes. Outdated comments can lead to confusion.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Function to calculate the area of a rectangle</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">calculateRectangleArea</span>(<span class="hljs-params">length, width</span>) </span>{
    <span class="hljs-keyword">return</span> length * width;
    <span class="hljs-comment">// Updated comment: Area calculated by multiplying length and width</span>
}
</code></pre>
<p>Ensuring that comments align with the current functionality or logic of the code is vital for accurate documentation.</p>
<h3 id="heading-comment-complex-sections">Comment complex sections:</h3>
<p>When dealing with intricate algorithms or unconventional solutions, detailed comments explaining the logic can be immensely helpful.</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Performs a complex calculation on the provided data, involving multiple steps including data preprocessing, calculation based on preprocessed data, and returning the final result</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">performComplexCalculation</span>(<span class="hljs-params">data</span>) </span>{
    <span class="hljs-comment">/* 
        Complex logic involving multiple steps:
        - Step 1: Data preprocessing
        - Step 2: Calculation based on preprocessed data
        - Step 3: Final result
    */</span>
    <span class="hljs-comment">// ... complex calculation logic</span>
}
</code></pre>
<p>For intricate algorithms or multi-step processes, detailed comments explaining each step can immensely aid in understanding.</p>
<h2 id="heading-types-of-comments-in-javascript">Types of Comments in JavaScript</h2>
<h3 id="heading-single-line-comments">Single-line comments:</h3>
<p>In JavaScript, single-line comments start with <code>//</code>. They're suitable for brief explanations or annotating specific lines. Keep in mind that the two forward slashes don't have any spaces between them.</p>
<p>Example:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// This function calculates the square of a number</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">square</span>(<span class="hljs-params">number</span>) </span>{
    <span class="hljs-keyword">return</span> number * number;
}
</code></pre>
<h3 id="heading-multi-line-comments">Multi-line comments:</h3>
<p>Multi-line comments begin with <code>/*</code> and end with <em><code>/</code>.</em> They are useful for commenting out blocks of code or providing longer explanations. Keep in mind that the forward slash and the asterisk (<code>*</code>) don't have any spaces between them.</p>
<p>Example:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">/*
    This block of code finds the maximum of two numbers
    and returns the larger number.
*/</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">findMax</span>(<span class="hljs-params">num1, num2</span>) </span>{
    <span class="hljs-comment">// Logic to find the maximum</span>
    <span class="hljs-keyword">return</span> (num1 &gt; num2) ? num1 : num2;
}
</code></pre>
<h3 id="heading-jsdoc-comments">JSDoc comments:</h3>
<p>JSDoc is a convention for adding comments to JavaScript code that enables the automatic generation of documentation. It uses a specific syntax to describe functions, parameters, return values, and so on.</p>
<p>Example:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">/**
 * Calculates the area of a rectangle
 * <span class="hljs-doctag">@param <span class="hljs-type">{number}</span> <span class="hljs-variable">length</span></span> - The length of the rectangle
 * <span class="hljs-doctag">@param <span class="hljs-type">{number}</span> <span class="hljs-variable">width</span></span> - The width of the rectangle
 * <span class="hljs-doctag">@returns <span class="hljs-type">{number}</span> </span>- The area of the rectangle
 */</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">calculateArea</span>(<span class="hljs-params">length, width</span>) </span>{
    <span class="hljs-keyword">return</span> length * width;
}
</code></pre>
<h2 id="heading-practice-commenting-your-code">Practice Commenting Your Code 📝✍️</h2>
<p>Learning without practicing is an incomplete process. So here's <a target="_blank" href="https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code"><strong>a learning challenge from the freeCodeCamp Certification Course</strong></a> where you will learn how comments work in JavaScript, and how you can use them in your code. </p>
<p>In this challenge, you will try to understand how single-line comments and multiline comments work.</p>
<p>I've included the solution next in case you can't solve the challenge yourself.</p>
<p>If you'd like to watch a video on this topic as well, you can find it here:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/oqFs3bRQDSY" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-the-solution-to-the-challenge">The Solution to the Challenge</h2>
<p>Make sure that you have tried to solve this challenge on your own before checking my solution.</p>
<p>Alright, if you're ready...here it is:</p>
<pre><code class="lang-javascript"><span class="hljs-comment">// Fahim</span>

<span class="hljs-comment">/*
My
Name
Is
Fahim
*/</span>
</code></pre>
<p>The first one is the single-line comment, and the second one is the multi-line comment.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Commenting on JavaScript code is an essential practice in software development. It improves code comprehension, aids collaboration, and facilitates maintenance and debugging. </p>
<p>By following best practices and using various comment types, we can create codebases that are easier to understand, maintain, and build upon.</p>
<p>I hope you have gained some valuable insights from the article. </p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> (<a target="_blank" href="https://fahimbinamin.com/">https://fahimbinamin.com/</a>) as well!</p>
<p>If you like to watch programming and technology-related videos, then you can check my <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">YouTube channel</a>, too. You can also check my other writings on <a target="_blank" href="https://dev.to/fahimfba">Dev.to</a>.</p>
<p>All the best for your programming and development journey. 😊</p>
<p>You can do it! Don't give up, never! ❤️</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Install Node.js on Ubuntu – Node Linux Installation Guide ]]>
                </title>
                <description>
                    <![CDATA[ If you are a web developer working on the frontend or the backend, you'll want to have Node.js installed on your system.  But if you use the typical sudo apt install nodejs command, it may install a very old version of Node which can be troublesome f... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-install-node-js-on-ubuntu/</link>
                <guid isPermaLink="false">66b902ede26f442bbe4b2770</guid>
                
                    <category>
                        <![CDATA[ Linux ]]>
                    </category>
                
                    <category>
                        <![CDATA[ node ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ubuntu ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Fri, 20 Oct 2023 19:29:06 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/10/programming-development-technology-work-at-night-2022-01-19-00-14-46-utc-1.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you are a web developer working on the frontend or the backend, you'll want to have <strong>Node.js</strong> installed on your system. </p>
<p>But if you use the typical <code>sudo apt install nodejs</code> command, it may install a very old version of Node which can be troublesome for you.</p>
<p>So you'll want to install a specific version, which requires a different command. This will install the LTS (Long-Term Support) version of Node which is useful for devs because it has a longer period for support. </p>
<p>Today, I am going to show you how you can install the latest LTS version of Node on your Ubuntu operating system. </p>
<p>This processes will work on any kind of Debian-based Linux operating system (Ubuntu, Mint, Zorin, Debian, Elementary OS, and so on). It'll work whether you are using that as your main operating system, secondary operating system on dual boot, WSL on Windows, or using in a virtual machine (VMware Workstation, VirtualBox, and so on).</p>
<h2 id="heading-video-tutorial">Video Tutorial</h2>
<p>I have also created a complete video to show you the process step-by-step. You can watch it here:</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/g4Enhyn1o-4" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p>At the time of writing this article, the latest LTS version for Node is 18.18.2.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-141242.png" alt="Image" width="600" height="400" loading="lazy">
<em>Node download page showing current LTS version</em></p>
<p>When you install Node following the instructions in this article, it will install the latest LTS version of Nodejs automatically. So you'll be safe without any hassle if you simply follow this article and the accompanying video.</p>
<h2 id="heading-update-your-operating-system">Update Your Operating System</h2>
<p>First, you'll want to ensure that you have installed all the updates beforehand. I like to work in the terminal mostly, so I'll install the updates using the terminal directly. </p>
<p>For updating to the latest versions of all the relevant packages, use <code>sudo apt update</code> in the terminal. Use your password when it asks for that.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-104647.png" alt="Image" width="600" height="400" loading="lazy">
<em>Updating all relevant packages</em></p>
<p>Now use <code>sudo apt upgrade -y</code> to upgrade all the upgradable packages.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-120347.png" alt="Image" width="600" height="400" loading="lazy">
<em>Upgrading all relevant packages</em></p>
<h2 id="heading-install-curl">Install CURL</h2>
<p>We're using the <strong>Node Version Manager (NVM)</strong> here to install Node. There are various advantages when we install Node and npm using the NVM as it also allows us to manage multiple versions of Node.js on our system altogether. </p>
<p>First, you'll need to install <code>curl</code> if it's not installed on your system already. You can install curl by using the command below:</p>
<pre><code class="lang-bash">sudo apt install curl -y
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-122355.png" alt="Image" width="600" height="400" loading="lazy">
<em>Installing CURL</em></p>
<h2 id="heading-how-to-install-nodejs">How to Install Node.js</h2>
<p>Now you'll need to follow these steps in order to ensure that you've installed Node.js successfully on your system.</p>
<h3 id="heading-install-node-version-manager-nvm">Install Node Version Manager (NVM)</h3>
<p>Install the Node Version Manager (NVM) by using the following command:</p>
<pre><code class="lang-bash">curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-122423.png" alt="Image" width="600" height="400" loading="lazy">
<em>Installing the Node Version Manager (NVM)</em></p>
<p>When you run this specific command, the curl downloads the NVM installation script from that specific URL. Afterward, bash executes the same script for installing NVM.</p>
<h3 id="heading-activate-nvm">Activate NVM</h3>
<p>Activate the NVM using the command below:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">source</span> ~/.bashrc
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-122517.png" alt="Image" width="600" height="400" loading="lazy">
<em>Activating the Node Version Manager (NVM)</em></p>
<h3 id="heading-install-the-latest-lts-version-of-node">Install the latest LTS version of Node</h3>
<p>Install the latest Long Term Support version of Node by using the command below:</p>
<pre><code class="lang-bash">nvm install --lts
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-122656.png" alt="Image" width="600" height="400" loading="lazy">
<em>Command for installing the latest LTS version of Node.js</em></p>
<p>It installs the latest version of the LTS release of Node by default. </p>
<h3 id="heading-make-the-default-lts-version-as-nvm">Make the default LTS version as NVM</h3>
<p>We have installed the latest LTS version of Node, but we also need to set the default version of NVM so that it gets used by default whenever we need it. You can use the command below to do that. Make sure to change the version to the exact LTS version you have installed on your system just now. </p>
<pre><code class="lang-bash">nvm <span class="hljs-built_in">alias</span> default 18.18.2
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-122842.png" alt="Image" width="600" height="400" loading="lazy">
<em>Selecting the appropriate Node version as the default version</em></p>
<p>If your LTS version is something like <code>24.1.2</code> then the command would be like below:</p>
<pre><code class="lang-bash">nvm <span class="hljs-built_in">alias</span> default 24.1.2
</code></pre>
<h3 id="heading-confirm-that-node-was-installed">Confirm that Node was installed</h3>
<p>Use the command below to check whether the default version is the exact version you just installed:</p>
<pre><code class="lang-bash">node -v npm -v
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-122937.png" alt="Image" width="600" height="400" loading="lazy">
<em>Showing the current version of Node installed</em></p>
<h2 id="heading-how-to-set-up-the-nodejs-environment">How to Set Up the Node.js Environment</h2>
<p>After installing Node and NPM, you need to set up the Node environment by creating a new Node project.</p>
<p>Use the command below to create a new directory/folder where you want to test a simple "Hello World" type Node project.</p>
<pre><code class="lang-bash">mkdir my-node-project
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-123101.png" alt="Image" width="600" height="400" loading="lazy">
<em>Creating a new directory/folder to test a simple "Hello World" program on Node</em></p>
<p>Navigate to the <code>my-node-project</code> directory by using the command below:</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> my-node-project
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-123148.png" alt="Image" width="600" height="400" loading="lazy">
<em>Changing the directory to enter into that newly created directory/folder</em></p>
<p>Initialize the new Node project like this:</p>
<pre><code class="lang-bash">npm init -y
</code></pre>
<p>This command will create a "package.json" file containing your project's metadata and dependencies. Here is the JSON output:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-123304-1.png" alt="Image" width="600" height="400" loading="lazy">
<em>Initializing npm in the folder</em></p>
<p>The JSON output is below:</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"name"</span>: <span class="hljs-string">"my-node-project"</span>,
  <span class="hljs-attr">"version"</span>: <span class="hljs-string">"1.0.0"</span>,
  <span class="hljs-attr">"description"</span>: <span class="hljs-string">""</span>,
  <span class="hljs-attr">"main"</span>: <span class="hljs-string">"index.js"</span>,
  <span class="hljs-attr">"scripts"</span>: {
    <span class="hljs-attr">"test"</span>: <span class="hljs-string">"echo \"Error: no test specified\" &amp;&amp; exit 1"</span>
  },
  <span class="hljs-attr">"keywords"</span>: [],
  <span class="hljs-attr">"author"</span>: <span class="hljs-string">""</span>,
  <span class="hljs-attr">"license"</span>: <span class="hljs-string">"ISC"</span>
}
</code></pre>
<p>Now run the setup with the simple command. For this, I am going to create a new file called <code>app.js</code> using the <strong>nano</strong> text editor in the terminal.</p>
<pre><code class="lang-bash">sudo nano app.js
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-123550.png" alt="Image" width="600" height="400" loading="lazy">
<em>Opening app.js file in nano</em></p>
<p>Once the text editor opens, type the below code:</p>
<pre><code class="lang-bash">console.log(<span class="hljs-string">"Hello, Node.js from Ubuntu!"</span>);
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-123710.png" alt="Image" width="600" height="400" loading="lazy">
<em>Writing a simple console.log code in the app.js file using nano</em></p>
<p>Use <code>Ctrl</code>+ <code>O</code> to save the file. Use <code>Enter</code> to save the file as <code>app.js</code>:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-123831.png" alt="Image" width="600" height="400" loading="lazy">
<em>Save the app.js file with the newly added line of code</em></p>
<p>Use <code>Ctrl</code> + <code>X</code> to return to the bash terminal again.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-123907.png" alt="Image" width="600" height="400" loading="lazy">
<em>Returning to the terminal again</em></p>
<p>Now, it is time to check the output and see whether it's working or not.</p>
<p>Use the command below:</p>
<pre><code class="lang-bash">node app.js
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/10/Screenshot-2023-10-20-124010.png" alt="Image" width="600" height="400" loading="lazy">
<em>Running the app.js file using Node</em></p>
<p>It is working!</p>
<p>We have successfully installed the latest LTS release of Node on our Ubuntu/Debian-based Linux operating system.</p>
<p>Cheers! 🥂</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Thank you so much for reading the entire article till now.</p>
<p>If you have enjoyed the procedures step-by-step, then don't forget to let me know on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>.</p>
<p>You can follow me on <a target="_blank" href="https://github.com/FahimFBA">GitHub</a> as well if you are interested in open source. Make sure to check <a target="_blank" href="https://fahimbinamin.com/">my website</a> (<a target="_blank" href="https://fahimbinamin.com/">https://fahimbinamin.com/</a>) as well! </p>
<p>If you like to watch programming and technology-related videos, then you can check my <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">YouTube channel</a>, too.</p>
<p>All the best for your programming and development journey. 😊</p>
<p>You can do it! Don't give up, never! ❤️</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Install Java in Ubuntu – JDK Linux Tutorial ]]>
                </title>
                <description>
                    <![CDATA[ Installing software on Linux is usually easier, or at least that's what it seems like. But this is usually not the case as we've come to a realization that installing and configuring some specific tools on Linux might be more time-consuming than on W... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-install-java-in-ubuntu/</link>
                <guid isPermaLink="false">66b902e53639976bd84355b7</guid>
                
                    <category>
                        <![CDATA[ Java ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Linux ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Ubuntu ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Thu, 07 Sep 2023 19:05:00 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/09/How-to-Install-Java-in-Ubuntu---JDK-Linux-Tutorial.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Installing software on Linux is usually easier, or at least that's what it seems like. But this is usually not the case as we've come to a realization that installing and configuring some specific tools on Linux might be more time-consuming than on Windows or MacOS.</p>
<p>An example of this can be seen when you want to install the latest version of Java on Ubuntu and make it your default Java version. Yes, I know that you're wondering about other Linux distributions like Fedora or Arch, and so on, but each distribution has some specific advantages and disadvantages over others.</p>
<p>Ubuntu is one of the most commonly used Linux distributions, and most people who would like to try out the Linux operating system for the first time usually start their Linux journey with Ubuntu.</p>
<p>However, if you're a Java developer who is migrating from a Windows machine to an Ubuntu based Linux machine, you might find it tedious to configure the latest version of Java on Ubuntu as opposed to Windows where you simply have to download and install the latest version, and add the directory to the path variable.</p>
<p>In this article, I will cover everything you need to know and do to configure your Ubuntu operating system for Java development. I will explain each of the processes with appropriate screenshots and test runs. </p>
<p>I have also created a full-length video showing all of the procedures. You can find the video at the end of this article. By the way, if you're wondering, "Hey Fahim! Who told you that installing Java on Windows is easier?", then you should probably check out my article on <a target="_blank" href="https://www.freecodecamp.org/news/how-to-install-java-on-windows/">how to install Java on Windows</a>.</p>
<h2 id="heading-how-to-check-java-version-on-ubuntu">How to Check Java Version on Ubuntu</h2>
<p>Before proceeding further, you might want to check whether you already have Java installed on your Ubuntu.</p>
<p>You can do this using the terminal. If it returns any version, then that means a version of Java is already installed on your machine. But if it returns something different, then we can assume that you do not have Java installed or it is not configured correctly.</p>
<p>Simply open your terminal. You can also use the shortcut keys for opening the terminal on Ubuntu: <code>Ctrl</code> + <code>Alt</code> + <code>T</code></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/2023-08-16_01-38.png" alt="Image" width="600" height="400" loading="lazy">
<em>Open the terminal</em></p>
<p>Then run the command: <code>java --version</code></p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/2023-08-18_00-00.png" alt="Image" width="600" height="400" loading="lazy">
<em>java --version</em></p>
<p>If it says "java not found" (like you see in the image above), then you can be sure that your system does not have Java installed.</p>
<p>But if it returns any version of Java or JDK (Java Development Kit), then Java is already installed on your machine. Based on the installed version and your need for the other versions, you can remove the older one and install the newer version or you can keep both of them and make one version the default version.</p>
<h2 id="heading-how-to-install-java-on-ubuntu">How to Install Java On Ubuntu</h2>
<p>There are many ways to install Java on Ubuntu. You can use the CLI (Command Line Interface) where you will install via the terminal, or you can download the package and install it using GUI (Graphical User Interface). </p>
<p>In this article, I am going to show you how you can download the latest Java from <a target="_blank" href="https://www.oracle.com/">Oracle</a> and install it on your Ubuntu machine. But that, you have to choose between installing the JRE (Java Runtime Environment) or the JDK (Java Development Kit) version for Java.</p>
<p>If you don't understand the differences between them or which one you need for your tasks, then here is a comparison for you:</p>
<h2 id="heading-jdk-vs-jre-in-java">JDK vs JRE in Java</h2>
<p>Here are some differences between JDK and JRE in Java:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>JDK</td><td>JRE</td></tr>
</thead>
<tbody>
<tr>
<td>It is used to develop Java applications and contains development tools like debuggers.</td><td>It is used only to execute Java programs.</td></tr>
<tr>
<td>As it is a complete package for Java development, it contains almost everything you might need as a Java developer.</td><td>It is mainly used for end users, who do not develop Java applications but only run Java applications as software or tools in their systems.</td></tr>
<tr>
<td>As it is responsible for Java development, you will get all of the development and debugging tools you need as a Java developer.</td><td>If you only want something lightweight, only to run Java applications, then it is the right choice for you. But keep in mind that it doesn't contain any tools like compilers, debuggers, or any other necessary development or debugging features in it. The sole purpose of it is to support the files required for executing them on the end systems.</td></tr>
</tbody>
</table>
</div><p>If you are a developer, then you should install the JDK instead of the JRE. On the other hand, if you are just a normal user who will not program or write code at all, you can install the JRE.</p>
<p>In this article, we'll be installing the JDK version because that covers everything. If you already have a JDK then you do not need to install JRE separately.</p>
<h2 id="heading-how-to-update-ubuntu">How to Update Ubuntu</h2>
<p>Before we install Java, we need to ensure that we've installed all the necessary updates for the Ubuntu operating system. </p>
<p>To update the your Ubuntu OS, simply use the <code>sudo apt update</code> command . Then provide your password and hit the enter key.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/2023-08-18_01-24.png" alt="Image" width="600" height="400" loading="lazy">
<em>Update the system</em></p>
<p>After updating, if you get a message that says something needs to be upgraded then you can upgrade them using <code>sudo apt upgrade</code>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/2023-08-18_01-25.png" alt="Image" width="600" height="400" loading="lazy">
<em>23 packages can be upgraded on my system right now. In your case, it might be different.</em></p>
<p>Make sure to press "y" or "Y" while upgrading.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/2023-08-18_01-27.png" alt="Image" width="600" height="400" loading="lazy">
<em>Upgrading the system</em></p>
<p>The upgrade might take some time depending on the file sizes that it needs to download and your internet speed.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/08/2023-08-18_01-31.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Make sure that everything has been upgraded without creating any errors.</p>
<h2 id="heading-how-to-download-oracle-jdk">How to Download Oracle JDK</h2>
<p>You can download the official JDK from <a target="_blank" href="https://www.oracle.com/">Oracle website</a>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_22-00.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Once the landing page loads, click on <strong>Products</strong> on the top navigation bar:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/image-43.png" alt="Image" width="600" height="400" loading="lazy">
<em>Oracle website navigation options</em></p>
<p>Then click <strong>Java</strong> under the <strong>Hardware and Software</strong> section.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/image-45.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Click <strong>Download Java</strong>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/image-46.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Here, you will get all the latest JDK files. For development purposes, it is recommended to use the LTS (Long Term Support) versions as they receive stable version updates for an extended period.</p>
<p>I am going to install the JDK 20 version (which is the latest version as of the time of writing this article). It is not the LTS version of course, but if you follow through with this article, then you'll be able to install any version you want swiftly!</p>
<p>In your case, I would recommend installing the latest LTS version of JDK. But if you want continuous access to latest JDK features (these features might not be stable), then you can download the latest JDK.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/image-47.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>To download, select <strong>Linux</strong> in the operating system section and download the file for <strong>x64 Debian Package</strong>. Clicking on the download link will start the download for the Debian package file.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/image-48.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Depending on your internet speed, it can take a shorter or longer amount of time. As I am writing this article at night and my internet speed remains slow at night, it is taking longer to download the package file in my system. </p>
<h2 id="heading-how-to-install-the-jdk">How to Install the JDK</h2>
<p>I have downloaded the package file using the Mozilla Firefox browser and by default, it downloads files in the <strong>Downloads</strong> directory. </p>
<p>Simply go to the directory where you downloaded the file and open the terminal there.</p>
<p>Usually, if you go into any directory and right-click, you will see a context menu that says <strong>Open in Terminal</strong>. By using that, you can open your terminal in that directory.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-01.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Alternatively, if you open the terminal elsewhere, you can use the <code>cd</code> command to go into any specific directory. </p>
<p>For example, I have opened my terminal elsewhere. I am using the <code>cd</code> command to go into my <strong>Downloads</strong> directory as can be seen in the image below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-03.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You can use the <code>ls</code> command to see all the files and folders available on a particular directory:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-04.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>After downloading the file, you will see that the file name also contains the version name which is necessary, but if you think that would be troublesome to type later on, you can shorten the filename as well.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-06.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>For this article, we'll use the default filename.</p>
<p>Grab the full directory path where the JDK package file is downloaded. You can use the shortcut <code>Ctrl</code> + <code>L</code> to display the whole directory path.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-07.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>For me, the current directory path where my JDK Debian file is located is <code>/home/fahim/Downloads/</code>. Make sure to copy the address.</p>
<p>Next, open the terminal. You can do that using the shortcut <code>Ctrl</code> + <code>Alt</code> + <code>T</code>.</p>
<p>I like to install the JDK using the terminal, but if you can also install it using the GUI (Graphical User Interface). But I recommend using the terminal as that would also help you debug any issues you face during installation.</p>
<p>Use the <code>sudo apt install /home/fahim/Downloads/jdk_filename.deb</code> command to start the installation. For me, the entire command is <code>sudo apt install /home/fahim/Downloads/jdk-20_linux-x64_bin.deb</code>.</p>
<p>Hit the enter key:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-11.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Input your password and type "y" when it asks for your permission to install the package.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-12.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Make sure that you have successfully installed the package before proceeding to the next step.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-13.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>You might get <code>N: Download is performed unsandboxed as root as file '/home/fahim/Downloads/jdk-20_linux-x64_bin.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)</code>. But don't worry about that because we performed the installation "unsandboxed" intentionally. </p>
<p>You will not face any problems if you use the Debian package downloaded from the right source.</p>
<p>You can clear the terminal using the command <code>clear</code>.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-15.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-how-to-configure-java-in-ubuntu">How to Configure Java in Ubuntu</h2>
<p>We need to make sure that if it updates, it does not download any downgraded version of Java.</p>
<p>You can do that using the <code>sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-version/bin/java 1</code> command.</p>
<p>Since I'm using the "JDK - 20" version, my command would be <code>sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-20/bin/java 1</code>.</p>
<p>Make sure to change the <code>jdk-version</code> to match your installed JDK version.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-18.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>We need to do the same thing for the <code>javac</code> (Java Compiler) version as well. The command would be <code>sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-version/bin/javac 1</code>.</p>
<p>My command would look like this: <code>sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-20/bin/javac 1</code>.</p>
<p>Remember to change the <code>jdk-version</code> to match your installed JDK version.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-20.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>We'll also do the same for <code>jar</code>. JAR is essential for running Java based applications directly in the system.</p>
<p>The command would be <code>sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-version/bin/jar 1</code>.</p>
<p>My command would look like this: <code>sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-20/bin/jar 1</code>.</p>
<p>Then change the <code>jdk-version</code> to match your installed JDK version.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2023/09/2023-09-05_23-23.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This is all for most of the cases. You are good to go!</p>
<p>But if you face any kind of problems, then check the complete video provided below. In that video, I talked about a lot of possible issues and how to solve them. If you have multiple Java versions installed on your system, then you need to make one of them the default. This is also covered in the video.</p>
<p>Also, if you want to make more modifications, then the video is going to help you with that as well. But for most of the users, this article is everything that you need to install Java on your Ubuntu operating system.</p>
<h2 id="heading-video-walkthrough">Video Walkthrough</h2>
<p>Check the complete video for troubleshooting any more issues or if you want to make more modifications.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/amk1hIeDK9c" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>I hope you have enjoyed this article and are able to install Java on your Ubuntu operating system.</p>
<p>If you have any questions then please let me know by reaching out on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>.</p>
<p>You can also follow me on:<br>🎁GitHub: <a target="_blank" href="https://github.com/FahimFBA">FahimFBA</a><br>🎁YouTube: <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">@FahimAmin</a></p>
<p>If you are interested then you can also check my website: <a target="_blank" href="https://fahimbinamin.com/">https://fahimbinamin.com/</a></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How JavaScript String Concatenation Works – the "+" Operator vs the "+=" Operator ]]>
                </title>
                <description>
                    <![CDATA[ String concatenation is a common task that we do often. String concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball". In this article, I will be showing two methods b... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/javascript-string-concatenation/</link>
                <guid isPermaLink="false">66b9030a380c84d101de5db1</guid>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Md. Fahim Bin Amin ]]>
                </dc:creator>
                <pubDate>Thu, 07 Sep 2023 18:50:21 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2023/09/pexels-francesco-ungaro-96081--1-.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>String concatenation is a common task that we do often. String concatenation is the operation of joining character strings end-to-end. For example, the concatenation of "snow" and "ball" is "snowball".</p>
<p>In this article, I will be showing two methods by which you can concatenate strings in JavaScript. I will also make sure to clarify when you should use each method. </p>
<p>Also, I will provide you with a good exercise from freeCodeCamp to practice this concept. If you are interested in watching a step-by-step video explanation, then you are also in the right place!</p>
<p>I recently tweeted about this, and and as I promised, I have created a video and now I am writing this article for you. Check out the Twitter thread also:</p>
<div class="embed-wrapper">
        <blockquote class="twitter-tweet">
          <a href="https://twitter.com/Fahim_FBA/status/1699144812602220569?s=20"></a>
        </blockquote>
        <script defer="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script></div>
<p>Make sure to follow me on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter/X</a> to get the latest updates about my new videos or articles.</p>
<h2 id="heading-video-walkthrough">Video Walkthrough:</h2>
<p>Now is the moment you may have been waiting for: yes, it is a video, and I have specially prepared it just for you.</p>
<div class="embed-wrapper">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/9eZMdTvvbJk" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
<p>Let me know if you like the video presentation in the video's comment section. Also, make sure to <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">subscribe to my YouTube channel</a>.</p>
<h2 id="heading-working-with-strings">Working with Strings</h2>
<p>Before talking about string concatenation, let us talk about some basic stuff.</p>
<p>Let's say, I want to print my full name but I do not want to input my full name all at once. Check the example below:</p>
<pre><code class="lang-javascript">myName = <span class="hljs-string">"Md. Fahim "</span>;
myName2 = <span class="hljs-string">"Bin Amin"</span>;
<span class="hljs-built_in">console</span>.log(myName); <span class="hljs-comment">// Md. Fahim </span>
<span class="hljs-built_in">console</span>.log(myName2); <span class="hljs-comment">// Bin Amin</span>
</code></pre>
<p>My full name is "Md. Fahim Bin Amin". I have broken it down into two parts or you can say in two halves. Therefore, <code>myName</code> contains my first name, <code>"Md. Fahim "</code> with a space at the end so that I can have a leading space before printing my last name. But you can add this space as a leading space in the second string also.</p>
<p><code>myName2</code> contains my last name, <code>"Bin Amin"</code>. Then I printed two variables' values. Therefore, I got two separate lines containing my full name. But it does not look good to print a person's name in two different lines, right?</p>
<p>Let's solve this issue now. There are many ways to do that, but we are going to use <strong>String Concatenation</strong> methods. We are going to learn two different approaches to using string concatenation along with the suitable usage for each of them.</p>
<h2 id="heading-string-concatenation-method-1-using-the-operator">String Concatenation Method 1 – Using the <code>+</code> Operator</h2>
<p>This is the simplest method: it uses the <code>+</code> operator. Let me give you an example first, and I promise that it will be crystal clear for you once we go through it.</p>
<p>Let's say I am creating a new variable named <code>fullName</code> for storing my full name. But as earlier, instead of using my full name in the double quotations, I will use separate strings.</p>
<pre><code class="lang-javascript">fullName = <span class="hljs-string">"Md. Fahim "</span> + <span class="hljs-string">"Bin Amin"</span>;
<span class="hljs-built_in">console</span>.log(fullName); <span class="hljs-comment">// Md. Fahim Bin Amin</span>
</code></pre>
<p>Here, I have provided two separate strings in a single string variable, but I used the plus ( <code>+</code> ) operator to append the second string at the end of the first string. Here <code>"Md. Fahim "</code> is the first string, and <code>"Bin Amin"</code> is the second string.</p>
<p>Since I want a space between the two separate strings, I have added a trailing space in the first string. But you can also add a leading space in the second string instead of adding a trailing space in the first string, as I mentioned above. </p>
<p>It is important to note that the order of the strings always matters in String Concatenation.</p>
<p>For example, if I change the order (give the second string before the first string) in the <code>fullName</code> variable, then the whole string also gets a different orientation and I will not get the result I want (it prints my name wrong!).</p>
<pre><code class="lang-javascript">fullName =  <span class="hljs-string">"Bin Amin"</span> + <span class="hljs-string">"Md. Fahim "</span>;
<span class="hljs-built_in">console</span>.log(fullName); <span class="hljs-comment">// Bin AminMd. Fahim</span>
</code></pre>
<p>It always considers the string that appears first as the first string and appends the next string at the end of that first string. It keeps going on each time like this – it doesn't matter how many individual strings you want to append in a single string variable.</p>
<pre><code class="lang-javascript">fullName =  <span class="hljs-string">"Bin Amin "</span> + <span class="hljs-string">"Md. Fahim"</span> + <span class="hljs-string">" My name is"</span>;
<span class="hljs-built_in">console</span>.log(fullName); <span class="hljs-comment">// Bin Amin Md. Fahim My name is</span>
</code></pre>
<p>Ah! It looks awful. Let me correct the orientation now:</p>
<pre><code class="lang-javascript">fullName = <span class="hljs-string">"My name is "</span> + <span class="hljs-string">"Md. Fahim "</span> + <span class="hljs-string">"Bin Amin"</span>;
<span class="hljs-built_in">console</span>.log(fullName); <span class="hljs-comment">// My name is Md. Fahim Bin Amin</span>
</code></pre>
<p>Now it is better.</p>
<h2 id="heading-string-concatenation-method-2-using-the-operator">String Concatenation Method 2 – Using the <code>+=</code> Operator</h2>
<p>This method is very handy. When using it, we append separate strings in separate lines. Let me give you an example again.</p>
<p>I will use a variable named <code>fullName</code> like earlier, but instead of using the <code>+</code> operator to concatenate strings like earlier, I will use <code>+=</code>:</p>
<pre><code class="lang-javascript">fullName = <span class="hljs-string">"Md. Fahim "</span>;
fullName += <span class="hljs-string">"Bin Amin"</span>;
<span class="hljs-built_in">console</span>.log(fullName); <span class="hljs-comment">// Md. Fahim Bin Amin</span>
</code></pre>
<p>In the first line, I have stored my first name in the <code>fullName</code> variable. In the second line, I have stored my last name in that same variable but using the <code>+=</code> operator (which is actually the combination for <code>fullName = fullName + "Bin Amin"</code>). It appends the second string at the end of the first string like earlier.</p>
<p>This lets me print my full name on a single line.</p>
<p> <code>+=</code> is a combination, so direct usage of the generic way also works the same as below:</p>
<pre><code class="lang-javascript">fullName = <span class="hljs-string">"Md. Fahim "</span>;
fullName = fullName + <span class="hljs-string">"Bin Amin"</span>;
<span class="hljs-built_in">console</span>.log(fullName); <span class="hljs-comment">// Md. Fahim Bin Amin</span>
</code></pre>
<p>But you can pretty much assume that using <code>+=</code> will be the easier and more compact way. So I recommend you to use the <code>+=</code> operator directly.</p>
<h3 id="heading-whats-the-difference">What's the Difference?</h3>
<p>I know you may be getting confused and thinking that if these methods give the exact same result, why you should learn both of them? What are the specific use cases for each one?</p>
<p>Hold your horses! I am going to answer your question right now.</p>
<p>Follow the code below where I am using the 1st method:</p>
<pre><code class="lang-javascript">fullParagraph = <span class="hljs-string">"This is the first line of the paragraph. "</span> + <span class="hljs-string">"This is the second line of the paragraph. "</span> + <span class="hljs-string">"This is the third line of the paragraph. "</span>;
<span class="hljs-built_in">console</span>.log(fullParagraph); <span class="hljs-comment">// This is the first line of the paragraph. This is the second line of the paragraph. This is the third line of the paragraph.</span>
</code></pre>
<p>Here I have taken a variable named <code>fullParagraph</code> and I have stored three individual strings/sentences in it. The output is accurate, but you see that based on the number of adding new strings/sentences, the one line for storing the data in that specific variable is getting longer. </p>
<p>The more strings or different sentences you add for string concatenation using the first method, the longer a single statement becomes. As such, it becomes very boring and hard to inspect later on.</p>
<p>Here comes the second method to the rescue! 😉</p>
<p>Follow the code below where I am using the 2nd method:</p>
<pre><code class="lang-javascript">fullParagraph = <span class="hljs-string">"This is the first line of the paragraph. "</span>;
fullParagraph += <span class="hljs-string">"This is the second line of the paragraph. "</span>;
fullParagraph += <span class="hljs-string">"This is the third line of the paragraph. "</span>;
<span class="hljs-built_in">console</span>.log(fullParagraph); <span class="hljs-comment">// This is the first line of the paragraph. This is the second line of the paragraph. This is the third line of the paragraph.</span>
</code></pre>
<p>Here I have taken a variable named <code>fullParagraph</code> and stored individual strings in individual lines. As usual, I can easily append newer strings in new lines using the <code>+=</code> operator. </p>
<p>Since I'm taking a new line for appending new strings each time, it doesn't create any hassle for me. Also, each individual statement is short and it is very easy to read or inspect later on. The code also looks pretty clean.</p>
<p>Keep in mind that the order of strings of course matters in each method. That means they always follow the orientation of the order of the strings during appending (String Concatenation).</p>
<h3 id="heading-when-to-use-each-method">When to Use Each Method</h3>
<p>I guess you already know this answer. But, still, for the sake of this article, let me clarify it again.</p>
<p>If you are using any string concatenation where the individual strings are comparatively smaller or you know they'll remain small in size, then you can directly go for the first method.</p>
<p>But if you know that you might need to append longer strings later on, then you should use the second method.</p>
<p>That's it!</p>
<h2 id="heading-practice-string-concatenation">Practice String Concatenation</h2>
<p>You can practice this concept <a target="_blank" href="https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/concatenating-strings-with-the-plus-equals-operator">using this freeCodeCamp exercise</a>.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>I hope you have enjoyed this short article. It takes a lot of time and effort to write an in-depth article and create videos for you. So let me know whether these are helping you or not.</p>
<p>Let's connect on <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>. Please make sure to endorse me on the relevant skillset. Also getting recommendations from you always makes me happy! 😊</p>
<p>If you have any questions then please let me know by reaching out on <a target="_blank" href="https://twitter.com/Fahim_FBA">Twitter</a> or <a target="_blank" href="https://www.linkedin.com/in/fahimfba/">LinkedIn</a>.</p>
<p>You can also follow me on:<br>🎁GitHub: <a target="_blank" href="https://github.com/FahimFBA">FahimFBA</a><br>🎁YouTube: <a target="_blank" href="https://www.youtube.com/@FahimAmin?sub_confirmation=1">@FahimAmin</a></p>
<p>If you are interested then you can also check my website: <a target="_blank" href="https://fahimbinamin.com/">https://fahimbinamin.com/</a></p>
<p>Cheers! 🍻</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
