Context API in ReactJS

Rahul Bansal
Updated on 18-Mar-2021 10:33:01

1K+ Views

In this article, we are going to see how to access the data without passing it through every parent component in the class-based component.Context APIs are used to set the global data and this data can now be accessed in any of the children's components without the need to pass it through every parent component.ExampleSuppose there are three components namely, A, B and C. A is the parent component of B and B is the parent component of C. So, our component structure is as follows − A→B→C.We have defined some data in A and want to handle it in ... Read More

Conditional Rendering in ReactJS

Rahul Bansal
Updated on 18-Mar-2021 10:32:01

605 Views

In this article, we are going to see how to conditionally render a component based on some conditions in a React applicationIn ReactJS, we can render only the desired components based on certain given conditions by using the if-else statements or by using the logical && operator of JavaScript. When the provided condition is satisfied, then React will match the UI and update it accordingly.Using if-else conditionsExampleIn this example, we will build a React application that has an App component as a parent component which will conditionally re-render the Form component and update the UI accordingly.App.jsximport React, { useState } ... Read More

Remove Web Scripting Virus

PranavBhardwaj
Updated on 18-Mar-2021 10:25:27

2K+ Views

In order to provide advanced and high-quality content, some web developer uses complex codes on their websites. Video streaming sites mainly execute such advance codes. These codes help end-users to instruct web programs. However, if not correctly structured, the codes are vulnerable to cyber-attacks.Cybercriminals carry out the virus attacks on such websites by deploying malicious scripts, thereby disabling the web program or take control of it to carry out vicious tasks. Such types of malicious programs are known as Web Scripting Virus.In this guide, we would discuss more on Web Scripting Virus and how to remove them from your system.What ... Read More

Delete Desired Node from a Binary Search Tree in JavaScript

AmitDiwan
Updated on 18-Mar-2021 08:45:50

264 Views

ProblemSuppose, we have the following code that creates a Binary Search Tree DS and provides us with the functionality to insert node −class Node{    constructor(data) {       this.data = data;       this.left = null;       this.right = null;    }; }; class BinarySearchTree{    constructor(){       // root of a binary seach tree       this.root = null;    }    insert(data){       var newNode = new Node(data);       if(this.root === null){          this.root = newNode;       }else{       ... Read More

Uninstall PowerShell Module

Chirag Nagrekar
Updated on 18-Mar-2021 07:54:23

19K+ Views

To uninstall the PowerShell module, we can directly use the Uninstall-Module command but the module should not be in use, otherwise, it will throw an error.When we use the Uninstall-Module command, it can uninstall the module from the current user profile or from the all users profile.Uninstall-Module 7Zip4PowerShell -Force -VerboseAnother method, Get-InstalledModule 7Zip4Powershell | Uninstall-Module -Force -VerboseIf you have multiple versions of the same module installed in the PowerShell, and if you want to uninstall all of them then use the -AllVersions Parameter.Uninstall-Module 7Zip4PowerShell -AllVersions -Force -VerboseIf you want to uninstall the specific version, we can use -RequiredVersion.Uninstall-Module 7Zip4PowerShell -RequiredVersion ... Read More

What is Adware?

PranavBhardwaj
Updated on 18-Mar-2021 07:52:57

551 Views

If you are suddenly receiving random ads on your browser and system, it might be because of an Adware infection. This post will guide you on what is Adware, how do you get it, what are its symptoms, and how to protect your device from Adware.What is Adware?Adware is short for advertising-supported software. It is the extension or application responsible for ad displaying on your browser, applications, or system. Generally, Adware enters the system unintentionally, and therefore it comes under Potentially Unwanted Programs or PUP. Since it can conduct various malicious tasks after infiltrating your device, it is also one ... Read More

Install the Latest PowerShell Module Version

Chirag Nagrekar
Updated on 18-Mar-2021 07:50:56

2K+ Views

Although simply running Install-Module command picks up the latest version of the module, we can still use the -RequiredVersion and -MinimumVersion parameter to install the latest version manually. Below command directly installs the latest available version of the module.In this example we are using 7Zip4PowerShell module.Install-Module 7Zip4PowerShell -Scope AllUsers -Force -VerboseTo manually install the latest version of the PowerShell module, there are two methods.Use the -RequiredVersion parameter if you know the latest version of the module.Use the -MinimumVersion parameter if you know the minor version of the module and it will pick up the latest version.Using -RequiredVersion ParameterThis parameter installs ... Read More

Install Specific Version of PowerShell Module

Chirag Nagrekar
Updated on 18-Mar-2021 07:50:01

7K+ Views

To install the specific version of the PowerShell module, we need to use the -RequiredVersion parameter with the Install-Module command.To find which module versions are available, we can use the Find-Module command with the -AllVersions parameter which retrieves all the versions of the module available in the PSGallery.In this example, we will use the 7Zip4PowerShell module.ExampleFind-Module 7zip4PowerShell -AllVersions | ft -AutoSizeWhen you run this command, you can see there are multiple versions available for this module.OutputVersion  Name            Repository -------  ----            ---------- 1.13.0   7Zip4Powershell PSGallery 1.12.0   7Zip4Powershell PSGallery 1.11.0 ... Read More

Update Windows Host File Entry Using PowerShell

Chirag Nagrekar
Updated on 18-Mar-2021 07:49:12

3K+ Views

Let say you want to update the host file particular entry, we have the below host file in our local computer.ExampleGet-Content $env:windir\system32\drivers\etc\hostsOutput# For example: # #      102.54.94.97     rhino.acme.com          # source server #       38.25.63.10     x.acme.com              # x client host # localhost name resolution is handled within DNS itself. #       127.0.0.1       localhost #       ::1             localhost 8.8.8.8   Google.comWe need to update the google.com entry to IP address ... Read More

Add Entry in Windows Host File Using PowerShell

Chirag Nagrekar
Updated on 18-Mar-2021 07:46:18

9K+ Views

To add the content to the host file, we need to first retrieve the content using the Get-Content command and the need to set the content to the host file after adding the entry. The Code is shown below. We need to add the global entry to it.Example$file = "C:\Windows\System32\drivers\etc\hosts" $hostfile = Get-Content $file $hostfile += "8.8.8.8   Google.com" Set-Content -Path $file -Value $hostfile -ForceOnce you check the host file entry  "8.8.8.8          Google.com" will be added to the host file.To add the entry on the remote computer, you just need to point that file location to the host file of the remote server and the rest of ... Read More

Advertisements