title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to make a Pagination using HTML and CSS ? | 13 Jun, 2022
Creating pagination is quite simple, you can easily do that by using Bootstrap, and JavaScript. However, in this article, we will use HTML and CSS to create pagination.
Pagination is helpful when the website contains lots of content on a single page, and a single page will not look good with all those top... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 223,
"s": 53,
"text": "Creating pagination is quite simple, you can easily do that by using Bootstrap, and JavaScript. However, in this article, we will use HTML and CSS to create pagination. "
}... |
Learning Vector Quantization | 16 May, 2022
Learning Vector Quantization ( or LVQ ) is a type of Artificial Neural Network which also inspired by biological models of neural systems. It is based on prototype supervised learning classification algorithm and trained its network through a competitive learning algorithm similar to Self Organizing Map. I... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 May, 2022"
},
{
"code": null,
"e": 663,
"s": 54,
"text": "Learning Vector Quantization ( or LVQ ) is a type of Artificial Neural Network which also inspired by biological models of neural systems. It is based on prototype supervised... |
How to merge properties of two JavaScript objects dynamically? | 22 Apr, 2019
Using Spread Operator: Spread operator allows an iterable to expand in places where 0+ arguments are expected. It is mostly used in the variable array where there is more than 1 values are expected. It allows the privilege to obtain a list of parameters from an array.
Javascript objects are key-value paire... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2019"
},
{
"code": null,
"e": 297,
"s": 28,
"text": "Using Spread Operator: Spread operator allows an iterable to expand in places where 0+ arguments are expected. It is mostly used in the variable array where there is more than... |
Python Random Module | 14 Dec, 2021
Python Random module is an in-built module of Python which is used to generate random numbers. These are pseudo-random numbers means these are not truly random. This module can be used to perform random actions such as generating random numbers, print random a value for a list or string, etc.
Example: Prin... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Dec, 2021"
},
{
"code": null,
"e": 346,
"s": 52,
"text": "Python Random module is an in-built module of Python which is used to generate random numbers. These are pseudo-random numbers means these are not truly random. This module c... |
MFC - Quick Guide | The Microsoft Foundation Class (MFC) library provides a set of functions, constants, data types, and classes to simplify creating applications for the Microsoft Windows operating systems. In this tutorial, you will learn all about how to start and create windows based applications using MFC.
We have assumed that you kn... | [
{
"code": null,
"e": 2494,
"s": 2201,
"text": "The Microsoft Foundation Class (MFC) library provides a set of functions, constants, data types, and classes to simplify creating applications for the Microsoft Windows operating systems. In this tutorial, you will learn all about how to start and creat... |
Training machine learning models online for free(GPU, TPU enabled)!!! | by Maithreyan Surya | Towards Data Science | Computation power needed to train machine learning and deep learning model on large datasets, has always been a huge hindrance for machine learning enthusiast. But with jupyter notebook which run on cloud anyone who is has the passion to learn can train and come up with great results.
In this post I will providing info... | [
{
"code": null,
"e": 458,
"s": 172,
"text": "Computation power needed to train machine learning and deep learning model on large datasets, has always been a huge hindrance for machine learning enthusiast. But with jupyter notebook which run on cloud anyone who is has the passion to learn can train a... |
Initialization of global and static variables in C - GeeksforGeeks | 08 May, 2017
Predict the output of following C programs.
// PROGRAM 1#include <stdio.h>#include <stdlib.h> int main(void){ static int *p = (int*)malloc(sizeof(p)); *p = 10; printf("%d", *p);}
// PROGRAM 2#include <stdio.h>#include <stdlib.h>int *p = (int*)malloc(sizeof(p)); int main(void){ *p = 10; printf... | [
{
"code": null,
"e": 24087,
"s": 24059,
"text": "\n08 May, 2017"
},
{
"code": null,
"e": 24131,
"s": 24087,
"text": "Predict the output of following C programs."
},
{
"code": "// PROGRAM 1#include <stdio.h>#include <stdlib.h> int main(void){ static int *p = (int*)mallo... |
Tryit Editor v3.7 | Tryit: Evenly spaced color stops | [] |
Find the number of elements greater than k in a sorted array - GeeksforGeeks | 05 Aug, 2021
Given a sorted array arr[] of integers and an integer k, the task is to find the count of elements in the array which are greater than k. Note that k may or may not be present in the array.Examples:
Input: arr[] = {2, 3, 5, 6, 6, 9}, k = 6 Output: 1Input: arr[] = {1, 1, 2, 5, 5, 7}, k = 8 Output: 0
A... | [
{
"code": null,
"e": 24472,
"s": 24444,
"text": "\n05 Aug, 2021"
},
{
"code": null,
"e": 24673,
"s": 24472,
"text": "Given a sorted array arr[] of integers and an integer k, the task is to find the count of elements in the array which are greater than k. Note that k may or may no... |
Postorder Traversal | Practice | GeeksforGeeks | Given a binary tree, find the Postorder Traversal of it.
For Example, the postorder traversal of the following tree is:
5 10 39 1
1
/ \
10 39
/
5
Example 1:
Input:
19
/ \
10 8
/ \
11 13
Output: 11 13 10 8 19
Example 2:
Input:
11
/
... | [
{
"code": null,
"e": 357,
"s": 226,
"text": "Given a binary tree, find the Postorder Traversal of it.\nFor Example, the postorder traversal of the following tree is: \n5 10 39 1"
},
{
"code": null,
"e": 399,
"s": 357,
"text": " 1\n / \\\n 10 39\n /\n5"
},
... |
PHP - password_needs_rehash() Function | The password_needs_rehash() function can check if the given hash matches the given options.
boolean password_needs_rehash ( string $hash , integer $algo [, array $options ] )
The password_needs_rehash() function can check to see if the supplied hash implements the algorithm and options provided. If not, it's assumed ... | [
{
"code": null,
"e": 2850,
"s": 2757,
"text": "The password_needs_rehash() function can check if the given hash matches the given options. "
},
{
"code": null,
"e": 2934,
"s": 2850,
"text": "boolean password_needs_rehash ( string $hash , integer $algo [, array $options ] )\n"
}... |
Calculate the QR decomposition of a given matrix using NumPy - GeeksforGeeks | 05 Sep, 2020
In this article, we will discuss QR decomposition of a matrix. QR factorization of a matrix is the decomposition of a matrix say ‘A’ into ‘A=QR’ where Q is orthogonal and R is an upper-triangular matrix. We can calculate the QR decomposition of a given matrix with the help of numpy.linalg.qr().
Syntax : n... | [
{
"code": null,
"e": 24176,
"s": 24148,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 24473,
"s": 24176,
"text": "In this article, we will discuss QR decomposition of a matrix. QR factorization of a matrix is the decomposition of a matrix say ‘A’ into ‘A=QR’ where Q is orthogo... |
Python | Remove given element from the list - GeeksforGeeks | 20 May, 2019
Given a list, write a Python program to remove the given element (list may have duplicates) from given list. There are multiple ways we can do this task in Python. Let’s see some of Pythonic ways to do this task.
Method #1: Using pop() method [Remove given element found first.]
# Python program to remove g... | [
{
"code": null,
"e": 24340,
"s": 24312,
"text": "\n20 May, 2019"
},
{
"code": null,
"e": 24553,
"s": 24340,
"text": "Given a list, write a Python program to remove the given element (list may have duplicates) from given list. There are multiple ways we can do this task in Python.... |
How to find the mean of columns of an R data frame or a matrix? | If all the columns in an R data frame are numeric then it makes sense to find the mean for each of the columns. This calculation will help us to view how different the values of means are for each of the columns but to make sure that they are significantly different, we will need to run a hypothesis test. To find the c... | [
{
"code": null,
"e": 1452,
"s": 1062,
"text": "If all the columns in an R data frame are numeric then it makes sense to find the mean for each of the columns. This calculation will help us to view how different the values of means are for each of the columns but to make sure that they are significan... |
abs(), labs(), llabs() functions in C/C++ - GeeksforGeeks | 26 Apr, 2018
abs(), labs(), llabs() functions are defined in cstdlib header file. These functions return the absolute value of integer that is input to them as their argument.
abs() function: Input to this function is value of type int in C and value of type int, long int or long long int in C++. In C output is of int ... | [
{
"code": null,
"e": 24521,
"s": 24493,
"text": "\n26 Apr, 2018"
},
{
"code": null,
"e": 24684,
"s": 24521,
"text": "abs(), labs(), llabs() functions are defined in cstdlib header file. These functions return the absolute value of integer that is input to them as their argument."... |
Fzf - File Search From Linux Terminal - GeeksforGeeks | 11 May, 2021
Fzf is a command-line general-purpose fuzzy finder tool. It is somewhat like grep. It is a cross-platform command-line tool, that helps you to search and open files quickly. Furthermore, it is open-sourced portable with no dependencies. It has supports for Vim/Neo vim plugin, key bindings, and fuzzy auto-c... | [
{
"code": null,
"e": 25761,
"s": 25733,
"text": "\n11 May, 2021"
},
{
"code": null,
"e": 26184,
"s": 25761,
"text": "Fzf is a command-line general-purpose fuzzy finder tool. It is somewhat like grep. It is a cross-platform command-line tool, that helps you to search and open file... |
Big, fast human-in-the-loop NLP with Elasticsearch | by Joel Klinger | Towards Data Science | Part I: the keyword factory tl;dr: You could make one of these if you 1) store your data in Elasticsearch 2) use the clio_keywordsfunction from the clio-litepackage, pointing at your Elasticsearch endpoint 3) Host it in a Flask app, such as this.
Part II: a contextual search engine tl;dr: You could make one of these if... | [
{
"code": null,
"e": 419,
"s": 172,
"text": "Part I: the keyword factory tl;dr: You could make one of these if you 1) store your data in Elasticsearch 2) use the clio_keywordsfunction from the clio-litepackage, pointing at your Elasticsearch endpoint 3) Host it in a Flask app, such as this."
},
... |
How to add jQuery code to HTML file ? - GeeksforGeeks | 22 Jul, 2021
In this article, we will see how to add jQuery code to HTML file. You can easily add jQuery to HTML by using several methods, like adding jQuery from CDN or directly downloading jQuery files and including them into your projects. Several methods are discussed in this article.
Methods:
Download and include... | [
{
"code": null,
"e": 26303,
"s": 26272,
"text": " \n22 Jul, 2021\n"
},
{
"code": null,
"e": 26580,
"s": 26303,
"text": "In this article, we will see how to add jQuery code to HTML file. You can easily add jQuery to HTML by using several methods, like adding jQuery from CDN or dir... |
Structuring Python Programs - GeeksforGeeks | 02 Mar, 2020
In this article, you would come to know about proper structuring and formatting your python programs.
Python Statements In general, the interpreter reads and executes the statements line by line i.e sequentially. Though, there are some statements that can alter this behavior like conditional statements. ... | [
{
"code": null,
"e": 25782,
"s": 25754,
"text": "\n02 Mar, 2020"
},
{
"code": null,
"e": 25884,
"s": 25782,
"text": "In this article, you would come to know about proper structuring and formatting your python programs."
},
{
"code": null,
"e": 26388,
"s": 25884,
... |
How can multiple plots be plotted in same figure using matplotlib and Python? | Matplotlib is a popular Python package that is used for data visualization.
Visualizing data is a key step since it helps understand what is going on in the data without actually looking at the numbers and performing complicated computations.
It helps in communicating the quantitative insights to the audience effective... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "Matplotlib is a popular Python package that is used for data visualization."
},
{
"code": null,
"e": 1305,
"s": 1138,
"text": "Visualizing data is a key step since it helps understand what is going on in the data without actually loo... |
How can we show a popup menu when the user right-clicks on a JComboBox in Java? | A JComboBox is a subclass of JComponent class that displays a drop-down list and gives users options that we can select one and only one item at a time. A JComboBox can be editable or read-only. A getSelectedItem()
method can be used to get the selected or entered item from a combo box. We can invoke a popup menu from ... | [
{
"code": null,
"e": 1601,
"s": 1062,
"text": "A JComboBox is a subclass of JComponent class that displays a drop-down list and gives users options that we can select one and only one item at a time. A JComboBox can be editable or read-only. A getSelectedItem()\nmethod can be used to get the selecte... |
Difference between Preemptive Priority based and Non-preemptive Priority based CPU scheduling algorithms - GeeksforGeeks | 01 Jun, 2021
Prerequisite – CPU Scheduling Priority Scheduling : In priority scheduling, each process has a priority which is an integer value assigned to it. The smallest integer is considered as the highest priority and the largest integer is considered as the lowest priority. The process with the highest priority ge... | [
{
"code": null,
"e": 24802,
"s": 24774,
"text": "\n01 Jun, 2021"
},
{
"code": null,
"e": 25128,
"s": 24802,
"text": "Prerequisite – CPU Scheduling Priority Scheduling : In priority scheduling, each process has a priority which is an integer value assigned to it. The smallest inte... |
Introduction to the Probabilistic Data Structure - GeeksforGeeks | 28 Apr, 2020
Based on different properties such as speed, cost, and ease of use(as a developer), etc. the below information represents different ways of storing stuff in the computer machine.
Tape------->HDD------->SSD------->Memory
It means memory is faster than SSD than HDD than Tape and the same goes with cost and ... | [
{
"code": null,
"e": 24404,
"s": 24376,
"text": "\n28 Apr, 2020"
},
{
"code": null,
"e": 24583,
"s": 24404,
"text": "Based on different properties such as speed, cost, and ease of use(as a developer), etc. the below information represents different ways of storing stuff in the co... |
PHP - Function eregi() | int eregi(string pattern, string string, [array regs]);
The eregi() function searches throughout a string specified by pattern for a string specified by string. The search is not case sensitive. Eregi() can be particularly useful when checking the validity of strings, such as passwords.
The optional input parameter re... | [
{
"code": null,
"e": 2814,
"s": 2757,
"text": "int eregi(string pattern, string string, [array regs]);\n"
},
{
"code": null,
"e": 3046,
"s": 2814,
"text": "The eregi() function searches throughout a string specified by pattern for a string specified by string. The search is not c... |
Node.js - REPL Terminal | REPL stands for Read Eval Print Loop and it represents a computer environment like a Windows console or Unix/Linux shell where a command is entered and the system responds with an output in an interactive mode. Node.js or Node comes bundled with a REPL environment. It performs the following tasks −
Read − Reads user's ... | [
{
"code": null,
"e": 2318,
"s": 2018,
"text": "REPL stands for Read Eval Print Loop and it represents a computer environment like a Windows console or Unix/Linux shell where a command is entered and the system responds with an output in an interactive mode. Node.js or Node comes bundled with a REPL ... |
Java ResultSet insertRow() method with example | When we execute certain SQL queries (SELECT query in general) they return tabular data.
The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.
i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQue... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "When we execute certain SQL queries (SELECT query in general) they return tabular data."
},
{
"code": null,
"e": 1244,
"s": 1150,
"text": "The java.sql.ResultSet interface represents such tabular data returned by the SQL statements."... |
Big Data Analytics - Logistic Regression | Logistic regression is a classification model in which the response variable is categorical. It is an algorithm that comes from statistics and is used for supervised classification problems. In logistic regression we seek to find the vector β of parameters in the following equation that minimize the cost function.
logi... | [
{
"code": null,
"e": 2870,
"s": 2554,
"text": "Logistic regression is a classification model in which the response variable is categorical. It is an algorithm that comes from statistics and is used for supervised classification problems. In logistic regression we seek to find the vector β of paramet... |
Check if two vectors are collinear or not - GeeksforGeeks | 22 Apr, 2021
Given six integers representing the x, y, and z coordinates of two vectors, the task is to check if the two given vectors are collinear or not.
Examples:
Input: x1 = 4, y1 = 8, z1 = 12, x2 = 8, y2 = 16, z2 = 24Output: YesExplanation: The given vectors: 4i + 8j + 12k and 8i + 16j + 24k are collinear.
Input:... | [
{
"code": null,
"e": 24717,
"s": 24689,
"text": "\n22 Apr, 2021"
},
{
"code": null,
"e": 24861,
"s": 24717,
"text": "Given six integers representing the x, y, and z coordinates of two vectors, the task is to check if the two given vectors are collinear or not."
},
{
"code... |
Python - Calculate the minimum of column values of a Pandas DataFrame | To get the minimum of column values, use the min() function. At first, import the required Pandas library −
import pandas as pd
Now, create a DataFrame with two columns −
dataFrame1 = pd.DataFrame(
{
"Car": ['BMW', 'Lexus', 'Audi', 'Tesla', 'Bentley', 'Jaguar'],"Units": [100, 150, 110, 80, 110, 90] }
)
Finding... | [
{
"code": null,
"e": 1170,
"s": 1062,
"text": "To get the minimum of column values, use the min() function. At first, import the required Pandas library −"
},
{
"code": null,
"e": 1190,
"s": 1170,
"text": "import pandas as pd"
},
{
"code": null,
"e": 1233,
"s": 11... |
Explain project operation in relational algebra (DBMS)? | Query is a question or requesting information. Query language is a language which is used to retrieve information from a database.
Query language is divided into two types −
Procedural language
Procedural language
Non-procedural language
Non-procedural language
Information is retrieved from the database by specifying t... | [
{
"code": null,
"e": 1193,
"s": 1062,
"text": "Query is a question or requesting information. Query language is a language which is used to retrieve information from a database."
},
{
"code": null,
"e": 1236,
"s": 1193,
"text": "Query language is divided into two types −"
},
... |
How to horizontally center a div using CSS? - GeeksforGeeks | 08 Nov, 2021
In this article, we will know how to how to center the div horizontally using CSS.
To Horizontally centered the <div> element:
We can use the property of margin set to auto i.e margin: auto;.
The <div> element takes up its specified width and divides equally the remaining space by the left and right margin... | [
{
"code": null,
"e": 24678,
"s": 24650,
"text": "\n08 Nov, 2021"
},
{
"code": null,
"e": 24761,
"s": 24678,
"text": "In this article, we will know how to how to center the div horizontally using CSS."
},
{
"code": null,
"e": 24805,
"s": 24761,
"text": "To Hori... |
EDA(Exploratory Data Analysis) on Haberman’s Survival Data Set make you diagnose Cancer? | by pratik mirjapure | Towards Data Science | Haberman’s data set contains data from the study conducted in University of Chicago’s Billings Hospital between year 1958 to 1970 for the patients who undergone surgery of breast cancer. Source :https://www.kaggle.com/gilsousa/habermans-survival-data-set)
I would like to explain the various data analysis operation, I h... | [
{
"code": null,
"e": 427,
"s": 171,
"text": "Haberman’s data set contains data from the study conducted in University of Chicago’s Billings Hospital between year 1958 to 1970 for the patients who undergone surgery of breast cancer. Source :https://www.kaggle.com/gilsousa/habermans-survival-data-set)... |
Building a real-time web app in NodeJS Express with Socket.io library | by Charmaine Chui | Towards Data Science | To gain a deeper understanding of the travelling patterns among public transportation commuters, I had been tasked a few months ago to perform an analysis which involves trip chaining a series of bus journeys. While I had initially built a Bus Route Visualisation Site for the sole purpose of exporting custom bus route ... | [
{
"code": null,
"e": 553,
"s": 172,
"text": "To gain a deeper understanding of the travelling patterns among public transportation commuters, I had been tasked a few months ago to perform an analysis which involves trip chaining a series of bus journeys. While I had initially built a Bus Route Visua... |
How to set the opacity level for an element with JavaScript? | Use the opacity property in JavaScript to set the opacity level. You can try to run the following code to set the opacity level for an element with JavaScript −
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
#box {
width: 450px;
background-color: gray;
}
</style... | [
{
"code": null,
"e": 1223,
"s": 1062,
"text": "Use the opacity property in JavaScript to set the opacity level. You can try to run the following code to set the opacity level for an element with JavaScript −"
},
{
"code": null,
"e": 1233,
"s": 1223,
"text": "Live Demo"
},
{
... |
How to get the square root of a number in JavaScript? | To get the square root, use the Math.sqrt() method. This method returns the square root of a number. If the value of a number is negative, sqrt returns NaN.
You can try to run the following code to get the square root of a number −
<html>
<head>
<title>JavaScript Math sqrt() Method</title>
</head>
<body>... | [
{
"code": null,
"e": 1344,
"s": 1187,
"text": "To get the square root, use the Math.sqrt() method. This method returns the square root of a number. If the value of a number is negative, sqrt returns NaN."
},
{
"code": null,
"e": 1419,
"s": 1344,
"text": "You can try to run the fo... |
ListIterator in Java | 31 May, 2022
ListIterator is one of the four java cursors. It is a java iterator that is used to traverse all types of lists including ArrayList, Vector, LinkedList, Stack, etc. It is available since Java 1.2. It extends the iterator interface. The hierarchy of ListIterator is as follows:
Some Important points about L... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 May, 2022"
},
{
"code": null,
"e": 332,
"s": 54,
"text": "ListIterator is one of the four java cursors. It is a java iterator that is used to traverse all types of lists including ArrayList, Vector, LinkedList, Stack, etc. It is ava... |
Concatenating Objects in R Programming – combine() Function | 31 Aug, 2020
In R programming, coercion function c() and combine() function are similar to each other but are different in a way. combine() functions acts like c() and unlist() functions but uses consistent dplyr coercion rules. Moreover, combine() function is used to combine factors in R programming. In this article, ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Aug, 2020"
},
{
"code": null,
"e": 457,
"s": 28,
"text": "In R programming, coercion function c() and combine() function are similar to each other but are different in a way. combine() functions acts like c() and unlist() functions b... |
Program to print the sum of the given nth term | 09 Aug, 2021
Given the value of the n. You have to find the sum of the series where the nth term of the sequence is given by:Tn = n2 – ( n – 1 )2Examples :
Input : 3
Output : 9
Explanation: So here the term of the sequence upto n = 3 are:
1, 3, 5 And hence the required sum is = 1 + 3 + 5 = 9
Input : 6
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Aug, 2021"
},
{
"code": null,
"e": 172,
"s": 28,
"text": "Given the value of the n. You have to find the sum of the series where the nth term of the sequence is given by:Tn = n2 – ( n – 1 )2Examples : "
},
{
"code": null,
... |
Collect.js | count() Function | 05 Jun, 2020
The count() function is used to count the number of collections in the element. In JavaScript, the array is first converted to a collection and then the function is applied to the collection.
Syntax:
data.count()
Parameters: This function does not accept any parameterReturn Value: Returns the count of t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jun, 2020"
},
{
"code": null,
"e": 220,
"s": 28,
"text": "The count() function is used to count the number of collections in the element. In JavaScript, the array is first converted to a collection and then the function is applied to... |
Difference between var and val in Kotlin | 03 Jun, 2020
var and val are both used to declare variables in Kotlin language. However, there are some key differences between them:
It is a general variable. The value of a variable that is declared using var can be changed anytime throughout the program. var is also called mutable and non-final variable, as there va... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2020"
},
{
"code": null,
"e": 149,
"s": 28,
"text": "var and val are both used to declare variables in Kotlin language. However, there are some key differences between them:"
},
{
"code": null,
"e": 371,
"s": 149... |
Implementing upper_bound() and lower_bound() in C | 06 Aug, 2021
Given a sorted array arr[] of N integers and a number K, the task is to write the C program to find the upper_bound() and lower_bound() of K in the given array.Examples:
Input: arr[] = {4, 6, 10, 12, 18, 20}, K = 6 Output: Lower bound of 6 is 6 at index 1 Upper bound of 6 is 10 at index 2Input: arr[] = {... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Aug, 2021"
},
{
"code": null,
"e": 226,
"s": 54,
"text": "Given a sorted array arr[] of N integers and a number K, the task is to write the C program to find the upper_bound() and lower_bound() of K in the given array.Examples: "
... |
Connect new point to the previous point on a image with a straight line in Opencv-Python | 31 Aug, 2021
OpenCV-Python is a library of Python bindings designed to solve computer vision problems. Let’s see how to Connect a new point to the previous point on an image with a straight line.
Step 1: Draw points on image:
On a image we can mark points using cv2.circle( ) method. This method is used to draw a circle... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 211,
"s": 28,
"text": "OpenCV-Python is a library of Python bindings designed to solve computer vision problems. Let’s see how to Connect a new point to the previous point on an image with a straigh... |
Sampling Distributions with Python | by Luís Roque | Medium | Towards Data Science | In a series of weekly articles, I will be covering some important topics of statistics with a twist.
The goal is to use Python to help us get intuition on complex concepts, empirically test theoretical proofs, or build algorithms from scratch. In this series, you will find articles covering topics such as random variab... | [
{
"code": null,
"e": 273,
"s": 172,
"text": "In a series of weekly articles, I will be covering some important topics of statistics with a twist."
},
{
"code": null,
"e": 573,
"s": 273,
"text": "The goal is to use Python to help us get intuition on complex concepts, empirically t... |
How to skip a particular test method in TestNG? | We can skip a particular test method in TestNG. To overlook a particular test method from execution in TestNG enabled helper attribute is used. This attribute has to be set to false to overlook a test method from execution. Code Implementation of Java class file.
@Test(enabled=false)
public void verifyRepay(){
Syste... | [
{
"code": null,
"e": 1326,
"s": 1062,
"text": "We can skip a particular test method in TestNG. To overlook a particular test method from execution in TestNG enabled helper attribute is used. This attribute has to be set to false to overlook a test method from execution. Code Implementation of Java c... |
Executing SQL Statements from a Text File on MySQL Client | Let us understand how SQL statements can be executed from a text file on the MySQL client. The mysql client is generally used in interactive way. Let us see an example of the same −
shell> mysql db_name
It is also possible to put the SQL statements in a file and then tell mysql to read the input from that specific file... | [
{
"code": null,
"e": 1244,
"s": 1062,
"text": "Let us understand how SQL statements can be executed from a text file on the MySQL client. The mysql client is generally used in interactive way. Let us see an example of the same −"
},
{
"code": null,
"e": 1265,
"s": 1244,
"text": "... |
Accessing Values of Lists in Python | To access values in lists, use the square brackets for slicing along with the index or indices to obtain value available at that index.
Live Demo
#!/usr/bin/python
list1 = ['physics', 'chemistry', 1997, 2000];
list2 = [1, 2, 3, 4, 5, 6, 7 ];
print "list1[0]: ", list1[0]
print "list2[1:5]: ", list2[1:5]
When the above ... | [
{
"code": null,
"e": 1198,
"s": 1062,
"text": "To access values in lists, use the square brackets for slicing along with the index or indices to obtain value available at that index."
},
{
"code": null,
"e": 1209,
"s": 1198,
"text": " Live Demo"
},
{
"code": null,
"e"... |
Convert Unicode to UTF-8 in Java | Before moving onto their conversions, let us learn about Unicode and UTF-8.
Unicode is an international standard of character encoding which has the capability of representing a majority of written languages all over the globe. Unicode uses hexadecimal to represent a character. Unicode is a 16-bit character encoding sy... | [
{
"code": null,
"e": 1138,
"s": 1062,
"text": "Before moving onto their conversions, let us learn about Unicode and UTF-8."
},
{
"code": null,
"e": 1448,
"s": 1138,
"text": "Unicode is an international standard of character encoding which has the capability of representing a majo... |
How to Install Tensorflow 2.1 on Ubuntu 18.04 LTS with GPU support: Nvidia Drivers, CUDA 10 and cuDNN | by Dr. Joanne Kitson | Towards Data Science | In Part 1 of this series, I discussed how you can upgrade your PC hardware to incorporate a CUDA Toolkit compatible graphics processing card and I installed an Nvidia GTX 1060 6GB. Part 2 of the series covered the installation of CUDA, cuDNN and Tensorflow on Windows 10. In Part 3, I wiped Windows 10 from my PC and ins... | [
{
"code": null,
"e": 536,
"s": 171,
"text": "In Part 1 of this series, I discussed how you can upgrade your PC hardware to incorporate a CUDA Toolkit compatible graphics processing card and I installed an Nvidia GTX 1060 6GB. Part 2 of the series covered the installation of CUDA, cuDNN and Tensorflo... |
How to set background color in HTML? | To set the background color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <body> tag, with the CSS property background-color. HTML5 do not support the <body> tag bgcolor attribute, so the CSS style is used to add background color. The... | [
{
"code": null,
"e": 1422,
"s": 1062,
"text": "To set the background color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <body> tag, with the CSS property background-color. HTML5 do not support the <body> tag bgcol... |
FAANG Ask These 4 Python Simulations in 2021 | by Leihua Ye, PhD | Towards Data Science | Updated on Jan-10–2021
1
2
3
4
5
6
7
8
9
10
Powered by Play.ht
Create audio with Play.ht
Powered by Play.ht
Statistical Simulation is the most heavily tested topic in Data Science/Engineering Interviews! If we go over DS Interview questions posted at Glassdoor, statistical simulation is the key skill that all big tech ... | [
{
"code": null,
"e": 194,
"s": 171,
"text": "Updated on Jan-10–2021"
},
{
"code": null,
"e": 196,
"s": 194,
"text": "1"
},
{
"code": null,
"e": 198,
"s": 196,
"text": "2"
},
{
"code": null,
"e": 200,
"s": 198,
"text": "3"
},
{
"code... |
Building an ApiGateway-SQS-Lambda integration using Terraform | by Daniel Da Costa | Towards Data Science | Terraform is an amazing tool for building infrastructures. This tool is used for building, changing, and versioning infrastructure safely and efficiently. Terraform is the infrastructure as code offering from HashiCorp.
While using Terraform for building a project that I’m designing using Amazon Web Services (AWS), I c... | [
{
"code": null,
"e": 392,
"s": 172,
"text": "Terraform is an amazing tool for building infrastructures. This tool is used for building, changing, and versioning infrastructure safely and efficiently. Terraform is the infrastructure as code offering from HashiCorp."
},
{
"code": null,
"e"... |
Deep Q-Network (DQN)-II. Experience Replay and Target Networks | by Jordi TORRES.AI | Towards Data Science | This is the second post devoted to Deep Q-Network (DQN), in the “Deep Reinforcement Learning Explained” series, in which we will analyse some challenges that appear when we apply Deep Learning to Reinforcement Learning. We will also present in detail the code that solves the OpenAI Gym Pong game using the DQN network i... | [
{
"code": null,
"e": 524,
"s": 172,
"text": "This is the second post devoted to Deep Q-Network (DQN), in the “Deep Reinforcement Learning Explained” series, in which we will analyse some challenges that appear when we apply Deep Learning to Reinforcement Learning. We will also present in detail the ... |
How to Run Your First Spring Boot Application in IntelliJ IDEA? - GeeksforGeeks | 07 Dec, 2021
IntelliJ IDEA is an integrated development environment(IDE) written in Java. It is used for developing computer software. This IDE is developed by Jetbrains and is available as an Apache 2 Licensed community edition and a commercial edition. It is an intelligent, context-aware IDE for working with Java and... | [
{
"code": null,
"e": 25788,
"s": 25760,
"text": "\n07 Dec, 2021"
},
{
"code": null,
"e": 26575,
"s": 25788,
"text": "IntelliJ IDEA is an integrated development environment(IDE) written in Java. It is used for developing computer software. This IDE is developed by Jetbrains and is... |
Dynamic _Cast in C++ - GeeksforGeeks | 13 May, 2021
C++ is a powerful language. In C++ we can write a structured program and object-oriented program also. In this article, we will focus on dynamic_cast in C++. Now before start dynamic_cast in C++, first understand what is type casting in C++.’
Casting is a technique by which one data type to another data ty... | [
{
"code": null,
"e": 24042,
"s": 24014,
"text": "\n13 May, 2021"
},
{
"code": null,
"e": 24285,
"s": 24042,
"text": "C++ is a powerful language. In C++ we can write a structured program and object-oriented program also. In this article, we will focus on dynamic_cast in C++. Now b... |
How to pass a lambda expression as a method parameter in Java? | A lambda expression is an anonymous or unnamed method in Java. It doesn't execute on its own and used to implement methods that are declared in a functional interface. If we want to pass a lambda expression as a method parameter in java, the type of method parameter that receives must be of functional interface type.
i... | [
{
"code": null,
"e": 1381,
"s": 1062,
"text": "A lambda expression is an anonymous or unnamed method in Java. It doesn't execute on its own and used to implement methods that are declared in a functional interface. If we want to pass a lambda expression as a method parameter in java, the type of met... |
What is Lazy Evaluation in Python? | by Xiaoxu Gao | Towards Data Science | If you’ve never heard of Lazy Evaluation before, Lazy Evaluation is an evaluation strategy which delays the evaluation of an expression until its value is needed and which also avoids repeated evaluations (From Wikipedia). It’s usually being considered as a strategy to optimize your code.
Let’s turn this theory into an... | [
{
"code": null,
"e": 462,
"s": 172,
"text": "If you’ve never heard of Lazy Evaluation before, Lazy Evaluation is an evaluation strategy which delays the evaluation of an expression until its value is needed and which also avoids repeated evaluations (From Wikipedia). It’s usually being considered as... |
How do you click on an element which is hidden using Selenium WebDriver? | We can click on an element which is hidden with Selenium webdriver. The hidden elements are the ones which are present in the DOM but not visible on the page. Mostly the hidden elements are defined by the CSS property style="display:none;". In case an element is a part of the form tag, it can be hidden by setting the a... | [
{
"code": null,
"e": 1542,
"s": 1187,
"text": "We can click on an element which is hidden with Selenium webdriver. The hidden elements are the ones which are present in the DOM but not visible on the page. Mostly the hidden elements are defined by the CSS property style=\"display:none;\". In case an... |
Python PIL | ImageDraw.Draw.pieslice() | 02 Aug, 2019
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. You can use this module to create new images, annotate or retouch existing images, and to generate graphics on the fly for web use.
Ima... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Aug, 2019"
},
{
"code": null,
"e": 332,
"s": 28,
"text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. You... |
Python hasattr() method | 05 Jul, 2022
Python hasattr() function is an inbuilt utility function, which is used to check if an object has the given named attribute and return true if present, else false. In this article, we will see how to check if an object has an attribute in Python.
Syntax : hasattr(obj, key)
Parameters :
obj : The object wh... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 300,
"s": 53,
"text": "Python hasattr() function is an inbuilt utility function, which is used to check if an object has the given named attribute and return true if present, else false. In this ar... |
The Lazy-Code-Motion problem | 17 Jun, 2021
The Lazy-Code-Motion problem :To avoid redundant calculations, reduce code size, or save resources, code mobility optimizations move computations across a control-flow graph (CFG). For example, loop invariant code motion recognizes expressions computed within loops that have the same value iteration after ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 571,
"s": 54,
"text": "The Lazy-Code-Motion problem :To avoid redundant calculations, reduce code size, or save resources, code mobility optimizations move computations across a control-flow graph ... |
Maximize jobs that can be completed under given constraint | 07 Apr, 2022
Given an integer N denoting number of jobs and a matrix ranges[] consisting of a range [start day, end day] for each job within which it needs to be completed, the task is to find the maximum possible jobs that can be completed.Examples:
Input: N = 5, Ranges = {{1, 5}, {1, 5}, {1, 5}, {2, 3}, {2, 3}} Out... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Apr, 2022"
},
{
"code": null,
"e": 294,
"s": 54,
"text": "Given an integer N denoting number of jobs and a matrix ranges[] consisting of a range [start day, end day] for each job within which it needs to be completed, the task is to... |
Object Class in Java | 03 Jan, 2022
Object class is present in java.lang package. Every class in Java is directly or indirectly derived from the Object class. If a class does not extend any other class then it is a direct child class of Object and if extends another class then it is indirectly derived. Therefore the Object class methods are ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Jan, 2022"
},
{
"code": null,
"e": 472,
"s": 54,
"text": "Object class is present in java.lang package. Every class in Java is directly or indirectly derived from the Object class. If a class does not extend any other class then it ... |
Referencing Subclass objects with Subclass vs Superclass reference | 29 Mar, 2017
Prerequisite : InheritanceIn Java, all non-static methods are based on the runtime type of the underlying object rather than the type of the reference that points to that object. Therefore, it doesn’t matter which type you use in the declaration of the object, the behavior will be the same.
How to Refer a ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Mar, 2017"
},
{
"code": null,
"e": 344,
"s": 52,
"text": "Prerequisite : InheritanceIn Java, all non-static methods are based on the runtime type of the underlying object rather than the type of the reference that points to that obj... |
Minimum increment/decrement to make array non-Increasing | 26 May, 2022
Given an array a, your task is to convert it into a non-increasing form such that we can either increment or decrement the array value by 1 in the minimum changes possible.
Examples :
Input : a[] = {3, 1, 2, 1}Output : 1Explanation : We can convert the array into 3 1 1 1 by changing 3rd element of array i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 May, 2022"
},
{
"code": null,
"e": 225,
"s": 52,
"text": "Given an array a, your task is to convert it into a non-increasing form such that we can either increment or decrement the array value by 1 in the minimum changes possible."
... |
How to create animated banner links using HTML and CSS? | 09 Jul, 2021
Links are one of the most important parts of any component that is used in website making. Almost every component had some form of links in it. A common example is a menu/nav-bar. All we see is some button like home, about, etc. but under the hood they all are links. Sometimes there comes a situation where... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 976,
"s": 28,
"text": "Links are one of the most important parts of any component that is used in website making. Almost every component had some form of links in it. A common example is a menu/nav-... |
Prim’s Minimum Spanning Tree (MST) | Greedy Algo-5 | 13 Jun, 2022
We have discussed Kruskal’s algorithm for Minimum Spanning Tree. Like Kruskal’s algorithm, Prim’s algorithm is also a Greedy algorithm. It starts with an empty spanning tree. The idea is to maintain two sets of vertices. The first set contains the vertices already included in the MST, the other set contain... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 995,
"s": 54,
"text": "We have discussed Kruskal’s algorithm for Minimum Spanning Tree. Like Kruskal’s algorithm, Prim’s algorithm is also a Greedy algorithm. It starts with an empty spanning tree.... |
numpy.random.chisquare() in Python | 15 Jul, 2020
With the help of chisquare() method, we can get chi-square distribution by using this method. Mainly we can use this distribution in hypothesis testing.
chi-square distribution
Syntax : numpy.random.chisquare(df, size=None)
Parameters :
1) df – number of degree of freedom and must be >0.
2) size – Output ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Jul, 2020"
},
{
"code": null,
"e": 181,
"s": 28,
"text": "With the help of chisquare() method, we can get chi-square distribution by using this method. Mainly we can use this distribution in hypothesis testing."
},
{
"code": ... |
C++ Program for Third largest element in an array of distinct elements | 03 Jan, 2022
Given an array of n integers, find the third largest element. All the elements in the array are distinct integers. Example :
Input: arr[] = {1, 14, 2, 16, 10, 20}
Output: The third Largest element is 14
Explanation: Largest element is 20, second largest element is 16
and third largest element is 14
In... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jan, 2022"
},
{
"code": null,
"e": 155,
"s": 28,
"text": "Given an array of n integers, find the third largest element. All the elements in the array are distinct integers. Example : "
},
{
"code": null,
"e": 516,
"s... |
K-Fold Cross Validation Example Using Sklearn Python | by Cory Maklin | Towards Data Science | At the end of the day, machine learning models are used to make predictions on data for which we don’t already have the answer. For example, this could take the form of a recommender system that tries to predict whether the user will like the song or product.
When developing a model, we have to be very cautious not to ... | [
{
"code": null,
"e": 431,
"s": 171,
"text": "At the end of the day, machine learning models are used to make predictions on data for which we don’t already have the answer. For example, this could take the form of a recommender system that tries to predict whether the user will like the song or prod... |
C# | StringComparer.Compare Method - GeeksforGeeks | 30 Jun, 2019
StringComparer.Compare Method is used to compare two objects or strings and returns an indication of their relative sort order. There are 2 methods in the overload list of this method:
Compare(Object, Object)
Compare(String, String)
This method compares two objects and returns an indication of their relati... | [
{
"code": null,
"e": 25547,
"s": 25519,
"text": "\n30 Jun, 2019"
},
{
"code": null,
"e": 25732,
"s": 25547,
"text": "StringComparer.Compare Method is used to compare two objects or strings and returns an indication of their relative sort order. There are 2 methods in the overload... |
Using Fastai for Image Classification | by Pascal Schröder | Towards Data Science | I recently took a peek into Jeremy Howard’s 2019 course on deep learning. I never used the Fastai library before so I was pretty amazed by its level of abstraction that allows you to create stage-of-the-art neural networks in minutes, with a ridiculously tiny amount of code. In the following I will offer a short tutori... | [
{
"code": null,
"e": 544,
"s": 47,
"text": "I recently took a peek into Jeremy Howard’s 2019 course on deep learning. I never used the Fastai library before so I was pretty amazed by its level of abstraction that allows you to create stage-of-the-art neural networks in minutes, with a ridiculously t... |
Fortran - select case construct | A select case statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being selected on is checked for each select case.
The syntax for the select case construct is as follows −
[name:] select case (expression)
case (selector1)
! som... | [
{
"code": null,
"e": 2337,
"s": 2146,
"text": "A select case statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being selected on is checked for each select case."
},
{
"code": null,
"e": 2394,
"s": 2337,
... |
The Fastest Way to Visualize Correlation in Python | by Roman Orac | Towards Data Science | As a Data Scientist, I use correlation frequently to calculate and visualize relationships between features.
I used to start by importing matplotlib and seaborn packages, which render a good-looking plot. But it’s cumbersome to import both packages just to visualize the correlation when starting with an empty Jupyter N... | [
{
"code": null,
"e": 156,
"s": 47,
"text": "As a Data Scientist, I use correlation frequently to calculate and visualize relationships between features."
},
{
"code": null,
"e": 376,
"s": 156,
"text": "I used to start by importing matplotlib and seaborn packages, which render a g... |
How to remove partial string after a special character in R? | Sometimes we don’t require the whole string to proceed with the analysis, especially when it complicates the analysis or making no sense. In such type of situations, the part of string which we feel that is not necessary can be removed from the complete string. For example, suppose we have a string ID:00001-1 but we do... | [
{
"code": null,
"e": 1484,
"s": 1062,
"text": "Sometimes we don’t require the whole string to proceed with the analysis, especially when it complicates the analysis or making no sense. In such type of situations, the part of string which we feel that is not necessary can be removed from the complete... |
What is OpenMP? | OpenMP is a set of compiler directives as well as an API for programs written in C, C++, or FORTRAN that provides support for parallel programming in shared-memory environments. OpenMP identifies parallel regions as blocks of code that may run in parallel. Application developers insert compiler directives into their co... | [
{
"code": null,
"e": 1618,
"s": 1062,
"text": "OpenMP is a set of compiler directives as well as an API for programs written in C, C++, or FORTRAN that provides support for parallel programming in shared-memory environments. OpenMP identifies parallel regions as blocks of code that may run in parall... |
Nagios - Checks and States | Once the host and services are configured on Nagios, checks are used to see if the hosts and services are working as they are supposed to or not. Let us see an example to perform checks on host −
Consider that you have put your host definitions inside host1.cfg file in /usr/local/nagios/etc/objects directory.
cd /usr/l... | [
{
"code": null,
"e": 2092,
"s": 1896,
"text": "Once the host and services are configured on Nagios, checks are used to see if the hosts and services are working as they are supposed to or not. Let us see an example to perform checks on host −"
},
{
"code": null,
"e": 2207,
"s": 2092,... |
C - strtok function | 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,
... |
How to implement Kohonen’s Self Organizing Maps | by Kosala Sananthana | Towards Data Science | Artificial neural networks (ANN) are inspired by the early models of sensory processing by the brain. An artificial neural network can be created by simulating a network of model neurons in a computer. By applying algorithms that mimic the processes of real neurons, we can make the network ‘learn’ to solve many types o... | [
{
"code": null,
"e": 542,
"s": 171,
"text": "Artificial neural networks (ANN) are inspired by the early models of sensory processing by the brain. An artificial neural network can be created by simulating a network of model neurons in a computer. By applying algorithms that mimic the processes of re... |
Tokens in C | Tokens are the smallest elements of a program, which are meaningful to the compiler.
The following are the types of tokens: Keywords, Identifiers, Constant, Strings, Operators, etc.
Let us begin with Keywords.
Keywords are predefined, reserved words in C and each of which is associated with specific features. These wor... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "Tokens are the smallest elements of a program, which are meaningful to the compiler."
},
{
"code": null,
"e": 1244,
"s": 1147,
"text": "The following are the types of tokens: Keywords, Identifiers, Constant, Strings, Operators, etc."... |
Code indentation in Lua Programming | Lua codes are not like Python when it comes to indentation. So, most of the code you will write will work even if it falls on another line, and you don’t necessarily need to have the nested code to be intended by a certain tab size.
The code indentation in lua is more about making the code look much better and more rea... | [
{
"code": null,
"e": 1295,
"s": 1062,
"text": "Lua codes are not like Python when it comes to indentation. So, most of the code you will write will work even if it falls on another line, and you don’t necessarily need to have the nested code to be intended by a certain tab size."
},
{
"code"... |
How to remove text inside brackets in Python? - GeeksforGeeks | 27 Mar, 2021
In this article, we will learn how to remove content inside brackets without removing brackets in python.
Examples:
Input: (hai)geeks
Output: ()geeks
Input: (geeks)for(geeks)
Output: ()for()
We can remove content inside brackets without removing brackets in 2 methods, one of them is to use the inbuilt met... | [
{
"code": null,
"e": 24085,
"s": 24057,
"text": "\n27 Mar, 2021"
},
{
"code": null,
"e": 24191,
"s": 24085,
"text": "In this article, we will learn how to remove content inside brackets without removing brackets in python."
},
{
"code": null,
"e": 24201,
"s": 2419... |
Add given n time durations - GeeksforGeeks | 03 May, 2021
Given n time durations in the form of MM : SS, where MM denotes minutes and SS denotes the seconds. The task is to add all the time duration and output answer in the form of HH : MM : SS.Examples:
Input : n = 5
duration1 = 0 : 45
duration1 = 2 : 31
duration1 = 3 : 11
durat... | [
{
"code": null,
"e": 24151,
"s": 24123,
"text": "\n03 May, 2021"
},
{
"code": null,
"e": 24350,
"s": 24151,
"text": "Given n time durations in the form of MM : SS, where MM denotes minutes and SS denotes the seconds. The task is to add all the time duration and output answer in t... |
Tackling Jump Game Problems (LeetCode) | Towards Data Science | In this article, we will be tackling the two jump game problems which are available on LeetCode. These are pretty famous problems and can be a little tricky to solve in one go.
Here, we would discuss various ways to solve both the problems step by step with complexity analysis. So, let’s start with the first one.
Given... | [
{
"code": null,
"e": 348,
"s": 171,
"text": "In this article, we will be tackling the two jump game problems which are available on LeetCode. These are pretty famous problems and can be a little tricky to solve in one go."
},
{
"code": null,
"e": 486,
"s": 348,
"text": "Here, we ... |
Why and how are Python functions hashable? | An object is said to be hashable if it has a hash value that remains the same during its lifetime. It has a __hash__() method and it can be compared to other objects. For this, it needs the __eq__() or __cmp__()method. If hashable objects are equal when compared, then they have same hash value.
Being hashable renders a... | [
{
"code": null,
"e": 1358,
"s": 1062,
"text": "An object is said to be hashable if it has a hash value that remains the same during its lifetime. It has a __hash__() method and it can be compared to other objects. For this, it needs the __eq__() or __cmp__()method. If hashable objects are equal when... |
How to write a program to copy characters from one file to another in Java? | To copy the contents of one file to other character by character
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class CopyFiles {
public static void main(String[] args) throws IOException {
//Creating a File object to hold the source fil... | [
{
"code": null,
"e": 1127,
"s": 1062,
"text": "To copy the contents of one file to other character by character"
},
{
"code": null,
"e": 2174,
"s": 1127,
"text": "import java.io.File;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\... |
PySpark - Create DataFrame from List - GeeksforGeeks | 30 May, 2021
In this article, we are going to discuss how to create a Pyspark dataframe from a list.
To do this first create a list of data and a list of column names. Then pass this zipped data to spark.createDataFrame() method. This method is used to create DataFrame. The data attribute will be the list of data and ... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n30 May, 2021"
},
{
"code": null,
"e": 24381,
"s": 24292,
"text": "In this article, we are going to discuss how to create a Pyspark dataframe from a list. "
},
{
"code": null,
"e": 24648,
"s": 24381,
"text": "T... |
Create a linked list from two linked lists by choosing max element at each position - GeeksforGeeks | 03 Dec, 2021
Given two linked list of equal sizes, the task is to create new linked list using those linked lists where at every step, the maximum of the two elements from both the linked lists is chosen and the other is skipped.
Examples:
Input: list1 = 5 -> 2 -> 3 -> 8 -> NULL list2 = 1 -> 7 -> 4 -> 5 -> NULL Output... | [
{
"code": null,
"e": 24934,
"s": 24906,
"text": "\n03 Dec, 2021"
},
{
"code": null,
"e": 25151,
"s": 24934,
"text": "Given two linked list of equal sizes, the task is to create new linked list using those linked lists where at every step, the maximum of the two elements from both... |
10 Python Pandas tricks that make your work more efficient | by Shiu-Tang Li | Towards Data Science | Pandas is a widely used Python package for structured data. There’re many nice tutorials of it, but here I’d still like to introduce a few cool tricks the readers may not know before and I believe they’re useful.
Everyone knows this command. But the data you’re trying to read is large, try adding this argument: nrows =... | [
{
"code": null,
"e": 385,
"s": 172,
"text": "Pandas is a widely used Python package for structured data. There’re many nice tutorials of it, but here I’d still like to introduce a few cool tricks the readers may not know before and I believe they’re useful."
},
{
"code": null,
"e": 681,
... |
time.Round() Function in Golang With Examples - GeeksforGeeks | 21 Apr, 2020
In Go language, time packages supplies functionality for determining as well as viewing time. The Round() function in Go language is used to find the outcome of rounding the stated duration ‘d’ to the closest multiple of ‘m’ duration. Here, the rounding manner for middle values is to round far off from 0. ... | [
{
"code": null,
"e": 24492,
"s": 24464,
"text": "\n21 Apr, 2020"
},
{
"code": null,
"e": 24935,
"s": 24492,
"text": "In Go language, time packages supplies functionality for determining as well as viewing time. The Round() function in Go language is used to find the outcome of ro... |
Convert array with duplicate values to object with number of repeated occurrences in JavaScript | Suppose, we have an array string that contains some duplicate entries like this −
const arr = ['California','Texas','Texas','Texas','New
York','Missouri','New Mexico','California'];
We are required to write a JavaScript function that takes in one such array. Our function should then construct an array of objects that c... | [
{
"code": null,
"e": 1144,
"s": 1062,
"text": "Suppose, we have an array string that contains some duplicate entries like this −"
},
{
"code": null,
"e": 1244,
"s": 1144,
"text": "const arr = ['California','Texas','Texas','Texas','New\nYork','Missouri','New Mexico','California'];... |
Python | Removing duplicates from tuple - GeeksforGeeks | 29 Oct, 2019
Many times, while working with Python tuples, we can have a problem of removing duplicates. This is a very common problem and can occur in any form of programming set up, be it regular programming or web development. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using set() + ... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n29 Oct, 2019"
},
{
"code": null,
"e": 24573,
"s": 24292,
"text": "Many times, while working with Python tuples, we can have a problem of removing duplicates. This is a very common problem and can occur in any form of programming ... |
How to add Django debug toolbar to your project? | Django toolbox is a debugging tool that is used to debug database queries, Django website loading speed, and many other things. Debug toolbar is very popular among developers and everyone is using it. So, let's dive into to see how to implement it.
Create an app with the name "myapp".
First, install the django-debug-to... | [
{
"code": null,
"e": 1311,
"s": 1062,
"text": "Django toolbox is a debugging tool that is used to debug database queries, Django website loading speed, and many other things. Debug toolbar is very popular among developers and everyone is using it. So, let's dive into to see how to implement it."
}... |
10x times faster Pandas Apply in a single line change of code | by Satyam Kumar | Towards Data Science | Pandas is one of the popular Python packages among the data science community, as it offers a vast API and flexible data structures for data explorations and visualization. When it comes to handling and processing large-size datasets, it fails.
One can load and process a large-size dataset in chunks or use distributed ... | [
{
"code": null,
"e": 417,
"s": 172,
"text": "Pandas is one of the popular Python packages among the data science community, as it offers a vast API and flexible data structures for data explorations and visualization. When it comes to handling and processing large-size datasets, it fails."
},
{
... |
Is there any way in MongoDB to get the inner value of json data? | To get inner value of JSON data, use find() along with dot(.) notation. Let us create a collection with documents −
> db.demo235.insertOne(
... {
... "id":101,
... "details":[
... {
... "Name":"Chris Brown",
... "Age":21
... },
... {
... "Name":"David... | [
{
"code": null,
"e": 1178,
"s": 1062,
"text": "To get inner value of JSON data, use find() along with dot(.) notation. Let us create a collection with documents −"
},
{
"code": null,
"e": 1757,
"s": 1178,
"text": "> db.demo235.insertOne(\n... {\n... \"id\":101,\n... \... |
What is CGI in Python? | The Common Gateway Interface, or CGI, is a standard for external gateway programs to interface with information servers such as HTTP servers.
The current version is CGI/1.1 and CGI/1.2 is under progress.
To understand the concept of CGI, let us see what happens when we click a hyper link to browse a particular web page... | [
{
"code": null,
"e": 1204,
"s": 1062,
"text": "The Common Gateway Interface, or CGI, is a standard for external gateway programs to interface with information servers such as HTTP servers."
},
{
"code": null,
"e": 1266,
"s": 1204,
"text": "The current version is CGI/1.1 and CGI/1... |
How to change Tkinter Button state from disabled to normal? | Tkinter provides Button widgets to create a button for triggering an event. Let us suppose we have created a button that is already disabled in an application. In order to change the state of the button, we can use the state property.
The state property is used to enable and disable a button in an application. In order... | [
{
"code": null,
"e": 1297,
"s": 1062,
"text": "Tkinter provides Button widgets to create a button for triggering an event. Let us suppose we have created a button that is already disabled in an application. In order to change the state of the button, we can use the state property."
},
{
"cod... |
Find next palindrome prime - GeeksforGeeks | 21 May, 2021
Find the smallest palindrome number which is prime too and greater then given number N.Examples:
Input : N = 7
Output :11
11 is the smallest palindrome prime which
is greater than N.
Input : N = 112
Output : 131
A simple approach is to start a loop from N+1. For every number, check if it is palindrome... | [
{
"code": null,
"e": 24177,
"s": 24149,
"text": "\n21 May, 2021"
},
{
"code": null,
"e": 24276,
"s": 24177,
"text": "Find the smallest palindrome number which is prime too and greater then given number N.Examples: "
},
{
"code": null,
"e": 24392,
"s": 24276,
... |
Cd cmd command - GeeksforGeeks | 30 Sep, 2020
Cd is the abbreviation or synonym for chdir. It is a command found inside the Windows Command Processor (cmd) that allows for change of the current working directory of a shell instance. The CWD (Current Working Directory) is a path (of a directory) inside the file system, where the shell is currently work... | [
{
"code": null,
"e": 24774,
"s": 24746,
"text": "\n30 Sep, 2020"
},
{
"code": null,
"e": 25243,
"s": 24774,
"text": "Cd is the abbreviation or synonym for chdir. It is a command found inside the Windows Command Processor (cmd) that allows for change of the current working directo... |
SQL Relationships With SQLAlchemy | by Mike Wolfe | Towards Data Science | A couple of weeks ago, I wrote an article about leveraging the power of Entity Framework to minimize having to do complicated Linq queries. Essentially, the solution was to create configurations for each table in the database and then define the relationship between the tables within the configuration. It wasn’t exactl... | [
{
"code": null,
"e": 638,
"s": 171,
"text": "A couple of weeks ago, I wrote an article about leveraging the power of Entity Framework to minimize having to do complicated Linq queries. Essentially, the solution was to create configurations for each table in the database and then define the relations... |
Very simple Python script for extracting most common words from a story | by Tirthajyoti Sarkar | Towards Data Science | What is the most used word in all of Shakespeare plays? Was ‘king’ more often used than ‘Lord’ or vice versa?
To answer these type of fun questions, one often needs to quickly examine and plot most frequent words in a text file (often downloaded from open source portals such as Project Gutenberg). However, if you searc... | [
{
"code": null,
"e": 282,
"s": 172,
"text": "What is the most used word in all of Shakespeare plays? Was ‘king’ more often used than ‘Lord’ or vice versa?"
},
{
"code": null,
"e": 790,
"s": 282,
"text": "To answer these type of fun questions, one often needs to quickly examine an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.