code-rag-bench/online-tutorials huggingface dataset:
GATE | GATE-CS-2016 (Set 2) | Question 28 - GeeksforGeeks

11 Oct, 2021
Consider the following types of languages:
L1 Regular,
L2: Context-free,
L3: Recursive,
L4: Recursively enumerable. 
Which of the following is/are TRUE?
I.   L3' U L4 is recursively enumerable
II.  L2  U L3 is recursive
III. L1* U L2 is context-free
IV.  L1 U L2' is context-free 
(A) I only
(B) I and III only(C) I and IV only(D) I, II and III onlyAnswer: (D)Explanation: St 1: As L3 is Recursive and recursive languages are closed under complementation, L3’ will also be recursive and hence RE. L3’ U L4 is also recursive enumerable as recursive enumerable languages are closed under union.St 2: As L2 is Context- Free, it will be recursive as well. L2 U L3 is recursive because as recursive languages are closed under union.St 3: L1* is regular because regular languages are closed under kleene –closure. L1* U L2 is context free as union of regular and context free is context free.St 4: L2’ may or may not be context free because CFL are not closed under complementation. So it is not true.
So I, II and III are correct.
YouTubeGeeksforGeeks GATE Computer Science16.4K subscribersGATE PYQ's on Theory of Computation with Praddyumn Shukla | GeeksforGeeks GATE | GATE CSEWatch laterShareCopy linkInfoShoppingTap to unmuteIf playback doesn't begin shortly, try restarting your device.You're signed outVideos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer.CancelConfirmMore videosMore videosSwitch cameraShareInclude playlistAn error occurred while retrieving sharing information. Please try again later.Watch on0:000:0052:38 / 1:02:23•Live•<div class="player-unavailable"><h1 class="message">An error occurred.</h1><div class="submessage"><a href="https://www.youtube.com/watch?v=HLtwMQKSpTg" target="_blank">Try watching this video on www.youtube.com</a>, or enable JavaScript if it is disabled in your browser.</div></div>Quiz of this Question
sanyamlala
GATE-CS-2016 (Set 2)
GATE-GATE-CS-2016 (Set 2)
GATE
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
GATE | Gate IT 2007 | Question 25
GATE | GATE-CS-2001 | Question 39
GATE | GATE-CS-2000 | Question 41
GATE | GATE-CS-2005 | Question 6
GATE | GATE MOCK 2017 | Question 21
GATE | GATE-CS-2006 | Question 47
GATE | GATE MOCK 2017 | Question 24
GATE | Gate IT 2008 | Question 43
GATE | GATE-CS-2009 | Question 38
GATE | GATE-CS-2003 | Question 90
Program to find Nth term of series 2, 12, 28, 50, 77, 112, 152, 198, ..... - GeeksforGeeks

10 Mar, 2021
Given a number N. The task is to write a program to find the Nth term of the below series: 
2, 12, 28, 50, 77, 112, 152, 198.....(N Terms)
Examples:  
Input: N = 4
Output: 50
For N = 4
4th Term = ( 3 * 4 * 4 + 4 - 2) 
         = 50

Input: N = 10
Output: 307
 
Approach: The generalized Nth term of this series:  
 
Below is the required implementation:  
C++
Java
Python3
C#
PHP
Javascript
// C++ program to find the N-th term of the series:// 2, 12, 28, 50, 77, 112, 152, 198, .....#include <iostream>#include <math.h>using namespace std; // calculate Nth term of seriesint nthTerm(int n){    return 3 * pow(n, 2) + n - 2;} // Driver codeint main(){    int N = 4;     cout << nthTerm(N) << endl;     return 0;}
// Java program to find the N-th term of the series:// 2, 12, 28, 50, 77, 112, 152, 198, .....import java.util.*; class solution{ // calculate Nth term of seriesstatic int nthTerm(int n){return 3 *(int)Math.pow(n, 2) + n - 2;} //Driver programpublic static void main(String arr[]){         int N = 4;    System.out.println(nthTerm(N));} }//This code is contributed by Surendra_Gangwar
# Python3 program to find the# N-th term of the series:# 2, 12, 28, 50, 77, 112, 152, 198, ..... # calculate Nth term of seriesdef nthTerm(n):     return 3 * pow(n, 2) + n - 2 # Driver codeN = 4print(nthTerm(N)) # This code is contributed by# Sanjit_Prasad
// C# program to find the// N-th term of the series:// 2, 12, 28, 50, 77, 112, 152, 198, .....using System; class GFG{ // calculate Nth term of seriesstatic int nthTerm(int n){    return 3 * (int)Math.Pow(n, 2) +                             n - 2;} // Driver Codepublic static void Main(){    int N = 4;    Console.Write(nthTerm(N));}} // This code is contributed// by ChitraNayal
<?php// PHP program to find the// N-th term of the series:// 2, 12, 28, 50, 77,// 112, 152, 198, ..... // calculate Nth term of seriesfunction nthTerm($n){    return 3 * pow($n, 2) + $n - 2;} // Driver code$N = 4; echo nthTerm($N) ; // This code is contributed// by inder_verma?>
<script>// JavaScript program to find the N-th term of the series:// 2, 12, 28, 50, 77, 112, 152, 198, ..... // calculate Nth term of seriesfunction nthTerm( n){    return 3 * Math.pow(n, 2) + n - 2;} // Driver codelet N = 4;    document.write( nthTerm(N) ); // This code contributed by gauravrajput1 </script>
50
 
