title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Python – pass multiple arguments to map function | 23 Jun, 2020
The map() function is a built-in function in Python, which applies a given function to each item of iterable (like list, tuple etc) and returns a list of results or map object.
Syntax :
map(funct, iterbl)
Parameters :
funct : The function which is going to execute for each iterableiterbl : A sequence or c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jun, 2020"
},
{
"code": null,
"e": 206,
"s": 28,
"text": "The map() function is a built-in function in Python, which applies a given function to each item of iterable (like list, tuple etc) and returns a list of results or map object... |
numpy.take() in Python | 09 Mar, 2022
The numpy.take() function returns elements from array along the mentioned axis and indices.
Syntax: numpy.take(array, indices, axis = None, out = None, mode ='raise')
Parameters :
array : array_like, input array
indices : index of the values to be fetched
axis : [int, optional] axis over which we ne... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Mar, 2022"
},
{
"code": null,
"e": 121,
"s": 28,
"text": "The numpy.take() function returns elements from array along the mentioned axis and indices. "
},
{
"code": null,
"e": 196,
"s": 121,
"text": "Syntax: numpy... |
Perl | chomp() Function | 07 May, 2019
The chomp() function in Perl is used to remove the last trailing newline from the input string.
Syntax: chomp(String)
Parameters:String : Input String whose trailing newline is to be removed
Returns: the total number of trailing newlines removed from all its arguments
Example 1:
#!/usr/bin/perl # Initiali... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 May, 2019"
},
{
"code": null,
"e": 124,
"s": 28,
"text": "The chomp() function in Perl is used to remove the last trailing newline from the input string."
},
{
"code": null,
"e": 146,
"s": 124,
"text": "Syntax: ch... |
React Native Flexbox flexDirection Property | 25 May, 2021
In this article, We are going to see the Flexbox flexDirection Property in React Native. Flexbox has three main properties. One of them is flexDirection. The flexDirection property is used to determine the alignment of its elements in the horizontal or vertical directions. It established the main axis of t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 May, 2021"
},
{
"code": null,
"e": 347,
"s": 28,
"text": "In this article, We are going to see the Flexbox flexDirection Property in React Native. Flexbox has three main properties. One of them is flexDirection. The flexDirection pro... |
Templates in C++ vs Generics in Java | 12 Oct, 2021
While building large-scale projects, we need the code to be compatible with any kind of data which is provided to it. That is the place where your written code stands above that of others. Here what we meant is to make the code you write be generic to any kind of data provided to the program regardless of ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 534,
"s": 54,
"text": "While building large-scale projects, we need the code to be compatible with any kind of data which is provided to it. That is the place where your written code stands above t... |
Scientific GUI Calculator using Tkinter in Python | 23 Feb, 2022
Prerequisite: Python GUI – tkinter
In this article, we are going to create GUI Scientific Calculator using Python. As you can see, calculating large numbers nowadays is difficult or time-consuming. We’ve created a simple Scientific Calculator GUI using Python that allows you to perform simple and complex c... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Feb, 2022"
},
{
"code": null,
"e": 87,
"s": 52,
"text": "Prerequisite: Python GUI – tkinter"
},
{
"code": null,
"e": 431,
"s": 87,
"text": "In this article, we are going to create GUI Scientific Calculator using ... |
How to send an email using PHPMailer ? | 23 Aug, 2019
PHPMailer is a code library and used to send emails safely and easily via PHP code from a web server. Sending emails directly via PHP code requires a high-level familiarity to SMTP standard protocol and related issues and vulnerabilities about Email injection for spamming. PHPMailer simplifies the process ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 Aug, 2019"
},
{
"code": null,
"e": 406,
"s": 53,
"text": "PHPMailer is a code library and used to send emails safely and easily via PHP code from a web server. Sending emails directly via PHP code requires a high-level familiarity t... |
How to share code between Node.js and the browser? | 06 Sep, 2021
In this article, we will explore how to write JavaScript modules that can be used by both the client-side and the server-side applications.We have a small web application with a JavaScript client (running in the browser) and a Node.js server communicating with it. And we have a function getFrequency() whic... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 1385,
"s": 28,
"text": "In this article, we will explore how to write JavaScript modules that can be used by both the client-side and the server-side applications.We have a small web application wit... |
Check if a large number is divisible by 4 or not | 04 Jul, 2022
Given a number, the task is to check if a number is divisible by 4 or not. The input number may be large and it may not be possible to store even if we use long long int.
Examples:
Input : n = 1124
Output : Yes
Input : n = 1234567589333862
Output : No
Input : n = 363588395960667043875487
Output : No
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 223,
"s": 52,
"text": "Given a number, the task is to check if a number is divisible by 4 or not. The input number may be large and it may not be possible to store even if we use long long int."
... |
List frequency of elements in Python | In this article, we are going to learn how to find the frequency of elements in a list. We can solve the problem in different ways. Let's see two of them.
Follow the below steps to write the code.
Initialize the list with elements and an empty dictionary.
Iterate over the list of elements.Check whether the element is p... | [
{
"code": null,
"e": 1217,
"s": 1062,
"text": "In this article, we are going to learn how to find the frequency of elements in a list. We can solve the problem in different ways. Let's see two of them."
},
{
"code": null,
"e": 1259,
"s": 1217,
"text": "Follow the below steps to w... |
C++ Program to Check for balanced paranthesis by using Stacks | Here we will discuss how to check the balanced brackets using stacks. We not only check the opening and closing brackets but also check the ordering of brackets. For an example we can say that the expression "[{} () {()}]" it is correct, but "{[}]" it is not correct.
Input: Some expression with brackets "{()}[]"
Output... | [
{
"code": null,
"e": 1330,
"s": 1062,
"text": "Here we will discuss how to check the balanced brackets using stacks. We not only check the opening and closing brackets but also check the ordering of brackets. For an example we can say that the expression \"[{} () {()}]\" it is correct, but \"{[}]\" ... |
Value Investing Dashboard with Python Beautiful Soup and Dash Python | by Vincent Tatan | Towards Data Science | “So I usually searched the stocks on the trading website like SGX or Yahoo Finance, and copy pasted the relevant dataset one by one into my Excelsheet”
“There should be a quick access to the most relevant stocks information for me to make buy/sell decisions”
I still remembered on how my friend boasted on his hard earne... | [
{
"code": null,
"e": 324,
"s": 172,
"text": "“So I usually searched the stocks on the trading website like SGX or Yahoo Finance, and copy pasted the relevant dataset one by one into my Excelsheet”"
},
{
"code": null,
"e": 431,
"s": 324,
"text": "“There should be a quick access to... |
The Lift Curve: Unveiled. Another [AWESOME] way to evaluate... | by z_ai | Towards Data Science | The goal of this post is to explain what the Lift curve is, how it can complement other classification evaluation techniques like the ROC curve, and how it can be used to compare different models.
If you don’t know what the ROC Curve is, you can find a great post explaining all about it here. It is not necessary to kno... | [
{
"code": null,
"e": 368,
"s": 171,
"text": "The goal of this post is to explain what the Lift curve is, how it can complement other classification evaluation techniques like the ROC curve, and how it can be used to compare different models."
},
{
"code": null,
"e": 620,
"s": 368,
... |
Human Bias in Machine Learning. A brief exploration on the impacts that... | by Mark Xiang | Towards Data Science | Bias is an inescapable part of human nature. Previous research suggests that cognitive biases form to optimize brain function when humans are distracted. Biases are influenced by your environment, experiences, and can be difficult to eliminate. One such solution to minimize the effects of biases is to be aware of possi... | [
{
"code": null,
"e": 535,
"s": 172,
"text": "Bias is an inescapable part of human nature. Previous research suggests that cognitive biases form to optimize brain function when humans are distracted. Biases are influenced by your environment, experiences, and can be difficult to eliminate. One such s... |
Get Application Version using Python | In software industries, whenever developers add a new feature, fix bugs in a particular application, they name the application to a new version, as it helps to recognize the recently updated features in that application.
Using Python, we can get the version of any application. We will use pywin32 to interact with the e... | [
{
"code": null,
"e": 1283,
"s": 1062,
"text": "In software industries, whenever developers add a new feature, fix bugs in a particular application, they name the application to a new version, as it helps to recognize the recently updated features in that application."
},
{
"code": null,
... |
Teradata - Joins | Join is used to combine records from more than one table. Tables are joined based on the common columns/values from these tables.
There are different types of Joins available.
Inner Join
Left Outer Join
Right Outer Join
Full Outer Join
Self Join
Cross Join
Cartesian Production Join
Inner Join combines records from mult... | [
{
"code": null,
"e": 2760,
"s": 2630,
"text": "Join is used to combine records from more than one table. Tables are joined based on the common columns/values from these tables."
},
{
"code": null,
"e": 2806,
"s": 2760,
"text": "There are different types of Joins available."
},
... |
Apache Pig - Explain Operator | The explain operator is used to display the logical, physical, and MapReduce execution plans of a relation.
Given below is the syntax of the explain operator.
grunt> explain Relation_name;
Assume we have a file student_data.txt in HDFS with the following content.
001,Rajiv,Reddy,9848022337,Hyderabad
002,siddarth,Batta... | [
{
"code": null,
"e": 2792,
"s": 2684,
"text": "The explain operator is used to display the logical, physical, and MapReduce execution plans of a relation."
},
{
"code": null,
"e": 2843,
"s": 2792,
"text": "Given below is the syntax of the explain operator."
},
{
"code": n... |
Git Getting Started | You can download Git for free from the following website: https://www.git-scm.com/
To start using Git, we are first going to open up our Command shell.
For Windows, you can use Git bash, which comes included in Git for Windows.
For Mac and Linux you can use the built-in terminal.
The first thing we need to do, is to c... | [
{
"code": null,
"e": 83,
"s": 0,
"text": "You can download Git for free from the following website: https://www.git-scm.com/"
},
{
"code": null,
"e": 152,
"s": 83,
"text": "To start using Git, we are first going to open up our Command shell."
},
{
"code": null,
"e": 2... |
Logstash - Plugins | Logstash offers various plugins for all three stages of its pipeline (Input, Filter and Output). These plugins help the user to capture logs from various sources like Web Servers, Databases, Over Network Protocols, etc.
After capturing, Logstash can parse and transform the data into meaningful information as required b... | [
{
"code": null,
"e": 2275,
"s": 2055,
"text": "Logstash offers various plugins for all three stages of its pipeline (Input, Filter and Output). These plugins help the user to capture logs from various sources like Web Servers, Databases, Over Network Protocols, etc."
},
{
"code": null,
"... |
C++ Program For Removing All Occurrences Of Duplicates From A Sorted Linked List - GeeksforGeeks | 10 Jan, 2022
Given a sorted linked list, delete all nodes that have duplicate numbers (all occurrences), leaving only numbers that appear once in the original list. Examples:
Input: 23->28->28->35->49->49->53->53
Output: 23->35
Input: 11->11->11->11->75->75
Output: empty List
Note that this is different from Remove Du... | [
{
"code": null,
"e": 24606,
"s": 24578,
"text": "\n10 Jan, 2022"
},
{
"code": null,
"e": 24768,
"s": 24606,
"text": "Given a sorted linked list, delete all nodes that have duplicate numbers (all occurrences), leaving only numbers that appear once in the original list. Examples:"
... |
How to check existence of an element in android listview? | This example demonstrate about How to check existence of an element in android listview.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res... | [
{
"code": null,
"e": 1151,
"s": 1062,
"text": "This example demonstrate about How to check existence of an element in android listview."
},
{
"code": null,
"e": 1280,
"s": 1151,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all requir... |
The Elevator Optimization Problem. | by Brendan Ferris | Towards Data Science | Recently, I completed a small project that required me to make suggestions for optimizing an elevator configuration within a theoretical high-rise in New York City. The building is set up as follows. Entrants to the building must first swipe badges through a security system, then they can push the elevator call button ... | [
{
"code": null,
"e": 650,
"s": 172,
"text": "Recently, I completed a small project that required me to make suggestions for optimizing an elevator configuration within a theoretical high-rise in New York City. The building is set up as follows. Entrants to the building must first swipe badges throug... |
What are stack and unstack functions in the Python Pandas library. | Stack and unstack functions are used to reshape a DateFrame in the pandas library to extract more information in different ways.
Pandas stack is used for stacking the levels from column to index. It returns a new DataFrame or Series with a multi-level index. The stack method has 2 parameters which are level and dropna.... | [
{
"code": null,
"e": 1191,
"s": 1062,
"text": "Stack and unstack functions are used to reshape a DateFrame in the pandas library to extract more information in different ways."
},
{
"code": null,
"e": 1383,
"s": 1191,
"text": "Pandas stack is used for stacking the levels from col... |
python | Numpy masked_equal() method - GeeksforGeeks | 19 Sep, 2019
With the help of numpy.ma.masked_equal() method, we can get the mask a value that in an array by using numpy.ma.masked_equal() method.
Syntax : numpy.ma.masked_equal(array, value)
Return : Return the array after removing mask value.
Example #1 :
In this example we can see that by using numpy.ma.masked_equa... | [
{
"code": null,
"e": 25749,
"s": 25721,
"text": "\n19 Sep, 2019"
},
{
"code": null,
"e": 25884,
"s": 25749,
"text": "With the help of numpy.ma.masked_equal() method, we can get the mask a value that in an array by using numpy.ma.masked_equal() method."
},
{
"code": null,
... |
Golang Program to Find Largest Element in an Array - GeeksforGeeks | 10 May, 2020
The task is to find the largest element of an array in Golang by taking input values from the user.
Example:
Input: Enter the number of elements: 4
Enter the number : 40Enter the number : 69Enter the number : 89Enter the number : -54
Output: The largest number is : 89
In this program, the user needs to ent... | [
{
"code": null,
"e": 25703,
"s": 25675,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 25803,
"s": 25703,
"text": "The task is to find the largest element of an array in Golang by taking input values from the user."
},
{
"code": null,
"e": 25812,
"s": 25803,
... |
Java.util.Random.nextInt() in Java - GeeksforGeeks | 06 Nov, 2019
Generating random numbers themselves have a good utility value and having them achieved by the usage of function can prove to be very useful. Java in its language has dedicated an entire library to Random numbers seeing its importance in day-day programming. nextInt() is discussed in this article.
java.uti... | [
{
"code": null,
"e": 26206,
"s": 26178,
"text": "\n06 Nov, 2019"
},
{
"code": null,
"e": 26505,
"s": 26206,
"text": "Generating random numbers themselves have a good utility value and having them achieved by the usage of function can prove to be very useful. Java in its language ... |
3D Heatmap in Python - GeeksforGeeks | 28 Jul, 2021
Heatmaps are a great way to visualize a dataset, methods for visualizing the data are getting explored constantly and 3D heatmap is one of the ways to plot data. Let’s learn how we can plot 3D data in python. We are going to use matplotlib and mplot3d to plot the 3D Heatmap in Python. We need to install t... | [
{
"code": null,
"e": 26213,
"s": 26182,
"text": " \n28 Jul, 2021\n"
},
{
"code": null,
"e": 26593,
"s": 26213,
"text": "Heatmaps are a great way to visualize a dataset, methods for visualizing the data are getting explored constantly and 3D heatmap is one of the ways to plot data... |
Database Roles in CQL (Cassandra Query Language) - GeeksforGeeks | 17 May, 2021
In this article we will discuss Database Roles in Cassandra Query Language. It is very important to create different role for different type of users to provide access with a specific requirements. It is used to provide security for Database users or group of users.
A Role name can be simply defined as fo... | [
{
"code": null,
"e": 25549,
"s": 25521,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 25817,
"s": 25549,
"text": "In this article we will discuss Database Roles in Cassandra Query Language. It is very important to create different role for different type of users to provide ac... |
Ruby | Exception handling - GeeksforGeeks | 12 Oct, 2018
In Ruby, exception handling is a process which describes a way to handle the error raised in a program. Here, error means an unwanted or unexpected event, which occurs during the execution of a program, i.e. at run time, that disrupts the normal flow of the program’s instructions. So these types of errors ... | [
{
"code": null,
"e": 24931,
"s": 24903,
"text": "\n12 Oct, 2018"
},
{
"code": null,
"e": 25551,
"s": 24931,
"text": "In Ruby, exception handling is a process which describes a way to handle the error raised in a program. Here, error means an unwanted or unexpected event, which oc... |
Remove first and last character of a string in Java - GeeksforGeeks | 01 Aug, 2020
Given string str, the task is to write Java Program to remove the first and the last character of the string and print the modified string.
Examples:
Input: str = “GeeksForGeeks”Output: eeksForGeekExplanation:The first character of the given string is ‘G’ and the last character of the given string is ‘s’. ... | [
{
"code": null,
"e": 25839,
"s": 25811,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 25979,
"s": 25839,
"text": "Given string str, the task is to write Java Program to remove the first and the last character of the string and print the modified string."
},
{
"code": n... |
Kotlin Elvis Operator(?:) - GeeksforGeeks | 29 Nov, 2019
Elvis Operator (?:)It is used to return the not null value even the conditional expression is null. It is also used to check the null safety of values.
In some cases, we can declare a variable which can hold a null reference. If a variable st which contains null reference, before using st in program we wil... | [
{
"code": null,
"e": 25763,
"s": 25735,
"text": "\n29 Nov, 2019"
},
{
"code": null,
"e": 25915,
"s": 25763,
"text": "Elvis Operator (?:)It is used to return the not null value even the conditional expression is null. It is also used to check the null safety of values."
},
{
... |
Generics in C++ - GeeksforGeeks | 01 Apr, 2019
Generics is the idea to allow type (Integer, String, ... etc and user-defined types) to be a parameter to methods, classes and interfaces. For example, classes like an array, map, etc, which can be used using generics very efficiently. We can use them for any type.
The method of Generic Programming is impl... | [
{
"code": null,
"e": 25367,
"s": 25339,
"text": "\n01 Apr, 2019"
},
{
"code": null,
"e": 25633,
"s": 25367,
"text": "Generics is the idea to allow type (Integer, String, ... etc and user-defined types) to be a parameter to methods, classes and interfaces. For example, classes lik... |
Registers of 8085 Microprocessor | It has eight addressable 8-bit registers: A, B, C, D, E, H, L, F, and two 16-bit registers PC and SP. These registers can be classified as −
General Purpose Registers
General Purpose Registers
Temporary Registers: a) Temporary data register b) W and Z registers
Temporary Registers: a) Temporary data register b) W and Z... | [
{
"code": null,
"e": 1328,
"s": 1187,
"text": "It has eight addressable 8-bit registers: A, B, C, D, E, H, L, F, and two 16-bit registers PC and SP. These registers can be classified as −"
},
{
"code": null,
"e": 1354,
"s": 1328,
"text": "General Purpose Registers"
},
{
"... |
Python Tkinter | grid_location() and grid_size() method | 21 Jun, 2022
Tkinter is used to develop GUI (Graphical User Interface) applications. It supports a variety of widgets as well as a variety of widgets methods or universal widget methods.
This method returns a tuple containing (column, row) of any specified widget. Since this method is a widget method you cannot use it... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 203,
"s": 28,
"text": "Tkinter is used to develop GUI (Graphical User Interface) applications. It supports a variety of widgets as well as a variety of widgets methods or universal widget methods. "... |
Inter Process Communication (IPC) | 01 Apr, 2021
A process can be of two types:
Independent process.
Co-operating process.
An independent process is not affected by the execution of other processes while a co-operating process can be affected by other executing processes. Though one can think that those processes, which are running independently, will ex... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Apr, 2021"
},
{
"code": null,
"e": 85,
"s": 54,
"text": "A process can be of two types:"
},
{
"code": null,
"e": 106,
"s": 85,
"text": "Independent process."
},
{
"code": null,
"e": 128,
"s": 106,... |
scipy.ifft() in Python | 29 Aug, 2020
With the help of scipy.ifft() method, we can compute the inverse fast fourier transformation by passing simple 1-D numpy array and it will return the transformed array by using this method.
Inverse Fast Fourier Transformation
Syntax : scipy.ifft(y)
Return : Return the transformed array.
Example #1 :
In thi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 218,
"s": 28,
"text": "With the help of scipy.ifft() method, we can compute the inverse fast fourier transformation by passing simple 1-D numpy array and it will return the transformed array by usin... |
How to Load Any Image From URL Without Using Any Dependency in Android? | 05 Aug, 2021
Many applications display images from the internet using third-party APIs like Glide and Picasso to load images. This means that such applications partly depend on these services to keep themselves working fine. To make the application better, one should write their own code rather than depending on such s... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 465,
"s": 28,
"text": "Many applications display images from the internet using third-party APIs like Glide and Picasso to load images. This means that such applications partly depend on these servi... |
unordered_map rehash in C++ STL | 18 May, 2022
The std::unordered_map::rehash() is a built in function C++ STL which sets the number of buckets in container to n or more. Syntax
void rehash( size_type s );
If s is greater than the current buckets into the container then rehashed is done. The new bucket count can be greater than or equal to n.
If s is ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 May, 2022"
},
{
"code": null,
"e": 160,
"s": 28,
"text": "The std::unordered_map::rehash() is a built in function C++ STL which sets the number of buckets in container to n or more. Syntax "
},
{
"code": null,
"e": 188,
... |
Wait System Call in C | 08 Mar, 2021
Prerequisite : Fork System callA call to wait() blocks the calling process until one of its child processes exits or a signal is received. After child process terminates, parent continues its execution after wait system call instruction. Child process may terminate due to any of these:
It calls exit();
It... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Mar, 2021"
},
{
"code": null,
"e": 342,
"s": 54,
"text": "Prerequisite : Fork System callA call to wait() blocks the calling process until one of its child processes exits or a signal is received. After child process terminates, par... |
C library function - scanf() | The C library function int scanf(const char *format, ...) reads formatted input from stdin.
Following is the declaration for scanf() function.
int scanf(const char *format, ...)
format − This is the C string that contains one or more of the following items −
Whitespace character, Non-whitespace character and Format spe... | [
{
"code": null,
"e": 2233,
"s": 2141,
"text": "The C library function int scanf(const char *format, ...) reads formatted input from stdin."
},
{
"code": null,
"e": 2284,
"s": 2233,
"text": "Following is the declaration for scanf() function."
},
{
"code": null,
"e": 23... |
HTML Comments | 21 Jun, 2022
The comment tag ( ) is used to insert comments in the HTML code. It is a good practice of coding, so that coder and the reader can get help to understand the code. It is useful to understand steps of the complex code. The comment tag is helpful while the debugging of codes.
It is a simple piece of code t... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 330,
"s": 53,
"text": "The comment tag ( ) is used to insert comments in the HTML code. It is a good practice of coding, so that coder and the reader can get help to understand the code. It is us... |
Program to find the number of region in Planar Graph | 07 Jun, 2022
Given two integers V and E which represent the number of Vertices and Edges of a Planar Graph. The Task is to find the number of regions of that planar graph.
Planar Graph: A planar graph is one in which no edges cross each other or a graph that can be drawn on a plane without edges crossing is called plan... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jun, 2022"
},
{
"code": null,
"e": 212,
"s": 53,
"text": "Given two integers V and E which represent the number of Vertices and Edges of a Planar Graph. The Task is to find the number of regions of that planar graph."
},
{
"... |
How to Count Number of Rows and Columns in a Table Using jQuery? | 03 Aug, 2021
Given an HTML document containing a table, the task is to count the number of rows and columns in that table using JQuery.
Approach: The length property is used to count the number of rows and columns in an HTML table using jQuery. The selectors used for finding the number of rows and columns in an HTML ta... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 151,
"s": 28,
"text": "Given an HTML document containing a table, the task is to count the number of rows and columns in that table using JQuery."
},
{
"code": null,
"e": 344,
"s": 1... |
Reverse middle words of a string | 13 Apr, 2021
Given a string str, print reverse all words except the first and last words.
Examples:
Input : Hi how are you geeks
Output : Hi woh era uoy geeks
Input : I am fine
Output : I ma fine
Print the first word.For remaining middle words, print reverse of every word after reaching end of it. This will print ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Apr, 2021"
},
{
"code": null,
"e": 131,
"s": 54,
"text": "Given a string str, print reverse all words except the first and last words."
},
{
"code": null,
"e": 142,
"s": 131,
"text": "Examples: "
},
{
"co... |
Number of days in a month in Python | Suppose we have one year Y and a month M, we have to return the number of days of that month for the given year. So if the Y = 1992 and M = 7, then the result will be 31, if the year is 2020, and M = 2, then the result is 29.
To solve this, we will follow these steps −
if m = 2, thenif y is a leap year, return 29, othe... | [
{
"code": null,
"e": 1413,
"s": 1187,
"text": "Suppose we have one year Y and a month M, we have to return the number of days of that month for the given year. So if the Y = 1992 and M = 7, then the result will be 31, if the year is 2020, and M = 2, then the result is 29."
},
{
"code": null,... |
Mark-and-Sweep: Garbage Collection Algorithm | 10 May, 2022
There are many garbage collection algorithms that run in the background, of which one of them is mark and sweep.
All the objects which are created dynamically (using new in C++ and Java) are allocated memory in the heap. If we go on creating objects we might get Out Of Memory error since it is not possible... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 May, 2022"
},
{
"code": null,
"e": 167,
"s": 54,
"text": "There are many garbage collection algorithms that run in the background, of which one of them is mark and sweep."
},
{
"code": null,
"e": 841,
"s": 167,
"... |
SQL | Triggers | 22 Nov, 2021
Trigger is a statement that a system executes automatically when there is any modification to the database. In a trigger, we first specify when the trigger is to be executed and then the action to be performed when the trigger executes. Triggers are used to specify certain integrity constraints and referen... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Nov, 2021"
},
{
"code": null,
"e": 441,
"s": 52,
"text": "Trigger is a statement that a system executes automatically when there is any modification to the database. In a trigger, we first specify when the trigger is to be executed ... |
PostgreSQL – Continue | 20 Sep, 2021
In PostgreSQL ,The continue statement is used to skip the current iteration prematurely and directly move on to the next iteration. The continue statement is used in conjecture with all types of loops including unconditional loops, while loops and for loops.
Syntax:
CONTINUE [ label ] [ WHEN boolean-expres... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Sep, 2021"
},
{
"code": null,
"e": 287,
"s": 28,
"text": "In PostgreSQL ,The continue statement is used to skip the current iteration prematurely and directly move on to the next iteration. The continue statement is used in conjectur... |
Game Theory concepts with application in Python using Nashpy (Part 1) | by Mythili Krishnan | Towards Data Science | Does this image below ring a bell?
“Rock, paper, scissors” — everyone of us might have played this game in our childhood. Have you ever wondered the strategies we chose could in fact be modeled in a game theoretic concept?
You might think that people randomly choose a strategy here, but in reality we are trying to pred... | [
{
"code": null,
"e": 207,
"s": 172,
"text": "Does this image below ring a bell?"
},
{
"code": null,
"e": 395,
"s": 207,
"text": "“Rock, paper, scissors” — everyone of us might have played this game in our childhood. Have you ever wondered the strategies we chose could in fact be ... |
Binary Trees - GeeksforGeeks | 06 Sep, 2021
12
/
20
/
30
12
/ \
20 30
/
30
12
/ \
20 30
/ \
20 40
12
/ \
20 30
/ \
10 40
o
/ | \
o o o
/ | \ / | \
o o o o o o
/ | \
... | [
{
"code": null,
"e": 35744,
"s": 35716,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 35770,
"s": 35744,
"text": " 12\n / \n 20\n /\n30"
},
{
"code": null,
"e": 35804,
"s": 35770,
"text": " 12\n / \\\n 20 30\n /\n30"
},
{
"code":... |
Tree Traversal in C | Traversal is a process to visit all the nodes of a tree and may print their values too. Because, all nodes are connected via edges (links) we always start from the root (head) node. That is, we cannot random access a node in a tree. There are three ways which we use to traverse a tree −
In-order Traversal
Pre-order Tra... | [
{
"code": null,
"e": 2868,
"s": 2580,
"text": "Traversal is a process to visit all the nodes of a tree and may print their values too. Because, all nodes are connected via edges (links) we always start from the root (head) node. That is, we cannot random access a node in a tree. There are three ways... |
Tryit Editor v3.7 | HTML Input types
Tryit: HTML submit button | [
{
"code": null,
"e": 27,
"s": 10,
"text": "HTML Input types"
}
] |
Python | Count of elements matching particular condition - GeeksforGeeks | 30 Dec, 2018
Checking a number/element by a condition is a common problem one faces and is done in almost every program. Sometimes we also require to get the totals that match the particular condition to have a distinguish which to not match for further utilization. Lets discuss certain ways in which this task can be a... | [
{
"code": null,
"e": 24538,
"s": 24510,
"text": "\n30 Dec, 2018"
},
{
"code": null,
"e": 24854,
"s": 24538,
"text": "Checking a number/element by a condition is a common problem one faces and is done in almost every program. Sometimes we also require to get the totals that match ... |
Tryit Editor v3.6 - Show Python | f = open("demofile.txt", "r") | [] |
Deep Learning for Aircraft Recognition Part I | by Chris Chow | Towards Data Science | For the past few years, I’ve kept current on developments in machine learning (ML) through courses and interest groups. One thing I’ve noticed is that a lot of success stories were recycled from the business world. Although there are many potential military applications, especially for intelligence, these generally can... | [
{
"code": null,
"e": 799,
"s": 172,
"text": "For the past few years, I’ve kept current on developments in machine learning (ML) through courses and interest groups. One thing I’ve noticed is that a lot of success stories were recycled from the business world. Although there are many potential milita... |
How to get a JSON array field in a nested JSON using Rest Assured? | We can get a JSON array field in a nested JSON using Rest Assured. First, we shall obtain a Response body which is in JSON format from a request. Then convert it to string.
Finally, to obtain a particular array value, we shall use the array index followed by the field name. We shall send a GET request via Postman on a ... | [
{
"code": null,
"e": 1235,
"s": 1062,
"text": "We can get a JSON array field in a nested JSON using Rest Assured. First, we shall obtain a Response body which is in JSON format from a request. Then convert it to string."
},
{
"code": null,
"e": 1418,
"s": 1235,
"text": "Finally, ... |
Finding the last occurrence of a character in a String in Java | Use the lastIndexOf() method to find the last occurrence of a character in a string in Java.
Let’s say the following is our string.
String myStr = "Amit Diwan";
In the above string, we will find the last occurrence of character ‘i’
myStr.lastIndexOf('i');
The following is the complete example.
Live Demo
public class D... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "Use the lastIndexOf() method to find the last occurrence of a character in a string in Java."
},
{
"code": null,
"e": 1194,
"s": 1155,
"text": "Let’s say the following is our string."
},
{
"code": null,
"e": 1223,
"s"... |
Update multiple columns of a single row MySQL? | Let us first create a table −
mysql> create table DemoTable
-> (
-> FirstName varchar(100),
-> Age int,
-> Score int
-> );
Query OK, 0 rows affected (0.62 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('Robert',21,78);
Query OK, 1 row affected (0.10 sec)
... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table −"
},
{
"code": null,
"e": 1237,
"s": 1092,
"text": "mysql> create table DemoTable\n -> (\n -> FirstName varchar(100),\n -> Age int,\n -> Score int\n -> );\nQuery OK, 0 rows affected (0.62 sec)"
... |
Include these Spark Window Functions in your Data Science Workflow | by Rahul Agarwal | Towards Data Science | In my last few posts on Spark, I explained how to work with PySpark RDDs and Dataframes.
Although these posts explain a lot on how to work with RDDs and Dataframe operations, and I would ask readers to go through them if they want to learn Spark Basics, I still didn’t mention quite a lot when it comes to working with P... | [
{
"code": null,
"e": 261,
"s": 172,
"text": "In my last few posts on Spark, I explained how to work with PySpark RDDs and Dataframes."
},
{
"code": null,
"e": 511,
"s": 261,
"text": "Although these posts explain a lot on how to work with RDDs and Dataframe operations, and I would... |
Scala Collections - Seq | Scala Seq is a trait to represent immutable sequences. This structure provides index based access and various utility methods to find elements, their occurences and subsequences. A Seq maintains the insertion order.
The following is the syntax for declaring an Seq variable.
val seq: Seq[Int] = Seq(1, 2, 3, 4, 5)
Here,... | [
{
"code": null,
"e": 3098,
"s": 2882,
"text": "Scala Seq is a trait to represent immutable sequences. This structure provides index based access and various utility methods to find elements, their occurences and subsequences. A Seq maintains the insertion order."
},
{
"code": null,
"e": ... |
How to find the Sum of two Binary Numbers using C#? | To find the sum of two binary numbers, firstly set them.
val1 = 11110;
val2 = 11100;
Now call the displaySum() method, which created to display the sumL.
sum = displaySum(val1, val2);
We have set a new array in the method to display each bit of the binary number.
long[] sum = new long[30];
Now let us see the complete c... | [
{
"code": null,
"e": 1119,
"s": 1062,
"text": "To find the sum of two binary numbers, firstly set them."
},
{
"code": null,
"e": 1147,
"s": 1119,
"text": "val1 = 11110;\nval2 = 11100;"
},
{
"code": null,
"e": 1216,
"s": 1147,
"text": "Now call the displaySum()... |
Python | Pandas Index.size - GeeksforGeeks | 20 Feb, 2019
Pandas Index is an immutable ndarray implementing an ordered, sliceable set. It is the basic object which stores the axis labels for all pandas objects.
Pandas Index.size attribute return the number of elements in the underlying data of the given Index object.
Syntax: Index.size
Parameter : None
Returns : ... | [
{
"code": null,
"e": 23941,
"s": 23913,
"text": "\n20 Feb, 2019"
},
{
"code": null,
"e": 24094,
"s": 23941,
"text": "Pandas Index is an immutable ndarray implementing an ordered, sliceable set. It is the basic object which stores the axis labels for all pandas objects."
},
{
... |
Where do we use scope Resolution Operator (::) in C#? | In C++ the scope resolution operator i.e. :: is used for global variables, whereas in C# it is related to namespaces.
If you have a type that share an identifier in different namespace, then to identify them use the scope resolution operator.
For example, to reference System.Console class, use the global namespace alia... | [
{
"code": null,
"e": 1180,
"s": 1062,
"text": "In C++ the scope resolution operator i.e. :: is used for global variables, whereas in C# it is related to namespaces."
},
{
"code": null,
"e": 1305,
"s": 1180,
"text": "If you have a type that share an identifier in different namespa... |
How to change tabs on hover with CSS and JavaScript? | To change tabs on hover with CSS and JavaScript, the code is as follows −
Live Demo
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box}
.tab {
float: left;
border: 1px solid #ccc;
background-color: #f1f1f1;
width: 30%;
hei... | [
{
"code": null,
"e": 1136,
"s": 1062,
"text": "To change tabs on hover with CSS and JavaScript, the code is as follows −"
},
{
"code": null,
"e": 1147,
"s": 1136,
"text": " Live Demo"
},
{
"code": null,
"e": 3181,
"s": 1147,
"text": "<!DOCTYPE html>\n<html>\n<... |
SAS - SQL | SAS offers extensive support to most of the popular relational databases by using SQL queries inside SAS programs. Most of the ANSI SQL syntax is supported. The procedure PROC SQL is used to process the SQL statements. This procedure can not only give back the result of an SQL query, it can also create SAS tables & var... | [
{
"code": null,
"e": 2966,
"s": 2583,
"text": "SAS offers extensive support to most of the popular relational databases by using SQL queries inside SAS programs. Most of the ANSI SQL syntax is supported. The procedure PROC SQL is used to process the SQL statements. This procedure can not only give b... |
How to access the members of a class from another class in Java? | To access the members of a class from other class.
First of all, import the class.
Create an object of that class.
Using this object access, the members of that class.
Suppose there is a class in a package called myPackage with a method named display()
package myPackage;
public class Sample {
public void display() {... | [
{
"code": null,
"e": 1113,
"s": 1062,
"text": "To access the members of a class from other class."
},
{
"code": null,
"e": 1145,
"s": 1113,
"text": "First of all, import the class."
},
{
"code": null,
"e": 1177,
"s": 1145,
"text": "Create an object of that cla... |
(Almost) Real-Time Twitter Sentiment Analysis with Tweep & Vader | by Marcelo Rovai | Towards Data Science | The idea with this article is to capture tweets, to analyze them regarding the most used words and hashtags and classifying them regarding their sentiment (positive, negative or neutral). We will use as a dataset, not only tweets captured from a historical database, as for example, the last 200 tweets sent by @realDona... | [
{
"code": null,
"e": 501,
"s": 172,
"text": "The idea with this article is to capture tweets, to analyze them regarding the most used words and hashtags and classifying them regarding their sentiment (positive, negative or neutral). We will use as a dataset, not only tweets captured from a historica... |
Building A Logistic Regression in Python, Step by Step | by Susan Li | Towards Data Science | Logistic Regression is a Machine Learning classification algorithm that is used to predict the probability of a categorical dependent variable. In logistic regression, the dependent variable is a binary variable that contains data coded as 1 (yes, success, etc.) or 0 (no, failure, etc.). In other words, the logistic re... | [
{
"code": null,
"e": 543,
"s": 172,
"text": "Logistic Regression is a Machine Learning classification algorithm that is used to predict the probability of a categorical dependent variable. In logistic regression, the dependent variable is a binary variable that contains data coded as 1 (yes, success... |
JOGL - Rotation | In this chapter we explained you how to rotate an object using JOGL. Rotation of objects can be done along any of the three axes, using the glRotatef(float angle, float x, float y, float z) method of GLMatrixFunc interface. You need to pass an angle of rotation and x, y, z axes as parameters to this method.
The followi... | [
{
"code": null,
"e": 2328,
"s": 2019,
"text": "In this chapter we explained you how to rotate an object using JOGL. Rotation of objects can be done along any of the three axes, using the glRotatef(float angle, float x, float y, float z) method of GLMatrixFunc interface. You need to pass an angle of ... |
Understanding Javascript ‘this’ keyword (Context) | by Deepak Gupta | Towards Data Science | Context is one of those topics that always creates a lot of confusion when someone is starting to learn javascript and it’s a topic that the interviewer asks about a lot.
Let's start...
Context is always the value of the this keyword which is a reference to the object that “owns” the currently executing code or the fun... | [
{
"code": null,
"e": 342,
"s": 171,
"text": "Context is one of those topics that always creates a lot of confusion when someone is starting to learn javascript and it’s a topic that the interviewer asks about a lot."
},
{
"code": null,
"e": 357,
"s": 342,
"text": "Let's start..."... |
C program to find palindrome number by using while loop | Palindrome number is a number which remains same when it reverses. In C language, the user is allowed to enter any positive integer and to check, whether the given number is palindrome number or not by using the while loop.
Following is the C Program to find Palindrome number by using the while loop −
Live Demo
#inclu... | [
{
"code": null,
"e": 1286,
"s": 1062,
"text": "Palindrome number is a number which remains same when it reverses. In C language, the user is allowed to enter any positive integer and to check, whether the given number is palindrome number or not by using the while loop."
},
{
"code": null,
... |
Build Your Own Machine Translation Service with Transformers | by Kyle Gallatin | Towards Data Science | Machine translation is in demand within the enterprise environment. It’s vital that global companies are able to share documents, notes, emails, and other texts with people across the world in a gamut of different languages.
Arguably even more important is the need to democratize information alongside globalization. Re... | [
{
"code": null,
"e": 397,
"s": 172,
"text": "Machine translation is in demand within the enterprise environment. It’s vital that global companies are able to share documents, notes, emails, and other texts with people across the world in a gamut of different languages."
},
{
"code": null,
... |
8086 program to check whether a string is palindrome or not - GeeksforGeeks | 03 Aug, 2021
Problem: Write an 8086 program to check whether a given string is palindrome or not.Examples:
Input String: "abba"
Output: String is palindrome
Input String: "abbca"
Output: String is not palindrome
Explanation:
Create a stringTraverse to the end of the stringGet the address of the end of the string,... | [
{
"code": null,
"e": 24373,
"s": 24345,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 24469,
"s": 24373,
"text": "Problem: Write an 8086 program to check whether a given string is palindrome or not.Examples: "
},
{
"code": null,
"e": 24576,
"s": 24469,
"te... |
Exploring Normal Distribution With Jupyter Notebook | by Shinichi Okada | Towards Data Science | Table of ContentsIntroduction1. Normal Distribution Probability Density Function2. Using random normal distribution values3. A cumulative normal distribution function4. Calculating the probability of normal distribution5. Interval between variables6. Finding quantiles7. Multivariate Normal Distribution8. Standard norma... | [
{
"code": null,
"e": 459,
"s": 46,
"text": "Table of ContentsIntroduction1. Normal Distribution Probability Density Function2. Using random normal distribution values3. A cumulative normal distribution function4. Calculating the probability of normal distribution5. Interval between variables6. Findi... |
C# | Equals(String, String) Method | 24 Sep, 2021
In C#, Equals(String, String) is a String method. It is used to determine whether two String objects have the same value or not. Basically, it checks for equality. If both strings have the same value, it returns true otherwise returns false. This method is different from Compare and CompareTo methods. This... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 399,
"s": 28,
"text": "In C#, Equals(String, String) is a String method. It is used to determine whether two String objects have the same value or not. Basically, it checks for equality. If both str... |
SQL Full Outer Join Using Union Clause | 13 Apr, 2021
In this article, we will discuss the overview of SQL, and our main focus will be on how to perform Full Outer Join Using Union Clause in SQL. Let’s discuss it one by one.
Overview :To manage a relational database, SQL is a Structured Query Language to perform operations like creating, maintaining database ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Apr, 2021"
},
{
"code": null,
"e": 199,
"s": 28,
"text": "In this article, we will discuss the overview of SQL, and our main focus will be on how to perform Full Outer Join Using Union Clause in SQL. Let’s discuss it one by one."
}... |
Output of Python Program | Set 1 | 28 Jun, 2021
Predict the output of following python programs:
Program 1:
r = lambda q: q * 2s = lambda q: q * 3x = 2x = r(x)x = s(x)x = r(x)print (x)
Output:
24
Explanation : In the above program r and s are lambda functions or anonymous functions and q is the argument to both of the functions. In first step we have i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 101,
"s": 52,
"text": "Predict the output of following python programs:"
},
{
"code": null,
"e": 112,
"s": 101,
"text": "Program 1:"
},
{
"code": "r = lambda q: q * 2s =... |
Python | Max/Min value in Nth Column in Matrix | 30 Dec, 2020
Sometimes, while working with Python Matrix, we may have a problem in which we require to find the minimum and maximum value of a particular column. This can have a possible application in day-day programming and competitive programming. Let’s discuss certain way in which this task can be performed.
Method... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Dec, 2020"
},
{
"code": null,
"e": 329,
"s": 28,
"text": "Sometimes, while working with Python Matrix, we may have a problem in which we require to find the minimum and maximum value of a particular column. This can have a possible a... |
Linear Diophantine Equations | 31 Mar, 2021
A Diophantine equation is a polynomial equation, usually in two or more unknowns, such that only the integral solutions are required. An Integral solution is a solution such that all the unknown variables take only integer values.Given three integers a, b, c representing a linear equation of the form : ax ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Mar, 2021"
},
{
"code": null,
"e": 468,
"s": 54,
"text": "A Diophantine equation is a polynomial equation, usually in two or more unknowns, such that only the integral solutions are required. An Integral solution is a solution such ... |
Creating a Network in Docker and Connecting a Container to That Network | 23 Oct, 2020
Networks are created so that the devices which are inside that network can connect to each other and transfer of files can take place. In docker also we can create a network and can create a container and connect to the respective network and two containers that are connected to the same network can commun... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Oct, 2020"
},
{
"code": null,
"e": 585,
"s": 28,
"text": "Networks are created so that the devices which are inside that network can connect to each other and transfer of files can take place. In docker also we can create a network a... |
How to convert first letter of a string to upper case using jQuery ? | 27 Apr, 2020
The task is to capitalize the first letter of string without using toUpperCase() method with the help of jQuery. There are two approaches that are discussed below:
Approach 1: In this example, the css() method is used to used to set the text-transform property value to capitalize.
Example:
<!DOCTYPE HTML> ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Apr, 2020"
},
{
"code": null,
"e": 192,
"s": 28,
"text": "The task is to capitalize the first letter of string without using toUpperCase() method with the help of jQuery. There are two approaches that are discussed below:"
},
{
... |
What’s Android Interface Definition Language (AIDL) in Android? | 09 May, 2021
The Android Interface Definition Language (AIDL) is analogous to other IDLs you would possibly have worked with. It allows you to define the programming interface that both the client and repair agree upon so as to speak with one another using interprocess communication (IPC). Traditionally the Android way... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 684,
"s": 28,
"text": "The Android Interface Definition Language (AIDL) is analogous to other IDLs you would possibly have worked with. It allows you to define the programming interface that both th... |
Python Bokeh – Plotting Quadratic Curves on a Graph | 10 Jul, 2020
Bokeh is a Python interactive data visualization. It renders its plots using HTML and JavaScript. It targets modern web browsers for presentation providing elegant, concise construction of novel graphics with high-performance interactivity.
Bokeh can be used to plot quadratic curves on a graph. Plotting qu... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 269,
"s": 28,
"text": "Bokeh is a Python interactive data visualization. It renders its plots using HTML and JavaScript. It targets modern web browsers for presentation providing elegant, concise co... |
JavaScript string.localeCompare() Method | 05 Oct, 2021
Below is the example of the string.localeCompare() Method.
Example:<script> gfg = 'b'.localeCompare('a'); document.write(gfg + '<br>') </script>
<script> gfg = 'b'.localeCompare('a'); document.write(gfg + '<br>') </script>
Output:1
1
The string.localeCompare() is an inbuilt method in JavaScri... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 87,
"s": 28,
"text": "Below is the example of the string.localeCompare() Method."
},
{
"code": null,
"e": 180,
"s": 87,
"text": "Example:<script> gfg = 'b'.localeCompare('a');... |
List Methods in Python | Set 1 (in, not in, len(), min(), max()...) | 07 Jun, 2022
List basics have been covered in python in the set belowData Types-List, Tuples and Iterations
List methods are discussed in this articles.1. “in” operator :- This operator is used to check if an element is present in the list or not. Returns true if element is present in list else returns false. 2. “not i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jun, 2022"
},
{
"code": null,
"e": 147,
"s": 52,
"text": "List basics have been covered in python in the set belowData Types-List, Tuples and Iterations"
},
{
"code": null,
"e": 522,
"s": 147,
"text": "List metho... |
Count minimum number of “move-to-front” moves to sort an array | 06 Jul, 2022
Given an array of size n such that array elements are in range from 1 to n. The task is to count a number of move-to-front operations to arrange items as {1, 2, 3,... n}. The move-to-front operation is to pick any item and place it in first position.
This problem can also be seen as a stack of items with o... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 303,
"s": 52,
"text": "Given an array of size n such that array elements are in range from 1 to n. The task is to count a number of move-to-front operations to arrange items as {1, 2, 3,... n}. The... |
Python | Pandas Series.to_string() | 05 Feb, 2019
Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index.
Pandas Series.to_string() function render a string... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Feb, 2019"
},
{
"code": null,
"e": 285,
"s": 28,
"text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based index... |
Level order traversal line by line | Set 3 (Using One Queue) | 17 Jun, 2022
Given a Binary Tree, print the nodes level-wise, each level on a new line.
Output:
1
2 3
4 5
We have discussed two solutions in the articles below. Print level order traversal line by line | Set 1 Level order traversal line by line | Set 2 (Using Two Queues)In this post, a different approach using one que... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Jun, 2022"
},
{
"code": null,
"e": 128,
"s": 52,
"text": "Given a Binary Tree, print the nodes level-wise, each level on a new line. "
},
{
"code": null,
"e": 146,
"s": 128,
"text": "Output:\n1\n2 3\n4 5"
},
... |
Sum of Areas of Rectangles possible for an array | 23 Feb, 2022
Given an array, the task is to compute the sum of all possible maximum area rectangles which can be formed from the array elements. Also, you can reduce the elements of the array by at most 1.
Examples:
Input: a = {10, 10, 10, 10, 11,
10, 11, 10}
Output: 210
Explanation:
We can form two rec... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Feb, 2022"
},
{
"code": null,
"e": 246,
"s": 52,
"text": "Given an array, the task is to compute the sum of all possible maximum area rectangles which can be formed from the array elements. Also, you can reduce the elements of the a... |
C# | Adding an element to the List | 01 Feb, 2019
List.Add(T) Method is used to add an object to the end of the List.
Properties of List:
It is different from the arrays. A list can be resized dynamically but arrays cannot.
List class can accept null as a valid value for reference types and it also allows duplicate elements.
If the Count becomes equals to... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 96,
"s": 28,
"text": "List.Add(T) Method is used to add an object to the end of the List."
},
{
"code": null,
"e": 116,
"s": 96,
"text": "Properties of List:"
},
{
"code"... |
Insert Python list into PostgreSQL database | 23 Sep, 2021
In this article, we will discuss how to Insert a Python list into PostgreSQL database using pyscopg2 module.
Psycopg2 is the most popular PostgreSQL adapter for the Python programming language. Psycopg2 is a DB API 2.0 compliant PostgreSQL driver that is actively developed. It is designed for multi-threade... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 137,
"s": 28,
"text": "In this article, we will discuss how to Insert a Python list into PostgreSQL database using pyscopg2 module."
},
{
"code": null,
"e": 441,
"s": 137,
"text"... |
time.ParseDuration() Function in Golang With Examples | 02 Apr, 2020
Go language provides inbuilt support for measuring and displaying time with the help of the time package. In this package, the calendrical calculations always assume a Gregorian calendar with no leap seconds. This package provides a ParseDuration() function which parses a duration string. Duration string i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Apr, 2020"
},
{
"code": null,
"e": 566,
"s": 28,
"text": "Go language provides inbuilt support for measuring and displaying time with the help of the time package. In this package, the calendrical calculations always assume a Gregori... |
Chess Library in Python | 05 Jul, 2021
The chess module is a pure Python chess library with move generation, move validation and support for common formats. We can play chess with it. It will help us to move the king queen, pawn, bishops and knights. We need to know the basics of chess to play chess with it. This module does every task in pytho... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jul, 2021"
},
{
"code": null,
"e": 398,
"s": 54,
"text": "The chess module is a pure Python chess library with move generation, move validation and support for common formats. We can play chess with it. It will help us to move the k... |
Python - Segregate elements by delimiter - GeeksforGeeks | 29 Aug, 2020
Given list of Strings, segregate each string by delimiter and output different lists for prefix and suffix.
Input : test_list = [“7$2”, “8$5”, “9$1”], delim = “$”Output : [‘7’, ‘8’, ‘9’], [‘2’, ‘5’, ‘1’]Explanation : Different lists for prefix and suffix of “$”
Input : test_list = [“7*2”, “8*5”, “9*1”], de... | [
{
"code": null,
"e": 24450,
"s": 24422,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 24558,
"s": 24450,
"text": "Given list of Strings, segregate each string by delimiter and output different lists for prefix and suffix."
},
{
"code": null,
"e": 24712,
"s": 24... |
Search an element in sorted and rotated array | Practice | GeeksforGeeks | Given a sorted and rotated array A of N distinct elements which is rotated at some point, and given an element K. The task is to find the index of the given element K in the array A.
Example 1:
Input:
N = 9
A[] = {5 6,7,8,9,10,1,2,3}
K = 10
Output: 5
Explanation: 10 is found at index 5.
Example 1:
Input:
N = 3
A[] = {... | [
{
"code": null,
"e": 473,
"s": 290,
"text": "Given a sorted and rotated array A of N distinct elements which is rotated at some point, and given an element K. The task is to find the index of the given element K in the array A."
},
{
"code": null,
"e": 484,
"s": 473,
"text": "Exa... |
What is Python equivalent of the ! operator? | In C/C++, ! symbol is defined as not operator. Its equivalent in Python is not operator. It returns true if operand is false and vice versa
>>> not(True)
False
>>> not(False)
True
>>> not(20>30)
True
>>> not('abc'=='ABC')
True | [
{
"code": null,
"e": 1202,
"s": 1062,
"text": "In C/C++, ! symbol is defined as not operator. Its equivalent in Python is not operator. It returns true if operand is false and vice versa"
},
{
"code": null,
"e": 1289,
"s": 1202,
"text": ">>> not(True)\nFalse\n>>> not(False)\nTrue... |
Demystifying hypothesis testing with simple Python examples | by Tirthajyoti Sarkar | Towards Data Science | Hypothesis testing is a critical tool in inferential statistics, for determining what the value of a population parameter could be. We often draw this conclusion based on a sample data analysis.
Not sure what exactly ‘population’ and ‘sample’ means in statistics? See this article.
www.statisticshowto.datasciencecentral... | [
{
"code": null,
"e": 366,
"s": 171,
"text": "Hypothesis testing is a critical tool in inferential statistics, for determining what the value of a population parameter could be. We often draw this conclusion based on a sample data analysis."
},
{
"code": null,
"e": 453,
"s": 366,
... |
How to use month input type in HTML? | The month input type is used in HTML using the <input type="month">. Using this, allow the users to select month and year. A date picker popup is visible whenever you will give a user input to the month input type.
Note − The input type month is not supported on Firefox and Internet Explorer. It works on Google Chrome.... | [
{
"code": null,
"e": 1277,
"s": 1062,
"text": "The month input type is used in HTML using the <input type=\"month\">. Using this, allow the users to select month and year. A date picker popup is visible whenever you will give a user input to the month input type."
},
{
"code": null,
"e":... |
How to rename directory using Python? | You can rename a directory in Python by moving it using the shutil module. The shutil.move(src, dst) moves the directory from src to dst. If you just change the name of the directory without specifying the path, you'll basically be renaming it.
>>> import shutil
>>> shutil.move('my_folder', 'new_name')
The above code r... | [
{
"code": null,
"e": 1307,
"s": 1062,
"text": "You can rename a directory in Python by moving it using the shutil module. The shutil.move(src, dst) moves the directory from src to dst. If you just change the name of the directory without specifying the path, you'll basically be renaming it."
},
... |
C++ Program to Rotate bits of a number - GeeksforGeeks | 11 Dec, 2021
Bit Rotation: A rotation (or circular shift) is an operation similar to shift except that the bits that fall off at one end are put back to the other end. In left rotation, the bits that fall off at left end are put back at right end. In right rotation, the bits that fall off at right end are put back at l... | [
{
"code": null,
"e": 24908,
"s": 24880,
"text": "\n11 Dec, 2021"
},
{
"code": null,
"e": 25225,
"s": 24908,
"text": "Bit Rotation: A rotation (or circular shift) is an operation similar to shift except that the bits that fall off at one end are put back to the other end. In left ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.