title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Python Program for Column to Row Transpose using Pandas | 20 Jan, 2022
Given an Input File, having columns Dept and Name, perform an operation to convert the column values to rows. Name contains pipe separated values that belong to a particular department identified by the column Dept.
Attached Dataset: emp_data
Examples:
Input:
dept, name
10, Vivek|John
20, Ritika|Shubham|Ni... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jan, 2022"
},
{
"code": null,
"e": 244,
"s": 28,
"text": "Given an Input File, having columns Dept and Name, perform an operation to convert the column values to rows. Name contains pipe separated values that belong to a particular d... |
Python β Append List every Nth index | 11 Oct, 2020
Given 2 list, append list to the original list every nth index.
Input : test_list = [3, 7, 8, 2, 1, 5, 8], app_list = [βGβ, βFβ, βGβ], N = 3 Output : [βGβ, βFβ, βGβ, 3, 7, 8, βGβ, βFβ, βGβ, 2, 1, 5, βGβ, βFβ, βGβ, 8] Explanation : List is added after every 3rd element.Input : test_list = [3, 7, 8, 2, 1, 5,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Oct, 2020"
},
{
"code": null,
"e": 92,
"s": 28,
"text": "Given 2 list, append list to the original list every nth index."
},
{
"code": null,
"e": 510,
"s": 92,
"text": "Input : test_list = [3, 7, 8, 2, 1, 5, 8], a... |
Python program to count occurrences of a word in a string | In this tutorial, we are going to write a program that counts the number of times a word occurs in the string. You are given the word and a string, we have to calculate the frequency of the word in the string.
Suppose we have a string I am a programmer. I am a student. And the word is. The program that we are going to ... | [
{
"code": null,
"e": 1397,
"s": 1187,
"text": "In this tutorial, we are going to write a program that counts the number of times a word occurs in the string. You are given the word and a string, we have to calculate the frequency of the word in the string."
},
{
"code": null,
"e": 1580,
... |
Lottie Animation in Android Jetpack Compose | 17 Aug, 2021
Lottie is a great library to add animated files into your app. Two days ago Jetpack compose went stable and also Lottie supports Compose. In this article, we are going to see how to add Lottie animations in compose app.
We will build a simple app showing Lottie animation with a pause/play and an increase/d... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Aug, 2021"
},
{
"code": null,
"e": 248,
"s": 28,
"text": "Lottie is a great library to add animated files into your app. Two days ago Jetpack compose went stable and also Lottie supports Compose. In this article, we are going to see ... |
PrintStream print(char) method in Java with Examples | 31 Jan, 2019
The print(char) method of PrintStream Class in Java is used to print the specified char value on the stream. This char value is taken as a parameter.
Syntax:
public void print(char charValue)
Parameters: This method accepts a mandatory parameter charValue which is the char value to be written on the stream... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Jan, 2019"
},
{
"code": null,
"e": 178,
"s": 28,
"text": "The print(char) method of PrintStream Class in Java is used to print the specified char value on the stream. This char value is taken as a parameter."
},
{
"code": nul... |
Difference between Primary and Candidate Key | 22 Mar, 2021
Prerequisite β DBMS | Keys in Relational Model Both Primary Key and Candidate Key are the attributes that are used to access tuples from a table. These(Primary key and Candidate key) are also can be used to create a relationship between two tables.
Primary Key: Primary Key is a set of attributes (or attri... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n22 Mar, 2021"
},
{
"code": null,
"e": 303,
"s": 53,
"text": "Prerequisite β DBMS | Keys in Relational Model Both Primary Key and Candidate Key are the attributes that are used to access tuples from a table. These(Primary key and Candid... |
How to fill up the rest of screen height using Tailwind CSS ? | 26 May, 2021
In this article, we will learn how to fill up the rest of the screen height using Tailwind CSS.
Approach: To solve the above problem weβll be using the Flex Class and Height Class of Tailwind CSS.
The classes that weβll be using to solve this are as follows.
flex: It is used to set the length of flexible ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 124,
"s": 28,
"text": "In this article, we will learn how to fill up the rest of the screen height using Tailwind CSS."
},
{
"code": null,
"e": 226,
"s": 124,
"text": "Approach: ... |
Python Continue Statement | 27 Aug, 2021
In this article, we will discuss continue statements in Python for altering the flow of loops.
Loops in Python automates and repeats the tasks in an efficient manner. But sometimes, there may arise a condition where you want to exit the loop completely, skip an iteration or ignore that condition. These can... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Aug, 2021"
},
{
"code": null,
"e": 147,
"s": 52,
"text": "In this article, we will discuss continue statements in Python for altering the flow of loops."
},
{
"code": null,
"e": 479,
"s": 147,
"text": "Loops in P... |
Count common characters in two strings | 25 Nov, 2021
Given two strings s1 and s2 consisting of lowercase English alphabets, the task is to count all the pairs of indices (i, j) from the given strings such that s1[i] = s2[j] and all the indices are distinct i.e. if s1[i] pairs with some s2[j] then these two characters will not be paired with any other charact... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 372,
"s": 52,
"text": "Given two strings s1 and s2 consisting of lowercase English alphabets, the task is to count all the pairs of indices (i, j) from the given strings such that s1[i] = s2[j] and... |
How to create line chart using react bootstrap ? | 21 Jun, 2021
Line charts are used to represent the relation between two data X and Y on a different axis. One of the axes of the plot represents the specific categories being compared, while the other axis represents the measured values corresponding to those categories.
Creating React Application And Installing Module... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Jun, 2021"
},
{
"code": null,
"e": 313,
"s": 54,
"text": "Line charts are used to represent the relation between two data X and Y on a different axis. One of the axes of the plot represents the specific categories being compared, wh... |
How to create a GitHub repository | A GitHub account is a pre-requisite for creating a GitHub repository. Follow the below steps after registering with GitHub.
Step 1 β Login to the GitHub account. Once you login to your account you will see a β+β button on the right. Click on the button and select "New repository" option to create a new repository.
Conf... | [
{
"code": null,
"e": 1311,
"s": 1187,
"text": "A GitHub account is a pre-requisite for creating a GitHub repository. Follow the below steps after registering with GitHub."
},
{
"code": null,
"e": 1503,
"s": 1311,
"text": "Step 1 β Login to the GitHub account. Once you login to yo... |
VB.Net - Label Control | The Label control represents a standard Windows label. It is generally used to display some informative text on the GUI which is not changed during runtime.
Let's create a label by dragging a Label control from the Toolbox and dropping it on the form.
The following are some of the commonly used properties of the Label ... | [
{
"code": null,
"e": 2591,
"s": 2434,
"text": "The Label control represents a standard Windows label. It is generally used to display some informative text on the GUI which is not changed during runtime."
},
{
"code": null,
"e": 2686,
"s": 2591,
"text": "Let's create a label by d... |
TreeMap values() Method in Java with Examples | 18 Nov, 2021
In Java, the values() method of the TreeMap class is present inside java.util package which is used to create a collection out of the values of the map. It basically returns a Collection view of the values in the TreeMap.
--> java.util package
--> TreeMap class
--> values() Method
Syntax:
Tr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 250,
"s": 28,
"text": "In Java, the values() method of the TreeMap class is present inside java.util package which is used to create a collection out of the values of the map. It basically returns a... |
Select the next row after skipping every 2 rows in MySQL | To skip rows, you can use OFFSET. Let us first create a table β
mysql> create table DemoTable617(Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,FirstName varchar(100));
Query OK, 0 rows affected (1.70 sec)
Insert some records in the table using insert command β
mysql> insert into DemoTable617(FirstName) values('John');
Que... | [
{
"code": null,
"e": 1126,
"s": 1062,
"text": "To skip rows, you can use OFFSET. Let us first create a table β"
},
{
"code": null,
"e": 1264,
"s": 1126,
"text": "mysql> create table DemoTable617(Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,FirstName varchar(100));\nQuery OK, 0 rows... |
Delete a directory or file using Python - GeeksforGeeks | 29 Dec, 2020
Python provides different methods and functions for removing files and directories. One can remove the file according to their need. Various methods provided by Python are β
Using os.remove()
Using os.rmdir()
Using shutil.rmtree()
OS module in Python provides functions for interacting with the operating sy... | [
{
"code": null,
"e": 24318,
"s": 24290,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 24492,
"s": 24318,
"text": "Python provides different methods and functions for removing files and directories. One can remove the file according to their need. Various methods provided by Py... |
How to use select list in selenium? | We can select an option from the dropdown list with Selenium webdriver. The Select class is used to handle static dropdown. A dropdown is identified with the <select> tag in an html code.
Let us consider the below html code for <select> tag.
We have to import org.openqa.selenium.support.ui.Select to work with methods u... | [
{
"code": null,
"e": 1250,
"s": 1062,
"text": "We can select an option from the dropdown list with Selenium webdriver. The Select class is used to handle static dropdown. A dropdown is identified with the <select> tag in an html code."
},
{
"code": null,
"e": 1304,
"s": 1250,
"te... |
Granting _SYS_REPO with SELECT to user schema in SAP HANA | In SAP HANA system _SYS_REPO user is required to create run time objects that are saved in HANA database under _SYS_BIC schema. When you activate modeling views in HANA, SYS REPO provides the read access to users on these modeling views. That is why it is required to grant _SYS_REPO with SELECT with GRANT privilege to ... | [
{
"code": null,
"e": 1396,
"s": 1062,
"text": "In SAP HANA system _SYS_REPO user is required to create run time objects that are saved in HANA database under _SYS_BIC schema. When you activate modeling views in HANA, SYS REPO provides the read access to users on these modeling views. That is why it ... |
Overloading in PHP | 15 Jun, 2022
What is function overloading? Function overloading is the ability to create multiple functions of the same name with different implementations. Function overloading in PHP? Function overloading in PHP is used to dynamically create properties and methods. These dynamic entities are processed by magic method... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Jun, 2022"
},
{
"code": null,
"e": 936,
"s": 52,
"text": "What is function overloading? Function overloading is the ability to create multiple functions of the same name with different implementations. Function overloading in PHP? F... |
Use of :even and :odd pseudo-classes with list items in CSS | 16 Dec, 2021
The:nth-child() selector in CSS is used to match the elements based on their position in a group of siblings. It matches every element that is the nth-child. The: even and: odd pseudo-class is used with the list of items such as paragraph, article items which is basically a list content.
odd: The use of o... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 342,
"s": 52,
"text": "The:nth-child() selector in CSS is used to match the elements based on their position in a group of siblings. It matches every element that is the nth-child. The: even and: o... |
Header Linked List in C | 29 Jan, 2020
Prerequisite: Linked List, Circular Linked List
A header node is a special node that is found at the beginning of the list. A list that contains this type of node, is called the header-linked list. This type of list is useful when information other than that found in each node is needed.For example, suppos... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Jan, 2020"
},
{
"code": null,
"e": 100,
"s": 52,
"text": "Prerequisite: Linked List, Circular Linked List"
},
{
"code": null,
"e": 628,
"s": 100,
"text": "A header node is a special node that is found at the begi... |
PyQt5 QListWidget β Setting Selection Mode | 06 Aug, 2020
In this article we will see how we can set the selection mode property to the QListWidget. QListWidget is a convenience class that provides a list view with a classic item-based interface for adding and removing items. QListWidget uses an internal model to manage each QListWidgetItem in the list. This prop... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Aug, 2020"
},
{
"code": null,
"e": 547,
"s": 28,
"text": "In this article we will see how we can set the selection mode property to the QListWidget. QListWidget is a convenience class that provides a list view with a classic item-bas... |
Linked List Pair Sum | 04 Apr, 2022
Given a linked list, and a number, check if their exist two numbers whose sum is equal to given number. If there exist two numbers, print them. If there are multiple answer, print any of them.Examples:
Input : 1 -> 2 -> 3 -> 4 -> 5 -> NULL
sum = 3
Output : Pair is (1, 2)
Input : 10 -> 12 -> 31 -... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Apr, 2022"
},
{
"code": null,
"e": 255,
"s": 52,
"text": "Given a linked list, and a number, check if their exist two numbers whose sum is equal to given number. If there exist two numbers, print them. If there are multiple answer, ... |
Sagemaker β Exploring Ground truth labeling | ML | 03 Jun, 2020
Have you ever thought of doing machine learning completely from the scratch and donβt know where to start? If yes, there is a place where you can enter by holding just the dataset in your hands and leaves the place with fully trained machine learning model which is ready to be deployed in the real-life sce... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2020"
},
{
"code": null,
"e": 545,
"s": 28,
"text": "Have you ever thought of doing machine learning completely from the scratch and donβt know where to start? If yes, there is a place where you can enter by holding just the dat... |
RESTful Routes in Node.js | 14 Jul, 2020
Routing: Routing is one of the most significant parts of your website or web application. Routing in Express is basic, adaptable, and robust. Routing is the mechanism by which requests (as specified by a URL and HTTP method) are routed(directed) to the code that handles them.
What is RESTful Routing?REST s... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jul, 2020"
},
{
"code": null,
"e": 305,
"s": 28,
"text": "Routing: Routing is one of the most significant parts of your website or web application. Routing in Express is basic, adaptable, and robust. Routing is the mechanism by which... |
Recursive function to do substring search | 30 Jun, 2022
Given a text txt[] and a pattern pat[], write a recursive function βcontains(char pat[], char txt[])β that returns true if pat[] is present in txt[], otherwise false. Examples:
1) Input: txt[] = "THIS IS A TEST TEXT"
pat[] = "TEST"
Output: true
2) Input: txt[] = "geeksforgeeks"
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 229,
"s": 52,
"text": "Given a text txt[] and a pattern pat[], write a recursive function βcontains(char pat[], char txt[])β that returns true if pat[] is present in txt[], otherwise false. Example... |
Find duplicate rows in a Dataframe based on all or selected columns | 16 Feb, 2022
In this article, we will be discussing how to find duplicate rows in a Dataframe based on all or a list of columns. For this, we will use Dataframe.duplicated() method of Pandas.
Syntax : DataFrame.duplicated(subset = None, keep = βfirstβ)Parameters: subset: This Takes a column or list of column label. It... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Feb, 2022"
},
{
"code": null,
"e": 208,
"s": 28,
"text": "In this article, we will be discussing how to find duplicate rows in a Dataframe based on all or a list of columns. For this, we will use Dataframe.duplicated() method of Pand... |
Method Chaining in JavaScript | 31 Mar, 2021
As a good programming practice, we should write individual functions/methods for dealing with individual actions. And, writing only one method/function for all actions is a thing. However, sticking to good practice takes a toll on the readability and comprehensibility of the code, because defining a separa... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Mar, 2021"
},
{
"code": null,
"e": 597,
"s": 52,
"text": "As a good programming practice, we should write individual functions/methods for dealing with individual actions. And, writing only one method/function for all actions is a t... |
Stored Procedures classification based on Input and Output Parameters in SQL Server | 18 Aug, 2021
Stored Procedure:
The stored procedure has the following key points as follows.
It is a collection of SQL statements such as if you want to write and read data from a database then you can use create a statement for write and select statement for reading the data from database and SQL command logic for the... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 46,
"s": 28,
"text": "Stored Procedure:"
},
{
"code": null,
"e": 108,
"s": 46,
"text": "The stored procedure has the following key points as follows."
},
{
"code": null,
... |
MongoDB SELECT COUNT GROUP BY? | You can achieve this with the help of an aggregate framework. To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows β
> db.countGroupByDemo.insertOne({"StudentId":10,"StudentName":"John"});
{
"acknowledged" : true,
"insertedId" : Ob... | [
{
"code": null,
"e": 1262,
"s": 1062,
"text": "You can achieve this with the help of an aggregate framework. To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows β"
},
{
"code": null,
"e": 2364,
"s": 1... |
Restricting MySQL Connections to Secure Transport | MySQL will make secure connections easier when it has streamlined key generation for both MySQL Community and MySQL Enterprise. This way, the security is improved by expanding support for TLSv1.1 and TLSv1.2. This also helps administrators determine if clients are connecting securely or not with enhanced visibility int... | [
{
"code": null,
"e": 1402,
"s": 1062,
"text": "MySQL will make secure connections easier when it has streamlined key generation for both MySQL Community and MySQL Enterprise. This way, the security is improved by expanding support for TLSv1.1 and TLSv1.2. This also helps administrators determine if ... |
Minimum operations required to make all the array elements equal in C++ | Given an array with n positive integers. We need to find the minimum number of operation to make all elements equal. We can perform addition, multiplication, subtraction or division with any element on an array element.
If input array is = {1, 2, 3, 4} then we require minimum 3 operations to make all elements equal. Fo... | [
{
"code": null,
"e": 1282,
"s": 1062,
"text": "Given an array with n positive integers. We need to find the minimum number of operation to make all elements equal. We can perform addition, multiplication, subtraction or division with any element on an array element."
},
{
"code": null,
"... |
How to Make a DIV 100% of the Window Height using CSS | The CSS height property helps us specify the height of an element.
The syntax of CSS height property is as follows β
Selector {
height: /*value*/
}
The following examples illustrate CSS height property.
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
html, body {
... | [
{
"code": null,
"e": 1129,
"s": 1062,
"text": "The CSS height property helps us specify the height of an element."
},
{
"code": null,
"e": 1179,
"s": 1129,
"text": "The syntax of CSS height property is as follows β"
},
{
"code": null,
"e": 1213,
"s": 1179,
"te... |
Hyperparameter Optimization with Scikit-Learn, Scikit-Opt and Keras | by Luke Newman | Towards Data Science | Hyperparameter optimization is often one of the final steps in a data science project. Once you have a shortlist of promising models you will want to fine-tune them so that they perform better on your particular dataset.
In this post, we will go over three techniques used to find optimal hyperparameters with examples o... | [
{
"code": null,
"e": 392,
"s": 171,
"text": "Hyperparameter optimization is often one of the final steps in a data science project. Once you have a shortlist of promising models you will want to fine-tune them so that they perform better on your particular dataset."
},
{
"code": null,
"e... |
8085 program to add three 16 bit numbers stored in registers - GeeksforGeeks | 22 May, 2018
Problem β Write an assembly language program to add three 16 bit numbers stored in register HL, DE, BC and store the result in DE with minimum number of instructions.
Example β
Assumptions β
Numbers to be added are already stored in register HL, DE, BCNumbers stored in register are such that final result s... | [
{
"code": null,
"e": 25092,
"s": 25064,
"text": "\n22 May, 2018"
},
{
"code": null,
"e": 25259,
"s": 25092,
"text": "Problem β Write an assembly language program to add three 16 bit numbers stored in register HL, DE, BC and store the result in DE with minimum number of instructio... |
High-Availability MySQL cluster with load balancing using HAProxy and Heartbeat. | by Alexey Nizhegolenko | Towards Data Science | Hello, in this article I wanna share some experience of building a high available MySQL database cluster, from two master MySQL nodes, with load balancing and failover capability based on HAProxy & Heartbeat.
On most of modern projects, the database availability is a matter of life and death. Good solution will be crea... | [
{
"code": null,
"e": 380,
"s": 171,
"text": "Hello, in this article I wanna share some experience of building a high available MySQL database cluster, from two master MySQL nodes, with load balancing and failover capability based on HAProxy & Heartbeat."
},
{
"code": null,
"e": 715,
... |
Simple GUI calculator using Tkinter in Python | In this tutorial, we are going to create a simple GUI calculator using the Tkinter module. Tkinter is builtin the Python module for developing the GUI application. It's easy to use and comes with Python. We can visualize our data with GUI applications.
Let's see how to create a simple GUI calculator.
Import everything ... | [
{
"code": null,
"e": 1315,
"s": 1062,
"text": "In this tutorial, we are going to create a simple GUI calculator using the Tkinter module. Tkinter is builtin the Python module for developing the GUI application. It's easy to use and comes with Python. We can visualize our data with GUI applications."... |
SWING - BorderLayout Class | The class BorderLayout arranges the components to fit in the five regions: east, west, north, south, and center. Each region can contain only one component and each component in each region is identified by the corresponding constant NORTH, SOUTH, EAST, WEST, and CENTER.
Following is the declaration for java.awt.Border... | [
{
"code": null,
"e": 2035,
"s": 1763,
"text": "The class BorderLayout arranges the components to fit in the five regions: east, west, north, south, and center. Each region can contain only one component and each component in each region is identified by the corresponding constant NORTH, SOUTH, EAST,... |
The extern storage class in C++ | The extern storage class specifier lets you declare objects that several source files can use. An extern declaration makes the described variable usable by the succeeding part of the current source file. This declaration does not replace the definition. The declaration is used to describe the variable that is externall... | [
{
"code": null,
"e": 1393,
"s": 1062,
"text": "The extern storage class specifier lets you declare objects that several source files can use. An extern declaration makes the described variable usable by the succeeding part of the current source file. This declaration does not replace the definition.... |
How to add rows in an R data frame? | To add rows in an R data frame, we can follow the below steps β
First of all, create a data frame.
First of all, create a data frame.
Then, use rbind function and the vectors that will be added as rows to the data frame.
Then, use rbind function and the vectors that will be added as rows to the data frame.
Letβs create... | [
{
"code": null,
"e": 1126,
"s": 1062,
"text": "To add rows in an R data frame, we can follow the below steps β"
},
{
"code": null,
"e": 1161,
"s": 1126,
"text": "First of all, create a data frame."
},
{
"code": null,
"e": 1196,
"s": 1161,
"text": "First of all... |
How to Calculate Covariance in MATLAB - GeeksforGeeks | 31 Aug, 2021
Covariance is the measure of the strength of correlation between two or more random variables. Covariance of two random variables X and Y can be defined as:
Where E(X) and E(Y) are expectation or mean of random variables X and Y respectively.
The covariance matrix of two random variables A and B is defined... | [
{
"code": null,
"e": 24515,
"s": 24487,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 24672,
"s": 24515,
"text": "Covariance is the measure of the strength of correlation between two or more random variables. Covariance of two random variables X and Y can be defined as:"
},
... |
How to use typeof with arguments in JavaScript? | Arguments object is the arguments passed to a function. It is a variable accessible for all functions. Letβs say two arguments are passed to a function, then you can access them like the following:
arguments[0]
arguments[1]
In the same way, you can use a type of with arguments in JavaScript. Firstly, letβs see how to w... | [
{
"code": null,
"e": 1260,
"s": 1062,
"text": "Arguments object is the arguments passed to a function. It is a variable accessible for all functions. Letβs say two arguments are passed to a function, then you can access them like the following:"
},
{
"code": null,
"e": 1286,
"s": 126... |
Dashboard Tutorial (II): HTML, CSS, PHP, and Heroku | by Denise Chen | Towards Data Science | The layout of a webpage often comes as an element to display the content through the CSS Selectors. Through CSS, you can determine text color, content display, and webpage background and image. When it comes to deploying the web page on the server, Heroku is often the common deployment platform. In the Heroku platform,... | [
{
"code": null,
"e": 702,
"s": 172,
"text": "The layout of a webpage often comes as an element to display the content through the CSS Selectors. Through CSS, you can determine text color, content display, and webpage background and image. When it comes to deploying the web page on the server, Heroku... |
How to compare two arrays in C#? | Firstly, set the two arrays to be compared β
// two arrays
int[] arr = new int[] { 99, 87, 56, 45};
int[] brr = new int[] { 99, 87, 56, 45 };
Now, use SequenceEqual() to compare the two arrays β
arr.SequenceEqual(brr);
The following is the code to compare two arrays β
using System;
using System.Linq;
namespace Demo {
... | [
{
"code": null,
"e": 1107,
"s": 1062,
"text": "Firstly, set the two arrays to be compared β"
},
{
"code": null,
"e": 1204,
"s": 1107,
"text": "// two arrays\nint[] arr = new int[] { 99, 87, 56, 45};\nint[] brr = new int[] { 99, 87, 56, 45 };"
},
{
"code": null,
"e": 1... |
Java MD5 Encryption Example | Java MD5 Hashing Example | 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, I am going to show you how ... | [
{
"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,
... |
java.time.LocalDate.minusMonths() Method Example | The java.time.LocalDate.minusMonths(long monthsToSubtract) method returns a copy of this date with the specified months subtracted.
Following is the declaration for java.time.LocalDate.minusMonths(long monthsToSubtract) method.
public LocalDate minusMonths(long monthsToSubtract)
monthsToSubtract β the months to subtra... | [
{
"code": null,
"e": 2047,
"s": 1915,
"text": "The java.time.LocalDate.minusMonths(long monthsToSubtract) method returns a copy of this date with the specified months subtracted."
},
{
"code": null,
"e": 2143,
"s": 2047,
"text": "Following is the declaration for java.time.LocalDa... |
Async/Await Function in JavaScript - GeeksforGeeks | 02 Dec, 2021
We all know that Javascript is a Synchronous which means that it has an event loop that allows you to queue up an action that wonβt take place until the loop is available sometime after the code that queued the action has finished executing. But thereβs a lot of functionalities in our program which makes o... | [
{
"code": null,
"e": 23905,
"s": 23877,
"text": "\n02 Dec, 2021"
},
{
"code": null,
"e": 24280,
"s": 23905,
"text": "We all know that Javascript is a Synchronous which means that it has an event loop that allows you to queue up an action that wonβt take place until the loop is av... |
How to predict an image using CNN with Keras? | by Anh T. Dang | Towards Data Science | There are the following six steps to determine what object does the image contains?
Load an image.
Resize it to a predefined size such as 224 x 224 pixels.
Scale the value of the pixels to the range [0, 255].
Select a pre-trained model.
Run the pre-trained model.
Display the results.
Install TensorFlow and Keras.
pip i... | [
{
"code": null,
"e": 256,
"s": 172,
"text": "There are the following six steps to determine what object does the image contains?"
},
{
"code": null,
"e": 271,
"s": 256,
"text": "Load an image."
},
{
"code": null,
"e": 328,
"s": 271,
"text": "Resize it to a pre... |
Hugging Face Transformers: Fine-tuning DistilBERT for Binary Classification Tasks | Towards Data Science | Creating high-performing natural language models is as time-consuming as it is expensive. After all, it took the team behind Google Brain 3.5 days on 8 Tesla P100 GPUs to train all 340 million parameters of the famous BERT-large model, and ever since its inception in 2018, natural language models have only increased in... | [
{
"code": null,
"e": 505,
"s": 171,
"text": "Creating high-performing natural language models is as time-consuming as it is expensive. After all, it took the team behind Google Brain 3.5 days on 8 Tesla P100 GPUs to train all 340 million parameters of the famous BERT-large model, and ever since its ... |
How can we see MySQL temporary tables in the list of tables? | As we know that we can see the list of tables in a database with the help of SHOW TABLES statement. But MySQL temporary tables are not stored in this list or in other words we can say that we cannot see the temporary tables with the help of SHOW TABLES statement. To illustrate it we are using the following example β
In... | [
{
"code": null,
"e": 1380,
"s": 1062,
"text": "As we know that we can see the list of tables in a database with the help of SHOW TABLES statement. But MySQL temporary tables are not stored in this list or in other words we can say that we cannot see the temporary tables with the help of SHOW TABLES ... |
Tryit Editor v3.7 | HTML Input types
Tryit: HTML input password | [
{
"code": null,
"e": 27,
"s": 10,
"text": "HTML Input types"
}
] |
strnset() function in C | 26 Sep, 2018
The strnset() function is a builtin function in C and it sets the first n characters of a string to a given character. If n is greater than the length of string, the length of string is used in place of n.
Syntax:
char *strnset(const char *str, char ch, int n);
Parameters:
str: This is the original string... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n26 Sep, 2018"
},
{
"code": null,
"e": 259,
"s": 53,
"text": "The strnset() function is a builtin function in C and it sets the first n characters of a string to a given character. If n is greater than the length of string, the length o... |
Ways to read input from console in Java | 18 Mar, 2022
In Java, there are four different ways for reading input from the user in the command line environment(console).
1.Using Buffered Reader Class
This is the Java classical method to take input, Introduced in JDK1.0. This method is used by wrapping the System.in (standard input stream) in an InputStreamReade... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Mar, 2022"
},
{
"code": null,
"e": 166,
"s": 52,
"text": "In Java, there are four different ways for reading input from the user in the command line environment(console). "
},
{
"code": null,
"e": 196,
"s": 166,
... |
Joining two Pandas DataFrames using merge() | 17 Aug, 2020
Let us see how to join two Pandas DataFrames using the merge() function.
Syntax : DataFrame.merge(parameters)
Parameters :
right : DataFrame or named Series
how : {βleftβ, βrightβ, βouterβ, βinnerβ}, default βinnerβ
on : label or list
left_on : label or list, or array-like
right_on : label or list, or arra... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Aug, 2020"
},
{
"code": null,
"e": 127,
"s": 54,
"text": "Let us see how to join two Pandas DataFrames using the merge() function."
},
{
"code": null,
"e": 164,
"s": 127,
"text": "Syntax : DataFrame.merge(paramet... |
How to Move a Column to First Position in Pandas DataFrame? | 02 Feb, 2021
Prerequisites: Pandas
The basic idea to move a column in a pandas dataframe is to remove the column from its current place and insert it in the desired position. The pandas library offers many useful functions such as pop() and insert(). We will make use of these two functions to manipulate with our datafr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Feb, 2021"
},
{
"code": null,
"e": 50,
"s": 28,
"text": "Prerequisites: Pandas"
},
{
"code": null,
"e": 341,
"s": 50,
"text": "The basic idea to move a column in a pandas dataframe is to remove the column from its... |
Count distinct elements in an array in Python | In a list in Python we may have duplicate elements. When we count the length of the list we get the total length including the duplicate elements. But in this article we will see how to get the total count of the distinct elements or unique elements in a list.
In the below example we use the counter() from the collecti... | [
{
"code": null,
"e": 1448,
"s": 1187,
"text": "In a list in Python we may have duplicate elements. When we count the length of the list we get the total length including the duplicate elements. But in this article we will see how to get the total count of the distinct elements or unique elements in ... |
How to apply functions in a Group in a Pandas DataFrame? | 03 Jan, 2021
In this article, letβs see how to apply functions in a group in a Pandas Dataframe. Steps to be followed for performing this task are β
Import the necessary libraries.
Set up the data as a Pandas DataFrame.
Use apply function to find different statistical measures like Rolling Mean, Average, Sum, Maximum,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jan, 2021"
},
{
"code": null,
"e": 165,
"s": 28,
"text": "In this article, letβs see how to apply functions in a group in a Pandas Dataframe. Steps to be followed for performing this task are β "
},
{
"code": null,
"e": 1... |
Shell Script to Demonstrate Wait Command in Linux | 02 Jun, 2022
Wait command is one of the process management commands. There are different process commands in Linux mainly 5 commands are widely used which are ps, wait, sleep, kill, exit.
ps is an acronym for process status. It displays information about the active processes. wait command will suspend execution of the ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n02 Jun, 2022"
},
{
"code": null,
"e": 228,
"s": 53,
"text": "Wait command is one of the process management commands. There are different process commands in Linux mainly 5 commands are widely used which are ps, wait, sleep, kill, exit.... |
median_grouped() function in Python statistics module | 30 May, 2022
Coming to Statistical functions, median of a data-set is the measure of robust central tendency, which is less affected by the presence of outliers in data. As seen previously, medians of an ungrouped data-set using median(), median_high(), median_low() functions. Python gives the option to calculate the m... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 May, 2022"
},
{
"code": null,
"e": 926,
"s": 28,
"text": "Coming to Statistical functions, median of a data-set is the measure of robust central tendency, which is less affected by the presence of outliers in data. As seen previously... |
Understanding Rainbow Table Attack | 17 Jun, 2021
What is a Rainbow Table?
The passwords in a computer system are not stored directly as plain texts but are hashed using encryption. A hash function is a 1-way function, which means that it canβt be decrypted. Whenever a user enters a password, it is converted into a hash value and is compared with the alre... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 79,
"s": 54,
"text": "What is a Rainbow Table?"
},
{
"code": null,
"e": 857,
"s": 79,
"text": "The passwords in a computer system are not stored directly as plain texts but are ... |
Return all dates between two dates in an array in PHP | 21 Nov, 2018
Given two dates (start date and end date) and the task is to return all the dates in an array.
Example 1: In this example, use date interval class which stores fixed amount of time (in years, months, days, hours etc) or relative time string in the format that DateTime.
<?php // Function to get all the dat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Nov, 2018"
},
{
"code": null,
"e": 123,
"s": 28,
"text": "Given two dates (start date and end date) and the task is to return all the dates in an array."
},
{
"code": null,
"e": 298,
"s": 123,
"text": "Example 1: ... |
reset_actions method β Action Chains in Selenium Python | 15 May, 2020
Seleniumβs Python Module is built to perform automated testing with Python. ActionChains are a way to automate low-level interactions such as mouse movements, mouse button actions, keypress, and context menu interactions. This is useful for doing more complex actions like hover over and drag and drop. Acti... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 May, 2020"
},
{
"code": null,
"e": 750,
"s": 28,
"text": "Seleniumβs Python Module is built to perform automated testing with Python. ActionChains are a way to automate low-level interactions such as mouse movements, mouse button act... |
How to set the Size of the DateTimePicker in C#? | 02 Aug, 2019
In Windows Forms, the DateTimePicker control is used to select and display date/time with a specific format in your form. In DateTimePicker control, you can set the size of the DateTimePicker using the Size Property. This property represents both height and width in pixels. You can set this property in two... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Aug, 2019"
},
{
"code": null,
"e": 352,
"s": 28,
"text": "In Windows Forms, the DateTimePicker control is used to select and display date/time with a specific format in your form. In DateTimePicker control, you can set the size of th... |
Difference between @Bean and @Component annotation in Spring. | Spring supports multiple types annotations such as @Component,@Controller,@service @Repository and @Bean. All theses can be found under the org.springframework.stereotype package.
When classes in our application are annotated with any of the above mentioned annotation then during project startup spring scan(using @comp... | [
{
"code": null,
"e": 1368,
"s": 1187,
"text": " Spring supports multiple types annotations such as @Component,@Controller,@service @Repository and @Bean. All theses can be found under the org.springframework.stereotype package."
},
{
"code": null,
"e": 1735,
"s": 1368,
"text": "W... |
Validation of file size while uploading using JavaScript / jQuery | 10 May, 2022
In this article, we will learn how to implement file size validation by checking file size before upload using Javascript and jQuery. This is a demonstration of client-side validation and is implemented to provide a nice user experience. In some cases, client-side validation is a much better method in comp... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 May, 2022"
},
{
"code": null,
"e": 750,
"s": 54,
"text": "In this article, we will learn how to implement file size validation by checking file size before upload using Javascript and jQuery. This is a demonstration of client-side v... |
Special two digit number | 16 Apr, 2021
A special two-digit number is a number such that when the sum of the digits of the number is added to the product of its digits, the result is equal to the original two-digit number. Examples :
input : 59.
output : 59 is a Special Two-Digit Number
Explanation:
Sum of digits = 5 + 9 = 14
Product of its di... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Apr, 2021"
},
{
"code": null,
"e": 248,
"s": 52,
"text": "A special two-digit number is a number such that when the sum of the digits of the number is added to the product of its digits, the result is equal to the original two-digit... |
How to append a slice in Golang? | 05 Sep, 2019
In Go language slice is more powerful, flexible, convenient than an array, and is a lightweight data structure. A slice is a variable-length sequence which stores elements of a similar type, you are not allowed to store different type of elements in the same slice. It is just like an array having an index ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Sep, 2019"
},
{
"code": null,
"e": 623,
"s": 28,
"text": "In Go language slice is more powerful, flexible, convenient than an array, and is a lightweight data structure. A slice is a variable-length sequence which stores elements of ... |
Maximum sum of elements in a diagonal parallel to the main diagonal of a given Matrix | 17 Mar, 2021
Give a square matrix mat[][] of dimensions N * N, the task is to find the maximum sum of elements present in the given matrix along the diagonals which are parallel to the main diagonal. Below is the image of the same.
Examples:
Input: mat[][] = {{1, 2, 5, 7}, {2, 6, 7, 3}, {12, 3, 2, 4}, {3, 6, 9, 4}}Out... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Mar, 2021"
},
{
"code": null,
"e": 273,
"s": 54,
"text": "Give a square matrix mat[][] of dimensions N * N, the task is to find the maximum sum of elements present in the given matrix along the diagonals which are parallel to the ma... |
Scala Tutorial β Learn Scala with Step By Step Guide | 03 Jan, 2022
Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides support to the functional programming approach. Scala programs can convert to bytecodes and can run on the JVM(Java Virtual Machine). Scala stands for Scalable ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Jan, 2022"
},
{
"code": null,
"e": 772,
"s": 54,
"text": "Scala is a general-purpose, high-level, multi-paradigm programming language. It is a pure object-oriented programming language which also provides support to the functional p... |
URL Class in Java with Examples | 18 Apr, 2022
URL known as Uniform Resource Locator is simply a string of text that identifies all the resources on the Internet, telling us the address of the resource, how to communicate with it, and retrieve something from it.
A URL can have many forms. The most general however follows a three-components system as pr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Apr, 2022"
},
{
"code": null,
"e": 268,
"s": 52,
"text": "URL known as Uniform Resource Locator is simply a string of text that identifies all the resources on the Internet, telling us the address of the resource, how to communicate... |
Symmetric Binary Tree | 21 Jun, 2021
Given a binary tree, check whether it is a mirror of itself.
Examples:
Input:
5
/ \
3 3
/ \ / \
8 9 9 8
Output: Symmetric
Input:
5
/ \
8 7
\ \
4 3
Output: Not Symmetric
Approach: The idea is to traverse the tree using Morris Traversal and Rev... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Jun, 2021"
},
{
"code": null,
"e": 114,
"s": 53,
"text": "Given a binary tree, check whether it is a mirror of itself."
},
{
"code": null,
"e": 124,
"s": 114,
"text": "Examples:"
},
{
"code": null,
"e... |
Sum of maximum elements of all subsets | 06 Jul, 2022
Given an array of integer numbers, we need to find sum of maximum number of all possible subsets.
Examples:
Input : arr = {3, 2, 5}
Output : 28
Explanation :
Subsets and their maximum are,
{} maximum = 0
{3} maximum = 3
{2} maximum = 2
{5} maximum = 5
{3, 2} ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 152,
"s": 54,
"text": "Given an array of integer numbers, we need to find sum of maximum number of all possible subsets."
},
{
"code": null,
"e": 163,
"s": 152,
"text": "Example... |
How to check whether a Button is clicked with JavaScript? | Following is the code for checking whether a button is clicked using JavaScript β
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, ... | [
{
"code": null,
"e": 1269,
"s": 1187,
"text": "Following is the code for checking whether a button is clicked using JavaScript β"
},
{
"code": null,
"e": 1280,
"s": 1269,
"text": " Live Demo"
},
{
"code": null,
"e": 2206,
"s": 1280,
"text": "<!DOCTYPE html>\n<... |
Program to print Arithmetic Progression series | 11 Jul, 2022
Given first term (a), common difference (d) and a integer n of the Arithmetic Progression series, the task is to print the series. Examples :
Input : a = 5, d = 2, n = 10
Output : 5 7 9 11 13 15 17 19 21 23
Approach :
We know the Arithmetic Progression series is like = 2, 5, 8, 11, 14 .... ... In thi... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Jul, 2022"
},
{
"code": null,
"e": 196,
"s": 52,
"text": "Given first term (a), common difference (d) and a integer n of the Arithmetic Progression series, the task is to print the series. Examples : "
},
{
"code": null,
... |
Perl push Function | This function pushes the values in LIST onto the end of the list ARRAY. Used with pop to implement stacks.
Following is the simple syntax for this function β
push ARRAY, LIST
This function returns number of elements in new array.
Following is the example code showing its basic usage β
#!/usr/bin/perl -w
$, = ",";
@ar... | [
{
"code": null,
"e": 2461,
"s": 2354,
"text": "This function pushes the values in LIST onto the end of the list ARRAY. Used with pop to implement stacks."
},
{
"code": null,
"e": 2512,
"s": 2461,
"text": "Following is the simple syntax for this function β"
},
{
"code": nu... |
Java Program that Shows Use of Collection Interface | 14 Sep, 2021
The Collection framework is a unified architecture for representing and manipulating collections, enabling collections to be manipulated independently of implementation details.
Uses and advantages of Collection Framework:
This reduces the efforts of programmers by providing data structures and algorithms,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 206,
"s": 28,
"text": "The Collection framework is a unified architecture for representing and manipulating collections, enabling collections to be manipulated independently of implementation detail... |
SimpleDateFormat toPattern() Method in Java with Examples | 05 Feb, 2021
The toPattern() Method of SimpleDateFormat class is used to return the pattern of the date format.
Syntax:
public String toPattern()
Parameters: The method does not take any parameters.
Return Value: The method returns the pattern string describing this Date format.
Below programs illustrate the working ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Feb, 2021"
},
{
"code": null,
"e": 127,
"s": 28,
"text": "The toPattern() Method of SimpleDateFormat class is used to return the pattern of the date format."
},
{
"code": null,
"e": 137,
"s": 127,
"text": "Syntax:... |
Find the missing number in Geometric Progression - GeeksforGeeks | 19 Apr, 2021
Given an array that represents elements of geometric progression in order. One element is missing in the progression, find the missing number. It may be assumed that one term is always missing and the missing term is not first or last of series.Examples:
Input : arr[] = {1, 3 , 27, 81}
Output : 9
Input ... | [
{
"code": null,
"e": 26067,
"s": 26039,
"text": "\n19 Apr, 2021"
},
{
"code": null,
"e": 26324,
"s": 26067,
"text": "Given an array that represents elements of geometric progression in order. One element is missing in the progression, find the missing number. It may be assumed th... |
Bidirectional Search - GeeksforGeeks | CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data ScienceExplore MoreSelf-PacedDSA- Self PacedCIPJAVA / Python / C+... | [
{
"code": null,
"e": 419,
"s": 0,
"text": "CoursesFor Working ProfessionalsLIVEDSA Live ClassesSystem DesignJava Backend DevelopmentFull Stack LIVEExplore MoreSelf-PacedDSA- Self PacedSDE TheoryMust-Do Coding QuestionsExplore MoreFor StudentsLIVECompetitive ProgrammingData Structures with C++Data Sc... |
Replacing Element in Java Vector - GeeksforGeeks | 11 Dec, 2020
To replace an element in Java Vector, set() method of java.util.Vector class can be used. The set() method takes two parameters-the indexes of the element which has to be replaced and the new element. The index of a Vector is zero-based. So, to replace the first element, 0 should be the index passed as par... | [
{
"code": null,
"e": 25535,
"s": 25507,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 25850,
"s": 25535,
"text": "To replace an element in Java Vector, set() method of java.util.Vector class can be used. The set() method takes two parameters-the indexes of the element which ha... |
Microsoft Azure - CPU and Memory Utilization of Azure VMs in a Single Table Chart - GeeksforGeeks | 16 Dec, 2021
In this article, you will see that how you can analyze your azure virtual machineβs performance of both CPU Utilization and Memory Utilization at once using azure log queries. These KQL queries will help you to understand all the Azure VMs Performance in the form of a table chart and this will also allow y... | [
{
"code": null,
"e": 26939,
"s": 26911,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 27286,
"s": 26939,
"text": "In this article, you will see that how you can analyze your azure virtual machineβs performance of both CPU Utilization and Memory Utilization at once using azure ... |
A Problem in Many Binary Search Implementations - GeeksforGeeks | 15 Dec, 2016
Consider the following C implementation of Binary Search function, is there anything wrong in this?
// A iterative binary search function. It returns location of x in// given array arr[l..r] if present, otherwise -1int binarySearch(int arr[], int l, int r, int x){ while (l <= r) { // find inde... | [
{
"code": null,
"e": 25999,
"s": 25971,
"text": "\n15 Dec, 2016"
},
{
"code": null,
"e": 26099,
"s": 25999,
"text": "Consider the following C implementation of Binary Search function, is there anything wrong in this?"
},
{
"code": "// A iterative binary search function. I... |
ByteBuffer getChar() method in Java with Examples - GeeksforGeeks | 22 Jul, 2019
The getChar() method of java.nio.ByteBuffer class is used to get method for reading a char value
Reads the next two bytes at this bufferβs current position, composing them into a char value according to the current byte order, and then increments the position by two.
Syntax:
public abstract char getChar()
... | [
{
"code": null,
"e": 25893,
"s": 25865,
"text": "\n22 Jul, 2019"
},
{
"code": null,
"e": 25990,
"s": 25893,
"text": "The getChar() method of java.nio.ByteBuffer class is used to get method for reading a char value"
},
{
"code": null,
"e": 26161,
"s": 25990,
"t... |
Count number of triplets with product equal to given number with duplicates allowed | Set-2 - GeeksforGeeks | 12 Nov, 2021
Given an array of positive integers(may contain duplicates) and a number βmβ, find the number of unordered triplets ((Ai, Aj, Ak) and (Aj, Ai, Ak) and other permutations are counted as one only) with product equal to βmβ.
Examples:
Input: arr[] = { 1, 4, 6, 2, 3, 8}, M = 24 Output: 3 The triplets are {1,... | [
{
"code": null,
"e": 26943,
"s": 26915,
"text": "\n12 Nov, 2021"
},
{
"code": null,
"e": 27166,
"s": 26943,
"text": "Given an array of positive integers(may contain duplicates) and a number βmβ, find the number of unordered triplets ((Ai, Aj, Ak) and (Aj, Ai, Ak) and other permut... |
How to plot all the columns of a dataframe in R ? - GeeksforGeeks | 10 Sep, 2021
In this article, we will learn how to plot all columns of the DataFrame in R programming language.
Dataset in use:
x y1 y2 y3
1 1 0.08475635 0.4543649 0
2 2 0.22646034 0.6492529 1
3 3 0.43255650 0.1537271 0
4 4 0.55806524 0.6492887 3
5 5 0.05975527 0.3832137 1
6 6 0.0847563... | [
{
"code": null,
"e": 26357,
"s": 26329,
"text": "\n10 Sep, 2021"
},
{
"code": null,
"e": 26456,
"s": 26357,
"text": "In this article, we will learn how to plot all columns of the DataFrame in R programming language."
},
{
"code": null,
"e": 26472,
"s": 26456,
... |
Find the numbers from 1 to N that contains exactly k non-zero digits - GeeksforGeeks | 24 Nov, 2021
Prerequisites: Dynamic Programming, DigitDPGiven two integers N and K. The task is to find the number of integers between 1 and N (inclusive) that contains exactly K non-zero digits when written in base ten.
Examples:
Input: N = 100, K = 1 Output: 19 Explanation: The digits with exactly 1 non zero digits... | [
{
"code": null,
"e": 26669,
"s": 26641,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 26877,
"s": 26669,
"text": "Prerequisites: Dynamic Programming, DigitDPGiven two integers N and K. The task is to find the number of integers between 1 and N (inclusive) that contains exactly... |
Command Pattern - GeeksforGeeks | 01 Sep, 2021
Like previous articles, let us take up a design problem to understand command pattern. Suppose you are building a home automation system. There is a programmable remote which can be used to turn on and off various items in your home like lights, stereo, AC etc. It looks something like this.
You can do it... | [
{
"code": null,
"e": 25803,
"s": 25775,
"text": "\n01 Sep, 2021"
},
{
"code": null,
"e": 26095,
"s": 25803,
"text": "Like previous articles, let us take up a design problem to understand command pattern. Suppose you are building a home automation system. There is a programmable r... |
How to use Python Pexpect to Automate Linux Commands? - GeeksforGeeks | 13 Dec, 2021
Pexpect is a Python library for spawning child processes and controlling them automatically. Pexpect can be used to automate interactive applications such as SSH, FTP, password, telnet, etc. Pexpect works by spawning child processes and responding to expected patterns.
Pexpect can be installed by using the... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n13 Dec, 2021"
},
{
"code": null,
"e": 25807,
"s": 25537,
"text": "Pexpect is a Python library for spawning child processes and controlling them automatically. Pexpect can be used to automate interactive applications such as SSH, ... |
Draw Diamond shape using Turtle graphics in Python - GeeksforGeeks | 11 Jun, 2021
In this article, we are going to learn how to draw the shape of a Diamond using turtle graphics in Python.
Turtle graphics:
forward(length): moves the pen in the forward direction by x unit.
right(angle): rotate the pen in the clockwise direction by an angle x.
left(angle): rotate the pen in the anticlockw... | [
{
"code": null,
"e": 25561,
"s": 25533,
"text": "\n11 Jun, 2021"
},
{
"code": null,
"e": 25668,
"s": 25561,
"text": "In this article, we are going to learn how to draw the shape of a Diamond using turtle graphics in Python."
},
{
"code": null,
"e": 25685,
"s": 256... |
Lodash _.isString() Method - GeeksforGeeks | 05 Sep, 2020
The _.isString() method is used to find whether the given value is a string object or not. It returns True if the given value is a string. Otherwise, it returns false.
Syntax:
_.isString(value)
Parameters: This method accepts a single parameter as mentioned above and described below:
value: This paramet... | [
{
"code": null,
"e": 26307,
"s": 26279,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 26477,
"s": 26307,
"text": "The _.isString() method is used to find whether the given value is a string object or not. It returns True if the given value is a string. Otherwise, it returns fa... |
HTML Entities - GeeksforGeeks | 14 Dec, 2021
In this article, we will know HTML Entities, along with understanding their implementation through the examples. HTML provides some method to display reserved characters. Reserved characters are those characters that are either reserved for HTML or those which are not present in the basic keyboard. For ins... | [
{
"code": null,
"e": 31646,
"s": 31618,
"text": "\n14 Dec, 2021"
},
{
"code": null,
"e": 32330,
"s": 31646,
"text": "In this article, we will know HTML Entities, along with understanding their implementation through the examples. HTML provides some method to display reserved char... |
How to get the length of a string in bytes in JavaScript ? - GeeksforGeeks | 01 Apr, 2021
Task: To find the size of the given string in bytes.
Example:
Input: "GeeksForGeeks"
Output: 13 bytes
Input: 20β¬
Output: 5 bytes
Input: "????"
Output: 4 bytes
To achieve this we have two ways the first one is using the Blob API and the second is Buffer API, the first one works with the browser, and the s... | [
{
"code": null,
"e": 26805,
"s": 26777,
"text": "\n01 Apr, 2021"
},
{
"code": null,
"e": 26858,
"s": 26805,
"text": "Task: To find the size of the given string in bytes."
},
{
"code": null,
"e": 26867,
"s": 26858,
"text": "Example:"
},
{
"code": null,
... |
Array Index with same count of even or odd numbers on both sides - GeeksforGeeks | 12 May, 2022
Given an array of N integers. We need to find an index such that Frequency of Even numbers on its left side is equal to the frequency of even numbers on its right sides Or frequency of odd numbers on its left side is equal to the frequency of Odd numbers on its right sides. If No such index exist in an arr... | [
{
"code": null,
"e": 26065,
"s": 26037,
"text": "\n12 May, 2022"
},
{
"code": null,
"e": 26482,
"s": 26065,
"text": "Given an array of N integers. We need to find an index such that Frequency of Even numbers on its left side is equal to the frequency of even numbers on its right ... |
Python | Convert tuple to float value - GeeksforGeeks | 11 Nov, 2019
Sometimes, while working with tuple, we can have a problem in which, we need to convert a tuple to floating-point number in which first element represents integer part and next element represents a decimal part. Letβs discuss certain way in which this can be achieved.
Method : Using join() + float() + str(... | [
{
"code": null,
"e": 25841,
"s": 25813,
"text": "\n11 Nov, 2019"
},
{
"code": null,
"e": 26110,
"s": 25841,
"text": "Sometimes, while working with tuple, we can have a problem in which, we need to convert a tuple to floating-point number in which first element represents integer ... |
How to rotate a text canvas using Fabric.js ? - GeeksforGeeks | 04 Sep, 2021
In this article, we are going to see how to rotate a text canvas using FabricJS. The canvas means text written is movable and can be stretched according to requirement. Further, the text itself cannot be edited like a textbox.Approach: To make it possible, we are going to use a JavaScript library called Fa... | [
{
"code": null,
"e": 26217,
"s": 26189,
"text": "\n04 Sep, 2021"
},
{
"code": null,
"e": 26861,
"s": 26217,
"text": "In this article, we are going to see how to rotate a text canvas using FabricJS. The canvas means text written is movable and can be stretched according to require... |
MySQL update datetime column values and add 10 years 3 months 22 days and 10 hours, 30 minutes to existing data? | For this, you can use INTERVAL in MySQL. Let us first create a table β
mysql> create table DemoTable1509
-> (
-> ArrivalTime datetime
-> );
Query OK, 0 rows affected (0.51 sec)
Insert some records in the table using insert command β
mysql> insert into DemoTable1509 values('2018-01-21 10:20:30');
Query OK, 1 ro... | [
{
"code": null,
"e": 1133,
"s": 1062,
"text": "For this, you can use INTERVAL in MySQL. Let us first create a table β"
},
{
"code": null,
"e": 1248,
"s": 1133,
"text": "mysql> create table DemoTable1509\n -> (\n -> ArrivalTime datetime\n -> );\nQuery OK, 0 rows affected (0.... |
Find duplicate column values in MySQL and display them | For this, use GROUP BY HAVING clause. Let us first create a table β
mysql> create table DemoTable1858
(
ModelNumber varchar(50)
);
Query OK, 0 rows affected (0.00 sec)
Insert some records in the table using insert command β
mysql> insert into DemoTable1858 values('Audi A4');
Query OK, 1 row affected (0.0... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "For this, use GROUP BY HAVING clause. Let us first create a table β"
},
{
"code": null,
"e": 1245,
"s": 1130,
"text": "mysql> create table DemoTable1858\n (\n ModelNumber varchar(50)\n );\nQuery OK, 0 rows affected (0.00 ... |
PyTorch β How to convert an image to grayscale? | To convert an image to grayscale, we apply Grayscale() transformation. It's one of the transforms provided by the torchvision.transforms module. This module contains many important transformations that can be used to perform different types manipulations on the image data.
Grayscale() transformation accepts both PIL an... | [
{
"code": null,
"e": 1336,
"s": 1062,
"text": "To convert an image to grayscale, we apply Grayscale() transformation. It's one of the transforms provided by the torchvision.transforms module. This module contains many important transformations that can be used to perform different types manipulation... |
Convert MySQL date format from yyyy-mm-ddThh:mm:ss.sssZ to yyyy-mm-dd hh:mm:ss ? | Let us first create a table β
mysql> create table DemoTable668(JoiningDate varchar(200));
Query OK, 0 rows affected (0.97 sec)
Insert some records in the table using insert command. We have inserted date in the format yyyy-mm-ddThh:mm:ss.sssZ β
mysql> insert into DemoTable668 values('2001-01-10T06:20:00.000Z');
Query O... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table β"
},
{
"code": null,
"e": 1189,
"s": 1092,
"text": "mysql> create table DemoTable668(JoiningDate varchar(200));\nQuery OK, 0 rows affected (0.97 sec)"
},
{
"code": null,
"e": 1307,
"s": 11... |
Data Structures | Misc | Question 6 - GeeksforGeeks | 28 Jun, 2021
The most appropriate matching for the following pairs
X: depth first search 1: heap
Y: breadth-first search 2: queue
Z: sorting 3: stack
is (GATE CS 2000):
(A) Xβ1 Yβ2 Z-3(B) Xβ3 Yβ1 Z-2(C) Xβ3 Yβ2 Z-1(D) Xβ2 Yβ3 Z-1Answer: (C)Explanation: Stack is used for Depth f... | [
{
"code": null,
"e": 25020,
"s": 24992,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25074,
"s": 25020,
"text": "The most appropriate matching for the following pairs"
},
{
"code": null,
"e": 25199,
"s": 25074,
"text": "X: depth first search 1: ... |
5 Methods to Check for NaN values in in Python | by Abhijith Chandradas | Towards Data Science | NaN stands for Not A Number and is one of the common ways to represent the missing value in the data. It is a special floating-point value and cannot be converted to any other type than float.
NaN value is one of the major problems in Data Analysis. It is very essential to deal with NaN in order to get the desired resu... | [
{
"code": null,
"e": 365,
"s": 172,
"text": "NaN stands for Not A Number and is one of the common ways to represent the missing value in the data. It is a special floating-point value and cannot be converted to any other type than float."
},
{
"code": null,
"e": 497,
"s": 365,
"t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.