Time Complexity: O(1) 
Sanjit_Prasad
SURENDRA_GANGWAR
ukasp
inderDuMCA
GauravRajput1
series
Mathematical
School Programming
Mathematical
series
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Merge two sorted arrays
Modulo Operator (%) in C/C++ with Examples
Prime Numbers
Sieve of Eratosthenes
Program to find GCD or HCF of two numbers
Python Dictionary
Arrays in C/C++
Inheritance in C++
Reverse a string in Java
C++ Classes and Objects
HTML | keygen Tag - GeeksforGeeks

17 Mar, 2022
The <keygen> tag in HTML is used to specify a key-pair generator field in a form. The purpose of <keygen> element is to provide a secure way to authenticate users. When a from is submitted then two keys are generated, private key and public key. The private key stored locally, and the public key is sent to the server. The public key is used to generate client certificate to authenticate user for future.
Syntax:
<keygen name = "name">
Example:
<!DOCTYPE html><html>    <head>        <title>            HTML keygen tag        </title>    </head>          <body>        <h1 style = "color:green;">            GeeksforGeeks        </h1>                   <h2>Keygen Tag</h2>                   <form>            Username: <input type="text" name="uname">            <br><br>            Encryption: <keygen name="secure">            <input type="submit">        </form>    </body></html>                    
Output:
Supported Browsers: The browser supported by <keygen> tag are listed below:
Google Chrome
Firefox
Safari
Opera
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.
HTML-Tags
HTML
HTML
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to insert spaces/tabs in text using HTML/CSS?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to update Node.js and NPM to next version ?
How to set the default value for an HTML <select> element ?
Hide or show elements in HTML using display property
How to set input type date in dd-mm-yyyy format using HTML ?
REST API (Introduction)
How to Insert Form Data into Database using PHP ?
CSS to put icon inside an input element in a form
Types of CSS (Cascading Style Sheet)
How to catch multiple exceptions in one line (except block) in Python?

We catch multiple exceptions in one except block as follows
An except clause may name multiple exceptions as a parenthesized tuple, for example
try:
raise_certain_errors():
except (CertainError1, CertainError2,...) as e:
handle_error()
Separating the exception from the variable with a comma still works in Python 2.6 and 2.7, but is now deprecated and does not work in Python 3; now we should use ‘as’.
The parentheses are necessary as the commas are used to assign the error objects to names. The ‘as’ keyword is for the assignment. We can use any name for the error object like ‘error’, ‘e’, or ‘err’
Given code can be written as follows
try:
#do something
except (someException, someotherException) as err:
#handle_exception()
Taking input in Python

In this tutorial, we are going to learn how to take input in Python.
In Python2, we will find two different functions to take input from the user. One is raw_input another one is input.
The function raw_input([promt]) is used to take the string as input from the user.
The function input([prompt]) is used to take the integers as input from the user.
# taking 'string' input
a = raw_input('Enter your name:- ')
# printing the type
print(type(a))
# taking the 'int' input
b = input()
# printing the type
print(type(b))
If you run the above code, then you will get the following result.
Enter your name:- Tutorialspoint
<type 'str'>
5
<type 'int'>
In Python3, the function raw_input() is removed. Now, we have only input([prompt]) function take the input from the user. And anything that user enters will be a string in Python.
We have to convert it into respective data types using different built-in functions. Let's see examples.
# taking input from the user
a = input('Enter a name:- ')
# printing the data
print(type(a), a)
# asking number from the user
b = input('Enter a number:- ')
# converting the 'string' to 'int'
b = int(b)
# printing the data
print(type(b), b)
If you run the above code, then you will get the following result.
Enter a name:- Tutorialspoint
<class 'str'> Tutorialspoint
Enter a number:- 5
<class 'int'> 5
If you have any doubts in the tutorial, mention them in the comment section.
Program to find maximum number of balanced groups of parentheses in Python

Suppose we have a string s that contains balanced parentheses "(" and ")", we have to split
them into the maximum number of balanced groups.
So, if the input is like "(()())()(())", then the output will be ['(()())', '()', '(())']
To solve this, we will follow these steps −
temp := blank string
groups := a new list
count := 0
for each character b in s, doif count is same as 0 and size of temp > 0, theninsert temp at the end of groupstemp := blank stringtemp := temp concatenate bif b is same as '(', thencount := count + 1otherwise,count := count - 1
if count is same as 0 and size of temp > 0, theninsert temp at the end of groupstemp := blank string
insert temp at the end of groups
temp := blank string
temp := temp concatenate b
if b is same as '(', thencount := count + 1
count := count + 1
otherwise,count := count - 1
count := count - 1
insert temp at the end of groups
return groups
Let us see the following implementation to get better understanding −
 Live Demo
class Solution:
   def solve(self, s):
      temp = ''
      groups = []
      count = 0
      for b in s:
         if count == 0 and len(temp) > 0:
            groups.append(temp)
         temp = ''
         temp += b
         if b == '(':
            count += 1
         else:
            count -= 1
      groups.append(temp)
      return groups
s = "(()())()(())"
ob = Solution()
print(ob.solve(s))
"(()())()(())"
['(()())', '()', '(())']
Can you pass the negative number as an Array size in Java?

In general, arrays are the containers that store multiple variables of the same datatype. These are of fixed size and the size is determined at the time of creation. Each element in an array is positioned by a number starting from 0.
You can access the elements of an array using name and position as −
System.out.println(myArray[3]);
//Which is 1457
In Java, arrays are treated as referenced types you can create an array using the new keyword similar to objects and populate it using the indices as −
int myArray[] = new int[7];
While creating array in this way, you must specify the size of the array.
You can also directly assign values within flower braces separating them with commas (,) as −
int myArray = {1254, 1458, 5687, 1457, 4554, 5445, 7524};
No, you cannot use a negative integer as size, the size of an array represents the number of elements in it, –ve number of elements in an array makes no sense.
Still if you do so, the program gets compiled without issues but, while executing it generates a runtime exception of type NegativeArraySizeException
In the following Java program, we are trying to create an array with a negative value as size.
public class Test {
   public static void main(String[] args) {
      int[] intArray = new int[-5];
   }
}
On executing, this program generates a run time exception as shown below.
Exception in thread "main" java.lang.NegativeArraySizeException
at myPackage.Test.main(Test.java:6)
Print all the possible arithmetic expressions for a given number - GeeksforGeeks

