title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
C++ Program to Implement Sparse Array | A sparse matrix is a matrix in which majority of the elements are 0. An example for this is given as follows.
The matrix given below contains 5 zeroes. Since the number of zeroes is more than half the elements of the matrix, it is a sparse matrix.
0 0 9
5 0 8
7 0 0
Begin
Declare a 2D array a[10][10] to the integer d... | [
{
"code": null,
"e": 1172,
"s": 1062,
"text": "A sparse matrix is a matrix in which majority of the elements are 0. An example for this is given as follows."
},
{
"code": null,
"e": 1310,
"s": 1172,
"text": "The matrix given below contains 5 zeroes. Since the number of zeroes is ... |
Count of smaller elements on right side of each element in an Array using Merge sort - GeeksforGeeks | 02 Jun, 2021
Given an array arr[] of N integers, the task is to count the number of smaller elements on the right side for each of the element in the array
Examples:
Input: arr[] = {6, 3, 7, 2} Output: 2, 1, 1, 0 Explanation: Smaller elements after 6 = 2 [3, 2] Smaller elements after 3 = 1 [2] Smaller elements after 7... | [
{
"code": null,
"e": 24820,
"s": 24792,
"text": "\n02 Jun, 2021"
},
{
"code": null,
"e": 24963,
"s": 24820,
"text": "Given an array arr[] of N integers, the task is to count the number of smaller elements on the right side for each of the element in the array"
},
{
"code"... |
How to read multiple text files from a folder in Python?(Tkinter) | Python is capable of handling files, objects, and creating different applications. We can use Python's extensions and packages to build and develop fully featured applications.
Suppose you want to control the files in your system; then Python provides an OS Module which has system-enabled functionalities to allow you i... | [
{
"code": null,
"e": 1239,
"s": 1062,
"text": "Python is capable of handling files, objects, and creating different applications. We can use Python's extensions and packages to build and develop fully featured applications."
},
{
"code": null,
"e": 1430,
"s": 1239,
"text": "Suppo... |
Print number of words, vowels and frequency of each character - GeeksforGeeks | 28 Jun, 2021
Given a string str with uppercase, lowercase and special characters. The input string is to end with either a space or a dot. The problem is to calculate the number of words, vowels and frequency of each character of the string in a separate line.Example :
Input : How Good GOD Is.
Output :
Number of wo... | [
{
"code": null,
"e": 24432,
"s": 24404,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24691,
"s": 24432,
"text": "Given a string str with uppercase, lowercase and special characters. The input string is to end with either a space or a dot. The problem is to calculate the numbe... |
Style up your photos with a touch of Deep Learning magic | by George Seif | Towards Data Science | Style Transfer in the context of imaging refers to the process of transferring the “style” of one image to another, while maintaining the “content” of the second image.
For example, the image on the far left is the “content” image. We apply the “style” of the the middle image (the “style” image) to our content image. W... | [
{
"code": null,
"e": 216,
"s": 47,
"text": "Style Transfer in the context of imaging refers to the process of transferring the “style” of one image to another, while maintaining the “content” of the second image."
},
{
"code": null,
"e": 560,
"s": 216,
"text": "For example, the i... |
Mastering Indexing and Slicing in Python | by Giorgos Myrianthous | Towards Data Science | In Python, the elements of ordered sequences like strings or lists can be -individually- accessed through their indices. This can be achieved by providing the numerical index of the element we wish to extract from the sequence. Additionally, Python supports slicing that is a characteristic that lets us extract a subset... | [
{
"code": null,
"e": 401,
"s": 47,
"text": "In Python, the elements of ordered sequences like strings or lists can be -individually- accessed through their indices. This can be achieved by providing the numerical index of the element we wish to extract from the sequence. Additionally, Python support... |
Bootstrap - Interview Questions | Dear readers, these BOOTSTRAP Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of BOOTSTRAP Language. As per my experience good interviewers hardly plan to ask any particular question during your interview, normal... | [
{
"code": null,
"e": 3783,
"s": 3331,
"text": "Dear readers, these BOOTSTRAP Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of BOOTSTRAP Language. As per my experience good interviewers hardl... |
How to convert a PDF to byte array in Java? | You can read data from a PDF file using the read() method of the FileInputStream class this method requires a byte array as a parameter.
import java.io.File;
import java.io.FileInputStream;
import java.io.ByteArrayOutputStream;
public class PdfToByteArray {
public static void main(String args[]) throws Exception {
... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "You can read data from a PDF file using the read() method of the FileInputStream class this method requires a byte array as a parameter."
},
{
"code": null,
"e": 1654,
"s": 1199,
"text": "import java.io.File;\nimport java.io.FileInpu... |
Enabling JavaScript in Browsers | All the modern browsers come with built-in support for JavaScript. Frequently, you may need to enable or disable this support manually. This chapter explains the procedure of enabling and disabling JavaScript support in your browsers: Internet Explorer, Firefox, chrome, and Opera.
Here are simple steps to turn on or tu... | [
{
"code": null,
"e": 2748,
"s": 2466,
"text": "All the modern browsers come with built-in support for JavaScript. Frequently, you may need to enable or disable this support manually. This chapter explains the procedure of enabling and disabling JavaScript support in your browsers: Internet Explorer,... |
Using Update statement with TINYINT in MySQL? | Let us first create a table. We have set one of the columns with type TINYINT −
mysql> create table DemoTable
-> (
-> EmployeeId int,
-> isMarried tinyint
-> );
Query OK, 0 rows affected (6.84 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values(101,true);
Query O... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "Let us first create a table. We have set one of the columns with type TINYINT −"
},
{
"code": null,
"e": 1272,
"s": 1142,
"text": "mysql> create table DemoTable\n -> (\n -> EmployeeId int,\n -> isMarried tinyint\n -> );\nQuer... |
IDE | GeeksforGeeks | A computer science portal for geeks | Please enter your email address or userHandle.
1234567https://www.trybooking.com/events/landing?eid=857380https://zenodo.org/communities/-zh-917717-deified/https://zenodo.org/communities/-zh-917717-deified/about/https://zenodo.org/communities/zh-917717-deified-tw/about/https://tw-film-hd-quality.blogspot.com/2022/01/20... | [
{
"code": null,
"e": 164,
"s": 117,
"text": "Please enter your email address or userHandle."
},
{
"code": null,
"e": 1053,
"s": 164,
"text": "1234567https://www.trybooking.com/events/landing?eid=857380https://zenodo.org/communities/-zh-917717-deified/https://zenodo.org/communitie... |
Check if the Hashtable contains a specific value in C# | To check if the Hashtable contains a specific value, the code is as follows −
Live Demo
using System;
using System.Collections;
public class Demo {
public static void Main(){
Hashtable hash = new Hashtable();
hash.Add("1", "A");
hash.Add("2", "B");
hash.Add("3", "C");
hash.Add("4", "D"... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "To check if the Hashtable contains a specific value, the code is as follows −"
},
{
"code": null,
"e": 1151,
"s": 1140,
"text": " Live Demo"
},
{
"code": null,
"e": 1973,
"s": 1151,
"text": "using System;\nusing S... |
Golang program that uses structs as map keys - GeeksforGeeks | 10 May, 2020
A map in Golang is a collection of unordered pairs of key-value. It is widely used because it provides fast lookups and values that can retrieve, update or delete with the help of keys.
Syntax:
map[Key_Type]Value_Type{}
Example: var sample map[string]int
Here the sample is a map that has a string as key an... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 24087,
"s": 23901,
"text": "A map in Golang is a collection of unordered pairs of key-value. It is widely used because it provides fast lookups and values that can retrieve, update or delete ... |
Biopython - Sequence File Formats - GeeksforGeeks | 22 Oct, 2020
Bio.SeqIO module of Biopython provides a wide range of simple uniform interfaces to input and output the desired file formats. This file formats can only deal with the sequences as a SeqRecord object. Lowercase strings are used while specifying the file format. The same formats are also supported by the Bi... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n22 Oct, 2020"
},
{
"code": null,
"e": 24663,
"s": 24292,
"text": "Bio.SeqIO module of Biopython provides a wide range of simple uniform interfaces to input and output the desired file formats. This file formats can only deal with... |
Fine-Tuning the Algorithmic Strategy Using a Particle Swarm Optimization | by Sergey Malchevskiy | Towards Data Science | Today we talk about a technique that allows searching a good set of parameters for a limited time, also we will consider one trading strategy as a bonus. Have a good read!
Gentle Introduction to Particle Swarm OptimizationTrading Strategy AlgorithmLet’s Code It!ExperimentFurther ImprovementsSummary
Gentle Introduction ... | [
{
"code": null,
"e": 344,
"s": 172,
"text": "Today we talk about a technique that allows searching a good set of parameters for a limited time, also we will consider one trading strategy as a bonus. Have a good read!"
},
{
"code": null,
"e": 472,
"s": 344,
"text": "Gentle Introdu... |
What is the difference between an inner and an outer join in SQL? | by Kate Marie Lewis | Towards Data Science | Joins in SQL are used to combine the contents of different tables. You can specify how you want the data from tables to be joined in many ways, one of which is the type of join. There are four main types of joins: inner join, full outer join, left outer join and right outer join.
The major difference between inner and ... | [
{
"code": null,
"e": 453,
"s": 172,
"text": "Joins in SQL are used to combine the contents of different tables. You can specify how you want the data from tables to be joined in many ways, one of which is the type of join. There are four main types of joins: inner join, full outer join, left outer j... |
Calculating the area of a triangle using its three sides in JavaScript | We are required to write a JavaScript function that takes in the three sides of a triangle and uses Heron’s formula to calculate its area.
Following is the code −
Live Demo
const s1 = 10;
const s2 = 8;
const s3 = 7;
const findArea = (s1, s2, s3) => {
const arr = [];
const arguments = [s1, s2, s3];
for(let i =... | [
{
"code": null,
"e": 1201,
"s": 1062,
"text": "We are required to write a JavaScript function that takes in the three sides of a triangle and uses Heron’s formula to calculate its area."
},
{
"code": null,
"e": 1225,
"s": 1201,
"text": "Following is the code −"
},
{
"code... |
Find shortest unique prefix for every word in a given list | Set 1 (Using Trie) - GeeksforGeeks | 01 Dec, 2021
Given an array of words, find all shortest unique prefixes to represent each word in the given array. Assume that no word is prefix of another. Examples:
Input: arr[] = {"zebra", "dog", "duck", "dove"}
Output: dog, dov, du, z
Explanation: dog => dog
dove => dov
duck => du
... | [
{
"code": null,
"e": 24406,
"s": 24378,
"text": "\n01 Dec, 2021"
},
{
"code": null,
"e": 24562,
"s": 24406,
"text": "Given an array of words, find all shortest unique prefixes to represent each word in the given array. Assume that no word is prefix of another. Examples: "
},
... |
Minimum Cost to Connect Sticks in C++ | Suppose we have some sticks with positive integer lengths. We can connect any two sticks of lengths X and Y into one stick by paying a cost of X + Y. This will be performed until there is one stick remaining. We have to find the minimum cost of connecting all the given sticks into one stick in this way. So if the stack... | [
{
"code": null,
"e": 1423,
"s": 1062,
"text": "Suppose we have some sticks with positive integer lengths. We can connect any two sticks of lengths X and Y into one stick by paying a cost of X + Y. This will be performed until there is one stick remaining. We have to find the minimum cost of connecti... |
Tryit Editor v3.7 | Tryit: HTML nav element | [] |
Implement a JavaScript when an element loses focus - GeeksforGeeks | 24 Jun, 2019
Given a document, the task is to implement functionality when the element loses focus. We have 2 options, one is the onblur event and another is onfocusout event JavaScript. We’re going to discuss a few methods.First few methods to understand.
onblur Event:This event happens when an element is going to los... | [
{
"code": null,
"e": 25220,
"s": 25192,
"text": "\n24 Jun, 2019"
},
{
"code": null,
"e": 25464,
"s": 25220,
"text": "Given a document, the task is to implement functionality when the element loses focus. We have 2 options, one is the onblur event and another is onfocusout event J... |
How to round down to 2 decimals a float using Python? | Python's round() function requires two arguments. First is the number to be rounded. Second argument decides the number of decimal places to which it is rounded. To round the number to 2 decimals, give second argument as 2. If third digit after decimal point is greater than 5, last digit is increased by 1.
>>> round(1.... | [
{
"code": null,
"e": 1370,
"s": 1062,
"text": "Python's round() function requires two arguments. First is the number to be rounded. Second argument decides the number of decimal places to which it is rounded. To round the number to 2 decimals, give second argument as 2. If third digit after decimal ... |
How to use ButtonGroup Component in ReactJS? - GeeksforGeeks | 22 Jan, 2021
The ButtonGroup component can be used to group related buttons. Material UI for React has this component available for us and it is very easy to integrate. We can use ButtonGroup Component in ReactJS using the following approach:
Creating React Application And Installing Module:
Step 1: Create a React appl... | [
{
"code": null,
"e": 25232,
"s": 25204,
"text": "\n22 Jan, 2021"
},
{
"code": null,
"e": 25462,
"s": 25232,
"text": "The ButtonGroup component can be used to group related buttons. Material UI for React has this component available for us and it is very easy to integrate. We can ... |
{{ form.as_ul }} - Render Django Forms as list - GeeksforGeeks | 13 Feb, 2020
Django forms are an advanced set of HTML forms that can be created using python and support all features of HTML forms in a pythonic way. Rendering Django Forms in the template may seem messy at times but with proper knowledge of Django Forms and attributes of fields, one can easily create excellent Form w... | [
{
"code": null,
"e": 25747,
"s": 25719,
"text": "\n13 Feb, 2020"
},
{
"code": null,
"e": 26140,
"s": 25747,
"text": "Django forms are an advanced set of HTML forms that can be created using python and support all features of HTML forms in a pythonic way. Rendering Django Forms in... |
How to call a function using the OptionMenu widget in Tkinter? | Let's take an example and see how to call a function using OptionMenu widget in Tkinter. In the example, we will use a StringVar object and call its get() method. A StringVar object in Tkinter can help manage the value of a widget.
We will create an OptionMenu widget and fill it with a list of strings. When the user se... | [
{
"code": null,
"e": 1294,
"s": 1062,
"text": "Let's take an example and see how to call a function using OptionMenu widget in Tkinter. In the example, we will use a StringVar object and call its get() method. A StringVar object in Tkinter can help manage the value of a widget."
},
{
"code":... |
Explain Java command line arguments. | You can pass n number of arguments from the command line while executing the program, separating them with spaces.
java ClassName 10 20 30 . . . . .
The main method accepts/reads the values you have passed into an array of the type String.
public class
public static void main(String[] args){
}
These arguments are kn... | [
{
"code": null,
"e": 1177,
"s": 1062,
"text": "You can pass n number of arguments from the command line while executing the program, separating them with spaces."
},
{
"code": null,
"e": 1211,
"s": 1177,
"text": "java ClassName 10 20 30 . . . . ."
},
{
"code": null,
"... |
Find maximum values & position in columns and rows of a Dataframe in Pandas - GeeksforGeeks | 16 Feb, 2022
In this article, we are going to discuss how to find maximum value and its index position in columns and rows of a Dataframe.
DataFrame.max()
Pandas dataframe.max() method finds the maximum of the values in the object and returns it. If the input is a series, the method will return a scalar which will be t... | [
{
"code": null,
"e": 24969,
"s": 24941,
"text": "\n16 Feb, 2022"
},
{
"code": null,
"e": 25095,
"s": 24969,
"text": "In this article, we are going to discuss how to find maximum value and its index position in columns and rows of a Dataframe."
},
{
"code": null,
"e": ... |
Java Regex - MatchResult Interface | The java.util.regex.MatchResult interface represents the result of a match operation. This interface contains query methods used to determine the results of a match against a regular expression. The match boundaries, groups and group boundaries can be seen but not modified through a MatchResult.
Following is the declar... | [
{
"code": null,
"e": 2421,
"s": 2124,
"text": "The java.util.regex.MatchResult interface represents the result of a match operation. This interface contains query methods used to determine the results of a match against a regular expression. The match boundaries, groups and group boundaries can be s... |
Distributed Deep Learning Training with Horovod on Kubernetes | by Yifeng Jiang | Towards Data Science | You may have noticed that even a powerful machine like the Nvidia DGX is not fast enough to train a deep learning model quick enough. Not mentioning the long wait time just to copy data into the DGX. Datasets are getting larger, GPUs are disaggregated from storage, workers with GPUs need to coordinate for model checkpo... | [
{
"code": null,
"e": 615,
"s": 172,
"text": "You may have noticed that even a powerful machine like the Nvidia DGX is not fast enough to train a deep learning model quick enough. Not mentioning the long wait time just to copy data into the DGX. Datasets are getting larger, GPUs are disaggregated fro... |
Frog Position After T Seconds in C++ | Suppose we have one undirected tree consisting of n vertices. The vertices are numbered from 1 to n. Now a frog starts jumping from the vertex 1. The frog can jump from its current vertex to another non-visited vertex if they are adjacent, in one second. The frog can not jump back to a visited vertex. In case the frog ... | [
{
"code": null,
"e": 1444,
"s": 1062,
"text": "Suppose we have one undirected tree consisting of n vertices. The vertices are numbered from 1 to n. Now a frog starts jumping from the vertex 1. The frog can jump from its current vertex to another non-visited vertex if they are adjacent, in one second... |
How to schedule local notifications in Android? | This example demonstrate about How to schedule local notification in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<? xml version = "1.0" encoding = "utf-8" ?>
<Re... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "This example demonstrate about How to schedule local notification in android."
},
{
"code": null,
"e": 1269,
"s": 1140,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details ... |
Using Plotly Express to Create Interactive Scatter Plots | by Andy McDonald | Towards Data Science | Scatter plots allow us to plot two variables from a dataset and compare them. From these plots, we can understand if there is a relationship between the two variables, and what the strength of that relationship is.
Within petrophysics scatter plots, are commonly known as crossplots. They are routinely used as part of t... | [
{
"code": null,
"e": 387,
"s": 172,
"text": "Scatter plots allow us to plot two variables from a dataset and compare them. From these plots, we can understand if there is a relationship between the two variables, and what the strength of that relationship is."
},
{
"code": null,
"e": 584... |
Create your own Word Cloud. Learn to build a very simple word cloud... | by Gurucharan M K | Towards Data Science | Hi everybody! Haven’t all of us seen such interesting and new forms of word clouds being displayed and wondered if we could also generate such word clouds. What if I tell you it is possible with a Python Program comprising of not more than 20 lines of code. Let’s dive in!
In this story, I am going to show you a very si... | [
{
"code": null,
"e": 444,
"s": 171,
"text": "Hi everybody! Haven’t all of us seen such interesting and new forms of word clouds being displayed and wondered if we could also generate such word clouds. What if I tell you it is possible with a Python Program comprising of not more than 20 lines of cod... |
Circular Reveal Animation in Android - GeeksforGeeks | 23 Feb, 2021
Animations in Android play an important role in the user experience. This makes the user focus on the main content, which they want. And also helps in user interactivity. Animations communicate with the user to really get engaged in application usage. So in this article, one of the animations in android wh... | [
{
"code": null,
"e": 25036,
"s": 25008,
"text": "\n23 Feb, 2021"
},
{
"code": null,
"e": 25581,
"s": 25036,
"text": "Animations in Android play an important role in the user experience. This makes the user focus on the main content, which they want. And also helps in user interac... |
Bubble Sort Visualization using JavaScript - GeeksforGeeks | 08 Feb, 2021
GUI(Graphical User Interface) helps in better in understanding than programs. In this article, we will visualize Bubble Sort using JavaScript. We will see how the elements are swapped in Bubble Sort and how we get the final sorted array. We will also visualize the time complexity of Bubble Sort.
Refer:
Bu... | [
{
"code": null,
"e": 25502,
"s": 25474,
"text": "\n08 Feb, 2021"
},
{
"code": null,
"e": 25800,
"s": 25502,
"text": "GUI(Graphical User Interface) helps in better in understanding than programs. In this article, we will visualize Bubble Sort using JavaScript. We will see how the ... |
Allow users to change font size of a webpage using JavaScript - GeeksforGeeks | 19 Aug, 2021
If you have seen some websites especially some Indian government portals, you would have noticed three small buttons at the top rightmost corner of the page looking something like this: -A A A+. These buttons generally allow the website users to change the font size of the entire page or a certain portio... | [
{
"code": null,
"e": 25400,
"s": 25372,
"text": "\n19 Aug, 2021"
},
{
"code": null,
"e": 26190,
"s": 25400,
"text": "If you have seen some websites especially some Indian government portals, you would have noticed three small buttons at the top rightmost corner of the page lookin... |
MongoDB - $pull Operator - GeeksforGeeks | 10 May, 2020
MongoDB provides different types of array update operators to update the values of the array fields in the documents and $pull operator is one of them. This operator is used to remove all the instances of the value or the value that matches the specified condition from the existing array.
Syntax:
{ $pull: ... | [
{
"code": null,
"e": 23922,
"s": 23894,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 24212,
"s": 23922,
"text": "MongoDB provides different types of array update operators to update the values of the array fields in the documents and $pull operator is one of them. This operat... |
Front Office Management - Quick Guide | Every multi-departmental physical business needs to have a front office or reception to receive the visitors. Front Office Department is the face and as well as the voice of a business. Regardless of the star rating of the hotel or the hotel type, the hotel has a front office as its most visible department. For a busin... | [
{
"code": null,
"e": 2436,
"s": 1990,
"text": "Every multi-departmental physical business needs to have a front office or reception to receive the visitors. Front Office Department is the face and as well as the voice of a business. Regardless of the star rating of the hotel or the hotel type, the h... |
5 Exciting Deep Learning Advancements to Keep Your Eye on in 2021 | by Andre Ye | Towards Data Science | 2021 is here, and deep learning is as active as ever; research in the field is speeding up exponentially. There are obviously many more deep learning advancements that are fascinating and exciting. To me, though, the five presented demonstrate a central undercurrent in ongoing deep learning research: how necessary is t... | [
{
"code": null,
"e": 530,
"s": 172,
"text": "2021 is here, and deep learning is as active as ever; research in the field is speeding up exponentially. There are obviously many more deep learning advancements that are fascinating and exciting. To me, though, the five presented demonstrate a central u... |
Replace dot with comma on MySQL SELECT? | To replace dot with comma on SELECT, you can use REPLACE().
Following is the syntax −
select replace(yourColumnName, '.' , ',' ) from yourTableName;
Let us first create a table −
mysql> create table DemoTable
(
Value float
);
Query OK, 0 rows affected (0.63 sec)
Insert records in the table using insert command −
my... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "To replace dot with comma on SELECT, you can use REPLACE()."
},
{
"code": null,
"e": 1149,
"s": 1122,
"text": " Following is the syntax −"
},
{
"code": null,
"e": 1212,
"s": 1149,
"text": "select replace(yourColum... |
Java Program to set the height of only a single row in a JTable with multiple rows | To set the row height, use the setRowHeight and set a parameter that would be the number of pixels you need to set the row height.
However, if you want to set the row height of a single row then you need to use the same method, but set an additional parameter as shown below −
table.setRowHeight(3, 30);
The above sets r... | [
{
"code": null,
"e": 1193,
"s": 1062,
"text": "To set the row height, use the setRowHeight and set a parameter that would be the number of pixels you need to set the row height."
},
{
"code": null,
"e": 1339,
"s": 1193,
"text": "However, if you want to set the row height of a sin... |
Effect Size. Moving beyond the p-value | by Aren Carpenter | Towards Data Science | In the sciences, we deal with p-values and statistical tests constantly. We hope to see a p-value < 0.05 to declare that we’ve been successful in our efforts, but this fervor for incredibly low p-values means that we don’t ask another very important question. “Does it even matter?”
Let’s take a case where we are lookin... | [
{
"code": null,
"e": 455,
"s": 172,
"text": "In the sciences, we deal with p-values and statistical tests constantly. We hope to see a p-value < 0.05 to declare that we’ve been successful in our efforts, but this fervor for incredibly low p-values means that we don’t ask another very important quest... |
Sequential Test Cases for Dynamic Pages | In this chapter, we will describe the various combinations of -n and -c with the important flags to gradually increase the load on your webserver.
You should mainly focus on how the following metrics change as you increase the load −
Requests per second
Connection Times (ms)
Percentage of the requests served within a c... | [
{
"code": null,
"e": 1981,
"s": 1834,
"text": "In this chapter, we will describe the various combinations of -n and -c with the important flags to gradually increase the load on your webserver."
},
{
"code": null,
"e": 2068,
"s": 1981,
"text": "You should mainly focus on how the ... |
Load and unload a table in SAP HANA using SQL query | In SAP HANA, it is possible to manually load and unload individual tables and table columns.
You can perform loading of table to precisely measure the total or “worst case” amount of memory used by a particular table.
A table is unload from database to actively free up memory.
You can use following SQL queries to perfo... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "In SAP HANA, it is possible to manually load and unload individual tables and table columns."
},
{
"code": null,
"e": 1280,
"s": 1155,
"text": "You can perform loading of table to precisely measure the total or “worst case” amount of... |
Writing Linguistic Rules for Natural Language Processing | by Jenny Lee | Towards Data Science | Ruminations of a LinguistA solution: Rule-Based Syntactic Feature ExtractionAn example: Question Type Extraction Using spaCy
Ruminations of a Linguist
A solution: Rule-Based Syntactic Feature Extraction
An example: Question Type Extraction Using spaCy
When I first started exploring data science towards the end of my Ph... | [
{
"code": null,
"e": 297,
"s": 172,
"text": "Ruminations of a LinguistA solution: Rule-Based Syntactic Feature ExtractionAn example: Question Type Extraction Using spaCy"
},
{
"code": null,
"e": 323,
"s": 297,
"text": "Ruminations of a Linguist"
},
{
"code": null,
"e"... |
SQL Tryit Editor v1.6 | SELECT * FROM Customers
WHERE City LIKE 'ber%';
Edit the SQL Statement, and click "Run SQL" to see the result.
This SQL-Statement is not supported in the WebSQL Database.
The example still works, because it uses a modified version of SQL.
Your browser does not support WebSQL.
Your are now using a light-version of the... | [
{
"code": null,
"e": 24,
"s": 0,
"text": "SELECT * FROM Customers"
},
{
"code": null,
"e": 48,
"s": 24,
"text": "WHERE City LIKE 'ber%';"
},
{
"code": null,
"e": 50,
"s": 48,
"text": ""
},
{
"code": null,
"e": 113,
"s": 50,
"text": "Edit t... |
Basic AI Algorithms. Search Algorithms for Traveling... | by Mengsay Loem | Towards Data Science | To solve a problem with a computer, it is necessary to represent the problem in numerical or symbolic form and offer a specific procedure using a programming language. However, working with problem-solving in the artificial intelligence (AI) field, it is difficult to specify a formulation of a problem from the beginnin... | [
{
"code": null,
"e": 805,
"s": 171,
"text": "To solve a problem with a computer, it is necessary to represent the problem in numerical or symbolic form and offer a specific procedure using a programming language. However, working with problem-solving in the artificial intelligence (AI) field, it is ... |
Python - Merge Pandas DataFrame with Right Outer Join | To merge Pandas DataFrame, use the merge() function. The right outer join is implemented on both the DataFrames by setting under the “how” parameter of the merge() function i.e. −
how = “right”
At first, let us import the pandas library with an alias −
import pandas as pd
Create two dataframes to be merged −
# Create ... | [
{
"code": null,
"e": 1242,
"s": 1062,
"text": "To merge Pandas DataFrame, use the merge() function. The right outer join is implemented on both the DataFrames by setting under the “how” parameter of the merge() function i.e. −"
},
{
"code": null,
"e": 1256,
"s": 1242,
"text": "ho... |
AWT FileDialog Class | FileDialog control represents a dialog window from which the user can select a file.
Following is the declaration for java.awt.FileDialog class:
public class FileDialog
extends Dialog
Following are the fields for java.awt.Image class:
static int LOAD -- This constant value indicates that the purpose of the file dia... | [
{
"code": null,
"e": 1832,
"s": 1747,
"text": "FileDialog control represents a dialog window from which the user can select a file."
},
{
"code": null,
"e": 1892,
"s": 1832,
"text": "Following is the declaration for java.awt.FileDialog class:"
},
{
"code": null,
"e": ... |
Finding average marks of students for different subjects and display only the highest average marks in MySQL | For this, you can use subquery. Let us first create a table −
mysql> create table DemoTable
(
StudentName varchar(40),
StudentMarks int
);
Query OK, 0 rows affected (0.50 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('Adam',56);
Query OK, 1 row affected (0.14 sec... | [
{
"code": null,
"e": 1124,
"s": 1062,
"text": "For this, you can use subquery. Let us first create a table −"
},
{
"code": null,
"e": 1244,
"s": 1124,
"text": "mysql> create table DemoTable\n(\n StudentName varchar(40),\n StudentMarks int\n);\nQuery OK, 0 rows affected (0.50 ... |
A Minimalist End-to-End Scrapy Tutorial (Part I) | by Harry Wang | Towards Data Science | Part I, Part II, Part III, Part IV, Part V
Web scraping is an important skill for data scientists. I have developed a number of ad hoc web scraping projects using Python, BeautifulSoup, and Scrapy in the past few years and read a few books and tons of online tutorials along the way. However, I have not found a simple b... | [
{
"code": null,
"e": 214,
"s": 171,
"text": "Part I, Part II, Part III, Part IV, Part V"
},
{
"code": null,
"e": 788,
"s": 214,
"text": "Web scraping is an important skill for data scientists. I have developed a number of ad hoc web scraping projects using Python, BeautifulSoup, ... |
How to flush the internal buffer in Python? | Python buffers writes to files. That is, file.write returns before the data is actually written to your hard drive. The main motivation of this is that a few large writes are much faster than many tiny writes, so by saving up the output of file.write until a bit has accumulated, Python can maintain good writing speeds.... | [
{
"code": null,
"e": 1383,
"s": 1062,
"text": "Python buffers writes to files. That is, file.write returns before the data is actually written to your hard drive. The main motivation of this is that a few large writes are much faster than many tiny writes, so by saving up the output of file.write un... |
Java - String Buffer append() Method | This method updates the value of the object that invoked the method. The method takes boolean, char, int, long, Strings, etc.
Here is a separate method for each primitive data type −
public StringBuffer append(boolean b)
public StringBuffer append(char c)
public StringBuffer append(char[] str)
public StringBuffer appen... | [
{
"code": null,
"e": 2503,
"s": 2377,
"text": "This method updates the value of the object that invoked the method. The method takes boolean, char, int, long, Strings, etc."
},
{
"code": null,
"e": 2560,
"s": 2503,
"text": "Here is a separate method for each primitive data type −... |
Hyperparameter Tuning in Python | Towards Data Science | Kaggle’s Don’t Overfit II competition presents an interesting problem. We have 20,000 rows of continuous variables, with only 250 of them belonging to the training set.
The challenge is not to overfit.
With such a small dataset — and even smaller training set, this can be a difficult task!
In this article, we’ll explor... | [
{
"code": null,
"e": 341,
"s": 172,
"text": "Kaggle’s Don’t Overfit II competition presents an interesting problem. We have 20,000 rows of continuous variables, with only 250 of them belonging to the training set."
},
{
"code": null,
"e": 374,
"s": 341,
"text": "The challenge is ... |
Hibernate Criteria Example | Hibernate Criteria Tutorials Point | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorial, we are going to learn about... | [
{
"code": null,
"e": 158,
"s": 123,
"text": "PROGRAMMINGJava ExamplesC Examples"
},
{
"code": null,
"e": 172,
"s": 158,
"text": "Java Examples"
},
{
"code": null,
"e": 183,
"s": 172,
"text": "C Examples"
},
{
"code": null,
"e": 195,
"s": 183,
... |
Data Scientist vs Senior Data Scientist. Here’s the Difference. | by Matt Przybyla | Towards Data Science | IntroductionData ScientistSenior Data ScientistSummaryReferences
Introduction
Data Scientist
Senior Data Scientist
Summary
References
This article is for current data scientists who want to move up in their careers as well as for people switching careers to the data science landscape and want to know what separates and... | [
{
"code": null,
"e": 237,
"s": 172,
"text": "IntroductionData ScientistSenior Data ScientistSummaryReferences"
},
{
"code": null,
"e": 250,
"s": 237,
"text": "Introduction"
},
{
"code": null,
"e": 265,
"s": 250,
"text": "Data Scientist"
},
{
"code": nu... |
Difference between ++*p, *p++ and *++p in c++ | In this section we will see what are the differences between *ptr++, *++ptr and ++*ptr in C++.
Here we will see the precedence of postfix++ and prefix++ in C or C++. The precedence of prefix ++ or -- has higher priority than dereference operator ‘*’ and postfix ++ or -- has priority higher than both prefix ++ and deref... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "In this section we will see what are the differences between *ptr++, *++ptr and ++*ptr in C++."
},
{
"code": null,
"e": 1403,
"s": 1157,
"text": "Here we will see the precedence of postfix++ and prefix++ in C or C++. The precedence o... |
Selenium Webdriver submit() vs click(). | The click() and submit() functions are quite similar in terms of functionalities. However there are minor differences. Let us discuss some differences between them.
The submit() function is applicable only for <form> and makes handling of form easier. It can be used with any element inside a form. The click() is only a... | [
{
"code": null,
"e": 1227,
"s": 1062,
"text": "The click() and submit() functions are quite similar in terms of functionalities. However there are minor differences. Let us discuss some differences between them."
},
{
"code": null,
"e": 1431,
"s": 1227,
"text": "The submit() func... |
Cleaning & Preprocessing Text Data for Sentiment Analysis | by Muriel Kosaka | Towards Data Science | Sentiment analysis for text data combined natural language processing (NLP) and machine learning techniques to assign weighted sentiment scores to the systems, topics, or categories within a sentence or document. In business setting, sentiment analysis is extremely helpful as it can help understand customer experiences... | [
{
"code": null,
"e": 558,
"s": 172,
"text": "Sentiment analysis for text data combined natural language processing (NLP) and machine learning techniques to assign weighted sentiment scores to the systems, topics, or categories within a sentence or document. In business setting, sentiment analysis is... |
Avoid Unexpected string concatenation in JavaScript? | To avoid unexpected string concatenation while concatenating strings, multiple strings, and numbers, use backticks.
We have the following −
const concatValue = 'John,David,Mike';
var friendNames= `${concatValue}`;
The above value is concatenated with a string and number −
var studentNameWithFriends=` ${concatValue}| 'C... | [
{
"code": null,
"e": 1178,
"s": 1062,
"text": "To avoid unexpected string concatenation while concatenating strings, multiple strings, and numbers, use backticks."
},
{
"code": null,
"e": 1202,
"s": 1178,
"text": "We have the following −"
},
{
"code": null,
"e": 1276,... |
How to set the current figure in Matplotlib? | Using the figure() method, we can set the current figure.
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 1”.
Create a new figure, or activate an existing figure, with the window title “Welcome to figure 1”.
Create a new figure, or activate an existing figure, with the wind... | [
{
"code": null,
"e": 1120,
"s": 1062,
"text": "Using the figure() method, we can set the current figure."
},
{
"code": null,
"e": 1218,
"s": 1120,
"text": "Create a new figure, or activate an existing figure, with the window title “Welcome to figure 1”."
},
{
"code": null... |
Causal Inference. Answering causal questions with Python | by Shawhin Talebi | Towards Data Science | This is the second post in a series of three on causality. In the last post I introduced this “new science of cause and effect” [1], and gave a flavor for causal inference and causal discovery. In this post we will dive further into some details of causal inference and finish with a concrete example in Python.
In the l... | [
{
"code": null,
"e": 484,
"s": 172,
"text": "This is the second post in a series of three on causality. In the last post I introduced this “new science of cause and effect” [1], and gave a flavor for causal inference and causal discovery. In this post we will dive further into some details of causal... |
Javascript Interview Questions | Dear readers, these JavaScript Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of JavaScript. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally ques... | [
{
"code": null,
"e": 2910,
"s": 2466,
"text": "Dear readers, these JavaScript Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of JavaScript. As per my experience good interviewers hardly plan ... |
How to calculate the ln of a given number in JavaScript?
| To calculate the ln of a given number, use the Math.log() method in JavaScript. This method returns the natural logarithm (base E) of a number. If the value of a number is negative, the return value is always NaN.
You can try to run the following code to get the ln of a given number −
<html>
<head>
<title>Java... | [
{
"code": null,
"e": 1276,
"s": 1062,
"text": "To calculate the ln of a given number, use the Math.log() method in JavaScript. This method returns the natural logarithm (base E) of a number. If the value of a number is negative, the return value is always NaN."
},
{
"code": null,
"e": 13... |
Why do we need generics in Java? | As we know a class is a blue print in which we define the required behaviors and properties and, an interface is similar to class but it is a Specification (containing abstract methods).
These are also considered as datatypes in Java, unlike other primitive datatypes a literal of these kind of types points/refers to th... | [
{
"code": null,
"e": 1249,
"s": 1062,
"text": "As we know a class is a blue print in which we define the required behaviors and properties and, an interface is similar to class but it is a Specification (containing abstract methods)."
},
{
"code": null,
"e": 1448,
"s": 1249,
"tex... |
Java Program to Convert Milliseconds to Minutes and Seconds | 08 Oct, 2021
Convert Milliseconds to Minutes and Seconds in java using methods like toMinutes() and toSeconds(), TimeUnit which is in the concurrent package.
Milliseconds:
1 millisecond = 0.001 second or (1/1000) seconds
Seconds:
1 second = 1000 millisecond
1 second = (1/60) minutes
Minute:
1 minute = 60000 millisecon... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 198,
"s": 53,
"text": "Convert Milliseconds to Minutes and Seconds in java using methods like toMinutes() and toSeconds(), TimeUnit which is in the concurrent package."
},
{
"code": null,
... |
Java.util.BitSet.flip() in Java | 16 Aug, 2018
There are two variants of flip() method. This article depicts about all of them as follows:
1. flip(int value) : This method removes the value specified in the argument.
public void flip(int value)
Parameters :
value : the value to flip.
Return ValueThis method does not return a value.
// Java code to ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Aug, 2018"
},
{
"code": null,
"e": 120,
"s": 28,
"text": "There are two variants of flip() method. This article depicts about all of them as follows:"
},
{
"code": null,
"e": 198,
"s": 120,
"text": "1. flip(int va... |
Python Program to Return the Length of the Longest Word from the List of Words | 28 Jul, 2021
The problem is to go through all the words in an array and the program should return the word with the longest one. Consider for example we are having an array, and we have numbers in alphabetic form, now when we pass this array as an input then we should get the word with the longest one. Below I had expl... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 405,
"s": 28,
"text": "The problem is to go through all the words in an array and the program should return the word with the longest one. Consider for example we are having an array, and we have nu... |
Nested List Comprehensions in Python | 07 Nov, 2018
List Comprehensions are one of the most amazing features of Python. It is a smart and concise way of creating lists by iterating over an iterable object. Nested List Comprehensions are nothing but a list comprehension within another list comprehension which is quite similar to nested for loops.
Let’s take ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Nov, 2018"
},
{
"code": null,
"e": 348,
"s": 52,
"text": "List Comprehensions are one of the most amazing features of Python. It is a smart and concise way of creating lists by iterating over an iterable object. Nested List Comprehe... |
Output of Python programs | Set 10 (Exception Handling) | 10 Feb, 2020
Pre-requisite: Exception Handling in PythonNote: All the programs run on python version 3 and above.
1) What is the output of the following program?
data = 50try: data = data/0except ZeroDivisionError: print('Cannot divide by 0 ', end = '')else: print('Division successful ', end = '') try: dat... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Feb, 2020"
},
{
"code": null,
"e": 153,
"s": 52,
"text": "Pre-requisite: Exception Handling in PythonNote: All the programs run on python version 3 and above."
},
{
"code": null,
"e": 201,
"s": 153,
"text": "1) W... |
Creating objects in JavaScript (4 Different Ways) | 23 Jun, 2020
JavaScript is a flexible object-oriented language when it comes to syntax. In this article, we will see the different ways to instantiate objects in JavaScript.Before we proceed it is important to note that JavaScript is an object-based language based on prototypes, rather than being class-based. Because o... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Jun, 2020"
},
{
"code": null,
"e": 527,
"s": 54,
"text": "JavaScript is a flexible object-oriented language when it comes to syntax. In this article, we will see the different ways to instantiate objects in JavaScript.Before we proc... |
Scanner nextLong() method in Java with Examples | 12 Oct, 2018
The nextLong(radix) method of java.util.Scanner class scans the next token of the input as a long. If the translation is successful, the scanner advances past the input that matched. If the parameter radix is not passed, then it behaves similarly as nextLong(radix) where the radix is assumed to be the defa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Oct, 2018"
},
{
"code": null,
"e": 346,
"s": 28,
"text": "The nextLong(radix) method of java.util.Scanner class scans the next token of the input as a long. If the translation is successful, the scanner advances past the input that m... |
Plot a 3D Contour in MATLAB | 21 Apr, 2021
Contour plots are used to show 3D surfaces by plotting z- slides on a 2D surface. A contour plot is also called a line plot. In contour, we have 3 variables x, y, z. The x, y variables are used to give the values for z, ( z=f(x, y)). The x and y variables are usually in a grid called meshgrid.
There are va... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Apr, 2021"
},
{
"code": null,
"e": 349,
"s": 54,
"text": "Contour plots are used to show 3D surfaces by plotting z- slides on a 2D surface. A contour plot is also called a line plot. In contour, we have 3 variables x, y, z. The x, y... |
Turn on or off bulb using JavaScript | 19 Feb, 2019
Write a JavaScript code that turns ON and OFF the Light Bulb.Syntax:
img src = URl
or
img src = image_name.jpg
Here the src property sets or returns the value of the src attribute of an image. The required src attribute specifies the URL of an image.There are two states of the bulb is used which are ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Feb, 2019"
},
{
"code": null,
"e": 121,
"s": 52,
"text": "Write a JavaScript code that turns ON and OFF the Light Bulb.Syntax:"
},
{
"code": null,
"e": 169,
"s": 121,
"text": "img src = URl\n or\nimg src = im... |
Hashtable containsKey() Method in Java | 28 Jun, 2018
The java.util.Hashtable.containsKey() method is used to check whether a particular key is present in the Hashtable or not. It takes the key element as a parameter and returns True if that element is present in the table.
Syntax:
Hash_table.containsKey(key_element)
Parameters: The method takes just one para... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jun, 2018"
},
{
"code": null,
"e": 249,
"s": 28,
"text": "The java.util.Hashtable.containsKey() method is used to check whether a particular key is present in the Hashtable or not. It takes the key element as a parameter and returns ... |
Removing Array Element and Re-Indexing in PHP | 25 Jan, 2022
In order to remove an element from an array, we can use unset() function which removes the element from an array and then use array_values() function which indexes the array numerically automatically.
Function Used:
unset(): This function unsets a given variable.Syntax:void unset ( mixed $var [, mixed $...... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Jan, 2022"
},
{
"code": null,
"e": 253,
"s": 52,
"text": "In order to remove an element from an array, we can use unset() function which removes the element from an array and then use array_values() function which indexes the array ... |
Character getType() Method in Java with examples | 20 Jun, 2018
The Character.getType(char ch) is an inbuilt method in java that returns a value indicating a character’s general category. This method cannot handle supplementary characters. To support all Unicode characters, including supplementary characters, use the getType(int) method.Syntax:public static int getType... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jun, 2018"
},
{
"code": null,
"e": 3513,
"s": 28,
"text": "The Character.getType(char ch) is an inbuilt method in java that returns a value indicating a character’s general category. This method cannot handle supplementary characters... |
Update Date Field in SQL Server | 10 Oct, 2021
The UPDATE statement in SQL is used to update the data of an existing table in the database. We can update single columns as well as multiple columns using the UPDATE statements as per our requirement. With this article, we will learn how to Update the Date Field in SQL Server. In this article, we will be ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Oct, 2021"
},
{
"code": null,
"e": 417,
"s": 54,
"text": "The UPDATE statement in SQL is used to update the data of an existing table in the database. We can update single columns as well as multiple columns using the UPDATE stateme... |
How to delete an Element From an Array in PHP ? | 29 Jul, 2021
There are multiple ways to delete an element from an array in PHP. This article discusses some of the most common methods used in PHP to delete an element from an array.
Functions used:
unset(): This function takes an element as a parameter and unset it. It wouldn’t change the keys of other elements.
array... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 198,
"s": 28,
"text": "There are multiple ways to delete an element from an array in PHP. This article discusses some of the most common methods used in PHP to delete an element from an array."
},... |
Remove BST Keys in a given Range | 18 Jun, 2021
Given a Binary Search Tree (BST) and a range [min, max], remove all keys which are inside the given range. The modified tree should also be BST. For example, consider the following BST and range [50, 70].
50
/ \
30 70
/ \ / \
20 40 60 80
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Jun, 2021"
},
{
"code": null,
"e": 261,
"s": 54,
"text": "Given a Binary Search Tree (BST) and a range [min, max], remove all keys which are inside the given range. The modified tree should also be BST. For example, consider the fol... |
C++ Program to Implement Max Heap | A Binary Heap is a complete binary tree which is either Min Heap or Max Heap. In a Max Binary Heap, the key at root must be maximum among all keys present in Binary Heap. This property must be recursively true for all nodes in Binary Tree. Min Binary Heap is similar to MinHeap.
For max_heap:
Begin
Declare function m... | [
{
"code": null,
"e": 1341,
"s": 1062,
"text": "A Binary Heap is a complete binary tree which is either Min Heap or Max Heap. In a Max Binary Heap, the key at root must be maximum among all keys present in Binary Heap. This property must be recursively true for all nodes in Binary Tree. Min Binary He... |
GATE | GATE-CS-2014-(Set-2) | Question 20 - GeeksforGeeks | 28 Jun, 2021
Consider the function func shown below:
int func(int num){ int count = 0; while (num) { count++; num >>= 1; } return (count);}
The value returned by func(435)is __________.
(A) 8(B) 9(C) 10(D) 11Answer: (B)Explanation: The function mainly returns position of Most significant bi... | [
{
"code": null,
"e": 25805,
"s": 25777,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25845,
"s": 25805,
"text": "Consider the function func shown below:"
},
{
"code": "int func(int num){ int count = 0; while (num) { count++; num >>= 1; } r... |
Sum of all prime numbers in an Array - GeeksforGeeks | 21 May, 2021
Given an array arr[] of N positive integers. The task is to write a program to find the sum of all prime elements in the given array.Examples:
Input: arr[] = {1, 3, 4, 5, 7} Output: 15 There are three primes, 3, 5 and 7 whose sum =15.Input: arr[] = {1, 2, 3, 4, 5, 6, 7} Output: 17
Naive Approach: A s... | [
{
"code": null,
"e": 26174,
"s": 26146,
"text": "\n21 May, 2021"
},
{
"code": null,
"e": 26319,
"s": 26174,
"text": "Given an array arr[] of N positive integers. The task is to write a program to find the sum of all prime elements in the given array.Examples: "
},
{
"cod... |
Count Odd and Even numbers in a range from L to R - GeeksforGeeks | 30 Apr, 2021
Given two numbers L and R, the task is to count the number of odd numbers in the range L to R.Examples:
Input: l = 3, r = 7 Output: 3 2 Count of odd numbers is 3 i.e. 3, 5, 7 Count of even numbers is 2 i.e. 4, 6Input: l = 4, r = 8 Output: 2
Approach: Total numbers in the range will be (R – L + 1) i.e... | [
{
"code": null,
"e": 26437,
"s": 26409,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 26543,
"s": 26437,
"text": "Given two numbers L and R, the task is to count the number of odd numbers in the range L to R.Examples: "
},
{
"code": null,
"e": 26682,
"s": 2654... |
Check if Array can be split into subarrays such that XOR of length of Longest Decreasing Subsequences of those subarrays is 0 - GeeksforGeeks | 17 Dec, 2021
Given an array of integers arr[] of size N, the task is to check whether arr[] can be split into different subarrays such that on taking the XOR of lengths of LDS (Longest decreasing subsequences) of all the subarrays is equal to 0. Print ‘YES‘ if it is possible to split else print ‘NO‘.
Examples:
Input: a... | [
{
"code": null,
"e": 24716,
"s": 24688,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 25005,
"s": 24716,
"text": "Given an array of integers arr[] of size N, the task is to check whether arr[] can be split into different subarrays such that on taking the XOR of lengths of LDS ... |
How many types of inheritance are there in Python? | Inheritance is concept where one class accesses the methods and properties of another class.
Parent class is the class being inherited from, also called base class.
Child class is the class that inherits from another class, also called derived class.
There are two types of inheritance in python −
Multiple Inheritance
M... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "Inheritance is concept where one class accesses the methods and properties of another class."
},
{
"code": null,
"e": 1227,
"s": 1155,
"text": "Parent class is the class being inherited from, also called base class."
},
{
"co... |
Connecting to a MySQL database with Java | Use below URL to connect MySQL database. The syntax is as follows −
String MySQLURL="jdbc:mysql://localhost:3306/yourDatabaseName?useSSL=false";
String databseUserName="yourUserName";
String databasePassword="yourPassword";
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
pu... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "Use below URL to connect MySQL database. The syntax is as follows −"
},
{
"code": null,
"e": 1286,
"s": 1130,
"text": "String MySQLURL=\"jdbc:mysql://localhost:3306/yourDatabaseName?useSSL=false\";\nString databseUserName=\"yourUserN... |
PHP - imap_open() Function | PHP−IMAP functions helps you to access an email accounts, IMAP stands for Internet Mail Access Protocol using these functions you can also work with NNTP, POP3 protocols and local mailbox access methods.
The imap_open() function accepts three string values representing the mailbox name/URL, user name and, password as p... | [
{
"code": null,
"e": 2961,
"s": 2757,
"text": "PHP−IMAP functions helps you to access an email accounts, IMAP stands for Internet Mail Access Protocol using these functions you can also work with NNTP, POP3 protocols and local mailbox access methods."
},
{
"code": null,
"e": 3130,
"s... |
Difference between two vectors in R - GeeksforGeeks | 23 May, 2021
In this article, we will see how to find the difference between two vectors in R Programming Language.
The difference (A-B) between two vectors in R Programming is equivalent to the elements present in A which are not present in B. The resultant elements are always a subset of A. In case, both sets are no... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n23 May, 2021"
},
{
"code": null,
"e": 25346,
"s": 25242,
"text": "In this article, we will see how to find the difference between two vectors in R Programming Language. "
},
{
"code": null,
"e": 25596,
"s": 25346,... |
Remove duplicates and map an array in JavaScript | Suppose, we have an array of objects like this −
const arr = [
{id:123, value:"value1", name:"Name1"},
{id:124, value:"value2", name:"Name1"},
{id:125, value:"value3", name:"Name2"},
{id:126, value:"value4", name:"Name2"}
];
Note that some of the "name" property in objects within the array are duplicate.
We... | [
{
"code": null,
"e": 1111,
"s": 1062,
"text": "Suppose, we have an array of objects like this −"
},
{
"code": null,
"e": 1299,
"s": 1111,
"text": "const arr = [\n {id:123, value:\"value1\", name:\"Name1\"},\n {id:124, value:\"value2\", name:\"Name1\"},\n {id:125, value:\"va... |
Difference between Call by Value and Call by Reference - GeeksforGeeks | 14 Aug, 2020
Functions can be invoked in two ways: Call by Value or Call by Reference. These two ways are generally differentiated by the type of values passed to them as parameters.
The parameters passed to function are called actual parameters whereas the parameters received by function are called formal parameters.
... | [
{
"code": null,
"e": 24232,
"s": 24204,
"text": "\n14 Aug, 2020"
},
{
"code": null,
"e": 24402,
"s": 24232,
"text": "Functions can be invoked in two ways: Call by Value or Call by Reference. These two ways are generally differentiated by the type of values passed to them as param... |
NLP Text Similarity, how it works and the math behind it | by Jaskaran S. Puri | Towards Data Science | Have a look at these pairs of sentences, which one of these pairs you think has similar sentences?
You might be confident about the first two, but not so much about the last two. In reality, you’re right as the sentences in the first two pairs talk about the same thing (independently) and so are quite similar. However,... | [
{
"code": null,
"e": 271,
"s": 172,
"text": "Have a look at these pairs of sentences, which one of these pairs you think has similar sentences?"
},
{
"code": null,
"e": 607,
"s": 271,
"text": "You might be confident about the first two, but not so much about the last two. In real... |
Java DIP - Sobel Operator | Sobel operator is very similar to Prewitt operator. It is also a derivative mask and is used for edge detection. Sobel operator is used to detect two kinds of edges in an image: Vertical direction edges and Horizontal direction edges.
We are going to use OpenCV function filter2D to apply Sobel operator to images. It ca... | [
{
"code": null,
"e": 2572,
"s": 2337,
"text": "Sobel operator is very similar to Prewitt operator. It is also a derivative mask and is used for edge detection. Sobel operator is used to detect two kinds of edges in an image: Vertical direction edges and Horizontal direction edges."
},
{
"cod... |
PHP | fputcsv( ) Function - GeeksforGeeks | 13 Jun, 2018
The fputcsv() function in PHP is an inbuilt function which is used to format a line as CSV(comma separated values) file and writes it to an open file. The file which has to be read and the fields are sent as parameters to the fputcsv() function and it returns the length of the written string on success or ... | [
{
"code": null,
"e": 24644,
"s": 24616,
"text": "\n13 Jun, 2018"
},
{
"code": null,
"e": 24969,
"s": 24644,
"text": "The fputcsv() function in PHP is an inbuilt function which is used to format a line as CSV(comma separated values) file and writes it to an open file. The file whi... |
Apache Flink - Machine Learning | Apache Flink's Machine Learning library is called FlinkML. Since usage of machine learning has been increasing exponentially over the last 5 years, Flink community decided to add this machine learning APO also in its ecosystem. The list of contributors and algorithms are increasing in FlinkML. This API is not a part of... | [
{
"code": null,
"e": 2415,
"s": 2069,
"text": "Apache Flink's Machine Learning library is called FlinkML. Since usage of machine learning has been increasing exponentially over the last 5 years, Flink community decided to add this machine learning APO also in its ecosystem. The list of contributors ... |
How to create an unordered list in HTML ? - GeeksforGeeks | 09 Dec, 2021
In this article, we will know how to create an unordered list in HTML. An Unordered list <ul> tag in HTML is used to define the unordered list item in an HTML document. It contains the list items <li> element. The <ul> tag requires opening and closing tags.
Syntax:
<ul> List of items </ul>
Attribute: Thi... | [
{
"code": null,
"e": 24317,
"s": 24289,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 24576,
"s": 24317,
"text": "In this article, we will know how to create an unordered list in HTML. An Unordered list <ul> tag in HTML is used to define the unordered list item in an HTML docu... |
Check if given string can be made Palindrome by removing only single type of character - GeeksforGeeks | 23 Nov, 2021
Given a string S, the task is to whether a string can be made palindrome after removing the occurrences of the same character, any number of times
Examples:
Input: S = “abczdzacb” Output: Yes Explanation: Remove first and second occurrence of character ‘a’, string S becomes “bczdzcb”, which is a palindrom... | [
{
"code": null,
"e": 24461,
"s": 24433,
"text": "\n23 Nov, 2021"
},
{
"code": null,
"e": 24608,
"s": 24461,
"text": "Given a string S, the task is to whether a string can be made palindrome after removing the occurrences of the same character, any number of times"
},
{
"c... |
Check if dataframe contains infinity in Python - Pandas - GeeksforGeeks | 26 Dec, 2020
Prerequisites: Pandas
There are various cases where a data frame can contain infinity as value. This article discusses how we can keep track of infinities in our data frame.
Import module
Create a data frame, for this article, it is done using a dictionary. For including infinity in the data, import NumPy... | [
{
"code": null,
"e": 23938,
"s": 23910,
"text": "\n26 Dec, 2020"
},
{
"code": null,
"e": 23960,
"s": 23938,
"text": "Prerequisites: Pandas"
},
{
"code": null,
"e": 24113,
"s": 23960,
"text": "There are various cases where a data frame can contain infinity as v... |
Basic Algorithms — Heapsort. Sorting an array with “Heap” data... | by Keita Miyaki | Towards Data Science | In previous posts, we looked at different sorting algorithms such as Merge Sort and Quicksort, and this time another sorting algorithm, Heapsort, is discussed. Heapsort, as shown in its name, uses “Heap” data structure.
Heap is a data structure, and heaps are arrays of binary trees. Each node of the binary tree corresp... | [
{
"code": null,
"e": 392,
"s": 172,
"text": "In previous posts, we looked at different sorting algorithms such as Merge Sort and Quicksort, and this time another sorting algorithm, Heapsort, is discussed. Heapsort, as shown in its name, uses “Heap” data structure."
},
{
"code": null,
"e"... |
Create a grouped bar plot in Matplotlib - GeeksforGeeks | 17 Dec, 2020
In this article, we will learn how to Create a grouped bar plot in Matplotlib. Let’s discuss some concepts :
Matplotlib is a tremendous visualization library in Python for 2D plots of arrays. Matplotlib may be a multi-platform data visualization library built on NumPy arrays and designed to figure with the... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n17 Dec, 2020"
},
{
"code": null,
"e": 24010,
"s": 23901,
"text": "In this article, we will learn how to Create a grouped bar plot in Matplotlib. Let’s discuss some concepts :"
},
{
"code": null,
"e": 24290,
"s": 2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.