title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Find the sum of the ascii values of characters which are present at prime positions - GeeksforGeeks | 10 May, 2021
Given string str of size N, the task is to find the sum of all ASCII values of the characters which are present at prime positions.Examples:
Input: str = “abcdef” Output: 298 ‘b’, ‘c’ and ‘e’ are the only characters which are at prime positions i.e. 2, 3 and 5 respectively. And sum of their ASCII values ... | [
{
"code": null,
"e": 25472,
"s": 25444,
"text": "\n10 May, 2021"
},
{
"code": null,
"e": 25615,
"s": 25472,
"text": "Given string str of size N, the task is to find the sum of all ASCII values of the characters which are present at prime positions.Examples: "
},
{
"code"... |
Linear Regression from Scratch with NumPy — Implementation (Finally!) | by Levent Baş | Towards Data Science | Welcome to the second part of Linear Regression from Scratch with NumPy series! After explaining the intuition behind linear regression, now it is time to dive into the code for implementation of linear regression. If you want to catch up on linear regression intuition you can read the previous part of this series from... | [
{
"code": null,
"e": 530,
"s": 171,
"text": "Welcome to the second part of Linear Regression from Scratch with NumPy series! After explaining the intuition behind linear regression, now it is time to dive into the code for implementation of linear regression. If you want to catch up on linear regres... |
Comprehensive Guide to Multiclass Classification With Sklearn | Towards Data Science | Learn how to tackle any multiclass classification problem with Sklearn. The tutorial covers how to choose a model selection strategy, several multiclass evaluation metrics and how to use them finishing off with hyperparameter tuning to optimize for user-defined metrics.
Even though multi-class classification is not as ... | [
{
"code": null,
"e": 442,
"s": 171,
"text": "Learn how to tackle any multiclass classification problem with Sklearn. The tutorial covers how to choose a model selection strategy, several multiclass evaluation metrics and how to use them finishing off with hyperparameter tuning to optimize for user-d... |
How to match a range of characters using Java regex | To match a range of characters i.e. to match all the characters between two specified characters in a sequence you can use the character class as
[a-z]
The expression “[a-zA-Z]” accepts any English alphabet.
The expression “[a-zA-Z]” accepts any English alphabet.
The expression “[0-9&&[^35]]” accepts numbers except 3 ... | [
{
"code": null,
"e": 1209,
"s": 1062,
"text": "To match a range of characters i.e. to match all the characters between two specified characters in a sequence you can use the character class as "
},
{
"code": null,
"e": 1215,
"s": 1209,
"text": "[a-z]"
},
{
"code": null,
... |
Character.valueOf() in Java with examples - GeeksforGeeks | 06 Dec, 2018
Java.lang.Character.valueOf() is an inbuilt method in Java that returns a Character instance representing the specified char value. If a new Character instance is not required, this method is generally used in preference to the constructor Character(char), since this method is likely to yield significantly... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n06 Dec, 2018"
},
{
"code": null,
"e": 24065,
"s": 23557,
"text": "Java.lang.Character.valueOf() is an inbuilt method in Java that returns a Character instance representing the specified char value. If a new Character instance is ... |
ASP.NET MVC - Views | In an ASP.NET MVC application, there is nothing like a page and it also doesn’t include anything that directly corresponds to a page when you specify a path in URL. The closest thing to a page in an ASP.NET MVC application is known as a View.
In ASP.NET MVC application, all incoming browser requests are handled by the ... | [
{
"code": null,
"e": 2512,
"s": 2269,
"text": "In an ASP.NET MVC application, there is nothing like a page and it also doesn’t include anything that directly corresponds to a page when you specify a path in URL. The closest thing to a page in an ASP.NET MVC application is known as a View."
},
{
... |
How to use waiter functionality for bucket_not_exists using Boto3 and AWS Client? | Problem Statement − Use boto3 library in Python to check whether a bucket does not exist using waiter functionality. For example, use waiters to check whether Bucket_2 does not exist in S3.
Step 1 − Import boto3 and botocore exceptions to handle exceptions.
Step 2 − Use bucket_name as the parameter in the function.
Ste... | [
{
"code": null,
"e": 1252,
"s": 1062,
"text": "Problem Statement − Use boto3 library in Python to check whether a bucket does not exist using waiter functionality. For example, use waiters to check whether Bucket_2 does not exist in S3."
},
{
"code": null,
"e": 1320,
"s": 1252,
"... |
Groovy - Unit Testing | The fundamental unit of an object-oriented system is the class. Therefore unit testing consists of testig within a class. The approach taken is to create an object of the class under testing and use it to check that selected methods execute as expected. Not every method can be tested, since it is not always pratical to... | [
{
"code": null,
"e": 2653,
"s": 2238,
"text": "The fundamental unit of an object-oriented system is the class. Therefore unit testing consists of testig within a class. The approach taken is to create an object of the class under testing and use it to check that selected methods execute as expected.... |
HTML DOM Anchor target Property | The HTML DOM target property associated with the anchor tag (<a>) specifies where the new web page will open after clicking the URL. It can have the following values −
_blank − This will open the linked document in a new window.
_parent − This will open the linked document in the parent frameset.
_top − This will open ... | [
{
"code": null,
"e": 1230,
"s": 1062,
"text": "The HTML DOM target property associated with the anchor tag (<a>) specifies where the new web page will open after clicking the URL. It can have the following values −"
},
{
"code": null,
"e": 1291,
"s": 1230,
"text": "_blank − This ... |
Can we add null elements to a Set in Java? | A Set is a collection that cannot contain duplicate elements. It models the mathematical set abstraction.
It does not allow duplicate elements and allow one null value at most.
Set also adds a stronger contract on the behavior of the equals and hashCode operations, allowing Set instances to be compared meaningfully eve... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "A Set is a collection that cannot contain duplicate elements. It models the mathematical set abstraction."
},
{
"code": null,
"e": 1239,
"s": 1168,
"text": "It does not allow duplicate elements and allow one null value at most."
},... |
How to create real-time Face Detector | by Dimid | Towards Data Science | In this article, I will show you how to write a real-time face detector using Python, TensorFlow/Keras and OpenCV.
I’ll note right away, that all code files are available in this repo.
gitlab.com
First, in Theoretical Part I will tell you a little about the concepts that will be useful for us (Transfer Learning and Dat... | [
{
"code": null,
"e": 287,
"s": 172,
"text": "In this article, I will show you how to write a real-time face detector using Python, TensorFlow/Keras and OpenCV."
},
{
"code": null,
"e": 357,
"s": 287,
"text": "I’ll note right away, that all code files are available in this repo."
... |
How can we implement a custom iterable in Java? | An Iterable interface is defined in java.lang package and introduced with Java 5 version. An object that implements this interface allows it to be the target of the "for-each" statement. This for-each loop is used for iterating over arrays and collections. An Iterable interface can also be implemented to create custom ... | [
{
"code": null,
"e": 1392,
"s": 1062,
"text": "An Iterable interface is defined in java.lang package and introduced with Java 5 version. An object that implements this interface allows it to be the target of the \"for-each\" statement. This for-each loop is used for iterating over arrays and collect... |
Perl kill Function | This function sends a signal to a list of processes. Returns the number of processes successfully signaled.
If SIGNAL is zero, no signal is sent to the process. This is a useful way to check that a child process is alive and hasn't changed its UID. The precise list of signals supported is entirely dependent on the syst... | [
{
"code": null,
"e": 2328,
"s": 2220,
"text": "This function sends a signal to a list of processes. Returns the number of processes successfully signaled."
},
{
"code": null,
"e": 2560,
"s": 2328,
"text": "If SIGNAL is zero, no signal is sent to the process. This is a useful way ... |
Drillthrough like a PRO in Power BI | by Nikola Ilic | Towards Data Science | I must admit that the Power BI development team does really awesome job! Every month (or even less, like in these April and May Power BI Desktop update), they are going above and beyond and introducing fantastic new features.
In March 2020, Microsoft announced Page Navigation as an action for buttons as generally avail... | [
{
"code": null,
"e": 397,
"s": 171,
"text": "I must admit that the Power BI development team does really awesome job! Every month (or even less, like in these April and May Power BI Desktop update), they are going above and beyond and introducing fantastic new features."
},
{
"code": null,
... |
File.WriteAllBytes() Method in C# with Examples - GeeksforGeeks | 26 Feb, 2021
File.WriteAllBytes(String) is an inbuilt File class method that is used to create a new file then writes the specified byte array to the file and then closes the file. If the target file already exists, it is overwritten.
Syntax:
public static void WriteAllBytes (string path, byte[] bytes);
Parameter: T... | [
{
"code": null,
"e": 24856,
"s": 24828,
"text": "\n26 Feb, 2021"
},
{
"code": null,
"e": 25079,
"s": 24856,
"text": "File.WriteAllBytes(String) is an inbuilt File class method that is used to create a new file then writes the specified byte array to the file and then closes the f... |
Print words of a string in reverse order - GeeksforGeeks | 08 Mar, 2022
Let there be a string say “I AM A GEEK”. So, the output should be “GEEK A AM I” . This can done in many ways. One of the solutions is given in Reverse words in a string .
Examples:
Input : I AM A GEEK
Output : GEEK A AM I
Input : GfG IS THE BEST
Output : BEST THE IS GfG
This can be done in more simpler w... | [
{
"code": null,
"e": 24650,
"s": 24622,
"text": "\n08 Mar, 2022"
},
{
"code": null,
"e": 24821,
"s": 24650,
"text": "Let there be a string say “I AM A GEEK”. So, the output should be “GEEK A AM I” . This can done in many ways. One of the solutions is given in Reverse words in a s... |
Fifteen Jupyter Notebook Extensions to a Docker Image | by Bruce H. Cottman, Ph.D. | Towards Data Science | The Docker image for our Jupyter Python and R users required them to set their Nbextensions preferences after every launch. We were able to increase Jupyter notebook user productivity by setting commonly used Nbextensions preferences in the Docker image.
We have a shared disk where anybody can copy the template files t... | [
{
"code": null,
"e": 426,
"s": 171,
"text": "The Docker image for our Jupyter Python and R users required them to set their Nbextensions preferences after every launch. We were able to increase Jupyter notebook user productivity by setting commonly used Nbextensions preferences in the Docker image."... |
How to set new id attribute with jQuery? | To implement this, extract id from attr() and use replace() to replace the id attribute.
Following is the code −
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<link rel="stylesheet" href="//c... | [
{
"code": null,
"e": 1151,
"s": 1062,
"text": "To implement this, extract id from attr() and use replace() to replace the id attribute."
},
{
"code": null,
"e": 1175,
"s": 1151,
"text": "Following is the code −"
},
{
"code": null,
"e": 1878,
"s": 1175,
"text":... |
How to use PowerShell as a Calculator? Or How to use PowerShell for arithmetic operations? | You can use the PowerShell console to perform arithmetic operations, the same way the calculator does.
You can use the PowerShell console to perform arithmetic operations, the same way the calculator does.
To do the addition operation,
2+3
Output − 5
For complex, additional operations as well it is too quick.
For compl... | [
{
"code": null,
"e": 1165,
"s": 1062,
"text": "You can use the PowerShell console to perform arithmetic operations, the same way the calculator does."
},
{
"code": null,
"e": 1268,
"s": 1165,
"text": "You can use the PowerShell console to perform arithmetic operations, the same w... |
How to prevent Serialization to break a Singleton Class Pattern? | A Singleton pattern states that a class can have a single instance and multiple instances are not permitted to be created. For this purpose, we make the constructor of the class a private and return a instance via a static method. But using serialization, we can still create multiple instance of a class. See the exampl... | [
{
"code": null,
"e": 1392,
"s": 1062,
"text": "A Singleton pattern states that a class can have a single instance and multiple instances are not permitted to be created. For this purpose, we make the constructor of the class a private and return a instance via a static method. But using serializatio... |
Making a Bar Chart Race Plot using Plotly — made easy | by Luis Chaves | Towards Data Science | Have you ever seen these racing bar plots for ranking things or people over time? They are getting popular, they are fun to look at and they enable seeing who or what has topped a certain ranking over time. You might have seen the ranking of countries by COVID19 cases in 2020, or the ranking of the richest people from ... | [
{
"code": null,
"e": 667,
"s": 171,
"text": "Have you ever seen these racing bar plots for ranking things or people over time? They are getting popular, they are fun to look at and they enable seeing who or what has topped a certain ranking over time. You might have seen the ranking of countries by ... |
Scala List take() method with example - GeeksforGeeks | 13 Aug, 2019
The take() method belongs to the value member of the class List. It is utilized to take the first n elements from the list.
Method Definition: deftake(n: Int): List[A]
Where, n is the number of elements to be taken from the list.
Return Type:It returns a list containing only the first n elements from the s... | [
{
"code": null,
"e": 25493,
"s": 25465,
"text": "\n13 Aug, 2019"
},
{
"code": null,
"e": 25617,
"s": 25493,
"text": "The take() method belongs to the value member of the class List. It is utilized to take the first n elements from the list."
},
{
"code": null,
"e": 25... |
Special Keyboard | Practice | GeeksforGeeks | Imagine you have a special keyboard with the following keys:
Key 1: Prints 'A' on screen
Key 2: (Ctrl-A): Select screen
Key 3: (Ctrl-C): Copy selection to buffer
Key 4: (Ctrl-V): Print buffer on screen appending it after what has already been printed.
Find maximum numbers of A's that can be produced by pressing keys... | [
{
"code": null,
"e": 300,
"s": 238,
"text": "Imagine you have a special keyboard with the following keys: "
},
{
"code": null,
"e": 493,
"s": 300,
"text": "Key 1: Prints 'A' on screen\nKey 2: (Ctrl-A): Select screen\nKey 3: (Ctrl-C): Copy selection to buffer\nKey 4: (Ctrl-V): Pr... |
Binary Indexed Tree : Range Updates and Point Queries - GeeksforGeeks | 25 Feb, 2020
Given an array arr[0..n-1]. The following operations need to be performed.
update(l, r, val) : Add ‘val’ to all the elements in the array from [l, r].getElement(i) : Find element in the array indexed at ‘i’.Initially all the elements in the array are 0. Queries can be in any order, i.e., there can be many ... | [
{
"code": null,
"e": 25911,
"s": 25883,
"text": "\n25 Feb, 2020"
},
{
"code": null,
"e": 25986,
"s": 25911,
"text": "Given an array arr[0..n-1]. The following operations need to be performed."
},
{
"code": null,
"e": 46476,
"s": 25986,
"text": "update(l, r, va... |
JavaScript | Intl.DateTimeFormat.prototype.resolvedOptions() Method - GeeksforGeeks | 20 Nov, 2021
The Intl.DateTimeFormat.prototype.resolvedOptions() method is an inbuilt method in JavaScript which returns a new object with properties reflecting the locale, date and time formatting options computed during initialization of this DateTimeFormat object.Syntax:
dateTimeFormat.resolvedOptions()
Parameters... | [
{
"code": null,
"e": 26177,
"s": 26149,
"text": "\n20 Nov, 2021"
},
{
"code": null,
"e": 26441,
"s": 26177,
"text": "The Intl.DateTimeFormat.prototype.resolvedOptions() method is an inbuilt method in JavaScript which returns a new object with properties reflecting the locale, dat... |
How to Find the Percentage of Two Cells in Microsoft Excel? - GeeksforGeeks | 18 Jul, 2021
If you want to find the percentage of two cells in Microsoft Excel, Simply select an empty cell, where you want to display the percentage of the two cells.
Type in the following formula in the selected cell :
=address of cell1/address of cell2
For example, I want to print out the percentage of C2 and C3, s... | [
{
"code": null,
"e": 25167,
"s": 25139,
"text": "\n18 Jul, 2021"
},
{
"code": null,
"e": 25323,
"s": 25167,
"text": "If you want to find the percentage of two cells in Microsoft Excel, Simply select an empty cell, where you want to display the percentage of the two cells."
},
... |
Docker - Installation | Let’s go through the installation of each product.
Once the installer has been downloaded, double-click it to start the installer and then follow the steps given below.
Step 1 − Click on the Agreement terms and then the Install button to proceed ahead with the installation.
Step 2 − Once complete, click the Finish butt... | [
{
"code": null,
"e": 2391,
"s": 2340,
"text": "Let’s go through the installation of each product."
},
{
"code": null,
"e": 2509,
"s": 2391,
"text": "Once the installer has been downloaded, double-click it to start the installer and then follow the steps given below."
},
{
... |
Maximum number of candies that can be bought - GeeksforGeeks | 19 May, 2021
Given an array arr[] of size n where arr[i] is the number of candies of type i. You have an unlimited amount of money. The task is to buy as many candies as possible satisfying the following conditions: If you buy x(i) candies of type i (clearly, 0 ≤ x(i) ≤ arr[i]), then for all j (1 ≤ j ≤ i) at least one ... | [
{
"code": null,
"e": 26387,
"s": 26359,
"text": "\n19 May, 2021"
},
{
"code": null,
"e": 26724,
"s": 26387,
"text": "Given an array arr[] of size n where arr[i] is the number of candies of type i. You have an unlimited amount of money. The task is to buy as many candies as possib... |
Transmission Modes in Computer Networks (Simplex, Half-Duplex and Full-Duplex) - GeeksforGeeks | 10 Mar, 2022
Transmission mode means transferring data between two devices. It is also known as a communication mode. Buses and networks are designed to allow communication to occur between individual devices that are interconnected. There are three types of transmission mode:-
These are explained as following bel... | [
{
"code": null,
"e": 37948,
"s": 37920,
"text": "\n10 Mar, 2022"
},
{
"code": null,
"e": 38217,
"s": 37948,
"text": "Transmission mode means transferring data between two devices. It is also known as a communication mode. Buses and networks are designed to allow communication to ... |
Rotate a matrix by 90 degree without using any extra space | Set 2 - GeeksforGeeks | 12 May, 2022
Given a square matrix, turn it by 90 degrees in anti-clockwise direction without using any extra space.
Examples:
Input:
1 2 3
4 5 6
7 8 9
Output:
3 6 9
2 5 8
1 4 7
Rotated the input matrix by
90 degrees in anti-clockwise direction.
Input:
1 2 3 4
5 6 7 8
9 10 11 12
13 14... | [
{
"code": null,
"e": 39005,
"s": 38977,
"text": "\n12 May, 2022"
},
{
"code": null,
"e": 39109,
"s": 39005,
"text": "Given a square matrix, turn it by 90 degrees in anti-clockwise direction without using any extra space."
},
{
"code": null,
"e": 39120,
"s": 39109,... |
Python | Group and count similar records - GeeksforGeeks | 11 Nov, 2019
Sometimes, while working with records, we can have a problem in which we need to collect and maintain the counter value inside records. This kind of application is important in web development domain. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using loop + Counter() + set()... | [
{
"code": null,
"e": 25581,
"s": 25553,
"text": "\n11 Nov, 2019"
},
{
"code": null,
"e": 25846,
"s": 25581,
"text": "Sometimes, while working with records, we can have a problem in which we need to collect and maintain the counter value inside records. This kind of application is... |
GATE | GATE-CS-2017 (Set 1) | Question 14 - GeeksforGeeks | 16 Sep, 2021
Consider the following intermediate program in three address code
p = a - b
q = p * c
p = u * v
q = p + q
Which one of the following corresponds to a static single assignment from the above code
A)
p1 = a - b
q 1 = p1 * c
p1 = u * v
q1 = p1 + q1
B)
p3 = a - b
q4 = p3 * c
p4 = u * v
q5 = p4 + q4
C)
p ... | [
{
"code": null,
"e": 25647,
"s": 25619,
"text": "\n16 Sep, 2021"
},
{
"code": null,
"e": 25713,
"s": 25647,
"text": "Consider the following intermediate program in three address code"
},
{
"code": null,
"e": 25755,
"s": 25713,
"text": "p = a - b\nq = p * c\np... |
Loading Resources from Classpath in Java with Example - GeeksforGeeks | 05 Feb, 2021
Resources are the collections of files or images or stuff of other formats. Java programs help us to load these files or images of the resources and perform a read and write operation on them. For example, we can load a file from any resource directory and will be then able to read the content of that file... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n05 Feb, 2021"
},
{
"code": null,
"e": 25709,
"s": 25225,
"text": "Resources are the collections of files or images or stuff of other formats. Java programs help us to load these files or images of the resources and perform a read... |
How to apply !important in CSS? - GeeksforGeeks | 10 May, 2022
The !important property in CSS is used to provide more weight (importance) than normal property. In CSS, the !important means that “this is important”, ignore all the subsequent rules, and apply !important rule and the !important keyword must be placed at the end of the line, immediately before the semicol... | [
{
"code": null,
"e": 25975,
"s": 25947,
"text": "\n10 May, 2022"
},
{
"code": null,
"e": 26286,
"s": 25975,
"text": "The !important property in CSS is used to provide more weight (importance) than normal property. In CSS, the !important means that “this is important”, ignore all ... |
Design an IIR Bandpass Chebyshev Type-2 Filter using Scipy - Python - GeeksforGeeks | 10 Nov, 2021
IR stands for Infinite Impulse Response, It is one of the striking features of many linear-time invariant systems that are distinguished by having an impulse response h(t)/h(n) which does not become zero after some point but instead continues infinitely.
IIR Chebyshev is a filter that is linear-time invari... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n10 Nov, 2021"
},
{
"code": null,
"e": 25792,
"s": 25537,
"text": "IR stands for Infinite Impulse Response, It is one of the striking features of many linear-time invariant systems that are distinguished by having an impulse respo... |
Java Program to convert integer to boolean - GeeksforGeeks | 02 Jan, 2020
Given a integer value, the task is to convert this integer value into a boolean value in Java.
Examples:
Input: int = 1
Output: true
Input: int = 0
Output: false
Approach:
Get the boolean value to be converted.
Check if boolean value is true or false
If the integer value is greater than equal to 1, set t... | [
{
"code": null,
"e": 25705,
"s": 25677,
"text": "\n02 Jan, 2020"
},
{
"code": null,
"e": 25800,
"s": 25705,
"text": "Given a integer value, the task is to convert this integer value into a boolean value in Java."
},
{
"code": null,
"e": 25810,
"s": 25800,
"tex... |
Template Inheritance in Flask - GeeksforGeeks | 05 Sep, 2020
Template inheritance is a very good feature of Jinja templating . Jinja is a web template engine for the Python programming language . We have seen that webpages of a website contains same footer , navigation bar etc. So instead of making same footer and navigation bar in all webpages separately , we make... | [
{
"code": null,
"e": 25647,
"s": 25619,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 26301,
"s": 25647,
"text": "Template inheritance is a very good feature of Jinja templating . Jinja is a web template engine for the Python programming language . We have seen that webpages o... |
Python | Harmonic Mean of List - GeeksforGeeks | 14 Jan, 2020
While working with Python, we can have a problem in which we need to find harmonic mean of a list cumulative. This problem is common in Data Science domain. Let’s discuss certain ways in which this problem can be solved.
Method #1 : Using loop + formulaThe simpler manner to approach this problem is to empl... | [
{
"code": null,
"e": 25435,
"s": 25407,
"text": "\n14 Jan, 2020"
},
{
"code": null,
"e": 25656,
"s": 25435,
"text": "While working with Python, we can have a problem in which we need to find harmonic mean of a list cumulative. This problem is common in Data Science domain. Let’s ... |
C# | Copying the Hashtable elements to an Array Instance - GeeksforGeeks | 22 Jun, 2021
Hashtable.CopyTo(Array, Int32) Method is used to copy the elements of a Hashtable to a one-dimensional Array instance at the specified index.Syntax:
public virtual void CopyTo (Array array, int arrayIndex);
Parameters:
array : The one-dimensional Array that is the destination of the DictionaryEntry obje... | [
{
"code": null,
"e": 25547,
"s": 25519,
"text": "\n22 Jun, 2021"
},
{
"code": null,
"e": 25698,
"s": 25547,
"text": "Hashtable.CopyTo(Array, Int32) Method is used to copy the elements of a Hashtable to a one-dimensional Array instance at the specified index.Syntax: "
},
{
... |
Number of ways to select exactly K even numbers from given Array - GeeksforGeeks | 12 Sep, 2021
Given an array arr[] of n integers and an integer K, the task is to find the number of ways to select exactly K even numbers from the given array.
Examples:
Input: arr[] = {1, 2, 3, 4} k = 1 Output: 2 Explanation:The number of ways in which we can select one even number is 2.
Input: arr[] = {61, 65, 99, 2... | [
{
"code": null,
"e": 26041,
"s": 26013,
"text": "\n12 Sep, 2021"
},
{
"code": null,
"e": 26188,
"s": 26041,
"text": "Given an array arr[] of n integers and an integer K, the task is to find the number of ways to select exactly K even numbers from the given array."
},
{
"c... |
Python | Simple FLAMES game using Tkinter - GeeksforGeeks | 10 Jun, 2021
Prerequisites:
Introduction to Tkinter
Program to implement simple FLAMES game
Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. ... | [
{
"code": null,
"e": 25605,
"s": 25577,
"text": "\n10 Jun, 2021"
},
{
"code": null,
"e": 25621,
"s": 25605,
"text": "Prerequisites: "
},
{
"code": null,
"e": 25645,
"s": 25621,
"text": "Introduction to Tkinter"
},
{
"code": null,
"e": 25685,
"s... |
Convert binary to string using Python - GeeksforGeeks | 15 Oct, 2021
Data conversion has always been widely used utility and one among them can be the conversion of a binary equivalent to its string. Let’s discuss certain ways in which this can be done.Method #1:The naive approach is to convert the given binary data in decimal by taking the sum of binary digits (dn) times t... | [
{
"code": null,
"e": 25961,
"s": 25933,
"text": "\n15 Oct, 2021"
},
{
"code": null,
"e": 26677,
"s": 25961,
"text": "Data conversion has always been widely used utility and one among them can be the conversion of a binary equivalent to its string. Let’s discuss certain ways in wh... |
Implementing Race Condition in C++ - GeeksforGeeks | 21 Jan, 2021
Prerequisite – Race Condition Vulnerability
When two concurrent threads in execution access a shared resource in a way that it unintentionally produces different results depending on the timing of the threads or processes, this gives rise to a Race Condition.
In Simpler Words :If our privileged program (ap... | [
{
"code": null,
"e": 25737,
"s": 25709,
"text": "\n21 Jan, 2021"
},
{
"code": null,
"e": 25781,
"s": 25737,
"text": "Prerequisite – Race Condition Vulnerability"
},
{
"code": null,
"e": 25997,
"s": 25781,
"text": "When two concurrent threads in execution acces... |
How to create Abstract Model Class in Django? - GeeksforGeeks | 16 Feb, 2021
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much of the hassle of Web development, so you can focus on writing your app without needing to reinvent the wheel. It’s free and open source.
Model In... | [
{
"code": null,
"e": 25563,
"s": 25535,
"text": "\n16 Feb, 2021"
},
{
"code": null,
"e": 25862,
"s": 25563,
"text": "Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design. Built by experienced developers, it takes care of much o... |
Range Structure in C# 8.0 - GeeksforGeeks | 09 Jul, 2021
C# 8.0 introduced a new predefined structure that is known as Range struct. This struct is used to represent a range that has a start and end indexes. It provides a new style to create a range using .. operator. This operator is used to create a range that has a starting and ending index. Also with the hel... | [
{
"code": null,
"e": 25245,
"s": 25217,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 25630,
"s": 25245,
"text": "C# 8.0 introduced a new predefined structure that is known as Range struct. This struct is used to represent a range that has a start and end indexes. It provides ... |
Pandas — Save Memory with These Simple Tricks | by Soner Yıldırım | Towards Data Science | Memory is not a big concern when dealing with small-sized data. However, when it comes to large datasets, it becomes imperative to use memory efficiently. I will cover a few very simple tricks to reduce the size of a Pandas DataFrame. I will use a relatively large dataset about cryptocurrency market prices available on... | [
{
"code": null,
"e": 560,
"s": 172,
"text": "Memory is not a big concern when dealing with small-sized data. However, when it comes to large datasets, it becomes imperative to use memory efficiently. I will cover a few very simple tricks to reduce the size of a Pandas DataFrame. I will use a relativ... |
Image Viewer App in Python using Tkinter - GeeksforGeeks | 04 Oct, 2021
Prerequisites: Python GUI – tkinter, Python: Pillow
Have you ever wondered to make a Image viewer with the help of Python? Here is a solution to making the Image viewer with the help of Python. We can do this with the help of Tkinter and pillow. We will discuss the module needed and code below.
Tkinter: T... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 24264,
"s": 24212,
"text": "Prerequisites: Python GUI – tkinter, Python: Pillow"
},
{
"code": null,
"e": 24509,
"s": 24264,
"text": "Have you ever wondered to make a Image... |
Creating a Powerful COVID-19 Mask Detection Tool with PyTorch | by David Yastremsky | Towards Data Science | Over the last year, COVID-19 has taken a social, economic, and human toll on the world. AI tools can identify proper mask-wearing to help reopen the world and prevent future pandemics.
Of course, this has deeper social implications, such as the tradeoff of privacy versus security. These are discussed in the accompanyin... | [
{
"code": null,
"e": 356,
"s": 171,
"text": "Over the last year, COVID-19 has taken a social, economic, and human toll on the world. AI tools can identify proper mask-wearing to help reopen the world and prevent future pandemics."
},
{
"code": null,
"e": 520,
"s": 356,
"text": "O... |
JSP - Hits Counter | In this chapter, we will discuss Hits Counter in JSP. A hit counter tells you about the number of visits on a particular page of your web site. Usually you attach a hit counter with your index.jsp page assuming people first land on your home page.
To implement a hit counter you can make use of the Application Implicit ... | [
{
"code": null,
"e": 2487,
"s": 2239,
"text": "In this chapter, we will discuss Hits Counter in JSP. A hit counter tells you about the number of visits on a particular page of your web site. Usually you attach a hit counter with your index.jsp page assuming people first land on your home page."
},... |
Data Visualization — Advanced Bokeh Techniques | by Jim King | Towards Data Science | If you are looking to create powerful data visualizations then you should consider using Bokeh. In an earlier article, “How to Create an Interactive Geographic Map Using Python and Bokeh”, I demonstrated how to create an interactive geographic map using Bokeh. This article will take it a step further and demonstrate ho... | [
{
"code": null,
"e": 641,
"s": 172,
"text": "If you are looking to create powerful data visualizations then you should consider using Bokeh. In an earlier article, “How to Create an Interactive Geographic Map Using Python and Bokeh”, I demonstrated how to create an interactive geographic map using B... |
Building a Simple UI with Python. Streamlit: A Browser-based Python UI... | by Max Reynolds | Towards Data Science | Showcasing a Python project with a user interface has never been easier. With the Streamlit framework you can build a browser-based UI using only Python code. In this demo, we will be building the UI for a maze solver program described in detail in a previous article.
towardsdatascience.com
Streamlit is a web framework... | [
{
"code": null,
"e": 441,
"s": 172,
"text": "Showcasing a Python project with a user interface has never been easier. With the Streamlit framework you can build a browser-based UI using only Python code. In this demo, we will be building the UI for a maze solver program described in detail in a prev... |
Effectively Final Variable in Java with Examples - GeeksforGeeks | 17 Aug, 2021
A final variable is a variable that is declared with a keyword known as ‘final‘.
Example:
final int number;
number = 77;
The Effectively Final variable is a local variable that follows the following properties are listed below as follows:
Not defined as final
Assigned to ONLY once.
Any local variable or pa... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n17 Aug, 2021"
},
{
"code": null,
"e": 24029,
"s": 23948,
"text": "A final variable is a variable that is declared with a keyword known as ‘final‘."
},
{
"code": null,
"e": 24038,
"s": 24029,
"text": "Example:"... |
How to display a JFrame to the center of a screen in Java? | A JFrame is a subclass of Frame class and the components added to a frame are referred to as its contents, these are managed by the contentPane. We can add the components to a JFrame to use its contentPane instead. A JFrame is like a Window with border, title, and buttons. We can implement most of the java swing applic... | [
{
"code": null,
"e": 1403,
"s": 1062,
"text": "A JFrame is a subclass of Frame class and the components added to a frame are referred to as its contents, these are managed by the contentPane. We can add the components to a JFrame to use its contentPane instead. A JFrame is like a Window with border,... |
C++ Data Structures | C/C++ arrays allow you to define variables that combine several data items of the same kind, but structure is another user defined data type which allows you to combine data items of different kinds.
Structures are used to represent a record, suppose you want to keep track of your books in a library. You might want to ... | [
{
"code": null,
"e": 2518,
"s": 2318,
"text": "C/C++ arrays allow you to define variables that combine several data items of the same kind, but structure is another user defined data type which allows you to combine data items of different kinds."
},
{
"code": null,
"e": 2687,
"s": 2... |
Chrome WebDriver Options | Selenium Chrome webdriver Options are handled with the class - selenium.webdriver.chrome.options.Options.
Some of the methods of the above mentioned class are listed below −
add_argument(args) − It is used to append arguments to a list.
add_argument(args) − It is used to append arguments to a list.
add_encoded_extensio... | [
{
"code": null,
"e": 2309,
"s": 2203,
"text": "Selenium Chrome webdriver Options are handled with the class - selenium.webdriver.chrome.options.Options."
},
{
"code": null,
"e": 2377,
"s": 2309,
"text": "Some of the methods of the above mentioned class are listed below −"
},
... |
How to Convert Integers to Strings in Pandas DataFrame? - GeeksforGeeks | 01 Aug, 2020
In this article, we’ll look at different methods to convert an integer into a string in a Pandas dataframe. In Pandas, there are different functions that we can use to achieve this task :
map(str)
astype(str)
apply(str)
applymap(str)
Example 1 : In this example, we’ll convert each value of a column of inte... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 24089,
"s": 23901,
"text": "In this article, we’ll look at different methods to convert an integer into a string in a Pandas dataframe. In Pandas, there are different functions that we can us... |
What is the MySQL VARCHAR max size? | The MySQL version before 5.0.3 was capable of storing 255 characters but from the version 5.0.3 , it is capable of storing 65,535 characters.
MySQL official documentation states −
The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is subject to the maximum row size (65,535 bytes, which is shared among a... | [
{
"code": null,
"e": 1204,
"s": 1062,
"text": "The MySQL version before 5.0.3 was capable of storing 255 characters but from the version 5.0.3 , it is capable of storing 65,535 characters."
},
{
"code": null,
"e": 1242,
"s": 1204,
"text": "MySQL official documentation states −"
... |
Get the absolute values in Pandas - GeeksforGeeks | 18 Aug, 2020
Let us see how to get the absolute value of an element in Python Pandas. We can perform this task by using the abs() function. The abs() function is used to get a Series/DataFrame with absolute numeric value of each element.
Syntax : Series.abs() or DataFrame.abs()Parameters : NoneReturns : Series/DataFram... | [
{
"code": null,
"e": 25581,
"s": 25553,
"text": "\n18 Aug, 2020"
},
{
"code": null,
"e": 25806,
"s": 25581,
"text": "Let us see how to get the absolute value of an element in Python Pandas. We can perform this task by using the abs() function. The abs() function is used to get a ... |
Concatenate two columns in MySQL? | To concatenate two columns, use CONCAT() function in MySQL. The syntax is as follows −
select CONCAT(yourColumnName1, ' ',yourColumnName2) as anyVariableName from yourTableName;
To understand the above concept, let us create a table. The query to create a table is as follows −
mysql> create table concatenateTwoColumnsD... | [
{
"code": null,
"e": 1149,
"s": 1062,
"text": "To concatenate two columns, use CONCAT() function in MySQL. The syntax is as follows −"
},
{
"code": null,
"e": 1240,
"s": 1149,
"text": "select CONCAT(yourColumnName1, ' ',yourColumnName2) as anyVariableName from yourTableName;"
}... |
C++ Program to Implement AVL Tree | AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than one for all nodes.
Tree rotation is an operation that changes the structure without interfering with the order of the elements on an AVL tree. It moves one node up in the tree and one node... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than one for all nodes."
},
{
"code": null,
"e": 1779,
"s": 1213,
"text": "Tree rotation is an operation t... |
numpy.asarray() in Python - GeeksforGeeks | 12 Nov, 2021
numpy.asarray()function is used when we want to convert input to an array. Input can be lists, lists of tuples, tuples, tuples of tuples, tuples of lists and arrays.
Syntax : numpy.asarray(arr, dtype=None, order=None)
Parameters :arr : [array_like] Input data, in any form that can be converted to an array.... | [
{
"code": null,
"e": 24236,
"s": 24208,
"text": "\n12 Nov, 2021"
},
{
"code": null,
"e": 24402,
"s": 24236,
"text": "numpy.asarray()function is used when we want to convert input to an array. Input can be lists, lists of tuples, tuples, tuples of tuples, tuples of lists and array... |
How to convert Java object to JSON using Jackson library? | JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc.
There are several Java libraries available to handle JSON objects. Jackson is a simple java based l... | [
{
"code": null,
"e": 1283,
"s": 1062,
"text": "JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc."
},
{
"code": null,
... |
Maximum subarray sum modulo m | 09 Mar, 2022
Given an array of n elements and an integer m. The task is to find the maximum value of the sum of its subarray modulo m i.e find the sum of each subarray mod m and print the maximum value of this modulo operation.Examples:
Input : arr[] = { 3, 3, 9, 9, 5 }
m = 7
Output : 6
All sub-arrays and the... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Mar, 2022"
},
{
"code": null,
"e": 278,
"s": 52,
"text": "Given an array of n elements and an integer m. The task is to find the maximum value of the sum of its subarray modulo m i.e find the sum of each subarray mod m and print the... |
URI getQuery() method in Java with Examples | 02 Jan, 2019
The getQuery() function is a part of URI class. The function getQuery() returns the Query of a specified URI.
Function Signature
public String getQuery()
Syntax
uri.getQuery()
Parameter This function does not require any parameter
Return Type: The function returns String Type
Below programs illustrates the... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Jan, 2019"
},
{
"code": null,
"e": 138,
"s": 28,
"text": "The getQuery() function is a part of URI class. The function getQuery() returns the Query of a specified URI."
},
{
"code": null,
"e": 157,
"s": 138,
"text... |
URL getProtocol() method in Java with Examples | 27 Dec, 2018
The getProtocol() function is a part of URL class. The function getProtocol() returns the Protocol of a specified URL.
Function Signature
public String getProtocol()
Syntax
url.getProtocol()
Parameter This function does not require any parameter
Return Type: The function returns String Type
Below program... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2018"
},
{
"code": null,
"e": 147,
"s": 28,
"text": "The getProtocol() function is a part of URL class. The function getProtocol() returns the Protocol of a specified URL."
},
{
"code": null,
"e": 166,
"s": 147,
... |
Text Localization, Detection and Recognition using Pytesseract | 30 Nov, 2021
Pytesseract or Python-tesseract is an Optical Character Recognition (OCR) tool for Python. It will read and recognize the text in images, license plates etc. Python-tesseract is actually a wrapper class or a package for Google’s Tesseract-OCR Engine. It is also useful and regarded as a stand-alone invocati... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 479,
"s": 28,
"text": "Pytesseract or Python-tesseract is an Optical Character Recognition (OCR) tool for Python. It will read and recognize the text in images, license plates etc. Python-tesseract ... |
Find the number of distinct pairs of vertices which have a distance of exactly k in a tree | 22 Jun, 2022
Given an integer k and a tree with n nodes. The task is to count the number of distinct pairs of vertices that have a distance of exactly k.
Examples:
Input: k = 2
Output: 4Input: k = 3
Output: 2
Approach: This problem can be solved using dynamic programming. For every vertex v of the tree, we calcu... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 193,
"s": 52,
"text": "Given an integer k and a tree with n nodes. The task is to count the number of distinct pairs of vertices that have a distance of exactly k."
},
{
"code": null,
"... |
How to Create RecyclerView with Multiple ViewType in Android? | 27 Aug, 2020
RecyclerView forms a very crucial part of the UI in Android App development. It is especially important to optimize memory consumption during the display of a long list of items. A RecylerView inflates a customized list of items. This list can have either all similar layouts or multiple distinct layouts. H... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Aug, 2020"
},
{
"code": null,
"e": 491,
"s": 52,
"text": "RecyclerView forms a very crucial part of the UI in Android App development. It is especially important to optimize memory consumption during the display of a long list of it... |
JavaScript Number toString() Method | 31 May, 2022
Below is the example of the Number toString() Method.
Example:
html
<script type="text/javascript"> var num=12; document.write("Output : " + num.toString(2)); </script>
Output:
Output:1100
The toString() method in Javascript is used with a number and converts the number to a string. It is us... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 May, 2022"
},
{
"code": null,
"e": 82,
"s": 28,
"text": "Below is the example of the Number toString() Method."
},
{
"code": null,
"e": 92,
"s": 82,
"text": "Example: "
},
{
"code": null,
"e": 97,
... |
Python 3 - Numbers | Number data types store numeric values. They are immutable data types. This means, changing the value of a number data type results in a newly allocated object.
Number objects are created when you assign a value to them. For example −
var1 = 1
var2 = 10
You can also delete the reference to a number object by using the ... | [
{
"code": null,
"e": 2501,
"s": 2340,
"text": "Number data types store numeric values. They are immutable data types. This means, changing the value of a number data type results in a newly allocated object."
},
{
"code": null,
"e": 2575,
"s": 2501,
"text": "Number objects are cr... |
Find four elements a, b, c and d in an array such that a+b = c+d - GeeksforGeeks | 08 Aug, 2021
Given an array of distinct integers, find if there are two pairs (a, b) and (c, d) such that a+b = c+d, and a, b, c and d are distinct elements. If there are multiple answers, then print any of them.
Example:
Input: {3, 4, 7, 1, 2, 9, 8}
Output: (3, 8) and (4, 7)
Explanation: 3+8 = 4+7
Input: {3, 4... | [
{
"code": null,
"e": 24171,
"s": 24143,
"text": "\n08 Aug, 2021"
},
{
"code": null,
"e": 24372,
"s": 24171,
"text": "Given an array of distinct integers, find if there are two pairs (a, b) and (c, d) such that a+b = c+d, and a, b, c and d are distinct elements. If there are multi... |
CRLFuzz - A Linux Tool To Scan CRLF Vulnerability Written in Go - GeeksforGeeks | 14 Sep, 2021
CRLF injection is a software application coding vulnerability that occurs when an attacker injects a CRLF character sequence where it is not expected. Checking the CRLF Vulnerability manually on the target domain becomes very complicated. So there should be an automated approach for studying the vulnerabil... | [
{
"code": null,
"e": 24015,
"s": 23987,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 24498,
"s": 24015,
"text": "CRLF injection is a software application coding vulnerability that occurs when an attacker injects a CRLF character sequence where it is not expected. Checking the... |
Auxiliary Space with Recursive Functions in C Program? | Here we will see how the auxiliary space is required for recursive function call. And how it is differing from the normal function call?
Suppose we have one function like below −
long fact(int n){
if(n == 0 || n == 1)
return 1;
return n * fact(n-1);
}
This function is recursive function. When we call it lik... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "Here we will see how the auxiliary space is required for recursive function call. And how it is differing from the normal function call?"
},
{
"code": null,
"e": 1241,
"s": 1199,
"text": "Suppose we have one function like below −"
... |
Why Git And How To Use Git As A Data Scientist | by Admond Lee | Towards Data Science | Perhaps you’ve heard of Git somewhere else.
Perhaps someone told you that Git is only for software developers and being a data scientist simple couldn’t care less about this.
If you’re a software engineer turned data scientist, this topic is something very familiar to you.
If you’re as aspiring data scientist from diff... | [
{
"code": null,
"e": 91,
"s": 47,
"text": "Perhaps you’ve heard of Git somewhere else."
},
{
"code": null,
"e": 222,
"s": 91,
"text": "Perhaps someone told you that Git is only for software developers and being a data scientist simple couldn’t care less about this."
},
{
... |
Counts Zeros Xor Pairs | Practice | GeeksforGeeks | Given an array A[] of size N. Find the number of pairs (i, j) such that
Ai XOR Aj = 0, and 1 ≤ i < j ≤ N.
Example 1:
​Input : arr[ ] = {1, 3, 4, 1, 4}
Output : 2
Explanation:
Index( 0, 3 ) and (2 , 4 ) are only pairs
whose xors is zero so count is 2.
​Example 2:
Input : arr[ ] = {2, 2, 2}
Output : 3
Your... | [
{
"code": null,
"e": 344,
"s": 238,
"text": "Given an array A[] of size N. Find the number of pairs (i, j) such that\nAi XOR Aj = 0, and 1 ≤ i < j ≤ N."
},
{
"code": null,
"e": 355,
"s": 344,
"text": "Example 1:"
},
{
"code": null,
"e": 494,
"s": 355,
"text": ... |
C# - Regular Expressions | A regular expression is a pattern that could be matched against an input text. The .Net framework provides a regular expression engine that allows such matching. A pattern consists of one or more character literals, operators, or constructs.
There are various categories of characters, operators, and constructs that let... | [
{
"code": null,
"e": 2512,
"s": 2270,
"text": "A regular expression is a pattern that could be matched against an input text. The .Net framework provides a regular expression engine that allows such matching. A pattern consists of one or more character literals, operators, or constructs."
},
{
... |
How do we use Python in interactive mode? | Execute Python from command prompt to run Python interactive shell.
C:\user>python
>>>
Python prompt is made up of three greater than symbols. Any valid expression can now be evaluated interactively. Let us start with evaluating arithmetic expression.
>>> 2+3*5
17
You can assign value to a variable or accept input fr... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "Execute Python from command prompt to run Python interactive shell."
},
{
"code": null,
"e": 1150,
"s": 1130,
"text": "C:\\user>python\n >>>"
},
{
"code": null,
"e": 1315,
"s": 1150,
"text": "Python prompt is made... |
Benchmarking Categorical Encoders | by Denis Vorotyntsev | Towards Data Science | Most tabular datasets contain categorical features. The simplest way to work with these is to encode them with Label Encoder. It is simple, yet sometimes not accurate.
In this post, I would like to show better approaches which could be used “out of the box” (thanks to Category Encoders Python library). I’m going to sta... | [
{
"code": null,
"e": 340,
"s": 172,
"text": "Most tabular datasets contain categorical features. The simplest way to work with these is to encode them with Label Encoder. It is simple, yet sometimes not accurate."
},
{
"code": null,
"e": 807,
"s": 340,
"text": "In this post, I wo... |
Check if a number has two adjacent set bits - GeeksforGeeks | 03 May, 2021
Given a number you have to check whether there is pair of adjacent set bit or not.Examples :
Input : N = 67
Output : Yes
There is a pair of adjacent set bit
The binary representation is 100011
Input : N = 5
Output : No
A simple solution is to traverse all bits. For every set bit, check if next bit is ... | [
{
"code": null,
"e": 25011,
"s": 24983,
"text": "\n03 May, 2021"
},
{
"code": null,
"e": 25106,
"s": 25011,
"text": "Given a number you have to check whether there is pair of adjacent set bit or not.Examples : "
},
{
"code": null,
"e": 25233,
"s": 25106,
"tex... |
How to unbind “hover” event using JQuery? - GeeksforGeeks | 06 Sep, 2019
The problem unbind the hover effect of particular element with the help of JQuery. Here we are using 2 JQuery methods .unbind() and .off() method. Here are few techniques discussed.
Approach:
Select the element whose Hover effect needs to be unbinded.(Make sure Hover effect should be added by JQuery only, ... | [
{
"code": null,
"e": 25096,
"s": 25068,
"text": "\n06 Sep, 2019"
},
{
"code": null,
"e": 25278,
"s": 25096,
"text": "The problem unbind the hover effect of particular element with the help of JQuery. Here we are using 2 JQuery methods .unbind() and .off() method. Here are few tec... |
Customer segmentation with BigQuery ML: unsupervised learning without Python! | by Taís L. Pereira | Towards Data Science | Don’t get me wrong, I’m a big Python fan, both for unsupervised and supervised learning. However, since Kramp Hub’s 1 data warehouse is based on Google Cloud Platform (GCP), an alternative solution got my attention this time: BigQuery ML.
BigQuery Machine Learning (ML) is a GCP’s feature to operationalize ML algorithms... | [
{
"code": null,
"e": 411,
"s": 172,
"text": "Don’t get me wrong, I’m a big Python fan, both for unsupervised and supervised learning. However, since Kramp Hub’s 1 data warehouse is based on Google Cloud Platform (GCP), an alternative solution got my attention this time: BigQuery ML."
},
{
"c... |
How to run Invoke-Command in PowerShell Workflow? | To run Invoke-Command in PowerShell Workflow we need to use the InlineScript block because Invoke-Command is not supported directly in the workflow. The below example is without using the InlineScript block we get an error.
Workflow TestInvokeCommand{
Invoke-Command -ComputerName LabMachine2k16 -ScriptBlock{
G... | [
{
"code": null,
"e": 1286,
"s": 1062,
"text": "To run Invoke-Command in PowerShell Workflow we need to use the InlineScript block because Invoke-Command is not supported directly in the workflow. The below example is without using the InlineScript block we get an error."
},
{
"code": null,
... |
How to create a thread using lambda expressions in Java?
| The lambda expressions are introduced in Java 8. It is one of the most popular features of Java 8 and brings functional programming capabilities to Java. By using a lambda expression, we can directly write the implementation for a method in Java.
In the below program, we can create a thread by implementing the Runnable... | [
{
"code": null,
"e": 1309,
"s": 1062,
"text": "The lambda expressions are introduced in Java 8. It is one of the most popular features of Java 8 and brings functional programming capabilities to Java. By using a lambda expression, we can directly write the implementation for a method in Java."
},
... |
How to detect faces in an image using Java OpenCV library? | The CascadeClassifier class of is used to load the classifier file and detects the desired objects in the image.
The detectMultiScale() of this class detects multiple objects of various sizes. This method accepts −
An object of the class Mat holding the input image.
An object of the class Mat holding the input image.
A... | [
{
"code": null,
"e": 1175,
"s": 1062,
"text": "The CascadeClassifier class of is used to load the classifier file and detects the desired objects in the image."
},
{
"code": null,
"e": 1277,
"s": 1175,
"text": "The detectMultiScale() of this class detects multiple objects of vari... |
Count of subsequences of length 4 in form (x, x, x+1, x+1) | Set 2 - GeeksforGeeks | 27 Apr, 2021
Given a large number in form of string str of size N, the task is to count the subsequence of length 4 whose digit are in the form of (x, x, x+1, x+1).Example:
Input: str = “1515732322” Output: 3 Explanation: For the given input string str = “1515732322”, there are 3 subsequence {1122}, {1122}, and {1122} ... | [
{
"code": null,
"e": 24612,
"s": 24584,
"text": "\n27 Apr, 2021"
},
{
"code": null,
"e": 24772,
"s": 24612,
"text": "Given a large number in form of string str of size N, the task is to count the subsequence of length 4 whose digit are in the form of (x, x, x+1, x+1).Example:"
... |
Aptitude | GATE CS 1998 | Question 9 - GeeksforGeeks | 21 May, 2020
If the regular set ‘A’ is represented by A= (01+1)* and the regular set ‘B’ is represented by B= ((01)* 1*)*, which of the following is true ?(A) A ⊂ B(B) B ⊂ A(C) A and B are incomparable(D) A = BAnswer: (D)Explanation: Some of the regular expression always equivalent to (0+1)* such that
(0+1)*
= (0*+1*)... | [
{
"code": null,
"e": 24466,
"s": 24438,
"text": "\n21 May, 2020"
},
{
"code": null,
"e": 24756,
"s": 24466,
"text": "If the regular set ‘A’ is represented by A= (01+1)* and the regular set ‘B’ is represented by B= ((01)* 1*)*, which of the following is true ?(A) A ⊂ B(B) B ⊂ A(C)... |
Find an element in an array such that elements form a strictly decreasing and increasing sequence - GeeksforGeeks | 19 Jan, 2022
Given an array of positive integers, the task is to find a point/element up to which elements form a strictly decreasing sequence first followed by a sequence of strictly increasing integers.
Both of the sequences must at least be of length 2 (considering the common element).
The last value of the decrea... | [
{
"code": null,
"e": 25522,
"s": 25494,
"text": "\n19 Jan, 2022"
},
{
"code": null,
"e": 25716,
"s": 25522,
"text": "Given an array of positive integers, the task is to find a point/element up to which elements form a strictly decreasing sequence first followed by a sequence of s... |
VHDL Programming Combinational Circuits | This chapter explains the VHDL programming for Combinational Circuits.
VHDL Code:
Library ieee;
use ieee.std_logic_1164.all;
entity half_adder is
port(a,b:in bit; sum,carry:out bit);
end half_adder;
architecture data of half_adder is
begin
sum<= a xor b;
carry <= a and b;
end data;
Library ieee... | [
{
"code": null,
"e": 2010,
"s": 1939,
"text": "This chapter explains the VHDL programming for Combinational Circuits."
},
{
"code": null,
"e": 2247,
"s": 2010,
"text": "VHDL Code:\n \nLibrary ieee; \nuse ieee.std_logic_1164.all;\n \nentity half_adder is\n port(a,b:in bit; sum... |
Matplotlib - Scatter Plot | Scatter plots are used to plot data points on horizontal and vertical axis in the attempt to show how much one variable is affected by another. Each row in the data table is represented by a marker the position depends on its values in the columns set on the X and Y axes. A third variable can be set to correspond to th... | [
{
"code": null,
"e": 2915,
"s": 2516,
"text": "Scatter plots are used to plot data points on horizontal and vertical axis in the attempt to show how much one variable is affected by another. Each row in the data table is represented by a marker the position depends on its values in the columns set o... |
Java String length() Method | ❮ String Methods
Return the number of characters in a string:
String txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
System.out.println(txt.length());
Try it Yourself »
The length() method returns the length of a specified string.
Note: The length of an empty string is 0.
public int length()
None.
We just launchedW3Schools vid... | [
{
"code": null,
"e": 19,
"s": 0,
"text": "\n❮ String Methods\n"
},
{
"code": null,
"e": 64,
"s": 19,
"text": "Return the number of characters in a string:"
},
{
"code": null,
"e": 141,
"s": 64,
"text": "String txt = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nSystem.out.... |
<climits> (limits.h) in C/C++ - GeeksforGeeks | 25 Aug, 2021
The maximum and minimum size of integral values are quite useful or in simple terms limits of any integral type plays quite a role in programming. Instead of remembering these values different macros can be used.
<climits>(limits.h) defines sizes of integral types. This header defines constants with the li... | [
{
"code": null,
"e": 23843,
"s": 23815,
"text": "\n25 Aug, 2021"
},
{
"code": null,
"e": 24056,
"s": 23843,
"text": "The maximum and minimum size of integral values are quite useful or in simple terms limits of any integral type plays quite a role in programming. Instead of remem... |
What is an anonymous function in Python? | In Python, anonymous function is a function that is defined without a name. While normal functions are defined using the def keyword, in Python anonymous functions are defined using the lambda keyword. Hence, anonymous functions are also called lambda functions.
If we run the given code we get the following output
C:/... | [
{
"code": null,
"e": 1325,
"s": 1062,
"text": "In Python, anonymous function is a function that is defined without a name. While normal functions are defined using the def keyword, in Python anonymous functions are defined using the lambda keyword. Hence, anonymous functions are also called lambda f... |
Python Pandas - Get the levels in MultiIndex | To get the levels in MultiIndex, use the MultiIndex.levels property in Pandas. At first, import the required libraries −
import pandas as pd
MultiIndex is a multi-level, or hierarchical, index object for pandas objects. Create arrays −
arrays = [[1, 2, 3, 4, 5], ['John', 'Tim', 'Jacob', 'Chris', 'Keiron']]
The "names"... | [
{
"code": null,
"e": 1183,
"s": 1062,
"text": "To get the levels in MultiIndex, use the MultiIndex.levels property in Pandas. At first, import the required libraries −"
},
{
"code": null,
"e": 1203,
"s": 1183,
"text": "import pandas as pd"
},
{
"code": null,
"e": 1298... |
CSS Padding vs Margin - GeeksforGeeks | 24 May, 2021
In this article, we will explain the difference between CSS padding and margin.
Margin: It is the space around an element. Margins are used to move an element up or down on a page as well as left or right. Margin is completely transparent, and it does not have any background color. It clears the area aroun... | [
{
"code": null,
"e": 25010,
"s": 24982,
"text": "\n24 May, 2021"
},
{
"code": null,
"e": 25090,
"s": 25010,
"text": "In this article, we will explain the difference between CSS padding and margin."
},
{
"code": null,
"e": 25467,
"s": 25090,
"text": "Margin: It... |
Collections singletonMap() method in Java with Examples - GeeksforGeeks | 11 May, 2021
The singletonMap() method of java.util.Collections class is used to return an immutable map, mapping only the specified key to the specified value. The returned map is serializable.
Syntax:
public static Map singletonMap(K key, V value)
Parameters: This method takes the following parameters as a argument... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n11 May, 2021"
},
{
"code": null,
"e": 25407,
"s": 25225,
"text": "The singletonMap() method of java.util.Collections class is used to return an immutable map, mapping only the specified key to the specified value. The returned ma... |
Perl | exists() Function - GeeksforGeeks | 07 May, 2019
The exists() function in Perl is used to check whether an element in an given array or hash exists or not. This function returns 1 if the desired element is present in the given array or hash else returns 0.
Syntax: exists(Expression)
Parameters:Expression : This expression is either array or hash on which... | [
{
"code": null,
"e": 25287,
"s": 25259,
"text": "\n07 May, 2019"
},
{
"code": null,
"e": 25495,
"s": 25287,
"text": "The exists() function in Perl is used to check whether an element in an given array or hash exists or not. This function returns 1 if the desired element is presen... |
How to Change the Text Font of Side Navigation Drawer Items in Android? - GeeksforGeeks | 06 Jan, 2021
The navigation drawer is the most common feature offered by android and the navigation drawer is a UI panel that shows your app’s main navigation menu. It is also one of the important UI elements, which provides actions preferable to the users like example changing user profile, changing settings of the ap... | [
{
"code": null,
"e": 26381,
"s": 26353,
"text": "\n06 Jan, 2021"
},
{
"code": null,
"e": 27061,
"s": 26381,
"text": "The navigation drawer is the most common feature offered by android and the navigation drawer is a UI panel that shows your app’s main navigation menu. It is also ... |
Python Number degrees() Method | Python number method degrees() converts angle x from radians to degrees.
Following is the syntax for degrees() method −
degrees(x)
Note − This function is not accessible directly, so we need to import math module and then we need to call this function using math static object.
x − This must be a numeric value.
x − Th... | [
{
"code": null,
"e": 2318,
"s": 2244,
"text": "Python number method degrees() converts angle x from radians to degrees."
},
{
"code": null,
"e": 2365,
"s": 2318,
"text": "Following is the syntax for degrees() method −"
},
{
"code": null,
"e": 2377,
"s": 2365,
... |
How to delete a particular element from a JavaScript array? | To delete an element from a JavaScript array, firstly use the indexOf() method to get the index of the element to be deleted. After that use splice() method −
Live Demo
<html>
<body>
<script>
var array = [40, 20, 70, 50];
var index = array.indexOf(70); ... | [
{
"code": null,
"e": 1221,
"s": 1062,
"text": "To delete an element from a JavaScript array, firstly use the indexOf() method to get the index of the element to be deleted. After that use splice() method −"
},
{
"code": null,
"e": 1231,
"s": 1221,
"text": "Live Demo"
},
{
... |
C library function - sscanf() | The C library function int sscanf(const char *str, const char *format, ...) reads formatted input from a string.
Following is the declaration for sscanf() function.
int sscanf(const char *str, const char *format, ...)
str − This is the C string that the function processes as its source to retrieve the data.
str − This ... | [
{
"code": null,
"e": 2120,
"s": 2007,
"text": "The C library function int sscanf(const char *str, const char *format, ...) reads formatted input from a string."
},
{
"code": null,
"e": 2172,
"s": 2120,
"text": "Following is the declaration for sscanf() function."
},
{
"co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.