20 Jun, 2021
Given an integer N, the task is to print all the possible arithmetic expressions using all numbers from 1 to N and with binary operator +, –, * and /.Examples:  
Input: n = 2 Output: 1+2, 1-2, 1/2, 1*2Input: n = 3 Output: 1+2+3, 1+2-3, 1+2/3, 1+2*3, 1-2+3, 1-2-3, 1-2/3, 1-2*3 1/2+3, 1/2-3, 1/2/3, 1/2*3, 1*2+3, 1*2-3, 1*2/3, 1*2*3  
 
Approach: 
We will create a character array of length = n + n – 1, because for an expression with n operands to be valid we will need n-1 operators.  
Iterate the array and put numbers at even position whereas symbols at the odd position and call the function recursively.  
If number of characters becomes equal to the length of array, print the array.  
Below is the implementation of the above approach: 
CPP
// C++ program to print all the// expressions for the input value #include<iostream>#include<bits/stdc++.h>using namespace std; // Function to print all the// expressions using the numbervoid PrintRecursive(char *str,int arr[],                 int i, int n,char *res,                 int j, int len,int ln){    // Termination condition    if(j==len)    {        res[j]='\0';        cout<<res<<endl;        return;    }    // Even position will contain    // the numbers    if(j%2==0)    {        res[j]='0'+arr[i];                 // Recursive call         PrintRecursive(str,arr,i+1,n,res,                        j+1,len,ln);    }    else    {        // Add a symbol from string in        // odd position.        for(int k=0;k<ln;k++)        {            res[j]=str[k];            PrintRecursive(str,arr,i,n,res,                           j+1,len,ln);        }    }} void PrintExpressions(int n){    // Character array containing    // expressions    char str[4]={'+','-','/','*'};        str[4]='\0';         int ln=strlen(str);         int a[n];    for(int i=0;i<n;i++)    {        a[i] = i + 1;    }    char res[( 2 * n ) - 1];         PrintRecursive(str,a,0,n,res,0,                   2*n-1,ln);    return;} //Driver codeint main(){    int n = 2;         PrintExpressions(n);          return 0;}
1+2
1-2
1/2
1*2
 
anikakapoor
Arrays
Strings
Arrays
Strings
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Chocolate Distribution Problem
Reversal algorithm for array rotation
Window Sliding Technique
Next Greater Element
Find duplicates in O(n) time and O(1) extra space | Set 1
Reverse a string in Java
Write a program to print all permutations of a given string
C++ Data Types
Longest Common Subsequence | DP-4
Check for Balanced Brackets in an expression (well-formedness) using Stack
Cypress - Dashboards

Cypress Dashboard Service has to be set up to create a link between Cypress tests running in our system and the dashboard which is hosted on the cloud.
The features of Cypress Dashboard are explained below −
It provides data on the total number of passed, failed and skipped test cases.
It provides data on the total number of passed, failed and skipped test cases.
The stack trace and screenshots of the failed tests are available.
The stack trace and screenshots of the failed tests are available.
The video of test execution is available.
The video of test execution is available.
Management of test data, framework and their access is possible.
Management of test data, framework and their access is possible.
The usage trends in the organization is provided.
The usage trends in the organization is provided.
To set up the process, first, we should go to the Runs tab in the Cypress Test Runner window. Then, click on Connect to Dashboard. The following screen will appear −
We shall get various options of logging on to the Dashboard, as shown below −
After successful sign in, we shall get the success message. Click on Continue.
Enter the project name, owner and users, who can see the project.
Then, click on Set up project.
Cypress shall then give the following suggestions −
project Id
project Id
unique project key (in form of command to be executed in terminal)
unique project key (in form of command to be executed in terminal)
The projectId obtained from the Cypress suggestion should match with the project id available in the cypress.json file within the project folder.
Next, we have to run the below mentioned command as suggested by Cypress −
node_modules/cypress/bin/cypress run --record --key <project key>

The screen given below will appear −
Once the execution is done, we have to open the Runs tab of the Test Runner. It has the information on platform, browser, and duration of the tests.
The test records shall be visible. Click on a record.
The record is opened in a browser, with the test result Overview (count of passed, failed, pending, skipped), as shown below.
In the Specs tab, we should have the details of each test and its result.
Additionally, there are features like output, failed test screenshot, videos, and so on.

    73 Lectures 
     12 hours 

 Rahul Shetty
 Print
 Add Notes
 Bookmark this page
How to rename multiple column headers in a Pandas DataFrame? - GeeksforGeeks

