Posts

Package.json

Image
 Package.JSON The package.json file is the center of any Node.js project or npm package. It stores information about your project, similar to how the head section of an HTML document describes the content of a webpage. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; name and version , but it’s good practice to provide additional information about your project that could be useful to future   If you look at the file tree of your project, you will find the package.json file on the top level of the tree. This is the file that you will be improving in the next couple of challenges.   "author": "Jane Doe", One of the most common pieces of information in this file is the author field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will ...

Navbar

News-aunt Home Link Dropdown Action Another action Something else here Disabled

Shivam Dixit Transparent photo

Image
                 

Shivam Dixit

Image
 

SIGFPE - SIG Floating point Error : Cause, Resoultion, Means

 Floating Point Operation it is a measurement of accuracy the term FPO used most in scientific calculations SIGFPE - This error signal denotes some arithmetic error that occurred like division by zero, or floating-point error. If a program stores integer data in a location that is then used as a floating-point operation, this causes an “invalid operation” exception as the processor cannot recognize the data as a floating-point value. But this signal does not specify the type of floating-point error.    Basically, check your looping statement either it does not divide your value with 0

Why do we use "Using namespace std;" in cpp

what is the use of  Namespace & What is namespace or namespace std; in c++:  it is a special feature introduced in cpp, and with its help, we can prevent duplication in the program of variables and especially of methods(Functions()) For Ex, if we working with any xyz() and it is also present in the standard library then compiler gets exerts an error to us due duplicate function in the same directory  but with the use of it, we can overcome this error  Namespaces allow us to group named entities that otherwise would have  global scope  into narrower scopes, giving them  namespace scope . This allows organizing the elements of programs into different logical scopes referred to by names. Namespaces provide the space where we can define or declare identifiers i.e. names of variables, methods, classes, etc. Why do we use using namespace std; first, we should know what is the use of it  by this, we tell the compiler that we are using all the entitie...

Given a string str consisting of only two characters 'a' and 'b'. You need to find the minimum steps required to make the string empty by removing consecutive a's and b's

 Question:  Given a string  str  consisting of only two characters  'a'  and  'b' . You need to find the minimum steps required to make the string empty by removing consecutive  a's  and  b's My CODE(Shows RUNTIME ERROR(take more time than expected)): #include <iostream> #include <string> using namespace std; int ForB(string str,int sizeA,int countA=0,int i=0){     /*if(i==sizeB){         return countB;     }*/      while(i!=sizeA){     if (str[i]=='b' || str[i]=='B'){       if(i!=sizeA-1){         str[i]='X';}       else if (i==sizeA-1){           str[i]='X';           countA++;       }       i++;}       else if((str[i]!='a'||str[i]!='A')&&(/*str[i-1]=='a'||*/  str[i-1]=='X')){       ...

Pageviews