Posts

Showing posts from 2022

Git Cheat Sheet with 40+ commands & concepts

Git Cheat Sheet with 40+ commands & concepts Tired of memorizing git commands? Here is a cheat sheet with 40+ commands to simplify your life. 1. Initialize a local repository git init <directory> The <directory> is optional. If you don't specify it, the current directory will be used. 2. Clone a remote repository git clone <url> 3. Add a file to the staging area git add <file> To add all files in the current directory, use . in place of <file>. git add . 4. Commit changes git commit -m "<message>" If you want to add all changes made to tracked files & commit git commit -a -m "<message>" # or git commit -am "<message>" 5. Remove a file from the staging area git reset <file> 6. Move or rename a file git mv <current path> <new path> 7. Remove a file from the repository git rm <file> You can also remove it from staging area only using --cached flag git rm --cached <file> ...

C++ ios Library - Boolalpha Function

 C++ ios Library - Boolalpha Function Description It is used to sets the boolalpha format flag for the str stream. When the boolalpha format flag is set, bool values are inserted/extracted by their textual representation: either true or false, instead of integral values. Declaration Following is the declaration for std::boolalpha function. ios_base& boolalpha (ios_base& str); Parameters str − Stream object whose format flag is affected. Return Value It returns Argument str. Exceptions Basic guarantee − if an exception is thrown, str is in a valid state. Data races It modifies str. Concurrent access to the same stream object may cause data races. Example In below example explains about std::boolalpha function.  Live Demo #include <iostream>      int main () {    bool b = true;    std::cout << std::boolalpha << b << '\n';    std::cout << std::noboolalpha << b << '\n';    retu...

C++ complete roadmap

C++ complete roadmap # programming # tutorial # beginners # cpp Let's jump in! If you are a beginner I will suggest you make a timetable of at least 45 days which will be sufficient in order to get a really good understanding of C++. Now, you can break your 45 days into 6 weeks and start with the concepts. 1st Week : Now, these seven days will introduce you to something that you have no previous knowledge of. So make sure you understand the foundations well and give a kickstart to the world of programming. What is C++? It’s history and features. Understanding and writing our first Hello World program in C++. Tokens Variables, Datatypes. Keywords How to take input from the user? Operators Arithmetic Operators. Logical Operators. Relational Operators. Other operators. Selection Statements if statements if-else else-if switch 2nd Week : Now you have understood the basic units of a program well. Its time to take a step forward. So, schedule yourself to learn the following topics. Loops...

Solution of Codeforces Round #831 (Div. 1 + Div. 2) || Tutorial of Codeforces Round #831 (Div. 1 + Div. 2)

Solution of Codeforces Round #831 (Div. 1 + Div. 2) || Tutorial of Codeforces Round #831 (Div. 1 + Div. 2) Codeforces Round #831 (Div. 1 + Div. 2, based on COMPFEST 14 Final) Editorial 1740A. Factorise N+M Author:  Pyqe Developer:  Pyqe Tutorial 1740A - Factorise N+M There are multiple solutions for this problem. We will discuss two of them. One solution is to choose  m = n m = n . This always guarantees that  m m  is prime, because  n n  is always prime. And we can see that  n + m = n + n = 2 n n + m = n + n = 2 n , which is always not prime, because  n > 1 n > 1  always holds. Another solution is to choose  m = 7 m = 7 . If  n n  is odd, then  n + m n + m  will be an even number greater than  2 2  and therefore not prime. Otherwise  n n  is even. The only even number prime number is  2 2  and it can be verified that  2 + 7 = 9 2 + 7 = 9  is not a prime number. Time ...

Popular posts from this blog

12 Best Websites to Practice Coding for Beginners

Using Generic in TypeScript about types in the Code

Usage of Common “Header files” in C programming