27 Jan, 2022
In this article, we are going to rename multiple column headers using rename() method. The rename method used to rename a single column as well as rename multiple columns at a time. And pass columns that contain the new values and inplace = true as an argument. We pass inplace = true because we just modify the working data frame if we pass inplace = false then it returns a new data frame.
Approach:
Import pandas.
Create a data frame with multiple columns.
Create a dictionary and set key = old name, value= new name of columns header.
Assign the dictionary in columns .
Call the rename method and pass columns that contain dictionary and inplace=true as an argument.
Below is the implementation:
Example 1:
Python
# import pandasimport pandas as pd # create data framedf = pd.DataFrame({'First Name': ["Mukul", "Rohan", "Mayank",                                  "Vedansh", "Krishna"],                                       'Location': ["Saharanpur", "Rampur", "Agra",                                "Saharanpur", "Noida"],                                       'Pay': [56000.0, 55000.0, 61000.0, 45000.0, 62000.0]}) # print original data framedisplay(df) # create a dictionary# key = old name# value = new namedict = {'First Name': 'Name',        'Location': 'City',        'Pay': 'Salary'} # call rename () methoddf.rename(columns=dict,          inplace=True) # print Data frame after rename columnsdisplay(df)
Output:
Example 2: 
In this example, we will rename the multiple times using the same approach.
Python3
# import pandasimport pandas as pd # create data framedf = pd.DataFrame({'First Name': ["Mukul", "Rohan", "Mayank",                                  "Vedansh", "Krishna"],                                       'Location': ["Saharanpur", "Rampur",                                "Agra", "Saharanpur", "Noida"],                                       'Pay': [56000.0, 55000.0, 61000.0, 45000.0, 62000.0]}) print("Original DataFrame") # print original data framedisplay(df) # create a dictionary# key = old name# value = new namedict = {'First Name': 'Name',        'Location': 'City',        'Pay': 'Salary'} print("\nAfter rename")# call rename () methoddf.rename(columns=dict,          inplace=True) # print Data frame after rename columnsdisplay(df) # create a dictionary# key = old name# value = new namedict = {'Name': 'Full Name',        'City': 'Address',        'Salary': 'Amount'} # call rename () methoddf.rename(columns=dict,          inplace=True) display(df)
Output:
clintra
Python pandas-dataFrame
Python Pandas-exercise
Python-pandas
Technical Scripter 2020
Python
Technical Scripter
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to Install PIP on Windows ?
Check if element exists in list in Python
How To Convert Python Dictionary To JSON?
How to drop one or multiple columns in Pandas Dataframe
Python Classes and Objects
Python | os.path.join() method
Python | Pandas dataframe.groupby()
Create a directory in Python
Defaultdict in Python
Python | Get unique values from a list
Median of two sorted array

Medians are the middle numbers, in other words, the median value is the middle observation in an ordered list. It corresponds to the cumulative percentage of 50%.
The size of two arrays must be same, we will find the median of two separate arrays at first, then compare the separate medians to get an actual median of two lists.
Input:
Two sorted array are given.
Array 1: {1, 2, 3, 6, 7}
Array 2: {4, 6, 8, 10, 11}
Output:
The median from two array. Here the median value is 6.
Merge the given lists into one. {1, 2, 3, 4, 6, 6, 7, 8, 10, 11}
From the merged list find the average of two middle elements. here (6+6)/2 = 6.
median(list, n)
Input: List of data, and the number of data.
Output: Median of the given list.
Begin
   if the list has even number of data, then
      return (list[n/2] + list[n/2-1])/2
   else
      return list[n/2]
End
findMedian(list1, list2, n)
Input − Two sorted lists, and the number of lists.
Output − The median from two sorted lists.
Begin
   if n <= 0, then
      it is invalid, and return invalid number
   if n = 1, then
      return (list1[0] + list2[0])/2
   if n = 2, then
      return ((max of list1[0], list2[0]) + (min of list1[1], list2[1]))/2
   med1 := median(list1, n)
   med2 := median(list2, n)

   if med1 = med2, then
      return med1
   if med1 < med2, then
      if item has even number of data, then
         subList := data from list2, from 0 to n/2 – 1 data
         return findMedian(subList, list1, n – (n/2) + 1)
      subList := data from list2, from 0 to n/2 data
      return findMedian(subList, list2, n – (n/2))
End
#include<iostream>
using namespace std;

int median(int list[], int n) {
   if (n%2 == 0)     //when array containts even number of data
      return (list[n/2] + list[n/2-1])/2;
   else        //for odd number of data
      return list[n/2];
}

intfindMedian(int list1[], int list2[], int n) {
   if (n <= 0)
      return -1;      //invalid length of lists
   if (n == 1)
      return (list1[0] + list2[0])/2;    //for single element simply get average from two array
   if (n == 2)
      return (max(list1[0], list2[0]) + min(list1[1], list2[1])) / 2;

   int med1 = median(list1, n);     //Find median from first array
   int med2 = median(list2, n);     //Find median from second array

   if (med1 == med2)    //when both medians are same, they are the final median
       return med1;
   if (med1 < med2) {
       if (n % 2 == 0)
          return findMedian(list1 + n/2 - 1, list2, n - n/2 +1);
       return findMedian(list1 + n/2, list2, n - n/2);
   }

   if (n % 2 == 0)    //when med1 > med2
      return findMedian(list2 + n/2 - 1, list1, n - n/2 + 1);
   return findMedian(list2 + n/2, list1, n - n/2);
}

int main() {
   int list1[] = {1, 2, 3, 6, 7};
   int list2[] = {4, 6, 8, 10, 11};

   int n1 = 5;
   int n2 = 5;

   if (n1 == n2)
      cout<< "Median is "<<findMedian(list1, list2, n1);
   else
      cout<< "Doesn't work for lists of unequal size";
}
Median is 6
Calculate Square root of a number in R Language - sqrt() Function - GeeksforGeeks

