title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Generating Random Numbers and Arrays in Matlab and Numpy | by Xinyu Chen (้ๆฐๅฎ) | Towards Data Science | As we know, Numpy is a famous Python library for supporting matrix computations in Python, along with a large collection of high-level mathematical functions to operate on vector, matrix, and tensor arrays [1]. Matlab is a programming language and numerical computing environment, supporting matrix computations, plottin... | [
{
"code": null,
"e": 632,
"s": 171,
"text": "As we know, Numpy is a famous Python library for supporting matrix computations in Python, along with a large collection of high-level mathematical functions to operate on vector, matrix, and tensor arrays [1]. Matlab is a programming language and numeric... |
Julia Programming - Modules and Packages | The modules in Julia programming language are used to group together the related functions and other definitions. The structure of a module is given below โ
module ModuleName
end
We can define and put functions, type definitions, and so on in between above two lines.
Juliaโs package manager can be used to download an... | [
{
"code": null,
"e": 2235,
"s": 2078,
"text": "The modules in Julia programming language are used to group together the related functions and other definitions. The structure of a module is given below โ"
},
{
"code": null,
"e": 2259,
"s": 2235,
"text": "module ModuleName\n\nend\... |
Difference between Object and Class in Java | Object - Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors โ wagging the tail, barking, eating. An object is an instance of a class.
Class - A class can be defined as a template/blueprint that describes the behavior/state that the object of its type support.
In the f... | [
{
"code": null,
"e": 1248,
"s": 1062,
"text": "Object - Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors โ wagging the tail, barking, eating. An object is an instance of a class."
},
{
"code": null,
"e": 1374,
"s": 1248,
"text... |
Media.net Interview Experience for SDE-1 - GeeksforGeeks | 04 May, 2021
Round 1:
Given a string of 1โs and 2โs, standing at index โiโ, you can move exactly two steps forward or backward if s[i] == 2, else you can move one step forward or backward if s[i] ==1.A string is called a good string if you can reach the end of the string by moving every index exactly once.Now, you have... | [
{
"code": null,
"e": 25128,
"s": 25100,
"text": "\n04 May, 2021"
},
{
"code": null,
"e": 25137,
"s": 25128,
"text": "Round 1:"
},
{
"code": null,
"e": 25679,
"s": 25137,
"text": "Given a string of 1โs and 2โs, standing at index โiโ, you can move exactly two st... |
GATE | GATE CS 2021 | Set 2 | Question 20 - GeeksforGeeks | 13 Aug, 2021
Consider the following ANSI C program.
#include < stdio.h >
int main( )
{
int arr[4][5];
int i, j;
for (i=0; i<4; i++)
โโโโโโ{
for (j=0; j<5; j++)
{
arr[i][j] = 10 * i + j;
}
}
printf("%d", *(arr[1]+9));
return 0;
}
What is the output of ... | [
{
"code": null,
"e": 25751,
"s": 25723,
"text": "\n13 Aug, 2021"
},
{
"code": null,
"e": 25790,
"s": 25751,
"text": "Consider the following ANSI C program."
},
{
"code": null,
"e": 26036,
"s": 25790,
"text": "#include < stdio.h >\nint main( ) \n{\n int arr[... |
Alternatives for the Deprecated AsyncTask in Android - GeeksforGeeks | 05 Aug, 2021
AsyncTask (Asynchronous Task) in Android is an abstract class, or rather a helper class that lets the application perform tedious tasks in the background and parallelly perform UI changes in the front-end. This is quite similar to Threading but does not constitute any threading framework. Background tasks ... | [
{
"code": null,
"e": 26381,
"s": 26353,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 26890,
"s": 26381,
"text": "AsyncTask (Asynchronous Task) in Android is an abstract class, or rather a helper class that lets the application perform tedious tasks in the background and paral... |
std::rank in C++ with Examples - GeeksforGeeks | 08 Jun, 2020
The std::rank template of C++ STL is present in the <type_traits> header file. The std::rank template of C++ STL is used to find the rank of type T. This function return the rank of type T.
Header File:
#include<type_traits>
Template Class:
template<class T>
struct rank;
template<class T>
inline constexp... | [
{
"code": null,
"e": 25343,
"s": 25315,
"text": "\n08 Jun, 2020"
},
{
"code": null,
"e": 25533,
"s": 25343,
"text": "The std::rank template of C++ STL is present in the <type_traits> header file. The std::rank template of C++ STL is used to find the rank of type T. This function ... |
OpenCV | Loading Video - GeeksforGeeks | 26 Aug, 2019
This article aims to learn how to display a video in OpenCV. To do so is a simple task just like displayed as a single image. But here, this display of frames have to be read in a loop as a part of the sequence.
Letsโs understand the complete process line by line in detail.
CvCapture* capture = cvCreateFil... | [
{
"code": null,
"e": 25493,
"s": 25465,
"text": "\n26 Aug, 2019"
},
{
"code": null,
"e": 25705,
"s": 25493,
"text": "This article aims to learn how to display a video in OpenCV. To do so is a simple task just like displayed as a single image. But here, this display of frames have... |
Arraylist lastIndexOf() in Java with example - GeeksforGeeks | 26 Nov, 2018
The lastIndexOf() method of ArrayList in Java is used to get the index of the last occurrence of an element in an ArrayList object.
Syntax :
lastIndexOf(element)
Parameter : The element whose last index is to be returned.
Returns :It returns the last occurrence of the element passed in the parameter. It re... | [
{
"code": null,
"e": 25724,
"s": 25696,
"text": "\n26 Nov, 2018"
},
{
"code": null,
"e": 25856,
"s": 25724,
"text": "The lastIndexOf() method of ArrayList in Java is used to get the index of the last occurrence of an element in an ArrayList object."
},
{
"code": null,
... |
How to avoid Compile Error while defining Variables - GeeksforGeeks | 05 Apr, 2019
Variables: A variable is the name given to a memory location. It is the basic unit of storage in a program.
The value stored in a variable can be changed during program execution.
A variable is only a name given to a memory location, all the operations done on the variable effects that memory location.
All... | [
{
"code": null,
"e": 25957,
"s": 25929,
"text": "\n05 Apr, 2019"
},
{
"code": null,
"e": 26065,
"s": 25957,
"text": "Variables: A variable is the name given to a memory location. It is the basic unit of storage in a program."
},
{
"code": null,
"e": 26137,
"s": 26... |
QuickSelect (A Simple Iterative Implementation) - GeeksforGeeks | 08 Jun, 2021
Quickselect is a selection algorithm to find the k-th smallest element in an unordered list. It is related to the quick sort sorting algorithm.Examples:
Input: arr[] = {7, 10, 4, 3, 20, 15}
k = 3
Output: 7
Input: arr[] = {7, 10, 4, 3, 20, 15}
k = 4
Output: 10
The QuickSelect algo... | [
{
"code": null,
"e": 26215,
"s": 26187,
"text": "\n08 Jun, 2021"
},
{
"code": null,
"e": 26370,
"s": 26215,
"text": "Quickselect is a selection algorithm to find the k-th smallest element in an unordered list. It is related to the quick sort sorting algorithm.Examples: "
},
... |
How to find element with specific ID using jQuery ? - GeeksforGeeks | 26 May, 2021
The question is to determine whether an element with a specific id exists or not using JQuery.
jQuery on() Method: This method adds one or more event handlers for the selected elements and child elements.Syntax:
$(selector).on(event, childSelector, data, function, map)
Parameters: event: It is required... | [
{
"code": null,
"e": 27040,
"s": 27012,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 27137,
"s": 27040,
"text": "The question is to determine whether an element with a specific id exists or not using JQuery. "
},
{
"code": null,
"e": 27256,
"s": 27137,
"t... |
Python | Pandas Series.min() - GeeksforGeeks | 11 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.min() function return the mode of th... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n11 Feb, 2019"
},
{
"code": null,
"e": 25794,
"s": 25537,
"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... |
Python Program for cube sum of first n natural numbers - GeeksforGeeks | 09 Oct, 2018
Print the sum of series 13 + 23 + 33 + 43 + .......+ n3 till n-th term.
Examples:
Input : n = 5
Output : 225
13 + 23 + 33 + 43 + 53 = 225
Input : n = 7
Output : 784
13 + 23 + 33 + 43 + 53 +
63 + 73 = 784
# Simple Python program to find sum of series# with cubes of first n natural numbers # Returns the ... | [
{
"code": null,
"e": 26272,
"s": 26244,
"text": "\n09 Oct, 2018"
},
{
"code": null,
"e": 26344,
"s": 26272,
"text": "Print the sum of series 13 + 23 + 33 + 43 + .......+ n3 till n-th term."
},
{
"code": null,
"e": 26354,
"s": 26344,
"text": "Examples:"
},
... |
Docker - Compose - GeeksforGeeks | 28 Mar, 2022
Docker is an open-source platform that makes development, shiping and deployment of application easy. It packages all the dependendies of an application in a so called container and runs it as an isolated environment. To know more about docker, read Introduction to docker.
In a typical scenario there will ... | [
{
"code": null,
"e": 25101,
"s": 25073,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 25375,
"s": 25101,
"text": "Docker is an open-source platform that makes development, shiping and deployment of application easy. It packages all the dependendies of an application in a so ca... |
How to set axes labels & limits in a Seaborn plot? - GeeksforGeeks | 14 Sep, 2021
In this article, we will learn How to set axes labels & limits in a Seaborn plot. Letโs discuss some concepts first.
Axis is the region in the plot that contains the data space. The Axes contain two or three-axis(in case of 3D) objects which take care of the data limits.
Axes Labels are the labels that des... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 24329,
"s": 24212,
"text": "In this article, we will learn How to set axes labels & limits in a Seaborn plot. Letโs discuss some concepts first."
},
{
"code": null,
"e": 24484,
... |
Computer - Number System | When we type some letters or words, the computer translates them in numbers as computers can understand only numbers. A computer can understand the positional number system where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number.
... | [
{
"code": null,
"e": 2469,
"s": 2149,
"text": "When we type some letters or words, the computer translates them in numbers as computers can understand only numbers. A computer can understand the positional number system where there are only a few symbols called digits and these symbols represent dif... |
Dynamic Programming | High-effort vs. Low-effort Tasks Problem - GeeksforGeeks | 11 Aug, 2021
You are given n days and for each day (di) you could either perform a high effort tasks (hi) or a low effort tasks (li) or no task with the constraint that you can choose a high-effort tasks only if you choose no task on the previous day. Write a program to find the maximum amount of tasks you can perform ... | [
{
"code": null,
"e": 24305,
"s": 24277,
"text": "\n11 Aug, 2021"
},
{
"code": null,
"e": 24643,
"s": 24305,
"text": "You are given n days and for each day (di) you could either perform a high effort tasks (hi) or a low effort tasks (li) or no task with the constraint that you can... |
C library function - pow() | The C library function double pow(double x, double y) returns x raised to the power of y i.e. xy.
Following is the declaration for pow() function.
double pow(double x, double y)
x โ This is the floating point base value.
x โ This is the floating point base value.
y โ This is the floating point power value.
y โ This is ... | [
{
"code": null,
"e": 2105,
"s": 2007,
"text": "The C library function double pow(double x, double y) returns x raised to the power of y i.e. xy."
},
{
"code": null,
"e": 2154,
"s": 2105,
"text": "Following is the declaration for pow() function."
},
{
"code": null,
"e"... |
jQuery | event.stopPropagation() Method - GeeksforGeeks | 17 Jul, 2019
The event.stopPropagation() method is an inbuilt method in jQuery which is used to stop the windows propagation. In the DOM tree when setting an event with the child element and the parent element as well then if you hit on the child element event it will call both child and the parent element as well. So ... | [
{
"code": null,
"e": 25133,
"s": 25105,
"text": "\n17 Jul, 2019"
},
{
"code": null,
"e": 25543,
"s": 25133,
"text": "The event.stopPropagation() method is an inbuilt method in jQuery which is used to stop the windows propagation. In the DOM tree when setting an event with the chi... |
Docker for data scientists โ Part 1 | by Adam Sroka | Towards Data Science | Weโre going to jog through the following topics in order:
It works on my machine
Virtual Machines (VMs) and containerisation
Docker โ A Hello World! example
Next steps โ Putting models into production, Kubernetes, Helm, MLOps, and DataOps
Over my time working in data science Iโve seen many people struggle with (or simp... | [
{
"code": null,
"e": 230,
"s": 172,
"text": "Weโre going to jog through the following topics in order:"
},
{
"code": null,
"e": 253,
"s": 230,
"text": "It works on my machine"
},
{
"code": null,
"e": 297,
"s": 253,
"text": "Virtual Machines (VMs) and container... |
Swing Examples - Open file Dialog to select only Images | Following example showcase how to show a Open File dialog to select only images in swing based application.
We are using the following APIs.
JFileChooser โ To create a file chooser.
JFileChooser โ To create a file chooser.
JFileChooser.addChoosableFileFilter(ImageFilter) โ To add a custom file filter for Images only.
J... | [
{
"code": null,
"e": 2147,
"s": 2039,
"text": "Following example showcase how to show a Open File dialog to select only images in swing based application."
},
{
"code": null,
"e": 2180,
"s": 2147,
"text": "We are using the following APIs."
},
{
"code": null,
"e": 2221... |
How to scale down an image with CSS to make it responsive | To make an image responsive, you can try to run the following code:
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<img src = "https://www.tutorialspoint.com/videotutorials/images/coding_... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "To make an image responsive, you can try to run the following code:"
},
{
"code": null,
"e": 1140,
"s": 1130,
"text": "Live Demo"
},
{
"code": null,
"e": 1472,
"s": 1140,
"text": "<!DOCTYPE html>\n<html>\n <head... |
Draw a filled polygon using the OpenCV function fillPoly() | In this program, we will draw a filled polygon using the opencv function fillPoly(). The function takes in an image and the endpoints of the polygon.
Step 1: Import cv2 and numpy.
Step 2: Define the endpoints.
Step 3: Define the image using zeros.
Step 4: Draw the polygon using the fillpoly() function.
Step 5: Display ... | [
{
"code": null,
"e": 1212,
"s": 1062,
"text": "In this program, we will draw a filled polygon using the opencv function fillPoly(). The function takes in an image and the endpoints of the polygon."
},
{
"code": null,
"e": 1394,
"s": 1212,
"text": "Step 1: Import cv2 and numpy.\nS... |
Cleaning and Extracting JSON From Pandas DataFrames | by Mikio Harman | Towards Data Science | Someone I know came across an interesting problem recently that took me a minute to figure out. They had found this data on Kaggle that contained columns with JSON embedded in them. There were multiple of these columns and they wanted to extract the data from these columns and represent them on the same DataFrame.
Letโ... | [
{
"code": null,
"e": 488,
"s": 172,
"text": "Someone I know came across an interesting problem recently that took me a minute to figure out. They had found this data on Kaggle that contained columns with JSON embedded in them. There were multiple of these columns and they wanted to extract the data ... |
Difference between attributes and properties in Python - GeeksforGeeks | 20 Aug, 2020
Class Attribute: Class Attributes are unique to each class. Each instance of the class will have this attribute.
Example:
Python3
# declare a classclass Employee: # class attribute count = 0 # define a method def increase(self): Employee.count += 1 # create an Emp... | [
{
"code": null,
"e": 23927,
"s": 23899,
"text": "\n20 Aug, 2020"
},
{
"code": null,
"e": 24041,
"s": 23927,
"text": "Class Attribute: Class Attributes are unique to each class. Each instance of the class will have this attribute. "
},
{
"code": null,
"e": 24050,
"... |
Project: Predicting Heart Disease with Classification Machine Learning Algorithms | by Jarar Zaidi | Towards Data Science | 1. Introduction: Scenario & Goals, Features & Predictor
2. Data Wrangling
3. Exploratory Data Analysis: Correlations, Violin & Box Plots, Filtering data by positive & negative Heart Disease patient
4. Machine Learning + Predictive Analytics: Prepare Data for Modeling, Modeling/Training, Confusion Matrix, Feature Import... | [
{
"code": null,
"e": 228,
"s": 172,
"text": "1. Introduction: Scenario & Goals, Features & Predictor"
},
{
"code": null,
"e": 246,
"s": 228,
"text": "2. Data Wrangling"
},
{
"code": null,
"e": 370,
"s": 246,
"text": "3. Exploratory Data Analysis: Correlations,... |
How to use JavaScript Fetch API to Get Data ? - GeeksforGeeks | 08 Jan, 2021
The Fetch API provides a JavaScript interface that enables users to manipulate and access parts of the HTTP pipeline such as responses and requests.
Fetch API has so many rich and exciting options like method, headers, body, referrer, mode, credentials, cache, redirect, integrity and few more. However, t... | [
{
"code": null,
"e": 25007,
"s": 24976,
"text": " \n08 Jan, 2021\n"
},
{
"code": null,
"e": 25157,
"s": 25007,
"text": "The Fetch API provides a JavaScript interface that enables users to manipulate and access parts of the HTTP pipeline such as responses and requests. "
},
{
... |
Tryit Editor v3.7 | Tryit: HTML rgba color values | [] |
Create a mirror tree from the given binary tree in C++ Program | In this tutorial, we are going to reflect the given binary tree.
Let's see the steps to solve the problem.
Write a struct node.
Write a struct node.
Create the binary tree with dummy data.
Create the binary tree with dummy data.
Write a recursive function to find the mirror of the given binary tree.Recursively call the... | [
{
"code": null,
"e": 1127,
"s": 1062,
"text": "In this tutorial, we are going to reflect the given binary tree."
},
{
"code": null,
"e": 1169,
"s": 1127,
"text": "Let's see the steps to solve the problem."
},
{
"code": null,
"e": 1190,
"s": 1169,
"text": "Writ... |
Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum - GeeksforGeeks | 30 Mar, 2022
Given an Array[] of N elements and a number K. ( 1 <= K <= N ) . Split the given array into K subarrays (they must cover all the elements). The maximum subarray sum achievable out of K subarrays formed, must be the minimum possible. Find that possible subarray sum.Examples:
Input : Array[] = {1, 2, 3, 4}, ... | [
{
"code": null,
"e": 26623,
"s": 26595,
"text": "\n30 Mar, 2022"
},
{
"code": null,
"e": 26898,
"s": 26623,
"text": "Given an Array[] of N elements and a number K. ( 1 <= K <= N ) . Split the given array into K subarrays (they must cover all the elements). The maximum subarray su... |
Minimize cost to reach a cell in Matrix using horizontal, vertical and diagonal moves - GeeksforGeeks | 20 Jan, 2022
Given two points P1(x1, y1) and P2(x2, y2) of a matrix, the task is to find the minimum cost to reach P2 from P1 when:
A horizontal or vertical movement in any direction cost 1 unit
A diagonal movement in any direction costs 0 unit.
Examples:
Input: P1 = {7, 4}, P2 = {4, 4}Output: 1Explanation: The movemen... | [
{
"code": null,
"e": 25941,
"s": 25913,
"text": "\n20 Jan, 2022"
},
{
"code": null,
"e": 26060,
"s": 25941,
"text": "Given two points P1(x1, y1) and P2(x2, y2) of a matrix, the task is to find the minimum cost to reach P2 from P1 when:"
},
{
"code": null,
"e": 26123,
... |
Microsoft Interview Experience for SDE-2 - GeeksforGeeks | 12 May, 2021
Microsoft interview Experience for SDE-2 for Noida location, 2021. Iโll share my experience in this post and I hope it will be beneficial for some of you. I have around 5 years of experience working as a Java Developer(Backend). The interview was conducted as part of their hiring drive and all the intervi... | [
{
"code": null,
"e": 26383,
"s": 26355,
"text": "\n12 May, 2021"
},
{
"code": null,
"e": 26795,
"s": 26383,
"text": "Microsoft interview Experience for SDE-2 for Noida location, 2021. Iโll share my experience in this post and I hope it will be beneficial for some of you. I have a... |
Print all interleavings of given two strings - GeeksforGeeks | 12 Jan, 2022
Given two strings str1 and str2, write a function that prints all interleavings of the given two strings. You may assume that all characters in both strings are different Example:
Input: str1 = "AB", str2 = "CD"
Output:
ABCD
ACBD
ACDB
CABD
CADB
CDAB
Input: str1 = "AB", str2 = "... | [
{
"code": null,
"e": 26015,
"s": 25987,
"text": "\n12 Jan, 2022"
},
{
"code": null,
"e": 26197,
"s": 26015,
"text": "Given two strings str1 and str2, write a function that prints all interleavings of the given two strings. You may assume that all characters in both strings are di... |
PyQt5 Label โ Make shadow disappear according to user - GeeksforGeeks | 10 May, 2020
In this article we will see how we can make the shadow disappear of the label according to the user. Shadow will be shown and disappear when user make the radio button checked and will appear when radio button is unchecked.
In order to do this we use setEnabled method
Syntax : shadow.setEnabled(bool)
Argum... | [
{
"code": null,
"e": 25981,
"s": 25953,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 26205,
"s": 25981,
"text": "In this article we will see how we can make the shadow disappear of the label according to the user. Shadow will be shown and disappear when user make the radio bu... |
Type Conversion in C++ - GeeksforGeeks | 22 Oct, 2018
A type cast is basically a conversion from one type to another. There are two types of type conversion:
Implicit Type Conversion Also known as โautomatic type conversionโ.Done by the compiler on its own, without any external trigger from the user.Generally takes place when in an expression more than one da... | [
{
"code": null,
"e": 25911,
"s": 25883,
"text": "\n22 Oct, 2018"
},
{
"code": null,
"e": 26015,
"s": 25911,
"text": "A type cast is basically a conversion from one type to another. There are two types of type conversion:"
},
{
"code": null,
"e": 28346,
"s": 26015,... |
Python | Add dictionary to tuple - GeeksforGeeks | 04 Aug, 2021
Sometimes, while working with data, we can have a problem in which we need to append to a tuple a new record which is of form of Python dictionary. This kind of application can come in web development domain in case of composite attributes. Letโs discuss certain ways in which this task can be performed.Met... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 26060,
"s": 25537,
"text": "Sometimes, while working with data, we can have a problem in which we need to append to a tuple a new record which is of form of Python dictionary. This kind of ap... |
Python | Find fibonacci series upto n using lambda - GeeksforGeeks | 17 Mar, 2019
The Fibonacci numbers are the numbers in the following integer sequence.
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ........
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence relation
Fn = Fn-1 + Fn-2 with seed values F0 = 0 and F1 = 1.
Find the series of fibona... | [
{
"code": null,
"e": 26371,
"s": 26343,
"text": "\n17 Mar, 2019"
},
{
"code": null,
"e": 26444,
"s": 26371,
"text": "The Fibonacci numbers are the numbers in the following integer sequence."
},
{
"code": null,
"e": 26499,
"s": 26444,
"text": "0, 1, 1, 2, 3, 5,... |
Mutating column in dplyr using rowSums - GeeksforGeeks | 24 Oct, 2021
In this article, we are going to discuss how to mutate columns in dataframes using the dplyr package in R Programming Language.
The package can be downloaded and installed in the R working space using the following command :
Install Command โ install.packages(โdplyrโ)
Load Command โ library(โdplyrโ)
muta... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n24 Oct, 2021"
},
{
"code": null,
"e": 26616,
"s": 26487,
"text": "In this article, we are going to discuss how to mutate columns in dataframes using the dplyr package in R Programming Language. "
},
{
"code": null,
"e... |
Program to print mirror image of Swastika Pattern - GeeksforGeeks | 19 Apr, 2021
Given the number of rows and columns, print the mirror image of swastika pattern.Note : The number of rows and columns should be same and an odd number. This will generate a perfect mirror image of swastika pattern. Examples :
Input : row = 5, col = 5
Output :
* * * *
* *
* * * * *
* *
* * * ... | [
{
"code": null,
"e": 25665,
"s": 25637,
"text": "\n19 Apr, 2021"
},
{
"code": null,
"e": 25894,
"s": 25665,
"text": "Given the number of rows and columns, print the mirror image of swastika pattern.Note : The number of rows and columns should be same and an odd number. This will ... |
Avengers Endgame and Deep learning | Image Caption Generation using the Avengers EndGames Characters - GeeksforGeeks | 27 Jul, 2019
Behold, Marvel Fans. Avengers are out there to save the Multiverse, so are we, ready to do whatever it takes to support them.In this article, we will use Deep Learning and computer vision for the caption generation of Avengers Endgame characters. We will start will the basics, explaining concepts and use a... | [
{
"code": null,
"e": 25707,
"s": 25679,
"text": "\n27 Jul, 2019"
},
{
"code": null,
"e": 26059,
"s": 25707,
"text": "Behold, Marvel Fans. Avengers are out there to save the Multiverse, so are we, ready to do whatever it takes to support them.In this article, we will use Deep Lear... |
CSS | element > element Selector - GeeksforGeeks | 03 Jan, 2019
The element > element selector in CSS is used to style only those elements which are the children of specific parent.
The operand on the left of > is the parent and the operand on the right is the children element.
Note: Elements that are not directly a child of the specified parent, are not selected.
Synt... | [
{
"code": null,
"e": 24983,
"s": 24955,
"text": "\n03 Jan, 2019"
},
{
"code": null,
"e": 25101,
"s": 24983,
"text": "The element > element selector in CSS is used to style only those elements which are the children of specific parent."
},
{
"code": null,
"e": 25198,
... |
Flask Rendering Templates - GeeksforGeeks | 13 May, 2022
Flask is a backend web framework based on the Python programming language. It basically allows creating web applications in a Pythonic syntax and concepts. With Flask, we can use Python libraries and tools in our web applications. Using Flask we can set up a webserver to load up some basic HTML templates a... | [
{
"code": null,
"e": 25565,
"s": 25537,
"text": "\n13 May, 2022"
},
{
"code": null,
"e": 25984,
"s": 25565,
"text": "Flask is a backend web framework based on the Python programming language. It basically allows creating web applications in a Pythonic syntax and concepts. With Fl... |
GATE | GATE-CS-2015 (Set 2) | Question 65 - GeeksforGeeks | 28 Jun, 2021
Consider two decision problems Q1, Q2 such that Q1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2. Then which one of the following is consistent with the above statement?(A) Q1 is in NP, Q2 is NP hard(B) Q2 is in NP, Q1 is NP hard(C) Both Q1 and Q2 are in NP(D) Both Q1 and Q... | [
{
"code": null,
"e": 25563,
"s": 25535,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25910,
"s": 25563,
"text": "Consider two decision problems Q1, Q2 such that Q1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2. Then which one of the following ... |
How to Fix Minimal BASH Like Line Editing is Supported GRUB Error In Linux? - GeeksforGeeks | 11 Nov, 2019
GNU GRUB (Stands for GNU GRand Unified Bootloader) is a boot loader package. It is a part of the GNU project. It is the reference implementation of the Free Software Foundationโs Multiboot Specification, that provides a user the choice to boot one of multiple operating systems installed on a computer. It a... | [
{
"code": null,
"e": 25521,
"s": 25493,
"text": "\n11 Nov, 2019"
},
{
"code": null,
"e": 26029,
"s": 25521,
"text": "GNU GRUB (Stands for GNU GRand Unified Bootloader) is a boot loader package. It is a part of the GNU project. It is the reference implementation of the Free Softwa... |
hmac โ Keyed-Hashing for Message Authentication | 20 Jul, 2017
HMAC is a mechanism for message authentication using cryptographic hash functions. HMAC can be used with any iterative cryptographic hash function, e.g., MD5, SHA-1, in combination with a secret shared key.This module implements the HMAC algorithm. The basic idea is to generate a cryptographic hash of the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jul, 2017"
},
{
"code": null,
"e": 529,
"s": 28,
"text": "HMAC is a mechanism for message authentication using cryptographic hash functions. HMAC can be used with any iterative cryptographic hash function, e.g., MD5, SHA-1, in combin... |
typeof Operator Keyword in C# | 20 Jun, 2021
The typeof is an operator keyword which is used to get a type at the compile-time. Or in other words, this operator is used to get the System.Type object for a type. This operator takes the Type itself as an argument and returns the marked type of the argument. Important points:
The operand of typeof ope... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n20 Jun, 2021"
},
{
"code": null,
"e": 336,
"s": 54,
"text": "The typeof is an operator keyword which is used to get a type at the compile-time. Or in other words, this operator is used to get the System.Type object for a type. This ope... |
Python program to find number of likes and dislikes | 30 Jan, 2020
Alice and Bob made a list of topics and both of them voted if they like or dislike the topic. They wrote 0 to denote dislike and 1 to denote like. The task is to count the number of topics that both of them like or dislike.
Examples:
Input: alice = โ010101โ bob = โ101101โOutput: 3alice and bob both like 4t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jan, 2020"
},
{
"code": null,
"e": 252,
"s": 28,
"text": "Alice and Bob made a list of topics and both of them voted if they like or dislike the topic. They wrote 0 to denote dislike and 1 to denote like. The task is to count the num... |
How to find standard deviations for all columns of an R data frame? | To find the means of all columns in an R data frame, we can simply use colMeans function and it returns the mean. But for standard deviations, we do not have any direct function that can be used; therefore, we can use sd with apply and reference the columns to find the standard deviations for all column of an R data fr... | [
{
"code": null,
"e": 1787,
"s": 1187,
"text": "To find the means of all columns in an R data frame, we can simply use colMeans function and it returns the mean. But for standard deviations, we do not have any direct function that can be used; therefore, we can use sd with apply and reference the col... |
What are the encodeURI() and decodeURI() in JavaScript ? | 19 Oct, 2021
URLs and URIs are designed to locate/identify resources available over the internet, anything that uniquely identifies a resource is its URI, such as id, name. A URL specifies a resource and its access protocol. All URLs are URIs, but not all URIs are URLs. URI can only have certain characters from the sta... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 956,
"s": 52,
"text": "URLs and URIs are designed to locate/identify resources available over the internet, anything that uniquely identifies a resource is its URI, such as id, name. A URL specifie... |
Http Request methods โ Python requests | 06 Aug, 2021
Python requests module has several built-in methods to make Http requests to specified URI using GET, POST, PUT, PATCH or HEAD requests. A Http request is meant to either retrieve data from a specified URI or to push data to a server. It works as a request-response protocol between a client and server. A w... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Aug, 2021"
},
{
"code": null,
"e": 540,
"s": 28,
"text": "Python requests module has several built-in methods to make Http requests to specified URI using GET, POST, PUT, PATCH or HEAD requests. A Http request is meant to either retr... |
Python โ Get the object with the max attribute value in a list of objects | 04 Jan, 2022
Given a list of objects, the task is to write a Python program to get the object with the max attribute value in a list of objects using Python.
This task can be achieved by using the max() method and attrgetter operator. It returns a callable object that fetches attr from its operand. If more than one at... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Jan, 2022"
},
{
"code": null,
"e": 199,
"s": 53,
"text": "Given a list of objects, the task is to write a Python program to get the object with the max attribute value in a list of objects using Python. "
},
{
"code": null,
... |
How to set a Responsive Full Background Image Using CSS ? | 31 Mar, 2021
The purpose of this article is to set a Responsive Full Background Image Using CSS.
To set a Responsive Full Background Image using CSS we will use the CSS background-size property that has a value auto that tells the browsers to automatically scale the imageโs width and height based on the container, to m... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Mar, 2021"
},
{
"code": null,
"e": 138,
"s": 54,
"text": "The purpose of this article is to set a Responsive Full Background Image Using CSS."
},
{
"code": null,
"e": 492,
"s": 138,
"text": "To set a Responsive F... |
How to create a rank variable using mutate function of dplyr package in R? | A rank variable is created to convert a numerical variable into ordinal variable. This is useful for non-parametric analysis because if the distribution of the numerical variable is not normal or there are assumptions of parametric analysis that cannot be followed by the numerical variable then the raw variable values ... | [
{
"code": null,
"e": 1615,
"s": 1187,
"text": "A rank variable is created to convert a numerical variable into ordinal variable. This is useful for non-parametric analysis because if the distribution of the numerical variable is not normal or there are assumptions of parametric analysis that cannot ... |
Python program to find the longest word in a sentence | 10 Feb, 2021
Given a string S consisting of lowercase English alphabets, the task is to print the longest word present in the given string in python.
Examples:
Input: S = โbe confident and be yourselfโOutput: โconfidentโExplanation:Words present in the sentence are โbeโ, โconfidentโ, โandโ, โbeโ and โyourselfโ.Length o... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n10 Feb, 2021"
},
{
"code": null,
"e": 190,
"s": 53,
"text": "Given a string S consisting of lowercase English alphabets, the task is to print the longest word present in the given string in python."
},
{
"code": null,
"e": ... |
Scala | Trait App | 12 Apr, 2019
App is a trait which is utilized to rapidly change objects into feasible programs, which is carried out by applying DelayedInit function and the objects inheriting the trait App uses this function to execute the entire body of the program as a section of an inherited main method.Note:
trait App extends Del... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Apr, 2019"
},
{
"code": null,
"e": 314,
"s": 28,
"text": "App is a trait which is utilized to rapidly change objects into feasible programs, which is carried out by applying DelayedInit function and the objects inheriting the trait A... |
How to replace a word in excel using Python? | 29 Aug, 2020
Excel is a very useful tool where we can have the data in the format of rows and columns. We can say that before the database comes into existence, excel played an important role in the storage of data. Nowadays using Excel input, many batch processing is getting done. There may be the requirement of repla... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 510,
"s": 52,
"text": "Excel is a very useful tool where we can have the data in the format of rows and columns. We can say that before the database comes into existence, excel played an important ... |
Selenium Python Tricks | 25 Aug, 2021
Selenium: Selenium Python bindings provide a convenient API to access Selenium Web Driver like Firefox, Chrome, etc.What is webdriver? Selenium WebDriver is an automation testing tool. When I say automation, it means it automates test scripts written in Selenium.Webdriver Install
Chrome: https://sites... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Aug, 2021"
},
{
"code": null,
"e": 337,
"s": 54,
"text": "Selenium: Selenium Python bindings provide a convenient API to access Selenium Web Driver like Firefox, Chrome, etc.What is webdriver? Selenium WebDriver is an automation tes... |
Python | Detect Polygons in an Image using OpenCV | 13 Oct, 2019
Approach : The approach we would be used to detect the shape of a given polygon will be based on classifying the detected shape on the basis of a number of sides it has. For example, if the detected polynomial has 3 sides, then it could be considered as a triangle, if the polynomial has 4 sides then it cou... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Oct, 2019"
},
{
"code": null,
"e": 380,
"s": 28,
"text": "Approach : The approach we would be used to detect the shape of a given polygon will be based on classifying the detected shape on the basis of a number of sides it has. For e... |
Maximum value in record list as tuple attribute in Python | When it is required to find the maximum value in a record list of tuples, the list comprehension and the 'max' methods can be used.
A list can be used to store heterogeneous values (i.e data of any data type like integer, floating point, strings, and so on).
A list of tuple basically contains tuples enclosed in a list.... | [
{
"code": null,
"e": 1319,
"s": 1187,
"text": "When it is required to find the maximum value in a record list of tuples, the list comprehension and the 'max' methods can be used."
},
{
"code": null,
"e": 1446,
"s": 1319,
"text": "A list can be used to store heterogeneous values (... |
How can I update the boolean values in MySQL? | You can update boolean value using UPDATE command. If you use the BOOLEAN data type, MySQL internally convert it into tinyint(1). It can takes true or false literal in which true indicates 1 to tinyint(1) and false indicates 0 to tinyint(1).
The syntax is as follows โ
UPDATE yourTableName SET yourColumnName = yourValue... | [
{
"code": null,
"e": 1429,
"s": 1187,
"text": "You can update boolean value using UPDATE command. If you use the BOOLEAN data type, MySQL internally convert it into tinyint(1). It can takes true or false literal in which true indicates 1 to tinyint(1) and false indicates 0 to tinyint(1)."
},
{
... |
Count number of ways to divide an array into two halves with same sum | 30 May, 2022
Given an integer array of N elements. The task is to find the number of ways to split the array into two equal sum sub-arrays of non-zero lengths.
Examples:
Input: arr[] = {0, 0, 0, 0}Output: 3 Explanation:All the possible ways are: { {{0}, {0, 0, 0}}, {{0, 0}, {0, 0}}, {{0, 0, 0}, {0}} Therefore, the req... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 May, 2022"
},
{
"code": null,
"e": 199,
"s": 52,
"text": "Given an integer array of N elements. The task is to find the number of ways to split the array into two equal sum sub-arrays of non-zero lengths."
},
{
"code": null,... |
Reflection In 2D Graphics | 12 Oct, 2020
Reflection deals with obtaining a mirror image of the 2D object.
About x-axis: If P(x, y) is the point on x-y plane then Pโ(xโ, yโ) is the reflection about x-axis given as xโ=x ; yโ=-y
Matrix Form:
About y-axis : If P(x, y) is the point on x-y plane then Pโ(xโ, yโ) is the reflection about y-axis giv... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Oct, 2020"
},
{
"code": null,
"e": 94,
"s": 28,
"text": "Reflection deals with obtaining a mirror image of the 2D object. "
},
{
"code": null,
"e": 215,
"s": 94,
"text": "About x-axis: If P(x, y) is the point on x... |
StringBuffer setCharAt() method in Java with Examples | 04 Dec, 2018
The setCharAt() method of StringBuffer class sets the character at the position index to character which is the value passed as parameter to method. This method returns a new sequence which is identical to old sequence only difference is a new character ch is present at position index in new sequence. The ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 459,
"s": 28,
"text": "The setCharAt() method of StringBuffer class sets the character at the position index to character which is the value passed as parameter to method. This method returns a new ... |
Get table names using SELECT statement in MySQL? | To get table names using SELECT statement, use โinformation_schema.tablesโ. Let us see an example, wherein we have a database that contains 3 tables. The syntax to get all table names with the help of SELECT statement.
SELECT Table_name as TablesName from information_schema.tables where table_schema = 'yourDatabaseName... | [
{
"code": null,
"e": 1406,
"s": 1187,
"text": "To get table names using SELECT statement, use โinformation_schema.tablesโ. Let us see an example, wherein we have a database that contains 3 tables. The syntax to get all table names with the help of SELECT statement."
},
{
"code": null,
"e... |
Sorting a HashMap according to keys in Java | As we know that Hash map in Java does not maintain insertion order either by key or by order.Also it does not maintain any other order while adding entries to it.
But Java provide another API named as TreeMap which maintain its insertion order sorted according to the natural ordering of its keys.So in order to sort our... | [
{
"code": null,
"e": 1225,
"s": 1062,
"text": "As we know that Hash map in Java does not maintain insertion order either by key or by order.Also it does not maintain any other order while adding entries to it."
},
{
"code": null,
"e": 1604,
"s": 1225,
"text": "But Java provide an... |
Spring MVC - Hibernate Validator Example | The following example shows how to use Error Handling and Validators in forms using the Spring Web MVC framework. To begin with, let us have a working Eclipse IDE in place and adhere to the following steps to develop a Dynamic Form based Web Application using the Spring Web Framework.
package com.tutorialspoint;
impor... | [
{
"code": null,
"e": 3077,
"s": 2791,
"text": "The following example shows how to use Error Handling and Validators in forms using the Spring Web MVC framework. To begin with, let us have a working Eclipse IDE in place and adhere to the following steps to develop a Dynamic Form based Web Application... |
Optimization โ Descent Algorithms | by Omar Aflak | Towards Data Science | Many algorithms used in Machine Learning are based on basic mathematical optimization methods. Discovering these algorithms directly in the context of Machine Learning might be confusing because of all the prerequisites. Thus, I think it might be a good idea to see these algorithms free of any context in order to get a... | [
{
"code": null,
"e": 535,
"s": 172,
"text": "Many algorithms used in Machine Learning are based on basic mathematical optimization methods. Discovering these algorithms directly in the context of Machine Learning might be confusing because of all the prerequisites. Thus, I think it might be a good i... |
How to modify column default value in MySQL? | Let us first create a table โ
mysql> create table DemoTable
(
UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
UserName varchar(20) DEFAULT 'John'
);
Query OK, 0 rows affected (0.76 sec)
Let us check the description of table โ
mysql> desc DemoTable;
This will produce the following output โ
+----------+------------... | [
{
"code": null,
"e": 1092,
"s": 1062,
"text": "Let us first create a table โ"
},
{
"code": null,
"e": 1254,
"s": 1092,
"text": "mysql> create table DemoTable\n(\n UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n UserName varchar(20) DEFAULT 'John'\n);\nQuery OK, 0 rows affec... |
C - Play with Strings | C - Programming HOME
C - Basic Introduction
C - Program Structure
C - Reserved Keywords
C - Basic Datatypes
C - Variable Types
C - Storage Classes
C - Using Constants
C - Operator Types
C - Control Statements
C - Input and Output
C - Pointing to Data
C - Using Functions
C - Play with Strings
C - Structured Datatypes
C ... | [
{
"code": null,
"e": 1475,
"s": 1454,
"text": "C - Programming HOME"
},
{
"code": null,
"e": 1498,
"s": 1475,
"text": "C - Basic Introduction"
},
{
"code": null,
"e": 1520,
"s": 1498,
"text": "C - Program Structure"
},
{
"code": null,
"e": 1542,
... |
Introducing a simple and intuitive Python API for UCI machine learning repository | by Tirthajyoti Sarkar | Towards Data Science | Introducing a simple and intuitive API for UCI machine learning portal, where users can easily look up a data set description, search for a particular data set they are interested, and even download datasets categorized by size or machine learning task.
UCI machine learning dataset repository is something of a legend i... | [
{
"code": null,
"e": 426,
"s": 172,
"text": "Introducing a simple and intuitive API for UCI machine learning portal, where users can easily look up a data set description, search for a particular data set they are interested, and even download datasets categorized by size or machine learning task."
... |
Find all substrings in a string using C# | Use the substring() method in C# to find all substrings in a string.
Letโs say our string is โ
pqr
Loop through the length of the string and use the Substring function from the beginning to the end of the string โ
for (int start = 0; start <= str.Length - i; start++) {
string substr = str.Substring(start, i);
Con... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "Use the substring() method in C# to find all substrings in a string."
},
{
"code": null,
"e": 1157,
"s": 1131,
"text": "Letโs say our string is โ"
},
{
"code": null,
"e": 1161,
"s": 1157,
"text": "pqr"
},
{
... |
Create a Video and Audio Recorder with JavaScript MediaRecorder API - GeeksforGeeks | 16 Mar, 2021
WebRTC is very popular for accessing device cameras and device microphones and streaming the video or audio media in the browser. But in many cases, we might need to record the streaming for future use or for users (Like user might want to download the streaming, etc.). In that case, we can use the MediaRe... | [
{
"code": null,
"e": 25376,
"s": 25348,
"text": "\n16 Mar, 2021"
},
{
"code": null,
"e": 25725,
"s": 25376,
"text": "WebRTC is very popular for accessing device cameras and device microphones and streaming the video or audio media in the browser. But in many cases, we might need ... |
Difference Between InputStream and OutputStream in Java - GeeksforGeeks | 28 Jan, 2021
A stream can be defined as the sequence of data or continuous flow of data. Streams are a clear way to deal with Input/Output. Streams are of two types as Depicted below:
In the above diagram, our InputStream and OutputStream will reside in Byte Stream. So letโs discuss byte Stream.
1. Byte Stream: Byte St... | [
{
"code": null,
"e": 24882,
"s": 24854,
"text": "\n28 Jan, 2021"
},
{
"code": null,
"e": 25053,
"s": 24882,
"text": "A stream can be defined as the sequence of data or continuous flow of data. Streams are a clear way to deal with Input/Output. Streams are of two types as Depicted... |
Find the Substring with maximum product - GeeksforGeeks | 18 Nov, 2021
Given string str containing only lowercase English alphabets of size N, the task is to find the substring having the maximum product.
Each English alphabet has a value such that val(โaโ) = 0, val(โbโ) = 1, val(โcโ) = 2, ......, val(โzโ) = 25.
Examples:
Input: str = โsdtfakdhdahdzzโ Output: hdzz Here, t... | [
{
"code": null,
"e": 24716,
"s": 24688,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 24852,
"s": 24716,
"text": "Given string str containing only lowercase English alphabets of size N, the task is to find the substring having the maximum product. "
},
{
"code": null,... |
Lua - Functions | A function is a group of statements that together perform a task. You can divide up your code into separate functions. How you divide up your code among different functions is up to you, but logically the division usually unique, is so each function performs a specific task.
The Lua language provides numerous built-in ... | [
{
"code": null,
"e": 2379,
"s": 2103,
"text": "A function is a group of statements that together perform a task. You can divide up your code into separate functions. How you divide up your code among different functions is up to you, but logically the division usually unique, is so each function per... |
JavaMail API - SMTP Servers | SMTP is an acronym for Simple Mail Transfer Protocol. It is an Internet standard for electronic mail (e-mail) transmission across Internet Protocol (IP) networks. SMTP uses TCP port 25. SMTP connections secured by SSL are known by the shorthand SMTPS, though SMTPS is not a protocol in its own right.
JavaMail API has pa... | [
{
"code": null,
"e": 2372,
"s": 2071,
"text": "SMTP is an acronym for Simple Mail Transfer Protocol. It is an Internet standard for electronic mail (e-mail) transmission across Internet Protocol (IP) networks. SMTP uses TCP port 25. SMTP connections secured by SSL are known by the shorthand SMTPS, t... |
Using Genetic Algorithms to Schedule Timetables | by Vijini Mallawaarachchi | Towards Data Science | Genetic algorithms are a type of evolutionary algorithms that are inspired by the process of natural selection. I have already introduced genetic algorithms in my previous article, Introduction to Genetic Algorithms โ Including Example Code. Go check it out if you havenโt already!
towardsdatascience.com
Recently I noti... | [
{
"code": null,
"e": 453,
"s": 171,
"text": "Genetic algorithms are a type of evolutionary algorithms that are inspired by the process of natural selection. I have already introduced genetic algorithms in my previous article, Introduction to Genetic Algorithms โ Including Example Code. Go check it o... |
Second minimum element using minimum comparisons - GeeksforGeeks | 11 Feb, 2018
Given an array of integers, find the minimum (or maximum) element and the element just greater (or smaller) than that in less than 2n comparisons. The given array is not necessarily sorted. Extra space is allowed.
Examples:
Input: {3, 6, 100, 9, 10, 12, 7, -1, 10}
Output: Minimum: -1, Second minimum: 3
We... | [
{
"code": null,
"e": 24095,
"s": 24067,
"text": "\n11 Feb, 2018"
},
{
"code": null,
"e": 24309,
"s": 24095,
"text": "Given an array of integers, find the minimum (or maximum) element and the element just greater (or smaller) than that in less than 2n comparisons. The given array ... |
Python Pandas - Get the Names of levels in MultiIndex | To get the Names of levels in MultiIndex, use the MultiIndex.names property in Pandas. At first, import the required libraries โ
import pandas as pd
MultiIndex is a multi-level, or hierarchical, index object for pandas objects. Create arrays โ
arrays = [[1, 2, 3, 4, 5], ['John', 'Tim', 'Jacob', 'Chris', 'Keiron']]
The... | [
{
"code": null,
"e": 1191,
"s": 1062,
"text": "To get the Names of levels in MultiIndex, use the MultiIndex.names property in Pandas. At first, import the required libraries โ"
},
{
"code": null,
"e": 1211,
"s": 1191,
"text": "import pandas as pd"
},
{
"code": null,
"... |
Check whether an array can be made strictly increasing by removing at most one element - GeeksforGeeks | 25 Aug, 2021
Given an array arr[] consisting of N integers, the task is to check whether it is possible to make the given array strictly increasing by removing at most one element. If it is possible to make the array strictly increasing, then print โYesโ. Otherwise, print โNoโ.
Examples:
Input: arr[] = {1, 1, 2}Output:... | [
{
"code": null,
"e": 24822,
"s": 24794,
"text": "\n25 Aug, 2021"
},
{
"code": null,
"e": 25088,
"s": 24822,
"text": "Given an array arr[] consisting of N integers, the task is to check whether it is possible to make the given array strictly increasing by removing at most one elem... |
Remove first two characters of all fields in MySQL? | To remove the first two characters of all fields, you need to use SUBSTRING() function from MySQL. The syntax is as follows โ
UPDATE yourTableName SET yourColumnName=SUBSTRING(yourColumnName,3)
WHERE yourCondition;
To understand the above syntax, let us create a table. The query to create a table is as follows โ
mysql>... | [
{
"code": null,
"e": 1188,
"s": 1062,
"text": "To remove the first two characters of all fields, you need to use SUBSTRING() function from MySQL. The syntax is as follows โ"
},
{
"code": null,
"e": 1277,
"s": 1188,
"text": "UPDATE yourTableName SET yourColumnName=SUBSTRING(yourCo... |
Queries to check if substring[L...R] is palindrome or not in C++ Program | In this problem, we are given string str, Q number of queries each consisting of two values L and R for substring[L...R]. Our task is to create a program to solve Queries to check if substring[L...R] is palindrome or not.
Problem Description โ For solving each query, we need to check whether the substring created withi... | [
{
"code": null,
"e": 1284,
"s": 1062,
"text": "In this problem, we are given string str, Q number of queries each consisting of two values L and R for substring[L...R]. Our task is to create a program to solve Queries to check if substring[L...R] is palindrome or not."
},
{
"code": null,
... |
Is it possible to use variable for collection name using PyMongo? | PyMongo is a Python distribution containing tools for working with MongoDB. Use the following syntax to use a variable for collection name โ
var yourVariableName="yourCollectionName";
db[storeCollectionName].yourOperationName;
To understand the above syntax, let us create a collection with the document. The query to c... | [
{
"code": null,
"e": 1203,
"s": 1062,
"text": "PyMongo is a Python distribution containing tools for working with MongoDB. Use the following syntax to use a variable for collection name โ"
},
{
"code": null,
"e": 1290,
"s": 1203,
"text": "var yourVariableName=\"yourCollectionName... |
Simulation | A simulation is a computer model that mimics the operation of a real or proposed system and it is time based and takes into account all the resources and constraints involved.
Cost
Cost
Repeatability
Repeatability
Time
Time
A mobile simulator also known as emulator, a software that can be installed on a normal desktop... | [
{
"code": null,
"e": 5922,
"s": 5745,
"text": "A simulation is a computer model that mimics the operation of a real or proposed system and it is time based and takes into account all the resources and constraints involved. "
},
{
"code": null,
"e": 5927,
"s": 5922,
"text": "Cost"... |
Pascal - Sets | A set is a collection of elements of same type. Pascal allows defining the set data type. The elements in a set are called its members. In mathematics, sets are represented by enclosing the members within braces{}. However, in Pascal, set elements are enclosed within square brackets [], which are referred as set const... | [
{
"code": null,
"e": 2411,
"s": 2083,
"text": "A set is a collection of elements of same type. Pascal allows defining the set data type. The elements in a set are called its members. In mathematics, sets are represented by enclosing the members within braces{}. However, in Pascal, set elements are ... |
HTML | Marquee scrollamount attribute | 14 Jan, 2022
The Marquee scrollamount attribute in HTML is used to set the amount of scrolling at each interval in pixels. The default speed of the marquee value is 6.Syntax:
<marquee scrollamount=number >
Attribute value:
Number: Define the speed value.
Example:
html
<!DOCTYPE html><html> <head> <title>HTML M... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jan, 2022"
},
{
"code": null,
"e": 192,
"s": 28,
"text": "The Marquee scrollamount attribute in HTML is used to set the amount of scrolling at each interval in pixels. The default speed of the marquee value is 6.Syntax: "
},
{
... |
Reversing Deterministic Finite Automata | 12 Jan, 2022
Prerequisite โ Designing finite automata Reversal: We define the reversed language to be the language , where
Steps to Reversal:
Draw the states as it is.Add a new single accepting stateMake the accepting state the initial state and initial state the accepting stateInvert the transition function into a ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Jan, 2022"
},
{
"code": null,
"e": 166,
"s": 54,
"text": "Prerequisite โ Designing finite automata Reversal: We define the reversed language to be the language , where "
},
{
"code": null,
"e": 186,
"s": 166,
"t... |
Python | Modifying tuple contents with list | 20 Mar, 2019
In Python, tuples are immutable and hence no changes are required in them once they are formed. This restriction makes their processing harder and hence certain operations on tuples are quite useful to have knowledge of. This article deals with modifying the second tuple element with the list given. Letโs ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Mar, 2019"
},
{
"code": null,
"e": 383,
"s": 28,
"text": "In Python, tuples are immutable and hence no changes are required in them once they are formed. This restriction makes their processing harder and hence certain operations on ... |
stable_sort() in C++ STL | 23 Dec, 2021
stable_sort() is used to sort the elements in the range [first, last) in ascending order. It is like std::sort, but stable_sort() keeps the relative order of elements with equivalent values. It comes under the <algorithm> header file.
Syntax:
template< class RandomIterator>
void stable_sort( RandomIterator... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 287,
"s": 52,
"text": "stable_sort() is used to sort the elements in the range [first, last) in ascending order. It is like std::sort, but stable_sort() keeps the relative order of elements with eq... |
R Programming Language โ Introduction | 15 Aug, 2021
R is an open-source programming language that is widely used as a statistical software and data analysis tool. R generally comes with the Command-line interface. R is available across widely used platforms like Windows, Linux, and macOS. Also, the R programming language is the latest cutting-edge tool.
It ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Aug, 2021"
},
{
"code": null,
"e": 356,
"s": 52,
"text": "R is an open-source programming language that is widely used as a statistical software and data analysis tool. R generally comes with the Command-line interface. R is availab... |
How to log in as a different user on MySQL? | If you want to login as a different user on MySQL, you need to use โmysql -u -p commandโ. The syntax is as follows to login as a different user.
>mysql -u yourUsername -p After pressing enter key
Enter password โ
To understand the above syntax, let us create a user in MySQL. The syntax is as follows โ
CREATE USER 'your... | [
{
"code": null,
"e": 1332,
"s": 1187,
"text": "If you want to login as a different user on MySQL, you need to use โmysql -u -p commandโ. The syntax is as follows to login as a different user."
},
{
"code": null,
"e": 1400,
"s": 1332,
"text": ">mysql -u yourUsername -p After press... |
How to execute an array of synchronous and asynchronous functions in Node.js? | 07 Oct, 2021
We have an array of functions, some functions will be synchronous and some will be asynchronous. We will learn how to execute all of them in sequence.
Input:
listOfFunctions = [
() => {
console.log("Synchronous Function);
},
async () => new Promise(resolve => {
setTimeout(() => ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 203,
"s": 52,
"text": "We have an array of functions, some functions will be synchronous and some will be asynchronous. We will learn how to execute all of them in sequence."
},
{
"code": n... |
How to get slice of a Primitive Array in Java | 11 Dec, 2018
Given a Primitive Array, the task is to get a Slice of this array in Java, using start and ending index.
Examples:
Input: arr[] = {1, 2, 3, 4, 5}, startIndex = 2, endIndex = 4
Output: {3, 4, 5}
Input: arr[] = {1, 2, 3, 4, 5}, startIndex = 0, endIndex = 1
Output: {1, 2}
Method 1: Naive Method.Get the Arra... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 158,
"s": 53,
"text": "Given a Primitive Array, the task is to get a Slice of this array in Java, using start and ending index."
},
{
"code": null,
"e": 168,
"s": 158,
"text": "... |
Queries to find minimum absolute difference between adjacent array elements in given ranges | 13 Jun, 2022
Given an array arr[] consisting of N integers and an array query[] consisting of queries of the form {L, R}, the task for each query is to find the minimum of the absolute difference between adjacent elements over the range [L, R].
Examples:
Input: arr[] = {2, 6, 1, 8, 3, 4}, query[] = {{0, 3}, {1, 5}, {4,... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 260,
"s": 28,
"text": "Given an array arr[] consisting of N integers and an array query[] consisting of queries of the form {L, R}, the task for each query is to find the minimum of the absolute dif... |
File handling in Node.js | 11 Feb, 2022
The most important functionalities provided by programming languages are Reading and Writing files from the computers. Node.js provides the functionality to read and write files from the computer. Reading and Writing the file in Node.js is done by using one of the coolest Node.js modules called fs module, ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Feb, 2022"
},
{
"code": null,
"e": 430,
"s": 54,
"text": "The most important functionalities provided by programming languages are Reading and Writing files from the computers. Node.js provides the functionality to read and write fi... |
Sum of natural numbers using recursion | 16 Jun, 2022
Given a number n, find sum of first n natural numbers. To calculate the sum, we will use a recursive function recur_sum().Examples :
Input : 3
Output : 6
Explanation : 1 + 2 + 3 = 6
Input : 5
Output : 15
Explanation : 1 + 2 + 3 + 4 + 5 = 15
Below is code to find the sum of natural numbers up to n usin... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Jun, 2022"
},
{
"code": null,
"e": 187,
"s": 52,
"text": "Given a number n, find sum of first n natural numbers. To calculate the sum, we will use a recursive function recur_sum().Examples : "
},
{
"code": null,
"e": 29... |
How to Use Gzip and Keep Original File in Linux? | 19 Oct, 2021
Gzip is a command-line tool that by default comes with any Linux Operating System. Gzip is commonly used to compress and decompress files. It reduces the size of the file and replaces the original file with the extension .gz file. It can restore the compressed file using the simple command. Now letโs see h... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Oct, 2021"
},
{
"code": null,
"e": 396,
"s": 28,
"text": "Gzip is a command-line tool that by default comes with any Linux Operating System. Gzip is commonly used to compress and decompress files. It reduces the size of the file and ... |
Draw Beautiful and Interactive Line Charts Using Bokeh in Python | by Christopher Tao | Towards Data Science | The line chart is probably the most basic but useful chart that demonstrates the relationships between two dimensions. It is usually used to show the variance of a variable y over the time-axis x continuously, where the x-axis must be sorted.
It is quite easy to get insights from line charts such as whether the variabl... | [
{
"code": null,
"e": 415,
"s": 172,
"text": "The line chart is probably the most basic but useful chart that demonstrates the relationships between two dimensions. It is usually used to show the variance of a variable y over the time-axis x continuously, where the x-axis must be sorted."
},
{
... |
How to deal with glm.fit error โNA/NaN/Infโ for logistic regression model in R? | When we create a general linear model for logistic regression model, we need to specify the distribution family as binomial. The error โNA/NaN/Infโ occurs when we do not specify the distribution family. Hence, family="binomial" needs to be used inside glm function while creating the logistic regression model.
Following... | [
{
"code": null,
"e": 1373,
"s": 1062,
"text": "When we create a general linear model for logistic regression model, we need to specify the distribution family as binomial. The error โNA/NaN/Infโ occurs when we do not specify the distribution family. Hence, family=\"binomial\" needs to be used inside... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.