Latest Questions and Answers

How to Become a Successful Youtuber?

In the back of each well-known vlogger is a protracted journey of struggle and hard paintings. There are investments you want to make, strategies you want to observe, and greater earlier than you even create your first video. Being a YouTuber seems like a amusing and rewarding profession. You simply make motion pictures on subjects that you like and make money off of them, proper? But, beco... (more)

Bank ATM cash withdrawal rules 2021?

As per the new order from the RBI, the interchange charge that banks can charge on automated Teller Machines (ATM) will see a growth of Rs. 2 from August 1, 2021. Note that, the RBI had elevated the interchange rate  in June from Rs 15 to Rs 17, while for non-monetary transactions the price was raised from Rs 5 to Rs 6. This fee is being charged through the banks to customers processing the bills... (more)

How to generate a cohort using python?

You can create a cohort to do analysis for your business repetitive customers and can make necessary decisions accordingly to improve customer retention for your business. Example below will generate the cohort which can be seen in attached image. You need to keep the csv file in same folder with python file to avoid any error.     import pandas as pd import numpy as np import mat... (more)

How to read and compare value of one csv with other csv in python?

We are giving a complete code example of reading csv and picking value from one csv and reading other csv file to compare the value. You can implement any logic to perform on values of csv files. Below is the example of using core csv module instead of using external package/module of python: import csv #Open files fb_csv = open('first.csv', newline='', encoding='utf-1... (more)

How to do web scrapping using python?

Scrapping is a very interesting topic but serious as well. Because it is not a legal work until website owner allows you to scrap it so if you are doing it, will completely be your responsibility. I'm going to show you how you can scrap a website and store it in a csv file. You can save it into database as well its up to your choice. There are various ways to scrap but I have come with Bea... (more)

What is Git Stash?

When you have been working on part of your project and things are in a messy state and you want to switch branches for some other work. The problem is that you don’t want to do a commit of half done work so you can get back to this point later. In such situations git stash command is very useful. Stashing takes the your modified tracked files and staged changes and saves it on a stack of ... (more)

How to work with sleep or add delay in program?

Sleep function is present in time module of python. It is very useful when you are trying to add some delay in program execution. It does not stop complete program instead it just adds some delay in particular thread only. We can understand it with some examples which you see below:   import time #Example:1 sleep_time = 1 print("Hello") time.sleep(sleep_time) print("World")   #Examp... (more)

Write a program to generate Fibonacci series in Python?

Fibonacci series is a series of numbers in which each number is addition of previous two numbers. So, lets create it with an example For example:  0 1 1 2 3 5 8 13 and so on. Lets number of terms is 8. terms = 8 a=0 b=1 print(a,b,end="") for n in range(2, terms):     next = a+b     print(next, end="")     a=b     b=next        ... (more)

Npm ERR cb() never called?


npm update chokidar

the older versions aint compatible with Node v14 and above


Pendrive paste option is not showing in mac?

There is a very easy to use pendrive in mac system. You would have faced this type of problem with a pendrive formated as NTFS. You just need to reformat your pendrive and choose the option as FAT32 and now it will be ready to use with mac as well as windows operating system.


Laravel controller is not working?

I also faced such issue while working on a laravel project and after several rearch I found a solution which worked for me and it was really unexpected for me and that is the below command you can use in such scenario. composer dump-autoload Additionally, you can also use these below command collectively to avoid any other cache issue of laravel. php artisan cache:clear php artisan config:cac... (more)

How to apply loop on objects in JavaScript?