01 Jun, 2020
sqrt() function in R Language is used to calculate the mathematical square-root of the value passed to it as argument.
Syntax: sqrt(x)
Parameter:x: Any numerical value greater than 0
Example 1:
# R code to calculate square root of a number  x1 <- 16x2 <- 18  # Using sqrt() Functionsqrt(x1)sqrt(x2)
Output:
[1] 4
[1] 4.242641
Example 2:
# R code to calculate square root of a number  x1 <- 8.34526x2 <- -18  # Using sqrt() Functionsqrt(x1)sqrt(x2)
Output:
[1] 2.888816
[1] NaN
Warning message:
In sqrt(x2) : NaNs produced
Here, in the above code, NaN is produced because we passed a negative value in the sqrt() function.
R Math-Function
R Language
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to Replace specific values in column in R DataFrame ?
Loops in R (for, while, repeat)
Filter data by multiple conditions in R using Dplyr
How to change Row Names of DataFrame in R ?
Change Color of Bars in Barchart using ggplot2 in R
Remove rows with NA in one column of R DataFrame
How to Change Axis Scales in R Plots?
Group by function in R using Dplyr
How to Split Column Into Multiple Columns in R DataFrame?
K-Means Clustering in R Programming
How to Install Seaborn on MacOS? - GeeksforGeeks

30 Sep, 2021
In this article, we will learn how to install seaborn in Python on MacOS. Seaborn is a library for making statistical graphics in Python. It is built on top of matplotlib and is closely integrated with pandas data structures.
Follow the below steps to install the Seaborn package on macOS using pip:
Step 1: Install the latest Python3 in MacOS
Step 2: Check if pip3 and python3 are correctly installed.
python3 --version
pip3 --version
Step 3: Upgrade your pip to avoid errors during installation.
pip3 install --upgrade pip
Step 4: Enter the following command to install Seaborn using pip3.
pip3 install seaborn
Follow the below steps to install the Seaborn package on macOS using the setup.py file:
Step 1: Download the latest source package of Seaborn for python3 from here.
curl https://files.pythonhosted.org/packages/58/81/51b7ee560a1b01d5c47cae22bfed4e79f1529a08cdff950506097b0d51e1/seaborn-0.11.2.tar.gz > seaborn.tar.gz
Step 2: Extract the downloaded package using the following command.
tar -xzvf seaborn.tar.gz
Step 3: Go inside the folder and Enter the following command to install the package.
Note: You must have developer tools for XCode MacOS installed in your system
cd seaborn-0.11.2
python3 setup.py install
Make the following import in your python terminal to verify if the installation has been done properly:
import seaborn
If there is any error while importing the module then is not installed properly.
how-to-install
Picked
Python-Seaborn
How To
Installation Guide
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
How to Install FFmpeg on Windows?
How to Set Git Username and Password in GitBash?
How to Add External JAR File to an IntelliJ IDEA Project?
How to Install Jupyter Notebook on MacOS?
How to Create and Setup Spring Boot Project in Eclipse IDE?
Installation of Node.js on Linux
How to Install FFmpeg on Windows?
How to Install Pygame on Windows ?
How to Add External JAR File to an IntelliJ IDEA Project?
How to Install Jupyter Notebook on MacOS?
C++ Bitset Library - to_string() Function

The C++ function std::bitset::test() Tests whether Nth bit is set or not.
The C++ function std::bitset::to_string() converts bitset object to string object.
Following is the declaration for std::bitset::to_string() function form std::bitset header.
template <class charT, class traits, class Alloc>
basic_string<charT,traits,Alloc> to_string() const;
template <class charT = char,
          class traits = char_traits<charT>,
          class Alloc = allocator<charT>>
          basic_string<charT,traits,Alloc> to_string (charT zero = charT('0'),
          charT one  = charT('1')) const;
None
Returns string representation of bitset object.
No change in bitset if exception is thrown.
The following example shows the usage of std::bitset::to_string() function.
#include <iostream>
#include <bitset>

using namespace std;

int main(void) {

   bitset<4> b;

   string s = b.to_string();

   cout << s << endl;

   return 0;
}
Let us compile and run the above program, this will produce the following result −
0000

 Print
 Add Notes
 Bookmark this page
Implement array match in MongoDB?

Use $all for array match. The $all operator selects the documents where the value of a field is an array that contains all the specified elements. Let us create a collection with documents −
> db.demo668.createIndex({"ListOfSubject":1});
{
   "createdCollectionAutomatically" : true,
   "numIndexesBefore" : 1,
   "numIndexesAfter" : 2,
   "ok" : 1
}
> db.demo668.insert({"ListOfSubject":["MySQL","Java","C"]});
WriteResult({ "nInserted" : 1 })
> db.demo668.insert({"ListOfSubject":["MongoDB","Python","C++"]});
WriteResult({ "nInserted" : 1 })
> db.demo668.insert({"ListOfSubject":["C#","Spring","Hibernate","MongoDB"]});
WriteResult({ "nInserted" : 1 })
Display all documents from a collection with the help of find() method −
> db.demo668.find();
This will produce the following output −
{ "_id" : ObjectId("5ea311df04263e90dac943d6"), "ListOfSubject" : [ "MySQL", "Java", "C" ] }
{ "_id" : ObjectId("5ea311e004263e90dac943d7"), "ListOfSubject" : [ "MongoDB", "Python", "C++" ] }
{ "_id" : ObjectId("5ea311e104263e90dac943d8"), "ListOfSubject" : [ "C#", "Spring", "Hibernate", "MongoDB" ] }
Following is the query for array match −
> db.demo668.find({"ListOfSubject":{ $all:["MongoDB","C++"]}});
This will produce the following output −
{ "_id" : ObjectId("5ea311e004263e90dac943d7"), "ListOfSubject" : [ "MongoDB", "Python", "C++" ] }
Rnd() and Round Function in MS Access - GeeksforGeeks

