title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Find n-th term of series 1, 4, 27, 16, 125, 36, 343 ....... - GeeksforGeeks | 10 Mar, 2021
Given a number n, find the n-th term in the series 1, 4, 27, 16, 125, 36, 343........Examples:
Input : 5
Output : 125
Input : 6
Output : 36
Naive approach : In this Sequence, if the Nth term is even then the Nth term is square of N else Nth term is a cube of N.
N = 5 In this case, N is odd N = N * N ... | [
{
"code": null,
"e": 25152,
"s": 25124,
"text": "\n10 Mar, 2021"
},
{
"code": null,
"e": 25249,
"s": 25152,
"text": "Given a number n, find the n-th term in the series 1, 4, 27, 16, 125, 36, 343........Examples: "
},
{
"code": null,
"e": 25295,
"s": 25249,
"t... |
How to create a responsive bottom navigation menu with CSS and JavaScript? | Following is the code to create a responsive bottom navigation menu with CSS and JavaScript −
Live Demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
body {
margin: 0px;
margin-top: 10px;
... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "Following is the code to create a responsive bottom navigation menu with CSS and JavaScript −"
},
{
"code": null,
"e": 1167,
"s": 1156,
"text": " Live Demo"
},
{
"code": null,
"e": 2822,
"s": 1167,
"text": "<!DOCT... |
Adding new options in Dropdown dynamically using ReactJS - GeeksforGeeks | 18 Jan, 2021
Creating our own options in the dropdown means that whenever the user types any new value other than the values shown in the options, that new value should be added to the drop down menu as an option. Material UI for React has this component available for us and it is very easy to integrate.
Creating React... | [
{
"code": null,
"e": 24870,
"s": 24842,
"text": "\n18 Jan, 2021"
},
{
"code": null,
"e": 25163,
"s": 24870,
"text": "Creating our own options in the dropdown means that whenever the user types any new value other than the values shown in the options, that new value should be adde... |
Genetic Algorithm Implementation in Python | by Ahmed Gad | Towards Data Science | This tutorial will implement the genetic algorithm optimization technique in Python based on a simple example in which we are trying to maximize the output of an equation. The tutorial uses the decimal representation for genes, one point crossover, and uniform mutation.
5 May 2020 Note
The GitHub project of this tutori... | [
{
"code": null,
"e": 318,
"s": 47,
"text": "This tutorial will implement the genetic algorithm optimization technique in Python based on a simple example in which we are trying to maximize the output of an equation. The tutorial uses the decimal representation for genes, one point crossover, and uni... |
Level Up Your Data Visualizations with Trend Lines in Python | by Byron Dolon | Towards Data Science | Data visualization is a key part of data analysis. Visualizing data makes it easier for people to understand the trends in a dataset compared to just looking at numbers on a table. Part of this includes picking the right chart types to go with the right type of data you are trying to showcase, like using a line chart f... | [
{
"code": null,
"e": 512,
"s": 171,
"text": "Data visualization is a key part of data analysis. Visualizing data makes it easier for people to understand the trends in a dataset compared to just looking at numbers on a table. Part of this includes picking the right chart types to go with the right t... |
Java Program to Append Text to an Existing File | The Java.io.BufferedWriter class writes text to a character-output stream, buffering characters so as to provide for the efficient writing of single characters, arrays, and strings. To add contents to a file −
Instantiate the BufferedWriter class.
By passing the FileWriter object as an argument to its constructor.
W... | [
{
"code": null,
"e": 1272,
"s": 1062,
"text": "The Java.io.BufferedWriter class writes text to a character-output stream, buffering characters so as to provide for the efficient writing of single characters, arrays, and strings. To add contents to a file −"
},
{
"code": null,
"e": 1311,
... |
Create basic graph visualizations with SeaBorn | by Rahul Agarwal | Towards Data Science | When it comes to data preparation and getting acquainted with data, the one step we normally skip is the data visualization.
While a part of it could be attributed to the lack of good visualization tools for the platforms we use, most of us also get lazy at times.
For most of our plotting needs, I would read up blogs, ... | [
{
"code": null,
"e": 297,
"s": 172,
"text": "When it comes to data preparation and getting acquainted with data, the one step we normally skip is the data visualization."
},
{
"code": null,
"e": 437,
"s": 297,
"text": "While a part of it could be attributed to the lack of good vi... |
How to widen output display to see more columns in Pandas dataframe? - GeeksforGeeks | 18 Aug, 2020
In Python, if there are many more number of columns in the dataframe, then not all the columns will be shown in the output display. So, let’s see how to widen output display to see more columns.
Method 1: Using pandas.set_option() function.
This function is used to set the value of a specified option.
Synt... | [
{
"code": null,
"e": 24212,
"s": 24184,
"text": "\n18 Aug, 2020"
},
{
"code": null,
"e": 24407,
"s": 24212,
"text": "In Python, if there are many more number of columns in the dataframe, then not all the columns will be shown in the output display. So, let’s see how to widen outp... |
How do I get PHP errors to display? - GeeksforGeeks | 20 Dec, 2021
There are four ways to display errors in PHP which are listed below:
error_reporting: It does not display the E-STRICT, E-NOTICE and E_DEPRECATED level errors and display all the other level errors.
display_errors: Its default value is “off”. Set it to “on”.
log_errors: It’s default value is “on” which in... | [
{
"code": null,
"e": 40503,
"s": 40475,
"text": "\n20 Dec, 2021"
},
{
"code": null,
"e": 40573,
"s": 40503,
"text": "There are four ways to display errors in PHP which are listed below: "
},
{
"code": null,
"e": 40703,
"s": 40573,
"text": "error_reporting: It ... |
C# | Check whether a SortedList object contains a specific key - GeeksforGeeks | 01 Feb, 2019
SortedList.Contains(Object) Method is used to check whether a SortedList object contains a specific key.
Syntax:
public virtual bool Contains (object key);
Here, key is the Key which is to be located in the SortedList object.
Return Value: This method returns the true if the SortedList object contains an e... | [
{
"code": null,
"e": 23911,
"s": 23883,
"text": "\n01 Feb, 2019"
},
{
"code": null,
"e": 24016,
"s": 23911,
"text": "SortedList.Contains(Object) Method is used to check whether a SortedList object contains a specific key."
},
{
"code": null,
"e": 24024,
"s": 24016... |
C Program to Add two Integers - GeeksforGeeks | 12 Jan, 2022
Given two numbers A and B. The task is to write a program to find the addition of these two numbers.
Examples:
Input: A = 2, B = 3
Output: 5
Input: A = 3, B = 6
Output: 9
In the below program to add two numbers, the user is first asked to enter two numbers and the input is scanned using the scanf() f... | [
{
"code": null,
"e": 24564,
"s": 24536,
"text": "\n12 Jan, 2022"
},
{
"code": null,
"e": 24666,
"s": 24564,
"text": "Given two numbers A and B. The task is to write a program to find the addition of these two numbers. "
},
{
"code": null,
"e": 24678,
"s": 24666,
... |
How to ping external IP from java Android? | This example demonstrates how do I ping external IP from java android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?>
<android.support... | [
{
"code": null,
"e": 1133,
"s": 1062,
"text": "This example demonstrates how do I ping external IP from java android."
},
{
"code": null,
"e": 1262,
"s": 1133,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to crea... |
How to filter single column of a matrix with column name in R? | To filter a single column of a matrix in R if the matrix has column names, we can simply use single square brackets but this will result in a vector without the column name. If we want to use the column name then column name or column number needs to be passed with drop=FALSE argument as shown in the below examples.
Li... | [
{
"code": null,
"e": 1380,
"s": 1062,
"text": "To filter a single column of a matrix in R if the matrix has column names, we can simply use single square brackets but this will result in a vector without the column name. If we want to use the column name then column name or column number needs to be... |
The Three-Dimensional Koch Snowflake — Fun Fractals at Home | by Marc Wouts | Towards Data Science | Welcome! This is an article that we are writing with six hands: Marc, the Father, mathematician and a little bit of a handyman in his spare time, Sasha, 12, and Félix, 8. We started by exploring some mathematical concepts from the Koch Snowflake, everyone brought a lot of enthusiasm to it and we ended up going much fu... | [
{
"code": null,
"e": 688,
"s": 172,
"text": "Welcome! This is an article that we are writing with six hands: Marc, the Father, mathematician and a little bit of a handyman in his spare time, Sasha, 12, and Félix, 8. We started by exploring some mathematical concepts from the Koch Snowflake, everyon... |
Data Science for Fitness: 50 is the new 30 — Part I | by Luis Miguel Sánchez | Towards Data Science | The following article will try to explain a very interesting experience for me, that along with the algorithmic music composition algos (sans neural nets that I developed in 2013–2014) is one of the most rewarding projects I have undertaken: Data Science for Fitness.
In these series of practical applications of Data Sc... | [
{
"code": null,
"e": 440,
"s": 172,
"text": "The following article will try to explain a very interesting experience for me, that along with the algorithmic music composition algos (sans neural nets that I developed in 2013–2014) is one of the most rewarding projects I have undertaken: Data Science ... |
Decimal to binary list conversion in Python | Python being a versatile language can handle many requirements that comes up during the data processing. When we need to convert a decimal number to a binary number we can use the following python programs.
We can Use the letter in the formatter to indicate which number base: decimal, hex, octal, or binary we want our ... | [
{
"code": null,
"e": 1269,
"s": 1062,
"text": "Python being a versatile language can handle many requirements that comes up during the data processing. When we need to convert a decimal number to a binary number we can use the following python programs."
},
{
"code": null,
"e": 1544,
... |
Differences between Collection and Collections in Java? | The Collection is an interface whereas Collections is a utility class in Java. The Set, List, and Queue are some of the subinterfaces of Collection interface, a Map interface is also part of the Collections Framework, but it doesn't inherit Collection interface. The important methods of Collection interface are add(), ... | [
{
"code": null,
"e": 1521,
"s": 1062,
"text": "The Collection is an interface whereas Collections is a utility class in Java. The Set, List, and Queue are some of the subinterfaces of Collection interface, a Map interface is also part of the Collections Framework, but it doesn't inherit Collection i... |
JSF - Custom Tag | JSF provides the developer with a powerful capability to define own custom tags, which can be used to render custom contents.
Defining a custom tag in JSF is a three-step process.
<h:body>
<ui:composition>
<h:commandButton type = "submit" value = "#{okLabel}" />
<h:commandButton type = "reset" value = "... | [
{
"code": null,
"e": 2078,
"s": 1952,
"text": "JSF provides the developer with a powerful capability to define own custom tags, which can be used to render custom contents."
},
{
"code": null,
"e": 2132,
"s": 2078,
"text": "Defining a custom tag in JSF is a three-step process."
... |
Comparing enum members in Java
| The java.lang.Enum class is the common base class of all Java language enumeration types.
Following is the declaration for java.lang.Enum class -
public abstract class Enum<E extends Enum<E>>
extends Object
implements Comparable<E>, Serializable
We can compare enum variables using the following ways.
Using Enu... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "The java.lang.Enum class is the common base class of all Java language enumeration types."
},
{
"code": null,
"e": 1208,
"s": 1152,
"text": "Following is the declaration for java.lang.Enum class -"
},
{
"code": null,
"e":... |
Introduction to Data Pipelines with Singer.io | by Pavneet Singh | Towards Data Science | Data pipelines play a crucial role in all kinds of data platforms, be it for Predictive Analytics or Business Intelligence or maybe just for ETL (Extract — Transport — Load) between various heterogeneous data stores. They all rely on real time or batch ingestion of data which is further processed to derive insights and... | [
{
"code": null,
"e": 761,
"s": 172,
"text": "Data pipelines play a crucial role in all kinds of data platforms, be it for Predictive Analytics or Business Intelligence or maybe just for ETL (Extract — Transport — Load) between various heterogeneous data stores. They all rely on real time or batch in... |
Introduction to YACC - GeeksforGeeks | 29 Apr, 2021
A parser generator is a program that takes as input a specification of a syntax, and produces as output a procedure for recognizing that language. Historically, they are also called compiler-compilers.YACC (yet another compiler-compiler) is an LALR(1) (LookAhead, Left-to-right, Rightmost derivation produce... | [
{
"code": null,
"e": 26063,
"s": 26035,
"text": "\n29 Apr, 2021"
},
{
"code": null,
"e": 26532,
"s": 26063,
"text": "A parser generator is a program that takes as input a specification of a syntax, and produces as output a procedure for recognizing that language. Historically, th... |
How to auto-resize an image to fit a div container using CSS? - GeeksforGeeks | 30 Jul, 2021
To auto-resize an image or a video to fit in a div container use object-fit property. It is used to specify how an image or video fits in the container.
object-fit property: This property is used to specify how an image or video resize and fit the container. It tells the content how to fit in a specific di... | [
{
"code": null,
"e": 25949,
"s": 25921,
"text": "\n30 Jul, 2021"
},
{
"code": null,
"e": 26102,
"s": 25949,
"text": "To auto-resize an image or a video to fit in a div container use object-fit property. It is used to specify how an image or video fits in the container."
},
{
... |
HTML | <input> accept Attribute - GeeksforGeeks | 02 Dec, 2021
The HTML <input> accept Attribute is used to specifies the type of file that the server accepts. This attribute can be used with <input type=”file”> element only. This attribute is not used for validation tool because file uploads should be validated on the Server.Syntax:
<input accept = "file_extension ... | [
{
"code": null,
"e": 31646,
"s": 31618,
"text": "\n02 Dec, 2021"
},
{
"code": null,
"e": 31921,
"s": 31646,
"text": "The HTML <input> accept Attribute is used to specifies the type of file that the server accepts. This attribute can be used with <input type=”file”> element only. ... |
Filter PySpark DataFrame Columns with None or Null Values - GeeksforGeeks | 09 May, 2021
Many times while working on PySpark SQL dataframe, the dataframes contains many NULL/None values in columns, in many of the cases before performing any of the operations of the dataframe firstly we have to handle the NULL/None values in order to get the desired result or output, we have to filter those NUL... | [
{
"code": null,
"e": 26207,
"s": 26179,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 26543,
"s": 26207,
"text": "Many times while working on PySpark SQL dataframe, the dataframes contains many NULL/None values in columns, in many of the cases before performing any of the oper... |
Python Program to implement Full Subtractor - GeeksforGeeks | 21 Nov, 2021
Prerequisite –Full Subtractor in Digital Logic
In this, we will discuss the overview of the full subtractor and will implement the full subtractor logic in the python language. Also, we will cover with the help of examples. Let’s discuss it one by one.
Given three inputs of Full Subtractor A, B, Bin. The t... | [
{
"code": null,
"e": 25279,
"s": 25251,
"text": "\n21 Nov, 2021"
},
{
"code": null,
"e": 25326,
"s": 25279,
"text": "Prerequisite –Full Subtractor in Digital Logic"
},
{
"code": null,
"e": 25532,
"s": 25326,
"text": "In this, we will discuss the overview of th... |
Change Formatting of Numbers of ggplot2 Plot Axis in R - GeeksforGeeks | 30 Jun, 2021
In this article. we will discuss how to change the formatting of numbers of the ggplot2 plot axis in R Programming Language.
The ggplot() method can be used in this package in order to simulate graph customizations and induce flexibility in graph plotting.
Syntax:
ggplot(data = <DATA>, mapping = aes(<MAPPI... | [
{
"code": null,
"e": 26487,
"s": 26459,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 26612,
"s": 26487,
"text": "In this article. we will discuss how to change the formatting of numbers of the ggplot2 plot axis in R Programming Language."
},
{
"code": null,
"e": 2... |
Optimize and Compress JPEG or PNG Images in Linux Command line - GeeksforGeeks | 31 Aug, 2021
Today there are many GUI tools that compress and optimize the images, which are very useful. But if you are terminal addicted and want to compress and optimize the images in the terminal before uploading to the cloud, then you can do it. There are two tools by using which we can compress and optimize image... | [
{
"code": null,
"e": 25651,
"s": 25623,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 25973,
"s": 25651,
"text": "Today there are many GUI tools that compress and optimize the images, which are very useful. But if you are terminal addicted and want to compress and optimize the... |
How to flatten a Vector of Vectors or 2D Vector in C++ - GeeksforGeeks | 07 Apr, 2020
Given a Vector of Vectors (2D vector), the task is to flatten this 2d vector.
Examples:
Input: vector = [[1, 2, 3, 4], [5, 6], [7, 8]]Output: 1 2 3 4 5 6 7 8
Input: vector = [[1, 2], [3], [4, 5, 6, 8]]Output: 1 2 3 4 5 6 8
Algorithm:
2D Vector can be flattened using iterators.Store starting and ending iter... | [
{
"code": null,
"e": 25973,
"s": 25945,
"text": "\n07 Apr, 2020"
},
{
"code": null,
"e": 26051,
"s": 25973,
"text": "Given a Vector of Vectors (2D vector), the task is to flatten this 2d vector."
},
{
"code": null,
"e": 26061,
"s": 26051,
"text": "Examples:"
... |
Convert an Iterable to Collection in Java - GeeksforGeeks | 28 Feb, 2022
Iterable and Collection have served to be of great use in Java. Iterators are used in Collection framework in Java to retrieve elements one by one and a Collection is a group of individual objects represented as a single unit. Java provides Collection Framework which defines several classes and interfaces ... | [
{
"code": null,
"e": 25769,
"s": 25741,
"text": "\n28 Feb, 2022"
},
{
"code": null,
"e": 26416,
"s": 25769,
"text": "Iterable and Collection have served to be of great use in Java. Iterators are used in Collection framework in Java to retrieve elements one by one and a Collection... |
Matplotlib.axes.Axes.broken_barh() in Python - GeeksforGeeks | 13 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
The Axe... | [
{
"code": null,
"e": 25637,
"s": 25609,
"text": "\n13 Apr, 2020"
},
{
"code": null,
"e": 25937,
"s": 25637,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, ... |
SQL Query to Drop Foreign Key Constraint Using ALTER Command - GeeksforGeeks | 13 Apr, 2021
Here, we are going to see How to Drop a Foreign Key Constraint using ALTER Command(SQL Query) using Microsoft SQL Server.
A Foreign key is an attribute in one table which takes references from another table where it acts as the primary key in that table. Also, the column acting as a foreign key should be ... | [
{
"code": null,
"e": 25539,
"s": 25511,
"text": "\n13 Apr, 2021"
},
{
"code": null,
"e": 25662,
"s": 25539,
"text": "Here, we are going to see How to Drop a Foreign Key Constraint using ALTER Command(SQL Query) using Microsoft SQL Server."
},
{
"code": null,
"e": 258... |
ChronoZonedDateTime isBefore() method in Java with Examples - GeeksforGeeks | 29 May, 2019
The isBefore() method of ChronoZonedDateTime interface in Java is used to check if the date, passed as the parameter, is before this ChronoZonedDateTime instance or not. It returns a boolean value showing the same.
Syntax:
public boolean isBefore(ChronoZonedDateTime otherDate)
Parameter: This method accept... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n29 May, 2019"
},
{
"code": null,
"e": 25440,
"s": 25225,
"text": "The isBefore() method of ChronoZonedDateTime interface in Java is used to check if the date, passed as the parameter, is before this ChronoZonedDateTime instance o... |
C++ Program For Rearranging A Linked List In Zig-Zag Fashion - GeeksforGeeks | 30 Dec, 2021
Given a linked list, rearrange it such that the converted list should be of the form a < b > c < d > e < f ... where a, b, c... are consecutive data nodes of the linked list.
Examples:
Input: 1->2->3->4
Output: 1->3->2->4
Explanation: 1 and 3 should come first before 2 and 4 in
zig-zag fash... | [
{
"code": null,
"e": 25851,
"s": 25823,
"text": "\n30 Dec, 2021"
},
{
"code": null,
"e": 26026,
"s": 25851,
"text": "Given a linked list, rearrange it such that the converted list should be of the form a < b > c < d > e < f ... where a, b, c... are consecutive data nodes of the l... |
GATE | GATE-CS-2014-(Set-1) | Question 21 - GeeksforGeeks | 28 Jun, 2021
Consider a rooted Binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having having exactly 4 nodes O(na Logn b). Then the value of a + 10b is ________(A) 1(B) 11(C) 12(D) 21Answer: (A)Explanation: We can find the subtree with 4 nodes in O(n... | [
{
"code": null,
"e": 25757,
"s": 25729,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 26248,
"s": 25757,
"text": "Consider a rooted Binary tree represented using pointers. The best upper bound on the time required to determine the number of subtrees having having exactly 4 nod... |
Control Statements Usage - GeeksforGeeks | 13 May, 2022
Continue StatementIt returns the control to the beginning of the loop.
# Prints all letters except 'e' and 's'for letter in 'geeksforgeeks': if letter == 'e' or letter == 's': continue print 'Current Letter :', letter var = 10
Output:
Current Letter : g
Current Letter : k
Current Letter :... | [
{
"code": null,
"e": 24953,
"s": 24925,
"text": "\n13 May, 2022"
},
{
"code": null,
"e": 25024,
"s": 24953,
"text": "Continue StatementIt returns the control to the beginning of the loop."
},
{
"code": "# Prints all letters except 'e' and 's'for letter in 'geeksforgeeks':... |
Space and time efficient Binomial Coefficient - GeeksforGeeks | 17 Jan, 2022
Write a function that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k). Example:
Input: n = 4 and k = 2
Output: 6
Explanation: 4 C 2 is 4!/(2!*2!) = 6
Input: n = 5 and k = 2
Output: 10
Explanation: 5 C 2 is 5!/(3!*2!) = 20
We have discussed a O(n*k) time and O(k) extra ... | [
{
"code": null,
"e": 25839,
"s": 25811,
"text": "\n17 Jan, 2022"
},
{
"code": null,
"e": 25956,
"s": 25839,
"text": "Write a function that takes two parameters n and k and returns the value of Binomial Coefficient C(n, k). Example: "
},
{
"code": null,
"e": 26099,
... |
How to Truncate a File in Golang? - GeeksforGeeks | 23 Mar, 2020
In Go language, you are allowed to truncate the size of the file with the help of the Truncate() function. This function is used to truncate the size of the given file in the specified size.
If the given file is a symbolic link, then it changes the size of the link’s target.
If this method throws an error,... | [
{
"code": null,
"e": 25703,
"s": 25675,
"text": "\n23 Mar, 2020"
},
{
"code": null,
"e": 25894,
"s": 25703,
"text": "In Go language, you are allowed to truncate the size of the file with the help of the Truncate() function. This function is used to truncate the size of the given ... |
Count of Subarrays in an array containing numbers from 1 to the length of subarray - GeeksforGeeks | 19 Jan, 2022
Given an array arr[] of length N containing all elements from 1 to N, the task is to find the number of sub-arrays that contain numbers from 1 to M, where M is the length of the sub-array.
Examples:
Input: arr[] = {4, 1, 3, 2, 5, 6} Output: 5 Explanation: Desired Sub-arrays = { {4, 1, 3, 2}, {1}, {1, 3, 2... | [
{
"code": null,
"e": 26607,
"s": 26579,
"text": "\n19 Jan, 2022"
},
{
"code": null,
"e": 26796,
"s": 26607,
"text": "Given an array arr[] of length N containing all elements from 1 to N, the task is to find the number of sub-arrays that contain numbers from 1 to M, where M is the... |
Count of natural numbers in range [L, R] which are relatively prime with N - GeeksforGeeks | 17 Jun, 2021
Given three integers N, L, and R. The task is to calculate the number of natural numbers in the range [L, R] (both inclusive) which are relatively prime with N.
Examples:
Input: N = 10, L = 1, R = 25 Output: 10 Explanation: 10 natural numbers (in the range 1 to 25) are relatively prime to 10. They are 1,... | [
{
"code": null,
"e": 25052,
"s": 25024,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 25213,
"s": 25052,
"text": "Given three integers N, L, and R. The task is to calculate the number of natural numbers in the range [L, R] (both inclusive) which are relatively prime with N."
... |
Tryit Editor v3.7 | Tryit: Using the list-style shorthand property | [] |
Four Ways to Filter a Spark Dataset Against a Collection of Data Values | by Ajay Gupta | Towards Data Science | Let us assume there is a very large Dataset ‘A’ with the following schema:
root:| — empId: Integer| — sal: Integer| — name: String| — address: String| — dept: Integer
The Dataset ‘A’ needs to be filtered against a set of employee IDs (empIds), ‘B’ (can be broadcasted to executors), to get a filtered Dataset ‘A`’. The f... | [
{
"code": null,
"e": 246,
"s": 171,
"text": "Let us assume there is a very large Dataset ‘A’ with the following schema:"
},
{
"code": null,
"e": 338,
"s": 246,
"text": "root:| — empId: Integer| — sal: Integer| — name: String| — address: String| — dept: Integer"
},
{
"code... |
Fuzzy matching with Levenshtein and PostgreSQL | by Dhanesh Budhrani | Towards Data Science | User experience is the result of a combination of factors: UI design, response time, tolerance of user errors, etc. The scope of this post falls into the third category. More specifically, I’ll be explaining how to handle user errors in search forms using PostgreSQL and Levenshtein’s distance algorithm. For instance, w... | [
{
"code": null,
"e": 674,
"s": 171,
"text": "User experience is the result of a combination of factors: UI design, response time, tolerance of user errors, etc. The scope of this post falls into the third category. More specifically, I’ll be explaining how to handle user errors in search forms using... |
Static and non static blank final variables in Java | Static variable: Declared with the help of the keyword ‘static’, they are also known as class variables. They are defined within a constructor or outside a class function. When a variable is static, it is shared between all objects of the class, irrespective of the number of objects that are created.
Demonstrating how ... | [
{
"code": null,
"e": 1364,
"s": 1062,
"text": "Static variable: Declared with the help of the keyword ‘static’, they are also known as class variables. They are defined within a constructor or outside a class function. When a variable is static, it is shared between all objects of the class, irrespe... |
Queue add() method in Java | 26 Sep, 2018
The add(E e) method of Queue Interface inserts the element passed in the parameter to the end of the queue if there is space. If the Queue is capacity restricted and no space is left for insertion, it returns an IllegalStateException. The function returns true on successful insertion.
Syntax:
boolean add(E... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Sep, 2018"
},
{
"code": null,
"e": 314,
"s": 28,
"text": "The add(E e) method of Queue Interface inserts the element passed in the parameter to the end of the queue if there is space. If the Queue is capacity restricted and no space ... |
Floyd Warshall Algorithm | DP-16 | 14 Jun, 2022
The Floyd Warshall Algorithm is for solving the All Pairs Shortest Path problem. The problem is to find shortest distances between every pair of vertices in a given edge weighted directed Graph. Example:
Input:
graph[][] = { {0, 5, INF, 10},
{INF, 0, 3, INF},
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Jun, 2022"
},
{
"code": null,
"e": 259,
"s": 54,
"text": "The Floyd Warshall Algorithm is for solving the All Pairs Shortest Path problem. The problem is to find shortest distances between every pair of vertices in a given edge weig... |
numpy.radians() and deg2rad() in Python | 04 Dec, 2020
The numpy.radians() is a mathematical function that helps user to convert angles from degree to radians.
Syntax : numpy.radians(x[, out]) = ufunc ‘radians’)Parameters :
array : [array_like] elements are in degrees.out : [ndaaray, optional]Output array of same shape as x. 2pi Radians = 36o degrees
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2020"
},
{
"code": null,
"e": 133,
"s": 28,
"text": "The numpy.radians() is a mathematical function that helps user to convert angles from degree to radians."
},
{
"code": null,
"e": 197,
"s": 133,
"text": "S... |
Minimum squares to cover a rectangle | 13 Jun, 2022
Given a rectangle with length l and breadth b, we need to find the minimum number of squares that can cover the surface of the rectangle, given that each square has a side of length a. It is allowed to cover the surface larger than the rectangle, but the rectangle has to be covered. It is not allowed to br... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 386,
"s": 52,
"text": "Given a rectangle with length l and breadth b, we need to find the minimum number of squares that can cover the surface of the rectangle, given that each square has a side of... |
Scala Console | println, printf and readLine | 10 Apr, 2019
Console implements functions for displaying the stated values on the terminal i.e, with print, println, and printf we can post to the display. It is also utilized in reading values from the Console with the function from scala.io.StdIn. It is even helpful in constructing interactive programs.Let’s discuss ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Apr, 2019"
},
{
"code": null,
"e": 395,
"s": 28,
"text": "Console implements functions for displaying the stated values on the terminal i.e, with print, println, and printf we can post to the display. It is also utilized in reading v... |
Tensorflow | tf.data.Dataset.from_tensor_slices() | 03 Oct, 2019
With the help of tf.data.Dataset.from_tensor_slices() method, we can get the slices of an array in the form of objects by using tf.data.Dataset.from_tensor_slices() method.
Syntax : tf.data.Dataset.from_tensor_slices(list)Return : Return the objects of sliced elements.
Example #1 :In this example we can se... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n03 Oct, 2019"
},
{
"code": null,
"e": 226,
"s": 53,
"text": "With the help of tf.data.Dataset.from_tensor_slices() method, we can get the slices of an array in the form of objects by using tf.data.Dataset.from_tensor_slices() method."
... |
Internet Message Access Protocol (IMAP) | 22 Jan, 2021
Prerequisite – Protocols in Application Layer
Internet Message Access Protocol (IMAP) is an application layer protocol that operates as a contract for receiving emails from the mail server. It was designed by Mark Crispin in 1986 as a remote access mailbox protocol, the current version of IMAP is IMAP4. It... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jan, 2021"
},
{
"code": null,
"e": 98,
"s": 52,
"text": "Prerequisite – Protocols in Application Layer"
},
{
"code": null,
"e": 552,
"s": 98,
"text": "Internet Message Access Protocol (IMAP) is an application lay... |
Default Interface Methods in C# 8.0 | 06 Dec, 2019
Before C# 8.0 interfaces only contain the declaration of the members(methods, properties, events, and indexers), but from C# 8.0 it is allowed to add members as well as their implementation to the interface. Now you are allowed to add a method with their implementation to the interface without breaking the... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Dec, 2019"
},
{
"code": null,
"e": 695,
"s": 52,
"text": "Before C# 8.0 interfaces only contain the declaration of the members(methods, properties, events, and indexers), but from C# 8.0 it is allowed to add members as well as their... |
Loops in C and C++ | 01 Jun, 2022
In programming, sometimes there is a need to perform some operation more than once or (say) n number of times. Loops come into use when we need to repeatedly execute a block of statements.
For example: Suppose we want to print “Hello World” 10 times. This can be done in two ways as shown below:
Manually ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Jun, 2022"
},
{
"code": null,
"e": 242,
"s": 52,
"text": "In programming, sometimes there is a need to perform some operation more than once or (say) n number of times. Loops come into use when we need to repeatedly execute a block ... |
Convert a negative number to positive in JavaScript | 29 May, 2019
We can convert a negative number to a positive number in javascript by the methods described below.
Method 1: This is a general method in which we will first check whether the number is already positive or negative, if the number is negative then we will multiply the number with -1 to make it positive.
Syn... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 May, 2019"
},
{
"code": null,
"e": 128,
"s": 28,
"text": "We can convert a negative number to a positive number in javascript by the methods described below."
},
{
"code": null,
"e": 332,
"s": 128,
"text": "Method... |
Find the size of a Tuple in Python | 17 May, 2020
Tuple is a collection of Python objects much like a list. The sequence of values stored in a tuple can be of any type, and they are indexed by integers.Values of a tuple are syntactically separated by ‘commas’. Although it is not necessary, it is more common to define a tuple by closing the sequence of val... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 May, 2020"
},
{
"code": null,
"e": 540,
"s": 52,
"text": "Tuple is a collection of Python objects much like a list. The sequence of values stored in a tuple can be of any type, and they are indexed by integers.Values of a tuple are ... |
Express.js express.raw() Function - GeeksforGeeks | 03 Jul, 2020
The express.raw() function is a built-in middleware function in Express. It parses incoming request payloads into a Buffer and is based on body-parser.
Syntax:
express.raw( [options] )
Parameter: The options parameter contains various property like inflate, limit, type, etc.
Return Value: It returns an Obj... | [
{
"code": null,
"e": 29199,
"s": 29171,
"text": "\n03 Jul, 2020"
},
{
"code": null,
"e": 29351,
"s": 29199,
"text": "The express.raw() function is a built-in middleware function in Express. It parses incoming request payloads into a Buffer and is based on body-parser."
},
{
... |
Contains Duplicate in Python | Suppose we have a list of numbers. We have to check whether the list is holding some duplicate elements or not. So if the list is like [1,5,6,2,1,3], then it will return 1 as there are two 1s, but if the list is [1,2,3,4], then it will be false, as there is no duplicate present.
To solve this, we will follow this appro... | [
{
"code": null,
"e": 1342,
"s": 1062,
"text": "Suppose we have a list of numbers. We have to check whether the list is holding some duplicate elements or not. So if the list is like [1,5,6,2,1,3], then it will return 1 as there are two 1s, but if the list is [1,2,3,4], then it will be false, as ther... |
Tryit Editor v3.6 - Show Python | mydb = mysql.connector.connect(
host="localhost",
user="myusername",
password="mypassword"
)
mycursor = mydb.cursor() | [
{
"code": null,
"e": 57,
"s": 25,
"text": "mydb = mysql.connector.connect("
},
{
"code": null,
"e": 77,
"s": 57,
"text": " host=\"localhost\","
},
{
"code": null,
"e": 98,
"s": 77,
"text": " user=\"myusername\","
},
{
"code": null,
"e": 122,
... |
Find a triplet in an array whose sum is closest to a given number - GeeksforGeeks | 05 Dec, 2021
Given an array arr[] of N integers and an integer X, the task is to find three integers in arr[] such that the sum is closest to X.
Examples:
Input: arr[] = {-1, 2, 1, -4}, X = 1
Output: 2
Explanation:
Sums of triplets:
(-1) + 2 + 1 = 2
(-1) + 2 + (-4) = -3
2 + 1 + (-4) = -1
2 is closest to 1.
Input: arr[... | [
{
"code": null,
"e": 24301,
"s": 24273,
"text": "\n05 Dec, 2021"
},
{
"code": null,
"e": 24433,
"s": 24301,
"text": "Given an array arr[] of N integers and an integer X, the task is to find three integers in arr[] such that the sum is closest to X."
},
{
"code": null,
... |
Consonants and Vowels check | Practice | GeeksforGeeks | Let's learn about CPP strings here. CPP strings are quite different from their C counterpart and have various methods that can be invoked on them. We hope you've read the articles.
You are given a string s containing only lowercase letters. You need to count the number of vowels and the number of consonants.
If vowel ... | [
{
"code": null,
"e": 407,
"s": 226,
"text": "Let's learn about CPP strings here. CPP strings are quite different from their C counterpart and have various methods that can be invoked on them. We hope you've read the articles."
},
{
"code": null,
"e": 537,
"s": 407,
"text": "You a... |
Find out if a varchar contains a percent sign in MySQL? | To find out a varchar contains a percent sign in MySQL, you can use LIKE operator. The syntax is as follows −
SELECT * FROM yourTableName WHERE yourColumnName like '%|%%' escape '|';
To understand the above syntax, let us create a table. The query to create a table is as follows −
mysql> create table FindPercentInVarch... | [
{
"code": null,
"e": 1172,
"s": 1062,
"text": "To find out a varchar contains a percent sign in MySQL, you can use LIKE operator. The syntax is as follows −"
},
{
"code": null,
"e": 1245,
"s": 1172,
"text": "SELECT * FROM yourTableName WHERE yourColumnName like '%|%%' escape '|';... |
Logging with Weights & Biases. Monitoring your Neural Network’s... | by Abdur Rahman Kalim | Towards Data Science | Logging the loss and accuracy curves has never been an easy job. We often save these values in arrays or lists and then plot them at the end of the training. Sharing these graphs is even harder where sending screenshots of these graphs seems the only choice. In this tutorial, we will address this issue with Weights & B... | [
{
"code": null,
"e": 499,
"s": 172,
"text": "Logging the loss and accuracy curves has never been an easy job. We often save these values in arrays or lists and then plot them at the end of the training. Sharing these graphs is even harder where sending screenshots of these graphs seems the only choi... |
How can we create multiple MySQL triggers for the same trigger event and action time? | MySQL 5.7.2+ allows us to create multiple triggers for the same event and action time in a table. Both the triggers will activate sequentially when the event occurs. It can be understood with the help of an example −
In this example, we are creating multiple triggers for the same event say BEFORE UPDATE. The names of t... | [
{
"code": null,
"e": 1279,
"s": 1062,
"text": "MySQL 5.7.2+ allows us to create multiple triggers for the same event and action time in a table. Both the triggers will activate sequentially when the event occurs. It can be understood with the help of an example −"
},
{
"code": null,
"e":... |
Build a useful ML Model in hours on GCP to Predict The Beatles’ listeners | by Brian Ray | Towards Data Science | AutoML “Automated Machine Learning” is under fire lately by the Data Science Community. I had some criticism published in on Google Cloud ML Google Cloud’s AutoML first look (the Google AutoML Team did answer some of my requests, see **new** things at the end of this article) This post will show it is completely reason... | [
{
"code": null,
"e": 474,
"s": 46,
"text": "AutoML “Automated Machine Learning” is under fire lately by the Data Science Community. I had some criticism published in on Google Cloud ML Google Cloud’s AutoML first look (the Google AutoML Team did answer some of my requests, see **new** things at the ... |
Rotate Array | Practice | GeeksforGeeks | Given an unsorted array arr[] of size N, rotate it by D elements (Anti - clockwise).
Input:
The first line of the input contains T denoting the number of testcases. First line of each test case contains two space separated elements, N denoting the size of the array and an integer D denoting the number size of the rota... | [
{
"code": null,
"e": 324,
"s": 238,
"text": "Given an unsorted array arr[] of size N, rotate it by D elements (Anti - clockwise). "
},
{
"code": null,
"e": 626,
"s": 324,
"text": "Input:\nThe first line of the input contains T denoting the number of testcases. First line of each ... |
AWS Quicksight - Embedding Dashboard | You can also embed your Quicksight dashboards into external applications/web pages or can control user access using AWS Cognito service. To perform user control, you can create user pool and identity pool in Cognito and assign Embed dashboard policies to identity pool.
AWS Cognito is an IAM service which allows adminis... | [
{
"code": null,
"e": 2501,
"s": 2231,
"text": "You can also embed your Quicksight dashboards into external applications/web pages or can control user access using AWS Cognito service. To perform user control, you can create user pool and identity pool in Cognito and assign Embed dashboard policies t... |
How can we check if a JSON object is empty or not in Java?
| A JSON is a lightweight data-interchange format and the format of JSON is a key with value pair. The JSONObject can parse a text from a String to produce a map-like object and supports java.util.Map interface.
We can check whether the JSON object is empty or not in the below example
import java.util.*;
import org.json... | [
{
"code": null,
"e": 1273,
"s": 1062,
"text": "A JSON is a lightweight data-interchange format and the format of JSON is a key with value pair. The JSONObject can parse a text from a String to produce a map-like object and supports java.util.Map interface. "
},
{
"code": null,
"e": 1347,... |
Can HTML be embedded inside PHP “if” statement? | Yes, HTML can be embedded inside an ‘if’ statement with the help of PHP. Below are a few methods.
Using the if condition −
<?php if($condition) : ?>
<a href="website_name.com">it is displayed iff $condition is met</a>
<?php endif; ?>
Using the if and else if conditions −
<?php if($condition) : ?>
<a href=" websit... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "Yes, HTML can be embedded inside an ‘if’ statement with the help of PHP. Below are a few methods."
},
{
"code": null,
"e": 1185,
"s": 1160,
"text": "Using the if condition −"
},
{
"code": null,
"e": 1299,
"s": 1185,
... |
JLabel | Java Swing - GeeksforGeeks | 15 Apr, 2021
JLabel is a class of java Swing . JLabel is used to display a short string or an image icon. JLabel can display text, image or both . JLabel is only a display of text or image and it cannot get focus . JLabel is inactive to input events such a mouse focus or keyboard focus. By default labels are vertically... | [
{
"code": null,
"e": 25803,
"s": 25775,
"text": "\n15 Apr, 2021"
},
{
"code": null,
"e": 26200,
"s": 25803,
"text": "JLabel is a class of java Swing . JLabel is used to display a short string or an image icon. JLabel can display text, image or both . JLabel is only a display of t... |
Hashtable in Java - GeeksforGeeks | 11 May, 2022
The Hashtable class implements a hash table, which maps keys to values. Any non-null object can be used as a key or as a value. To successfully store and retrieve objects from a hashtable, the objects used as keys must implement the hashCode method and the equals method.
Features of Hashtable
It is simil... | [
{
"code": null,
"e": 30197,
"s": 30169,
"text": "\n11 May, 2022"
},
{
"code": null,
"e": 30471,
"s": 30197,
"text": "The Hashtable class implements a hash table, which maps keys to values. Any non-null object can be used as a key or as a value. To successfully store and retrieve ... |
Python Library for Self-Balancing BST - GeeksforGeeks | 10 Jan, 2022
Here we will see simulating the library framework TreeSet which is available in Java on Python. There are situations that arise to disallow duplicate entries especially in any management software where an object is uniquely identified by its uniqueness. In this post, let us see how to do that in Pythonic w... | [
{
"code": null,
"e": 25561,
"s": 25533,
"text": "\n10 Jan, 2022"
},
{
"code": null,
"e": 25872,
"s": 25561,
"text": "Here we will see simulating the library framework TreeSet which is available in Java on Python. There are situations that arise to disallow duplicate entries espec... |
Python | Database management in PostgreSQL - GeeksforGeeks | 25 Jun, 2019
PostgreSQL is an open source object-relational database management system. It is well known for its reliability, robustness, and performance. PostgreSQL has a variety of libraries of API (Application programmable interface) that are available for a variety of popular programming languages such as Python. I... | [
{
"code": null,
"e": 26089,
"s": 26061,
"text": "\n25 Jun, 2019"
},
{
"code": null,
"e": 26504,
"s": 26089,
"text": "PostgreSQL is an open source object-relational database management system. It is well known for its reliability, robustness, and performance. PostgreSQL has a vari... |
Implementation of Perceptron Algorithm for NOR Logic Gate with 2-bit Binary Input - GeeksforGeeks | 08 Jul, 2020
In the field of Machine Learning, the Perceptron is a Supervised Learning Algorithm for binary classifiers. The Perceptron Model implements the following function:
For a particular choice of the weight vector and bias parameter , the model predicts output for the corresponding input vector .
NOR log... | [
{
"code": null,
"e": 25589,
"s": 25561,
"text": "\n08 Jul, 2020"
},
{
"code": null,
"e": 25753,
"s": 25589,
"text": "In the field of Machine Learning, the Perceptron is a Supervised Learning Algorithm for binary classifiers. The Perceptron Model implements the following function:... |
Slicing a Vector in C++ - GeeksforGeeks | 19 Jul, 2021
Pre-requisite: Vectors in C++Slicing a vector means to make a subvector from a given vector. Given N integers in a vector arr and to positive numbers X and Y, the task is to slice the given vector from index X to Y in a given vector.Examples:
Input: vector arr = { 1, 3, 4, 2, 4, 2, 1 }, X = 2, Y = 5Outpu... | [
{
"code": null,
"e": 25815,
"s": 25787,
"text": "\n19 Jul, 2021"
},
{
"code": null,
"e": 26060,
"s": 25815,
"text": "Pre-requisite: Vectors in C++Slicing a vector means to make a subvector from a given vector. Given N integers in a vector arr and to positive numbers X and Y, the ... |
Remove first adjacent pairs of similar characters until possible - GeeksforGeeks | 27 May, 2021
Given a string Str, the task is to remove first adjacent pairs of similar characters until we can. Note: Remove adjacent characters to get a new string and then again remove adjacent duplicates from the new string and keep repeating this process until all similar adjacent character pairs are removed.Exampl... | [
{
"code": null,
"e": 25799,
"s": 25771,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 26112,
"s": 25799,
"text": "Given a string Str, the task is to remove first adjacent pairs of similar characters until we can. Note: Remove adjacent characters to get a new string and then ag... |
Python Dictionary to find mirror characters in a string - GeeksforGeeks | 26 May, 2021
Given a string and a number N, we need to mirror the characters from the N-th position up to the length of the string in alphabetical order. In mirror operation, we change ‘a’ to ‘z’, ‘b’ to ‘y’, and so on.Examples:
Input : N = 3
paradox
Output : paizwlc
We mirror characters from position 3 to en... | [
{
"code": null,
"e": 26031,
"s": 26003,
"text": "\n26 May, 2021"
},
{
"code": null,
"e": 26249,
"s": 26031,
"text": "Given a string and a number N, we need to mirror the characters from the N-th position up to the length of the string in alphabetical order. In mirror operation, w... |
To check a number is palindrome or not without using any extra space - GeeksforGeeks | 06 May, 2021
Given a number ‘n’ and our goal is to find out it is palindrome or not without using any extra space. We can’t make a new copy of number .Examples:
Input : 2332
Output : Yes it is Palindrome.
Explanation:
original number = 2332
reversed number = 2332
Both are same hence the number is palindrome.
Input ... | [
{
"code": null,
"e": 26117,
"s": 26089,
"text": "\n06 May, 2021"
},
{
"code": null,
"e": 26267,
"s": 26117,
"text": "Given a number ‘n’ and our goal is to find out it is palindrome or not without using any extra space. We can’t make a new copy of number .Examples: "
},
{
... |
How to set dropdown and search box in same line using Bootstrap ? - GeeksforGeeks | 21 Dec, 2020
A dropdown menu is a type of menu, by using the dropdown menu user can select something from the given predefined set. It is a toggleable menu, which means it appears when the user clicks on the menu. A search box is a type of box in which you can write the string which you want to search.
The main aim is... | [
{
"code": null,
"e": 26937,
"s": 26906,
"text": " \n21 Dec, 2020\n"
},
{
"code": null,
"e": 27228,
"s": 26937,
"text": "A dropdown menu is a type of menu, by using the dropdown menu user can select something from the given predefined set. It is a toggleable menu, which means it a... |
How to check the specified rune in Golang String? - GeeksforGeeks | 05 Sep, 2019
In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every character is represented by one or more bytes using UTF-8 Encoding.In the Go strings, you are allowed to check the given string contain the specified ru... | [
{
"code": null,
"e": 25653,
"s": 25625,
"text": "\n05 Sep, 2019"
},
{
"code": null,
"e": 26300,
"s": 25653,
"text": "In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every characte... |
Introduction to Markov Chains. What are Markov chains, when to use... | by Devin Soni 👑 | Towards Data Science | Markov chains are a fairly common, and relatively simple, way to statistically model random processes. They have been used in many different domains, ranging from text generation to financial modeling. A popular example is r/SubredditSimulator, which uses Markov chains to automate the creation of content for an entire ... | [
{
"code": null,
"e": 782,
"s": 171,
"text": "Markov chains are a fairly common, and relatively simple, way to statistically model random processes. They have been used in many different domains, ranging from text generation to financial modeling. A popular example is r/SubredditSimulator, which uses... |
How to make text bold, italic and underline using jQuery | To make text bold, italic and underline using jQuery, use the jQuery css() method with the CSS properties font-style, font-weight and text-decoration. You can try to run the following code to learn how to make text bold, italic and underline using jQuery −
Live Demo
<!DOCTYPE html>
<html>
<head>
<script src="https://aj... | [
{
"code": null,
"e": 1319,
"s": 1062,
"text": "To make text bold, italic and underline using jQuery, use the jQuery css() method with the CSS properties font-style, font-weight and text-decoration. You can try to run the following code to learn how to make text bold, italic and underline using jQuer... |
C# | Boolean.Parse() Method - GeeksforGeeks | 13 Sep, 2021
This method is used to convert the specified string representation of a logical value to its Boolean equivalent.
Syntax:
public static bool Parse (string value);
Here, the value is the string which contains the value to convert.Return Value: This method returns true if value is equivalent to TrueString ... | [
{
"code": null,
"e": 24161,
"s": 24133,
"text": "\n13 Sep, 2021"
},
{
"code": null,
"e": 24275,
"s": 24161,
"text": "This method is used to convert the specified string representation of a logical value to its Boolean equivalent. "
},
{
"code": null,
"e": 24285,
"... |
Publishing to Medium From Jupyter Notebooks | by Kurtis Pykes | Towards Data Science | Programmers, we all know the struggle of writing a notebook then having to copy and paste the code into Medium when we write a technical post... HEADACHE! To my delight, and probably yours, I’ve found the package that I believe is the saving grace for our programming on Medium woes.
Jupyter-to-Medium was created by a f... | [
{
"code": null,
"e": 456,
"s": 172,
"text": "Programmers, we all know the struggle of writing a notebook then having to copy and paste the code into Medium when we write a technical post... HEADACHE! To my delight, and probably yours, I’ve found the package that I believe is the saving grace for our... |
How to set the size of the browser window in Selenium? | We can set the size of the browser window by the following methods −
getSize() method
getSize() method
Javascript executor
Javascript executor
With setSize() method.
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.op... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "We can set the size of the browser window by the following methods −"
},
{
"code": null,
"e": 1148,
"s": 1131,
"text": "getSize() method"
},
{
"code": null,
"e": 1165,
"s": 1148,
"text": "getSize() method"
},
... |
Python/STAN Implementation of Multiplicative Marketing Mix Model | by Sibyl He | Towards Data Science | Full code and simulated dataset are posted on my Github repo: https://github.com/sibylhe/mmm_stan
The methodology of this project is based on this paper by Google, but is applied to a more complicated, real-world setting, where 1) there are 13 media channels and 46 control variables; 2) models are built in a stacked wa... | [
{
"code": null,
"e": 269,
"s": 171,
"text": "Full code and simulated dataset are posted on my Github repo: https://github.com/sibylhe/mmm_stan"
},
{
"code": null,
"e": 494,
"s": 269,
"text": "The methodology of this project is based on this paper by Google, but is applied to a mo... |
Binary Tree to CDLL | Practice | GeeksforGeeks | Given a Binary Tree of N edges. The task is to convert this to a Circular Doubly Linked List(CDLL) in-place. The left and right pointers in nodes are to be used as previous and next pointers respectively in converted CDLL. The order of nodes in CDLL must be same as Inorder of the given Binary Tree. The first node of In... | [
{
"code": null,
"e": 628,
"s": 238,
"text": "Given a Binary Tree of N edges. The task is to convert this to a Circular Doubly Linked List(CDLL) in-place. The left and right pointers in nodes are to be used as previous and next pointers respectively in converted CDLL. The order of nodes in CDLL must ... |
TreeMap descendingKeySet() Method in Java with Examples - GeeksforGeeks | 27 Aug, 2020
The descendingKeySet() method of TreeMap class returns a reverse order NavigableSet view of the keys contained within the map. The iterator of the set returns the keys in descending order.
Note: The set is backed by the map, so changes to the map are reflected within the set, and vice-versa.
Syntax:
publi... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n27 Aug, 2020"
},
{
"code": null,
"e": 23747,
"s": 23557,
"text": "The descendingKeySet() method of TreeMap class returns a reverse order NavigableSet view of the keys contained within the map. The iterator of the set returns the ... |
A single query to get the sum of count from different tables in MySQL? | To get the sum of count from different tables, use UNION ALL. Let us first create a table −
mysql> create table DemoTable1
-> (
-> Id int,
-> Name varchar(30)
-> );
Query OK, 0 rows affected (1.55 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1 values(10,'Chris Brown');
Query ... | [
{
"code": null,
"e": 1154,
"s": 1062,
"text": "To get the sum of count from different tables, use UNION ALL. Let us first create a table −"
},
{
"code": null,
"e": 1264,
"s": 1154,
"text": "mysql> create table DemoTable1\n-> (\n-> Id int,\n-> Name varchar(30)\n-> );\nQuery OK, 0 ... |
Modify XML files with Python | 18 Aug, 2021
Python|Modifying/Parsing XML Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.The design goals of XML focus on simplicity, generality, and usability across the Internet.It is a textual data ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 1120,
"s": 28,
"text": "Python|Modifying/Parsing XML Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable ... |
K’th Largest Element in BST when modification to BST is not allowed | 27 Jun, 2022
Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree. For example, in the following BST, if k = 3, then output should be 14, and if k = 5, then output should be 10.
We have discussed two methods in this post. The method 1 requires O(n) time. Th... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jun, 2022"
},
{
"code": null,
"e": 280,
"s": 52,
"text": "Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree. For example, in the following BST, if k = 3, then output s... |
Linked List Implementation in C# | 24 Jun, 2022
A LinkedList is a linear data structure which stores element in the non-contiguous location. The elements in a linked list are linked with each other using pointers. Or in other words, LinkedList consists of nodes where each node contains a data field and a reference(link) to the next node in the list. In ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 736,
"s": 53,
"text": "A LinkedList is a linear data structure which stores element in the non-contiguous location. The elements in a linked list are linked with each other using pointers. Or in ot... |
How to create table with 100% width, with vertical scroll inside table body in HTML ? | 12 Mar, 2019
The approach of this article is to create table with 100% width using width property and create vertical scroll inside table body using overflow-y property. Overflow property is used to create scrollbar in table. Use display: block; property to display the block level element. Since changing the display pr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Mar, 2019"
},
{
"code": null,
"e": 451,
"s": 28,
"text": "The approach of this article is to create table with 100% width using width property and create vertical scroll inside table body using overflow-y property. Overflow property ... |
Animated Splash Screen in Android Using Jetpack Compose | 08 Sep, 2021
Jetpack Compose is Android’s advanced toolkit for creating materialistic UI in a very simpler form. It does not require any kind of XML files in Android Studio also it helps to create native applications as well. It is recently launched in the Android Studio Arctic Fox version. Jetpack Compose Functions ar... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Sep, 2021"
},
{
"code": null,
"e": 374,
"s": 52,
"text": "Jetpack Compose is Android’s advanced toolkit for creating materialistic UI in a very simpler form. It does not require any kind of XML files in Android Studio also it helps ... |
C library function - memmove() | The C library function void *memmove(void *str1, const void *str2, size_t n) copies n characters from str2 to str1, but for overlapping memory blocks, memmove() is a safer approach than memcpy().
Following is the declaration for memmove() function.
void *memmove(void *str1, const void *str2, size_t n)
str1 − This is a ... | [
{
"code": null,
"e": 2337,
"s": 2141,
"text": "The C library function void *memmove(void *str1, const void *str2, size_t n) copies n characters from str2 to str1, but for overlapping memory blocks, memmove() is a safer approach than memcpy()."
},
{
"code": null,
"e": 2390,
"s": 2337,... |
HTML5 - Interview Questions | Dear readers, these HTML5 Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of HTML5. As per my experience good interviewers hardly plan to ask any particular question during your interview, normally questions star... | [
{
"code": null,
"e": 3176,
"s": 2742,
"text": "Dear readers, these HTML5 Interview Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of HTML5. As per my experience good interviewers hardly plan to ask any... |
TCS Coding Practice Question | Swap two Numbers | 07 Jul, 2022
Given two numbers, the task is to swap the two numbers using Command Line Arguments. Examples:
Input: n1 = 10, n2 = 20
Output: 20 10
Input: n1 = 100, n2 = 101
Output: 101 100
Approach:
Since the numbers are entered as Command line Arguments, there is no need for a dedicated input line
Extract the input n... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 149,
"s": 53,
"text": "Given two numbers, the task is to swap the two numbers using Command Line Arguments. Examples:"
},
{
"code": null,
"e": 230,
"s": 149,
"text": "Input: n1... |
Divide each dataframe row by vector in R | 17 May, 2021
In this article, we will discuss how to divide each dataframe row by vector in R Programming Language.
The mapply() method can be used to apply a FUN to the dataframe or a matrix, to modify the data. The function specified as the first argument may be any boolean operator, arithmetic, or logical. The opera... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 131,
"s": 28,
"text": "In this article, we will discuss how to divide each dataframe row by vector in R Programming Language."
},
{
"code": null,
"e": 564,
"s": 131,
"text": "The... |
Determining file format using Python | 02 Sep, 2020
The general way of recognizing the type of file is by looking at its extension. But this isn’t generally the case. This type of standard for recognizing file by associating an extension with a file type is enforced by some operating system families (predominantly Windows). Other OS’s such as Linux (and its... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Sep, 2020"
},
{
"code": null,
"e": 713,
"s": 28,
"text": "The general way of recognizing the type of file is by looking at its extension. But this isn’t generally the case. This type of standard for recognizing file by associating an... |
How to set font color in HTML? | To set the font color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property color. HTML5 do not support the <font> tag, so the CSS style is used to add font color. The <font> tag deprecated in HTML5.
Just keep i... | [
{
"code": null,
"e": 1371,
"s": 1062,
"text": "To set the font color in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <p> tag, with the CSS property color. HTML5 do not support the <font> tag, so the CSS style is used... |
Angular PrimeNG PanelMenu Component - GeeksforGeeks | 08 Sep, 2021
Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the PanelMenu component in Angular PrimeNG. We will also learn abo... | [
{
"code": null,
"e": 26464,
"s": 26436,
"text": "\n08 Sep, 2021"
},
{
"code": null,
"e": 26856,
"s": 26464,
"text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp... |
automake command in Linux with Examples - GeeksforGeeks | 08 Apr, 2019
automake is a tool used for automatically generating Makefile.in files compliant with the set GNU Coding Standards. autoconf is required for the use of automake. automake manual can either be read on-line or downloaded in the PDF format. More formats are also offered for download or on-line reading. It wil... | [
{
"code": null,
"e": 25455,
"s": 25427,
"text": "\n08 Apr, 2019"
},
{
"code": null,
"e": 25834,
"s": 25455,
"text": "automake is a tool used for automatically generating Makefile.in files compliant with the set GNU Coding Standards. autoconf is required for the use of automake. a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.