When we talk about looping through objects, before ES6 we had only one option to loop through objects using But it has some drawback as it iterates through properties in the prototype chain and to check if property belongs to the object you can do this with hasOwnProperty.    for (var property in object) {   if (object.hasOwnProperty(property)) {     // Rest code   } }   Bet... (more)

How to enable .htaccess on apache server?

.htaccess is a configuration file for the Apache web server. It’s an extremely powerful tool that can be used to modify the Apache configuration without editing the Apache configuration files directly. Let us see how to create this configuration and use it to restrict directory listings and IP addresses, and to handle redirects.   Enable .htaccess file:   sudo nano /etc/apache2/si... (more)

How to edit and update reactive form in Angular?

If you have a list of records and now you want a edit screen to edit and update the record then you can do it using following steps: 1- Import forms module in component import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms'; 2- Then declare variables of form builder and form group public testform: FormGroup;   constructor(     public share: S... (more)

Basic Concepts of JavaScript?

Here you can get a very useful javascript concepts where most of the people get confused or not aware of it. The below list will solve it:   What is NaN? NaN represents a special Not-a-Number value. It is a result of an invalid or an undefined mathematical operation,  like taking the square root of -1 or dividing 0 by 0, etc. We can check it using Number.isNa... (more)

What is view composer in laravel php?

If you want some data to be passed to a view each time when it is rendered. It helps to avoid writing code in controller 's methods repeatedly.   We can define it as below: View composers are callbacks or class methods that are called when a view is rendered. If you have data that you want to be bound to a view each time that view is rendered, a view composer can help you organize that log... (more)

Javascript ES6 interview questions and answers?

A list of important questions and answers which are frequently asked in interviews.   1) What is ES6 or ECMAScript 2015? It was released in June 2015, which is also known as the sixth edition of the language. Earlier, it was named ES6 and later renamed to ECMAScript 2015. There are several new features are introduced like modules, iterators, class, arrow functions, for...of loop, promises, an... (more)

What is an RxJS Operator?

Operators are methods that you can use on Observables/Subjects that allow you to change the original observable and return a new observable. Operators do not change the existing Observable, they simply modify it and return a new observable. Operators are known as pure functions, which are functions that do not modify the variables outside of its scope. Operatoes are of two types: Static Ope... (more)

Important React Interview Questions Part 1?

We have a list of interview questions in this section and would like to explain it thoroughly. We will keep adding multiple questions and answers into this later also.   What are the key features of React? The key features of Reactjs are:     1- It uses VirtualDOM instead of RealDOM considering that RealDOM manipulations are expensive.     2- It supports server side (SSR) rendering.    ... (more)

How to create multi select checkboxes with search feature?

Here I will show you how you can create a multi select checkbox with search feature using jQuery and bootstrap library and it is a very easy to integrate anywhere in web application. You just need to include bootstrap multi select library and few lines of configurable javascript code in your webpage. You will get that element integrated with many other features as well based on your requirement. F... (more)

Many to Many relationship structure in Laravel 7 php?

To establish Many to Many relation, laravel has given a way by creating an intermediary table that is called pivot table. It is a very simple table containing two foreign keys of related tables (Models). We can understand this relation easily with an example as stated below.   We have two entities Category and Post. A category may belongs to many posts and a post may belongs to many categories... (more)

What is difference between var and let in JavaScript?

  Var:----  The var statement declares a function-scoped or globally-scoped variable,  optionally initializing it to a value. var x = 1; if (x === 1) {   var x = 2;   console.log(x);   // expected output: 2 } console.log(x); // expected output: 2 var declarations, wherever they occur, are processed before any code is executed. This is called hoisting, and is discussed further below... (more)

What is Closure in JavaScript?

To understand concept of closure go through each line and concentrate on the code carefully:   function tempFunc() {   var name = 'Laptop'; // name is a local variable created by tempFunc   function printName() { // printName() is the inner function, a closure     alert(name); // use variable declared in the parent function   }   printName(); }   function testFunc() {   var na... (more)

What is Lexical Scoping in JavaScript?

We have described the Lexical Scoping concept very clearly using an example which everybody can find it very helpful. function tempFunc() {   var name = 'Laptop'; // name is a local variable created by tempFunc   function printName() { // printName() is the inner function, a closure     alert(name); // use variable declared in the parent function   }   printName(); } tempFunc(); te... (more)

Difference between Flux and Redux in Reactjs?

Flux and Redux are different types of workflows in reactjs. They have different concepts to develop a react application. You can see below differences in Flux and Redux:        ... (more)

Npx create-react-app not working on windows?

We have seen many people stuck in running the npx create-react-app on windows. We can resolve this issue by following below command step by step and start working on reactjs.    To fix this issue run below commands one by one: npm init npm install create-react-app npx create-react-app myapp   For global installation of react module use below commands: npm install -g crea... (more)

What is Redux and its key features?

This topic explains about redux and have briefly described its important aspects which are very helpful to understand and proceed with it further.   Redux: Redux is a predictable state container for javascript apps.   Three Core Concepts:   Store:- That holds the state of your application.   Action:- That describes the changes in the state of the application... (more)

What are hooks in React js?

Hooks in Reactjs facilitates us to achieve everything which we can do using class and functional components. It has been introduced in latest version of Reactjs which is very efficient and easy to use as compared to earlier introduced methods in reactjs. Please have a look below points to get an understanding about hooks in react:   React Hooks:   Hooks are a new feature addition in... (more)

Key points of Reactjs?

Here we have described important topics of react js briefly so that you can get an overview of building blocks of react js.   Components: Components are user interface and these can be nested, one component can exist into another component. There is a root component in React js and all other component lies under this root component and make up a complete web page. You can say a component is... (more)

What is ReactJs?

1- It is an open source javascript library for building user interfaces.

2- It is is not a framework, it is a javascript library.

3- It focuses on user interface and can create a complex UIs from small 

and isolated pieces of code called "components".

Inspirational: Quotations to inspire and give positivity?

  "Success Requires No Explanations            Failure Permits No Alibis"   "Tell The World What You Intend to Do,                   But First Show It."   "The starting point of all achievement is DESIRE.                 Keep this constantly in mind.         Weak desire brings weak results, just as        a small fire makes a small amount of heat."   ... (more)

How to resize the droplet in digitalocean?

Now a days each and every company want their website hosted on cloud server. Digitalocean is one of the very famous cloud platef orm which provides facility to host websites on cloud virtual server.  Here, first let us know what is droplet in digitalocean?  Digitalocean droplet is an individual Linux based virtual machine/server. We can create as much virtual machines as we want. After cr... (more)

How to encode URL in JavaScript?

When you are working to encode url in javascript you have following functions for encoding purpose.  encodeURI() will not encode: ~!@#$&*()=:/,;?+' encodeURIComponent() will not encode: ~!*()'   1- encodeURIComponent() is used when you want to encode query parameters in URL like var url = "" + encodeURIComponent(somevalue) + "¶m2=100";   2- You need... (more)

JavaScript Array functions?

If you want to work on array in javascript you must be aware of array operating functions which we have listed here for you. These are some of those methods which are frequently used when you work with arrays in javascript.    1- concat(): This method joins two or more arrays and return a new array containing all elements. array1.concat(array2, array3, ..., arrayX) var arr1 = ["abc", "def"]... (more)

JavaScript String functions?

We know very well about javascript demand in these days among software and website development companies. If you want to work on strings in javascript you must be aware of string operating functions which we have brought to you. These are some of those functions which are frequently used when you work with strings in javascript.  1- charAt(): This function returns the character at specified in... (more)

How to integrate Textlocal API in javascript?

Textlocal is one of the very famous Indian SMS gateway provider which provides feature of bulk sms anybody can use in website to enhance feature of his business and customer interaction using sms. We can use these messages for transactional or promotional purposes like OTP and invitation of registration link of the website.  There are following features which Textlocal provides: - Easil... (more)

Image is not uploading digitalocean website?

It is a permission issue for root folder. You need to give permission  to your user to read and write so that image can be uploaded as well  as read from folders to display on front end. To resolve the issue  you need to execute some commands which are listed below and try to  execute in same sequence. Login to your server execute ... (more)

How to display PHP code in browser without executing it?

We as a developer while working on projects whether it is website or any application write  code to implement logic and execute it. But here I will you how to display complete PHP  code in browser without executing it. You can do this following below code with an example: Here main key is to pass php code into htmlspecialchars() function. $php_cod... (more)

How to zip unzip folder ubuntu command?

Before doing zip or unzip a folder or files, you will need to install zip using below command if it is not already install: $ sudo apt install zip unzip Now you can use below syntaxes to create a zip of folders/files: zip -r folder zip -r folder1 folder2 zip -r /path/to/folder1 /path/to/file2 After running the command you will get a zipped file which you can keep as... (more)

How to change your mysql root user password?

To update the mysql root user password you will need to follow below steps and it will be updated without any problem. 1- First stop the mysql server  sudo /etc/init.d/mysql stop 2- Now run command to start mysqld configuration sudo mysqld --skip-grant-tables &   Don't forget & sign at the end In some cases you will need to create /var/run/mysqld  first sudo mkdir -v /var/run/mysql... (more)

How to update mysql user password using command?

I assume you have already a mysql user which password want to update or change. You will need to login into your mysql server with your root user which has administrative privileges. So, follow below steps and you will easily be able to update the user password: 1- Open the command shell and connect to the mysql server as root user mysql -u root -h localhost -p 2- Run command ALTER USER 'us... (more)

Async/await does not work within forEach loop in nodejs?

We have also faced such problem where we want to loop through array of objects and further get a detailed information about user from user id and add this into all objects respectively. I can explain with two examples where one works but the other does not:   1- Working example:   // Here info is the array of objects var newArr = [];... (more)

How to install free SSL in website?

Suppose you have already a website running on http protocol with apache  ubuntu server and you want to install a free SSL in your website then  follow the below steps and this license will expire in 90 days so you  will need to renew it again:   1- First of all run following commands to activate SSL mode and webserver to listen on ... (more)

How to install SSL certificate on ubuntu 18.04 apache server?

I assume you have setup your apache2 server and websites is running on http protocol.  Now you want to install SSL and get your website run on https only.  For this, you will need to purchase SSL certificate from any SSL provider.  Now if you have purchased the SSL you will need to follow few steps to  complete installation on apache... (more)

How to create a rest api in wordpress?

Wordpress allow us to create a rest api that can be used in application like mobile android, iOS apps or any other javascript frameworks. There is action hook "rest_api_init" which is used to create such an API in wordpress. You can understand it more exactly by below example: // Get user details by id function get_user_details(WP_REST_Request $request ) {         $id... (more)

What is data structure in programming languages?

Data sctructure is how we store, organize and group the data so that it can be used efficiently. 

There are many ways of storing data in programming languages like linked list, queue, graph, tree, array etc.

What is annotation in javascript?

Annotation is about specifyng type of the something like variable.  We can understand it better referring below example:   var a = 10; var b = "Hello"; var c = True;   Here javascript understand/infer the type of variable by the value being passed into it.   var a: number = 10; var b: String;   Here we have specified the type of th... (more)

What is Prototypes in javascript?

Let us understand the requirement of using prototype first.  Suppose you have a person class and there are two properties inside it.  You have created multiple objects and now you want to add a new property into class and that should  be available in all created objects then you would require to use prototype. If you add the new property... (more)

How to remove duplicate items from array in javascript?

You can remove duplicate items from array in javascript using below methods: 1-  Using filter function: var items = ["1", "2", "3", "1", "2", "4"]; var newArray = items.filter(function(item, index, items){       return items.indexOf(item) === index } );   2- Using core javascript logic: function removeDuplicateItems(arr) {      var tempArr = {};      for (var i ... (more)

Argument vs Parameter?

It seems same but there is difference between parameter and argument.  Parameter is variable in the declaration of function. Argument is the actual value of this variable that gets passed to function. See an example: def test_function(abc):      return abc   // Calling the function test_function(100) Here 'abc' is parameter and '100' is argument.... (more)