02 Sep, 2020
1. Rnd() Function :Rnd() function return the random number.if we want to generate a number between 0 to 1 then use only Rnd. Otherwise, if we want to generate a number between a range then we will use the formula Int ((upperbound – lowerbound + 1) * Rnd + lowerbound).
Syntax :
If we want to generate between 0 to 1 –Rnd 
Rnd 
If we want to generate in a range –Int((upperbound - lowerbound + 1) * Rnd + lowerbound) 
Int((upperbound - lowerbound + 1) * Rnd + lowerbound) 
Example-1 :
SELECT Int ((10 - 1 + 1) * Rnd + 1) AS RandNumBetween1and10;
Output –
Example-2 :
SELECT Rnd AS RandNumBetween0and1;
Output –
2. Round() Function :Round() function returns rounds a number to a specified number of decimal places.In this function we will pass an expression and the second parameter will be decimal places till that the number will be rounded.
Note :If the number ends with 5 then this function rounded last digits as even number.
Syntax :
Round(expression, decimal_places)
Example-1 :
SELECT Round(23.67, 1) As round;
Output –
Example-2 :
SELECT Round(45.65, 1) As round;
Output –
DBMS-SQL
SQL-Server
SQL
SQL
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Difference between DELETE, DROP and TRUNCATE
How to Update Multiple Columns in Single Update Statement in SQL?
Difference between SQL and NoSQL
Difference between DDL and DML in DBMS
SQL Interview Questions
What is Temporary Table in SQL?
SQL Query to Find the Name of a Person Whose Name Starts with Specific Letter
Difference between Where and Having Clause in SQL
SQL - ORDER BY
SQL using Python
How to use Split-Path command in PowerShell?

Split-Path is to retrieve the part of the specified path, such as a parent folder, a subfolder, or a file name. It can also tell if the path is relative or absolute.
This command supports a few parameters which help to retrieve the part of the specified path. Consider we have below executable file path and we will see how the Split-Path command will retrieve the parent folder and subfolder as well as the root directory.
'C:\Temp\PsExec.exe'
Default Split-Path command will retrieve the parent folder name of the file.
PS C:\> Split-Path 'C:\Temp\PsExec.exe'
C:\Temp
Here the default parameter is -Parent, which retrieves the parent folder path. Above command is similar to,
PS C:\> Split-Path 'C:\Temp\PsExec.exe' -Parent
C:\Temp
If you need only file name then use the -Leaf parameter.
PS C:\> Split-Path 'C:\Temp\PsExec.exe' -Leaf
PsExec.exe
To retrieve the root directory, you need to use the -Qualifier parameter.
PS C:\> Split-Path 'C:\Temp\PsExec.exe' -Qualifier
C:
If you want to check if the path is absolute or relative then use the -IsAbsolute Parameter.
PS C:\> Split-Path 'C:\Temp\PsExec.exe' -IsAbsolute
True

PS C:\Temp> Split-Path .\PsExec.exe -IsAbsolute
False
Now, let say you want the file names inside the folder so if we write below command that won’t give the desired output.
PS C:\> Split-Path C:\Scripts\* -Leaf
*
The output is * only and the command didn’t retrieve the files/folders name. To solve this issue, -Resolve parameter is used.
Split-Path C:\scripts\* -Leaf -Resolve

DSCTest
Lab01
MyModules
VS_Installation
DscTest.ps1
Servers.txt
You can see the files and folder names. Similarly, if you want to retrieve the specific extension files, you can use both the parameters -Leaf and -Resolve.
PS C:\> Split-Path C:\scripts\*.ps1 -Leaf -Resolve
DscTest.ps1
Similarly, you can apply Split-Path command for the registry.
Split-Path 'HKCU:\Software\Microsoft\Internet Explorer\Control Panel\'
HKCU:\Software\Microsoft\Internet Explorer

Split-Path 'HKCU:\Software\Microsoft\Internet Explorer\Control Panel\' -Qualifier
HKCU:

Split-Path 'HKCU:\Software\Microsoft\Internet Explorer\Control Panel\' -Leaf
Control Panel
Tailwind CSS Transition Delay - GeeksforGeeks

23 Mar, 2022
This class accepts lots of value in tailwind CSS in which all the properties are covered as in class form. The transition delay class is used to specify the length of time (in seconds or milliseconds) to start the transition effect. In CSS, we have done that by using the CSS transition-delay.
Transition Delay classes:
delay-75: This class is used to start the transition time of 75ms.
delay-100: This class is used to start the transition time of 100ms.
delay-150: This class is used to start the transition time of 150ms.
delay-200: This class is used to start the transition time of 200ms.
delay-300: This class is used to start the transition time of 300ms.
delay-500: This class is used to start the transition time of 500ms.
delay-700: This class is used to start the transition time of 700ms.
delay-1000: This class is used to start the transition time of 1000ms.
Syntax:
<element class="delay-{amount}">...</element>
Example:
HTML
<!DOCTYPE html> <html><head>     <link href= "https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"        rel="stylesheet"> </head>   <body class="text-center mx-4 space-y-2">     <h1 class="text-green-600 text-5xl font-bold">         GeeksforGeeks     </h1>     <b>Tailwind CSS Transition Delay Class</b>     <div class="bg-green-200 m-8 grid grid-flow-col gap-4 p-5">         <button class="transition delay-75 ease-in-out                        bg-green-300 hover:bg-green-600 transform                        hover:-translate-y-1 hover:scale-110                        rounded-lg p-4 border border-green-900">            Hover me        </button>        <button class="transition delay-100 ease-in-out                        bg-green-300 hover:bg-green-600 transform                        hover:-translate-y-1 hover:scale-110                        rounded-lg p-4 border border-green-900">            Hover me        </button>        <button class="transition delay-500 ease-in-out                        bg-green-300 hover:bg-green-600 transform                        hover:-translate-y-1 hover:scale-110                        rounded-lg p-4 border border-green-900">            Hover me        </button>        <button class="transition delay-1000 ease-in-out                        bg-green-300 hover:bg-green-600 transform                        hover:-translate-y-1 hover:scale-110                        rounded-lg p-4 border border-green-900">            Hover me        </button>    </div> </body>   </html>
Output:
transition delay 
Tailwind CSS
Tailwind-Transition & Animation
CSS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
How to insert spaces/tabs in text using HTML/CSS?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to create footer to stay at the bottom of a Web page?
How to update Node.js and NPM to next version ?
CSS to put icon inside an input element in a form
Remove elements from a JavaScript Array
Installation of Node.js on Linux
Convert a string to an integer in JavaScript
How to fetch data from an API in ReactJS ?
How to insert spaces/tabs in text using HTML/CSS?
Operator Overloading in C++ - GeeksQuiz

16 Apr, 2021
#include <stdlib.h>
#include <stdio.h>
#include <iostream>

using namespace std;

class Test {
private:
    void* operator new(size_t size) {}
    void* operator new[](size_t size) {}
};

int main()
{
    Test *obj = new Test;
    Test *arr = new Test[10];
    return 0;
}

1) Comparison Operator ( == )
2) Assignment Operator ( = ) 
#include<iostream>
using namespace std;

class Complex {
private:
    int real, imag;
public:
    Complex(int r = 0, int i =0)  {real = r;   imag = i;}
};

int main()
{
    Complex c1(10, 5), c2(2, 4);

    // For example, below code works fine
    c1 = c2;

    // But this code throws compiler error
    if (c1 == c2)
       cout << "Same";

    return 0;
}
#include <iostream>
using namespace std;

class Complex
{
private:
    int real;
    int imag;
public:
    Complex(int r = 0, int i =0)
    {
        real = r;
        imag = i;
    }
    friend ostream & operator << (ostream &out, const Complex &c);
};

ostream & operator << (ostream &out, const Complex &c)
{
    out << c.real;
    out << "+i" << c.imag;
    return out;
}

int main()
{
    Complex c1(10, 15);
    cout << c1;
    return 0;
}

class Complex
{
private:
    int real;
    int imag;
public:
    Complex(int r, int i)  {  real = r;   imag = i; }
    Complex operator ++(int);
    Complex & operator ++();
};

Complex &Complex::operator ++()
{
    real++; imag++;
    return *this;
}

Complex Complex::operator ++(int i)
{
    Complex c1(real, imag);
    real++; imag++;
    return c1;
}

int main()
{
    Complex c1(10, 15);
    c1++; 
    ++c1;
    return 0;
}
10
20
20
20
10
10
new called
Constructor called
delete called
Destructor called
new called
Constructor called
Destructor called
delete called
Constructor called
new called
Destructor called
delete called
Constructor called
new called
delete called
Destructor called
    Test *ptr = new Test;  
    return_type operator()(parameter_list) 
Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
Comments
Old Comments
Must Do Coding Questions for Product Based Companies
How to set background images in ReactJS ?
Microsoft Interview Experience for Internship (Via Engage)
Difference between var, let and const keywords in JavaScript
Array of Objects in C++ with Examples
SQLAlchemy Core - Creating Table
How to Alter Multiple Columns at Once in SQL Server?
How to Replace Values in Column Based on Condition in Pandas?
How to Fix: SyntaxError: positional argument follows keyword argument in Python
C Program to read contents of Whole File
Java regex program to match parenthesis "(" or, ")".

Following regular expression accepts a string with parenthesis −
"^.*[\\(\\)].*$";
^ matches the starting of the sentence.
^ matches the starting of the sentence.
.* Matches zero or more (any) characters.
.* Matches zero or more (any) characters.
[\\(\\)] matching parenthesis.
[\\(\\)] matching parenthesis.
$ indicates the end of the sentence.
$ indicates the end of the sentence.
 Live Demo
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class SampleTest {
   public static void main( String args[] ) {
      String regex = "^.*[\\(\\)].*$";
      //Reading input from user
      Scanner sc = new Scanner(System.in);
      System.out.println("Enter data: ");
      String input = sc.nextLine();
      //Instantiating the Pattern class
      Pattern pattern = Pattern.compile(regex);
      //Instantiating the Matcher class
      Matcher matcher = pattern.matcher(input);
      //verifying whether a match occurred
      if(matcher.find()) {
         System.out.println("Input accepted");
      }else {
         System.out.println("Not accepted");
      }
   }
}
Enter data:
sample(text) with parenthesis
Input accepted
Enter data:
sample text
Not accepted
 Live Demo
import java.util.Scanner;
public class Example {
   public static void main(String args[]) {
      //Reading String from user
      System.out.println("Enter email address: ");
      Scanner sc = new Scanner(System.in);
      String e_mail = sc.nextLine();
      //Regular expression
      String regex = "^.*[\\(\\)].*$";
      boolean result = e_mail.matches(regex);
      if(result) {
         System.out.println("Valid match");
      } else {
         System.out.println("Invalid match");
      }
   }
}
Enter email address:
sample(text) with parenthesis
Valid match
Enter email address:
sample text
Invalid match
How to add a where clause in a MySQL Insert statement?

You need to use UPDATE statement for this.
The syntax is as follows
update yourTableName
set yourColumnName1=yourValue1,yourColumnName2=yourValue2,....N
where yourCondition;
Let us create a table for our example
mysql> create table addWhereClauseDemo
   -> (
   -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
   -> StudentName varchar(30),
   -> StudentPassword varchar(40)
   -> );
Query OK, 0 rows affected (0.45 sec)
Insert some records in the table using insert command.
The query is as follows
mysql> insert into addWhereClauseDemo(StudentName,StudentPassword) values('John','John123456');
Query OK, 1 row affected (0.14 sec)
mysql> insert into addWhereClauseDemo(StudentName,StudentPassword) values('Carol','99999');
Query OK, 1 row affected (0.24 sec)
mysql> insert into addWhereClauseDemo(StudentName,StudentPassword) values('Bob','OO7Bob');
Query OK, 1 row affected (0.16 sec)
mysql> insert into addWhereClauseDemo(StudentName,StudentPassword) values('David','David321');
Query OK, 1 row affected (0.26 sec)
Display all records from the table using select statement.
The query is as follows
mysql> select *from addWhereClauseDemo;
The following is the output
+-----------+-------------+-----------------+
| StudentId | StudentName | StudentPassword |
+-----------+-------------+-----------------+
| 1         | John        | John123456      |
| 2         | Carol       | 99999           |
| 3         | Bob         | OO7Bob          |
| 4         | David       | David321        |
+-----------+-------------+-----------------+
4 rows in set (0.00 sec)
Here is the query to add a where clause i.e. updating the records
mysql> update addWhereClauseDemo
-> set StudentName='Maxwell',StudentPassword='Maxwell44444' where StudentId=4;
Query OK, 1 row affected (0.18 sec)
Rows matched: 1 Changed: 1 Warnings: 0
Let us check the table records once again.
The query is as follows
mysql> select *from addWhereClauseDemo;
The following is the output
+-----------+-------------+-----------------+
| StudentId | StudentName | StudentPassword |
+-----------+-------------+-----------------+
| 1         | John        | John123456      |
| 2         | Carol       | 99999           |
| 3         | Bob         | OO7Bob          |
| 4         | Maxwell     | Maxwell44444    |
+-----------+-------------+-----------------+
4 rows in set (0.00 sec)
How to list directory tree structure in python?

You can use the os.walk() method to get the list of all children of path you want to display the tree of. Then you can join the paths and get the absolute path of each file.
import os
def tree_printer(root):
    for root, dirs, files in os.walk(root):
        for d in dirs:
            print os.path.join(root, d)    
        for f in files:
            print os.path.join(root, f)
tree_printer('.')
This will print a list of all the directories in your tree first and the print the paths of all the files in the directory recursively.
C:\hello\my_folder
C:\hello\another_folder
C:\hello\my_folder\abc.txt
C:\hello\my_folder\xyz.txt
C:\hello\another_folder\new.txt
...
Excel Add Cells

Columns can be added and deleted. You access the menu by right clicking the column letter. New columns are added to the same place you clicked.
Let's try to create a new column B.
Right click on the column and select "Insert Columns":
And a new column is created:
Next, we need to get some Pokemon trainers in there. Type or copy the following data in the new column B:
Rows can also be added and deleted. You access the menu by right clicking the row number. New rows are added to the same place you clicked.
Let's try to create a new row 4.
We forgot to add Iva's Pokemon, Marowak. Lets add his data to the new row 4, by typing or copying the following values:
Excellent job!
Complete the name of the command for adding columns:
 Columns

Start the Exercise
We just launchedW3Schools videos
Get certifiedby completinga course today!
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com
Your message has been sent to W3Schools.
Go Variables

Variables are containers for storing data values.
In Go, there are different types of variables, for example:
int- stores integers (whole numbers), such as 123 or -123
float32- stores floating point numbers, with decimals, such as 19.99 or -19.99
string - stores text, such as "Hello World". String values are surrounded by double quotes
bool- stores values with two states: true or false
More about different variable types, will be explained in the Go Data Types chapter.
In Go, there are two ways to declare a variable:
Use the var keyword, followed by variable name and type:
Note: You always have to specify either type 
or value (or both).
Use the := sign, followed by the variable value:
Note:  In this case, the type of the variable is inferred from the value 
(means that the compiler decides the type of the variable, based on the value).
Note: It is not possible to declare a variable using
  :=, without assigning a value to it.
If the value of a variable is known from the start, you can declare the variable and assign a value to it 
on one line:
Note: The variable types of student2 and x is inferred from 
their values.
In Go, all variables are initialized. So, if you declare a variable without an initial value, 
its value will be set to the default value of its type: 
In this example there are 3 variables:
a
b
c
These variables are declared but they have not been assigned initial values.
By running the code, we can see that they already have the default values of their respective types:
a is ""
b is 0
c is false
It is possible to assign a value to a variable after it is declared. This is helpful for cases the value is not initially known.
Note: It is not possible to declare a variable using ":=" without assigning a value to it.
There are some small differences between the var var :=:
This example shows declaring variables outside of a function, with the var 
  keyword:
Since := is used outside of a function, running the program results in an error. 
Result:
Create a variable named myNum and assign the value 50 to it.
package main   
import ("fmt") 
func main() {
  var  = 
  fmt.Println()
}

Start the Exercise
We just launchedW3Schools videos
Get certifiedby completinga course today!
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:
help@w3schools.com
Your message has been sent to W3Schools.
How to get the value of an Entry widget in Tkinter?

Let us suppose that we have created an Entry widget and we want to get the value of it. In this case, we can use the .get() method. It maps the input object into a variable which can be used further to print or display the entered value.
In this example, we will create an application that will display the input text thorough a label widget.
#Import tkinter library
from tkinter import *
from tkinter import ttk
#Create an instance of tkinter frame or window
win= Tk()
#Set the geometry of tkinter frame
win.geometry("750x250")
def get_value():
   e_text=entry.get()
   Label(win, text=e_text, font= ('Century 15 bold')).pack(pady=20)
#Create an Entry Widget
entry= ttk.Entry(win,font=('Century 12'),width=40)
entry.pack(pady= 30)
#Create a button to display the text of entry widget
button= ttk.Button(win, text="Enter", command= get_value)
button.pack()
win.mainloop()
Running the above code will display a window that contains an entry widget and a button.
In the given output, if we will click the Enter button. It will mimic the input value from the Entry widget.