title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to convert a String representation of a Dictionary to a dictionary in Python? | Dictionary object is easily convertible to string by str() function.
>>> D1={'1':1, '2':2, '3':3}
>>> D1
{'1': 1, '2': 2, '3': 3}
>>> str(D1)
"{'1': 1, '2': 2, '3': 3}"
To convert a string to dictionary, we have to ensure that the string contains a valid representation of dictionary. This can be done by eval() function... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "Dictionary object is easily convertible to string by str() function."
},
{
"code": null,
"e": 1231,
"s": 1131,
"text": ">>> D1={'1':1, '2':2, '3':3}\n>>> D1\n{'1': 1, '2': 2, '3': 3}\n>>> str(D1)\n\"{'1': 1, '2': 2, '3': 3}\""
},
... |
Scylla – Phone Number & User Information Gathering Tool in Kali Linux - GeeksforGeeks | 30 Apr, 2021
Scylla is a free and open-source tool available on Github. Scylla is based upon the concept of Open Source Intelligence (OSINT). This tool is used for information gathering. Scylla is written in python language. You must have python language installed in your Kali Linux in order to use the Scylla tool. Scy... | [
{
"code": null,
"e": 24552,
"s": 24524,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 25245,
"s": 24552,
"text": "Scylla is a free and open-source tool available on Github. Scylla is based upon the concept of Open Source Intelligence (OSINT). This tool is used for information ... |
Setting the name of the axes in Pandas DataFrame - GeeksforGeeks | 23 Jan, 2019
There are multiple operations which can be performed over the exes in Pandas. Let’s see how to operate on row and column index with examples.
For link to the CSV file used in the code, click here.
Code #1 : We can reset the name of the DataFrame index by using df.index.name attribute.
# importing pandas as... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n23 Jan, 2019"
},
{
"code": null,
"e": 25697,
"s": 25555,
"text": "There are multiple operations which can be performed over the exes in Pandas. Let’s see how to operate on row and column index with examples."
},
{
"code":... |
What are the differences between JavaScript Primitive Data Types and Objects? | Before beginning with the difference, let’s learn what are Primitive Datatypes. Primitive defines immutable values and introduced recently by ECMAScript standard.
JavaScript allows you to work with three primitive data types,
Numbers, eg. 3, 310.20 etc.
Strings of text e.g. "This text string" etc.
Boolean e.g. true or ... | [
{
"code": null,
"e": 1225,
"s": 1062,
"text": "Before beginning with the difference, let’s learn what are Primitive Datatypes. Primitive defines immutable values and introduced recently by ECMAScript standard."
},
{
"code": null,
"e": 1288,
"s": 1225,
"text": "JavaScript allows y... |
Python IMDbPY – Getting released year of movie from movie object - GeeksforGeeks | 22 Apr, 2020
In this article we will see how we can get the released year of movie from the movie object, we can get movie object with the help of search_movie and get_movie method to find movies.
search_movie method returns list and each element of list work as a dictionary similarly get_movie method return a movie ob... | [
{
"code": null,
"e": 26429,
"s": 26401,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 26613,
"s": 26429,
"text": "In this article we will see how we can get the released year of movie from the movie object, we can get movie object with the help of search_movie and get_movie me... |
MomentJS - Examples | Till now, we have learnt many concepts in MomentJS. This chapter gives you further examples for a better understanding.
This is an example which displays the dates between two given dates.
<!DOCTYPE html>
<html>
<head>
<script type="text/JavaScript" src="MomentJS.js"></script>
<style>
table, td ... | [
{
"code": null,
"e": 2080,
"s": 1960,
"text": "Till now, we have learnt many concepts in MomentJS. This chapter gives you further examples for a better understanding."
},
{
"code": null,
"e": 2149,
"s": 2080,
"text": "This is an example which displays the dates between two given ... |
Classifying Loans based on the risk of defaulting | by Vidhur Kumar | Towards Data Science | Classification is one of the classical problems in Supervised Learning where we attempt to train a model to classify data points into *n* distinct classes. As I was browsing through datasets online, I came across one that contained information on 1000 loan applicants (from both urban and rural areas). One of the column... | [
{
"code": null,
"e": 585,
"s": 172,
"text": "Classification is one of the classical problems in Supervised Learning where we attempt to train a model to classify data points into *n* distinct classes. As I was browsing through datasets online, I came across one that contained information on 1000 loa... |
__new__ in Python - GeeksforGeeks | 25 Nov, 2019
Python is an Object oriented programming language i.e everything in Python is an object. There are special kind of methods in Python known as magic methods or dunder methods (dunder here means “Double Underscores”). Dunder or magic methods in Python are the methods having two prefix and suffix underscores ... | [
{
"code": null,
"e": 24348,
"s": 24320,
"text": "\n25 Nov, 2019"
},
{
"code": null,
"e": 24802,
"s": 24348,
"text": "Python is an Object oriented programming language i.e everything in Python is an object. There are special kind of methods in Python known as magic methods or dund... |
Audio Classification using FastAI and On-the-Fly Frequency Transforms | by John Hartquist | Towards Data Science | While deep learning models are able to help tackle many different types of problems, image classification is the most prevalent example for courses and frameworks, often acting as the “hello, world” introduction. FastAI is a high-level library built on top of PyTorch that makes it extremely easy to get started classify... | [
{
"code": null,
"e": 1175,
"s": 172,
"text": "While deep learning models are able to help tackle many different types of problems, image classification is the most prevalent example for courses and frameworks, often acting as the “hello, world” introduction. FastAI is a high-level library built on t... |
Lolcode - Loops | Loops are used in programming languages to execute a set of statements multiple times. For example, if you want to print the digit 5 for five times, then instead of writing the VISIBLE “5” statement five times, you can run a loop with single VISIBLE “5” statement for five times.
Simple loops are represented with IM IN ... | [
{
"code": null,
"e": 2120,
"s": 1840,
"text": "Loops are used in programming languages to execute a set of statements multiple times. For example, if you want to print the digit 5 for five times, then instead of writing the VISIBLE “5” statement five times, you can run a loop with single VISIBLE “5”... |
Connecting to SAP R/3 system via JCo client and JCo Server | In JCo3.0, Java client JCO.Client is replaced by JCoDestinations. You can connect to SAP system via Inbound RFC Communication (Java calls ABAP) or via Outbound RFC Communication (ABAP calls Java).
For inbound RFC communication, you need to use JCoDestination for executing a remote function module at ABAP side. To use i... | [
{
"code": null,
"e": 1259,
"s": 1062,
"text": "In JCo3.0, Java client JCO.Client is replaced by JCoDestinations. You can connect to SAP system via Inbound RFC Communication (Java calls ABAP) or via Outbound RFC Communication (ABAP calls Java)."
},
{
"code": null,
"e": 1680,
"s": 1259... |
Divide the array in K segments such that the sum of minimums is maximized | 26 May, 2022
Given an array a of size N and an integer K, the task is to divide the array into K segments such that sum of the minimum of K segments is maximized. Examples:
Input: a[] = {5, 7, 4, 2, 8, 1, 6}, K = 3 Output: 7 Divide the array at indexes 0 and 1. Then the segments are {5}, {7}, {4, 2, 8, 1, 6}. Sum of ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 May, 2022"
},
{
"code": null,
"e": 214,
"s": 52,
"text": "Given an array a of size N and an integer K, the task is to divide the array into K segments such that sum of the minimum of K segments is maximized. Examples: "
},
{
... |
Why Python is called Dynamically Typed? | 16 Sep, 2018
Python variable assignment is different from some of the popular languages like c, c++ and java. There is no declaration of a variable, just an assignment statement.
Let us see why?When we declare a variable in C or alike languages, this sets aside an area of memory for holding values allowed by the data t... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Sep, 2018"
},
{
"code": null,
"e": 220,
"s": 54,
"text": "Python variable assignment is different from some of the popular languages like c, c++ and java. There is no declaration of a variable, just an assignment statement."
},
... |
How to send email verification link with firebase using ReactJS? | 12 Apr, 2021
In this article we are going to see how to send an email verification link with firebase using React.js.
For Setup a firebase (Setup a Firebase for your React Project).
Creating React Application And Installing Module.
Step 1: Create a React myapp using the following command.npx create-react-app myapp
Ste... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Apr, 2021"
},
{
"code": null,
"e": 160,
"s": 54,
"text": "In this article we are going to see how to send an email verification link with firebase using React.js. "
},
{
"code": null,
"e": 224,
"s": 160,
"text": ... |
Set in C++ Standard Template Library (STL)
| 06 Jul, 2022
Sets are a type of associative containers in which each element has to be unique because the value of the element identifies it. The values are stored in a specific order.
Syntax:
set<datatype> setname;
Datatype: Set can take any data type depending on the values, e.g. int, char, float, etc.
Example:
set... | [
{
"code": null,
"e": 57,
"s": 26,
"text": " \n06 Jul, 2022\n"
},
{
"code": null,
"e": 230,
"s": 57,
"text": "Sets are a type of associative containers in which each element has to be unique because the value of the element identifies it. The values are stored in a specific order.... |
ord() function in Python | 23 Sep, 2021
Python ord() function returns the Unicode code from a given character. This function accepts a string of unit length as an argument and returns the Unicode equivalence of the passed argument. In other words, given a string of length 1, the ord() function returns an integer representing the Unicode code poi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 482,
"s": 54,
"text": "Python ord() function returns the Unicode code from a given character. This function accepts a string of unit length as an argument and returns the Unicode equivalence of the... |
Mosaic Plot in R Programming | 30 Jun, 2021
Mosaic Plots are used to show symmetries for tables that are divided into two or more conditional distributions. Mosaic plots are a great way to visualize hierarchical data. A collection of rectangles represents all the elements to be visualized with the rectangles of different sizes and colors makes a tab... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 663,
"s": 28,
"text": "Mosaic Plots are used to show symmetries for tables that are divided into two or more conditional distributions. Mosaic plots are a great way to visualize hierarchical data. A... |
How to create a translucent text input in ReactJS ? | 14 Jan, 2022
In this article, we are going to learn how to create a translucent text input in ReactJS.
Prerequisites:
Knowledge of JavaScript (ES6)Knowledge of HTML/CSS.Basic knowledge of ReactJS.
Knowledge of JavaScript (ES6)
Knowledge of HTML/CSS.
Basic knowledge of ReactJS.
React hooks used in building this applicat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jan, 2022"
},
{
"code": null,
"e": 118,
"s": 28,
"text": "In this article, we are going to learn how to create a translucent text input in ReactJS."
},
{
"code": null,
"e": 133,
"s": 118,
"text": "Prerequisites:"
... |
What is Event bubbling and Event Capturing in JavaScript ? | 14 Sep, 2021
Event bubbling and event capturing are the two interesting concepts of JavaScript. Before diving deep into these fascinating concepts, let us first know about what an event listener is? An event listener is basically a function that waits for an event to occur. That event can be anything like a mouse click... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 422,
"s": 54,
"text": "Event bubbling and event capturing are the two interesting concepts of JavaScript. Before diving deep into these fascinating concepts, let us first know about what an event l... |
Giuga Numbers | 07 Jul, 2021
Given a number N, the task is to check if N is an Giuga Number or not. If N is an Giuga Number then print “Yes” else print “No”.
A Giuga Number is a composite number N such that p divides (N/p – 1) for every prime factor p of N.
Examples:
Input: N = 30 Output: Yes Explanation: 30 is a composite number ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jul, 2021"
},
{
"code": null,
"e": 157,
"s": 28,
"text": "Given a number N, the task is to check if N is an Giuga Number or not. If N is an Giuga Number then print “Yes” else print “No”."
},
{
"code": null,
"e": 259,
... |
Integer.numberOfLeadingZeros() Method in Java With Example | 13 Dec, 2021
The java.lang.Integer.numberOfLeadingZeros() is the method which returns the total number of zero(0) bits preceding the highest-order (ie.leftmost or most significant “1” bit)one-bit in the two’s complement binary representation of the specified integer value or we can say that it is the function which con... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Dec, 2021"
},
{
"code": null,
"e": 597,
"s": 28,
"text": "The java.lang.Integer.numberOfLeadingZeros() is the method which returns the total number of zero(0) bits preceding the highest-order (ie.leftmost or most significant “1” bit)... |
How to Convert Categorical Variable to Numeric in Pandas? | 01 Dec, 2021
In this article, we will learn how to convert a categorical variable into a Numeric by using pandas.
When we look at the categorical data, the first question that arises to anyone is how to handle those data, because machine learning is always good at dealing with numeric values. We could make machine lear... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Dec, 2021"
},
{
"code": null,
"e": 129,
"s": 28,
"text": "In this article, we will learn how to convert a categorical variable into a Numeric by using pandas."
},
{
"code": null,
"e": 452,
"s": 129,
"text": "When ... |
SQL | ALTER (RENAME) | 22 Mar, 2021
Sometimes we may want to rename our table to give it a more relevant name. For this purpose we can use ALTER TABLE to rename the name of table.
*Syntax may vary in different databases. Syntax(Oracle,MySQL,MariaDB):
ALTER TABLE table_name
RENAME TO new_table_name;
Columns can be also be given new name wit... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n22 Mar, 2021"
},
{
"code": null,
"e": 197,
"s": 53,
"text": "Sometimes we may want to rename our table to give it a more relevant name. For this purpose we can use ALTER TABLE to rename the name of table."
},
{
"code": null,
... |
R – Charts and Graphs | 09 Dec, 2021
R language is mostly used for statistics and data analytics purposes to represent the data graphically in the software. To represent those data graphically, charts and graphs are used in R.
There are hundreds of charts and graphs present in R. For example, bar plot, box plot, mosaic plot, dot chart, coplo... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 245,
"s": 54,
"text": "R language is mostly used for statistics and data analytics purposes to represent the data graphically in the software. To represent those data graphically, charts and graphs... |
How to install Doxygen on Ubuntu | Doxygen is the de facto regular tool for generating documentation from annotated C++ sources, however, it additionally supports different wellknown programming languages akin to C, objective-C, C#, Hypertext Preprocessor, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL and Tcl. This arti... | [
{
"code": null,
"e": 1436,
"s": 1062,
"text": "Doxygen is the de facto regular tool for generating documentation from annotated C++ sources, however, it additionally supports different wellknown programming languages akin to C, objective-C, C#, Hypertext Preprocessor, Java, Python, IDL (Corba, Micro... |
How to add two arrays into a new array in JavaScript? | Let’s say the following is our first array −
var firstArray=["John","David","Bob","Mike"];
Following is our second array −
var secondArray=["Chris","Adam","James","Carol"];
To add the above two arrays into a new array, use concat().
Following is the code −
var firstArray=["John","David","Bob","Mike"];
var secondArray=[... | [
{
"code": null,
"e": 1107,
"s": 1062,
"text": "Let’s say the following is our first array −"
},
{
"code": null,
"e": 1153,
"s": 1107,
"text": "var firstArray=[\"John\",\"David\",\"Bob\",\"Mike\"];"
},
{
"code": null,
"e": 1185,
"s": 1153,
"text": "Following is... |
Log Transformation Base For Data Linearization Does Not Matter | by Jeremy Chow | Towards Data Science | Code for this demonstration can be found here:
Today a colleague asked me a simple question:
“How do you find the best logarithm base to linearly transform your data?”
This is actually a trick question, because there is no best log base to linearly transform your data — the fact that you are taking a log will linearize... | [
{
"code": null,
"e": 219,
"s": 172,
"text": "Code for this demonstration can be found here:"
},
{
"code": null,
"e": 265,
"s": 219,
"text": "Today a colleague asked me a simple question:"
},
{
"code": null,
"e": 340,
"s": 265,
"text": "“How do you find the bes... |
Tryit Editor v3.7 | Padding & Spacing
Tryit: HTML table - space between cells | [
{
"code": null,
"e": 40,
"s": 22,
"text": "Padding & Spacing"
}
] |
Design File System in Python | Suppose we have to design a file system which provides these two functions −
createPath(path, value) − This creates a new path and associates a value to it if possible and returns True. It returns False if the path already exists or its parent path doesn't exist.get(path) − This finds the value associated with a path o... | [
{
"code": null,
"e": 1139,
"s": 1062,
"text": "Suppose we have to design a file system which provides these two functions −"
},
{
"code": null,
"e": 1422,
"s": 1139,
"text": "createPath(path, value) − This creates a new path and associates a value to it if possible and returns Tr... |
Replace first occurrence of a character in Java | To replace the first occurrence of a character in Java, use the replaceFirst() method.
Here is our string.
String str = "The Haunting of Hill House!";
Let us replace the first occurrence of character “H”
str.replaceFirst("(?:H)+", "B");
The following is the complete example.
Live Demo
public class Demo {
public st... | [
{
"code": null,
"e": 1149,
"s": 1062,
"text": "To replace the first occurrence of a character in Java, use the replaceFirst() method."
},
{
"code": null,
"e": 1169,
"s": 1149,
"text": "Here is our string."
},
{
"code": null,
"e": 1213,
"s": 1169,
"text": "Stri... |
Gensim - Developing Word Embedding | The chapter will help us understand developing word embedding in Gensim.
Word embedding, approach to represent words & document, is a dense vector representation for text where words having the same meaning have a similar representation. Following are some characteristics of word embedding −
It is a class of technique ... | [
{
"code": null,
"e": 2125,
"s": 2052,
"text": "The chapter will help us understand developing word embedding in Gensim."
},
{
"code": null,
"e": 2345,
"s": 2125,
"text": "Word embedding, approach to represent words & document, is a dense vector representation for text where words... |
Python - Relational Databases | We can connect to relational databases for analysing data using the pandas library as well as another additional library for implementing database connectivity.
This package is named as sqlalchemy which provides full SQL language functionality to be used in python.
The installation is very straight forward using Anacon... | [
{
"code": null,
"e": 2795,
"s": 2529,
"text": "We can connect to relational databases for analysing data using the pandas library as well as another additional library for implementing database connectivity.\nThis package is named as sqlalchemy which provides full SQL language functionality to be us... |
Hidden Bootstrap class | To hide a Bootstrap class, use the .hidden class.
You can try to run the following code to hide a class −
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Example</title>
<link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
<script src = "/scripts/jquery.min.js"></script>
... | [
{
"code": null,
"e": 1112,
"s": 1062,
"text": "To hide a Bootstrap class, use the .hidden class."
},
{
"code": null,
"e": 1168,
"s": 1112,
"text": "You can try to run the following code to hide a class −"
},
{
"code": null,
"e": 1178,
"s": 1168,
"text": "Live ... |
Laravel - Authentication | Authentication is the process of identifying the user credentials. In web applications, authentication is managed by sessions which take the input parameters such as email or username and password, for user identification. If these parameters match, the user is said to be authenticated.
Laravel uses the following comma... | [
{
"code": null,
"e": 2760,
"s": 2472,
"text": "Authentication is the process of identifying the user credentials. In web applications, authentication is managed by sessions which take the input parameters such as email or username and password, for user identification. If these parameters match, the... |
Android - Drag and Drop | Android drag/drop framework allows your users to move data from one View to another View in the current layout using a graphical drag and drop gesture. As of API 11 drag and drop of view onto other views or view groups is supported.The framework includes following three important components to support drag & drop funct... | [
{
"code": null,
"e": 3938,
"s": 3607,
"text": "Android drag/drop framework allows your users to move data from one View to another View in the current layout using a graphical drag and drop gesture. As of API 11 drag and drop of view onto other views or view groups is supported.The framework include... |
How to convert a Date object to LocalDate object in java? | To convert a Date object to LocalDate object in Java −
Convert the obtained date object to an Instant object using the toInstant() method.
Convert the obtained date object to an Instant object using the toInstant() method.
Instant instant = date.toInstant();
Create the ZonedDateTime object using the atZone() method of ... | [
{
"code": null,
"e": 1117,
"s": 1062,
"text": "To convert a Date object to LocalDate object in Java −"
},
{
"code": null,
"e": 1201,
"s": 1117,
"text": "Convert the obtained date object to an Instant object using the toInstant() method."
},
{
"code": null,
"e": 1285,
... |
8051 Program to Divide two 8 Bit numbers | Now we will see another arithmetic operation. The divide operation to divide two 8-bit numbers using this 8051 microcontroller. The register A and B will be used in this operation. No other registers can be used for division. The result of the division has two parts. The quotient part and the remainder part. Register A... | [
{
"code": null,
"e": 1439,
"s": 1062,
"text": "Now we will see another arithmetic operation. The divide operation to divide two 8-bit numbers using this 8051 microcontroller. The register A and B will be used in this operation. No other registers can be used for division. The result of the division ... |
Basic calculator program using Python - GeeksforGeeks | 19 Apr, 2020
Create a simple calculator which can perform basic arithmetic operations like addition, subtraction, multiplication or division depending upon the user input.Approach :
User choose the desired operation. Options 1, 2, 3 and 4 are valid.
Two numbers are taken and an if...elif...else branching is used to exe... | [
{
"code": null,
"e": 24348,
"s": 24320,
"text": "\n19 Apr, 2020"
},
{
"code": null,
"e": 24517,
"s": 24348,
"text": "Create a simple calculator which can perform basic arithmetic operations like addition, subtraction, multiplication or division depending upon the user input.Appro... |
TypeScript - Tuples | At times, there might be a need to store a collection of values of varied types. Arrays will not serve this purpose. TypeScript gives us a data type called tuple that helps to achieve such a purpose.
It represents a heterogeneous collection of values. In other words, tuples enable storing multiple fields of different t... | [
{
"code": null,
"e": 2248,
"s": 2048,
"text": "At times, there might be a need to store a collection of values of varied types. Arrays will not serve this purpose. TypeScript gives us a data type called tuple that helps to achieve such a purpose."
},
{
"code": null,
"e": 2428,
"s": 2... |
Matplotlib - Box Plot | A box plot which is also known as a whisker plot displays a summary of a set of data containing the minimum, first quartile, median, third quartile, and maximum. In a box plot, we draw a box from the first quartile to the third quartile. A vertical line goes through the box at the median. The whiskers go from each quar... | [
{
"code": null,
"e": 2868,
"s": 2516,
"text": "A box plot which is also known as a whisker plot displays a summary of a set of data containing the minimum, first quartile, median, third quartile, and maximum. In a box plot, we draw a box from the first quartile to the third quartile. A vertical line... |
Java Program to get a character from a String | 11 Dec, 2018
Given a String str, the task is to get a specific character from that String at a specific index.
Examples:
Input: str = "Geeks", index = 2
Output: e
Input: str = "GeeksForGeeks", index = 5
Output: F
Below are various ways to do so:
Using String.charAt() method:Get the string and the indexGet the specifi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 126,
"s": 28,
"text": "Given a String str, the task is to get a specific character from that String at a specific index."
},
{
"code": null,
"e": 136,
"s": 126,
"text": "Examples... |
jQuery | ajax() Method | 03 Aug, 2021
The ajax() method in jQuery is used to perform an AJAX request or asynchronous HTTP request.
Syntax:
$.ajax({name:value, name:value, ... })
Parameters: The list of possible values are given below:
type: It is used to specify the type of request.
url: It is used to specify the URL to send the request to.
us... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 147,
"s": 54,
"text": "The ajax() method in jQuery is used to perform an AJAX request or asynchronous HTTP request."
},
{
"code": null,
"e": 155,
"s": 147,
"text": "Syntax:"
}... |
PHP | Introduction | 17 Jun, 2022
The term PHP is an acronym for PHP: Hypertext Preprocessor. PHP is a server-side scripting language designed specifically for web development. It is open-source which means it is free to download and use. It is very simple to learn and use. The files have the extension “.php”.
Rasmus Lerdorf inspired the ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n17 Jun, 2022"
},
{
"code": null,
"e": 331,
"s": 52,
"text": "The term PHP is an acronym for PHP: Hypertext Preprocessor. PHP is a server-side scripting language designed specifically for web development. It is open-source which means i... |
Delete a Linked List node at a given position | 28 Jun, 2022
Given a singly linked list and a position, delete a linked list node at the given position.
Example:
Input: position = 1, Linked List = 8->2->3->1->7
Output: Linked List = 8->3->1->7
Input: position = 0, Linked List = 8->2->3->1->7
Output: Linked List = 2->3->1->7
If the node to be deleted is the root,... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 144,
"s": 52,
"text": "Given a singly linked list and a position, delete a linked list node at the given position."
},
{
"code": null,
"e": 155,
"s": 144,
"text": "Example: "
... |
How to find an element using the attribute “name” in Selenium? | We can find an element using the attribute name with Selenium webdriver using the locators - name, css, or xpath. To identify the element with css, the expression should be tagname[name='value'] and the method to be used is By.cssSelector.
To identify the element with xpath, the expression should be //tagname[@name='va... | [
{
"code": null,
"e": 1302,
"s": 1062,
"text": "We can find an element using the attribute name with Selenium webdriver using the locators - name, css, or xpath. To identify the element with css, the expression should be tagname[name='value'] and the method to be used is By.cssSelector."
},
{
... |
Java String isEmpty() method with example - GeeksforGeeks | 04 Dec, 2018
Java.lang.String.isEmpty() String method checks whether a String is empty or not. This method returns true if the given string is empty, else it returns false. The isEmpty() method of String class is included in java string since JDK 1.6. In other words, you can say that this method returns true if the len... | [
{
"code": null,
"e": 24666,
"s": 24638,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 25006,
"s": 24666,
"text": "Java.lang.String.isEmpty() String method checks whether a String is empty or not. This method returns true if the given string is empty, else it returns false. The... |
Java String split() method example. | The split(String regex, int limit) method of the String class. splits the current string around matches of the given regular expression.
The array returned by this method contains each substring of this string that is terminated by another substring that matches the given expression or is terminated by the end of the s... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "The split(String regex, int limit) method of the String class. splits the current string around matches of the given regular expression."
},
{
"code": null,
"e": 1389,
"s": 1199,
"text": "The array returned by this method contains ea... |
java.util.zip.ZipInputStream.read() Method Example | The java.util.zip.ZipInputStream.read(byte[] buf, int off, int len) method reads from the current ZIP entry into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned.
Following is the declaration for java.util.zip.ZipInputStream.read(byte... | [
{
"code": null,
"e": 2441,
"s": 2192,
"text": "The java.util.zip.ZipInputStream.read(byte[] buf, int off, int len) method reads from the current ZIP entry into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned."
}... |
Maximum water that can be stored between two buildings - GeeksforGeeks | 11 Feb, 2022
Given an integer array which represents the heights of N buildings, the task is to delete N-2 buildings such that the water that can be trapped between the remaining two building is maximum. Please note that the total water trapped between two buildings is gap between them (number of buildings removed) mul... | [
{
"code": null,
"e": 24429,
"s": 24401,
"text": "\n11 Feb, 2022"
},
{
"code": null,
"e": 24779,
"s": 24429,
"text": "Given an integer array which represents the heights of N buildings, the task is to delete N-2 buildings such that the water that can be trapped between the remaini... |
What is strncpy() Function in C language? | The C library function char *strncpy(char *dest, const char *src, size_t n) copies up to n characters from the string pointed to, by src to dest. In a case where, the length of src is less than that of n, the remainder of dest will be padded with null bytes.
An array of characters is called a string.
Following is the d... | [
{
"code": null,
"e": 1321,
"s": 1062,
"text": "The C library function char *strncpy(char *dest, const char *src, size_t n) copies up to n characters from the string pointed to, by src to dest. In a case where, the length of src is less than that of n, the remainder of dest will be padded with null b... |
C - Array of pointers | Before we understand the concept of arrays of pointers, let us consider the following example, which uses an array of 3 integers −
#include <stdio.h>
const int MAX = 3;
int main () {
int var[] = {10, 100, 200};
int i;
for (i = 0; i < MAX; i++) {
printf("Value of var[%d] = %d\n", i, var[i] );
}... | [
{
"code": null,
"e": 2215,
"s": 2084,
"text": "Before we understand the concept of arrays of pointers, let us consider the following example, which uses an array of 3 integers −"
},
{
"code": null,
"e": 2424,
"s": 2215,
"text": "#include <stdio.h>\n \nconst int MAX = 3;\n \nint m... |
Preprocessing BIG Data In Julia With Lathe | by Emmett Boudreau | Towards Data Science | When it comes to the wonderful and vast world of machine-learning, there are many popular options that many Data Scientists choose to work worth. Truthfully, in my personal outlook on the Data Science ecosystem right now, I think that many aspects of the field are outdated while others are charging forward at the speed... | [
{
"code": null,
"e": 664,
"s": 172,
"text": "When it comes to the wonderful and vast world of machine-learning, there are many popular options that many Data Scientists choose to work worth. Truthfully, in my personal outlook on the Data Science ecosystem right now, I think that many aspects of the ... |
Next.js - CLI | NEXT.JS provides a CLI to start, build and export application. It can be invoked using npx which comes npm 5.2 onwards.
To get list of CLI commands and help on them, type the following command.
npx next -h
Usage
$ next <command>
Available commands
build, start, export, dev, telemetry
Options
... | [
{
"code": null,
"e": 2227,
"s": 2107,
"text": "NEXT.JS provides a CLI to start, build and export application. It can be invoked using npx which comes npm 5.2 onwards."
},
{
"code": null,
"e": 2301,
"s": 2227,
"text": "To get list of CLI commands and help on them, type the followi... |
How we can translate Python dictionary into C++? | A python dictionary is a Hashmap. You can use the map data structure in C++ to mimic the behavior of a python dict. You can use map in C++ as follows:
#include <iostream>
#include <map>
using namespace std;
int main(void) {
/* Initializer_list constructor */
map<char, int> m1 = {
{'a', 1},
{'b', 2},
... | [
{
"code": null,
"e": 1213,
"s": 1062,
"text": "A python dictionary is a Hashmap. You can use the map data structure in C++ to mimic the behavior of a python dict. You can use map in C++ as follows:"
},
{
"code": null,
"e": 1608,
"s": 1213,
"text": "#include <iostream>\n#include <... |
How can I clear text of a textbox using Python Selenium WebDriver? | We can clear text of a textbox with Selenium webdriver in Python using the clear method. First of all, we have to identify the text box with the help of any of the locators like id, css, name, class, xpath, css, or class.
Then we have to enter text into it with the help of the send_keys method. Finally, to clear it we ... | [
{
"code": null,
"e": 1284,
"s": 1062,
"text": "We can clear text of a textbox with Selenium webdriver in Python using the clear method. First of all, we have to identify the text box with the help of any of the locators like id, css, name, class, xpath, css, or class."
},
{
"code": null,
... |
Bloom Filters - Introduction and Implementation - GeeksforGeeks | 21 Apr, 2022
Suppose you are creating an account on Geekbook, you want to enter a cool username, you entered it and got a message, “Username is already taken”. You added your birth date along username, still no luck. Now you have added your university roll number also, still got “Username is already taken”. It’s really... | [
{
"code": null,
"e": 24592,
"s": 24564,
"text": "\n21 Apr, 2022"
},
{
"code": null,
"e": 25101,
"s": 24592,
"text": "Suppose you are creating an account on Geekbook, you want to enter a cool username, you entered it and got a message, “Username is already taken”. You added your b... |
How to Avoid the “divide by Zero” Error in SQL? - GeeksforGeeks | 25 Oct, 2021
In this article, we will look at how to avoid the “divide by zero” error in SQL. If we divide any number by zero, it leads to infinity, and we get an error message. We can avoid this error message using the following three methods:
Using NULLIF() function
Using CASE statement
Using SET ARITHABORT OFF
We wi... | [
{
"code": null,
"e": 24188,
"s": 24160,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 24420,
"s": 24188,
"text": "In this article, we will look at how to avoid the “divide by zero” error in SQL. If we divide any number by zero, it leads to infinity, and we get an error message... |
Consecutive Numbers Sum in C++ | Suppose we have a positive integer N, we have to find how many different ways can we write it as a sum of consecutive positive integers?
So, if the input is like 10, then the output will be 3, this is because we can represent 10 as 5 + 5 and 7 + 3, so there are two different ways.
To solve this, we will follow these st... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "Suppose we have a positive integer N, we have to find how many different ways can we write it as a sum of consecutive positive integers?"
},
{
"code": null,
"e": 1344,
"s": 1199,
"text": "So, if the input is like 10, then the output ... |
Apache Spark with Scala - Resilient Distributed Dataset - GeeksforGeeks | 02 Sep, 2021
In the modern world, we are dealing with huge datasets every day. Data is growing even faster than processing speeds. To perform computations on such large data is often achieved by using distributed systems. A distributed system consists of clusters (nodes/networked computers) that run processes in parall... | [
{
"code": null,
"e": 24346,
"s": 24318,
"text": "\n02 Sep, 2021"
},
{
"code": null,
"e": 24699,
"s": 24346,
"text": "In the modern world, we are dealing with huge datasets every day. Data is growing even faster than processing speeds. To perform computations on such large data is... |
Beautiful Soup - Quick Guide | In today’s world, we have tons of unstructured data/information (mostly web data) available freely. Sometimes the freely available data is easy to read and sometimes not. No matter how your data is available, web scraping is very useful tool to transform unstructured data into structured data that is easier to read & a... | [
{
"code": null,
"e": 2473,
"s": 1985,
"text": "In today’s world, we have tons of unstructured data/information (mostly web data) available freely. Sometimes the freely available data is easy to read and sometimes not. No matter how your data is available, web scraping is very useful tool to transfor... |
Latent Dirichlet Allocation For Topic Modelling Explained: Algorithm And Python Scikit-Learn Implementation | by Marius Borcan | Towards Data Science | Latent Dirichlet Allocation algorithm for topic modelling and Python Scikit-Learn Implementation.
Latent Dirichlet Allocation is a form of unsupervised Machine Learning that is usually used for topic modelling in Natural Language Processing tasks. It is a very popular model for these type of tasks and the algorithm beh... | [
{
"code": null,
"e": 270,
"s": 172,
"text": "Latent Dirichlet Allocation algorithm for topic modelling and Python Scikit-Learn Implementation."
},
{
"code": null,
"e": 713,
"s": 270,
"text": "Latent Dirichlet Allocation is a form of unsupervised Machine Learning that is usually u... |
SMOTE using Python. Achieving class balance with few lines... | by Dr. Saptarsi Goswami | Towards Data Science | Class Imbalance is a quite frequently occurring problem manifested in fraud detection, intrusion detection, Suspicious activity detection to name a few. In the context of binary classification, the less frequently occurring class is called the minority class, and the more frequently occurring class is called the majori... | [
{
"code": null,
"e": 554,
"s": 172,
"text": "Class Imbalance is a quite frequently occurring problem manifested in fraud detection, intrusion detection, Suspicious activity detection to name a few. In the context of binary classification, the less frequently occurring class is called the minority cl... |
Image segmentation using fastai. Learn how to color code every pixel of... | by Dipam Vasani | Towards Data Science | Image segmentation is an application of computer vision wherein we color-code every pixel in an image. Each pixel then represents a particular object in that image. If you look at the images above, every street is coded in violet, every building is orange, every tree is green and so on. Why do we do this and how is it ... | [
{
"code": null,
"e": 525,
"s": 172,
"text": "Image segmentation is an application of computer vision wherein we color-code every pixel in an image. Each pixel then represents a particular object in that image. If you look at the images above, every street is coded in violet, every building is orange... |
MariaDB - PHP Syntax | MariaDB partners well with a wide variety of programming languages and frameworks such as PHP, C#, JavaScript, Ruby on Rails, Django, and more. PHP remains the most popular of all available languages due to its simplicity and historical footprint. This guide will focus on PHP partnered with MariaDB.
PHP provides a sele... | [
{
"code": null,
"e": 2663,
"s": 2362,
"text": "MariaDB partners well with a wide variety of programming languages and frameworks such as PHP, C#, JavaScript, Ruby on Rails, Django, and more. PHP remains the most popular of all available languages due to its simplicity and historical footprint. This ... |
C Program for Basic Euclidean algorithms? | Here we will see the Euclidean algorithm to find the GCD of two numbers. The GCD (Greatest Common Divisor) can easily be found using Euclidean algorithm. There are two different approach. One is iterative, another one is recursive. Here we are going to use the recursive Euclidean algorithm.
begin
if a is 0, then
... | [
{
"code": null,
"e": 1354,
"s": 1062,
"text": "Here we will see the Euclidean algorithm to find the GCD of two numbers. The GCD (Greatest Common Divisor) can easily be found using Euclidean algorithm. There are two different approach. One is iterative, another one is recursive. Here we are going to ... |
Running Jupyter on a remote Docker container using SSH | by Lucas Rodés-Guirao | Towards Data Science | In my research I work with Machine Learning/Deep Learning algorithms, which I mostly develop using Python. As such, I find it useful to test different frameworks (such as Keras, PyTorch, Tensorflow...). This lead me to using Docker, and in particular ufoym/deepo image as it provides a very complete environment.
I use a... | [
{
"code": null,
"e": 485,
"s": 172,
"text": "In my research I work with Machine Learning/Deep Learning algorithms, which I mostly develop using Python. As such, I find it useful to test different frameworks (such as Keras, PyTorch, Tensorflow...). This lead me to using Docker, and in particular ufoy... |
Find duplicate rows in a binary matrix | Practice | GeeksforGeeks | Given a boolean matrix of size RxC where each cell contains either 0 or 1, find the row numbers of row (0-based) which already exists or are repeated.
Example 1:
Input:
R = 2, C = 2
matrix[][] = {{1, 0},
{1, 0}}
Output:
1
Explanation:
Row 1 is duplicate of Row 0.
Example 2:
Input:
R = 4, C = 3
matrix[][... | [
{
"code": null,
"e": 389,
"s": 238,
"text": "Given a boolean matrix of size RxC where each cell contains either 0 or 1, find the row numbers of row (0-based) which already exists or are repeated."
},
{
"code": null,
"e": 400,
"s": 389,
"text": "Example 1:"
},
{
"code": nu... |
How to replace missing values with linear interpolation method in an R vector? | The linear interpolation is a method of fitting a curve using linear polynomials and it helps us to create a new data points but these points lie within the range of the original values for which the linear interpolation is done. Sometimes these values may go a little far from the original values but not too far. In R,... | [
{
"code": null,
"e": 1517,
"s": 1062,
"text": "The linear interpolation is a method of fitting a curve using linear polynomials and it helps us to create a new data points but these points lie within the range of the original values for which the linear interpolation is done. Sometimes these values ... |
Using HTML ISMAP | To use an image with ismap attribute, you simply put your image inside a hyper link and use ismap attribute which makes it special image and when the user clicks some place within the image, the browser passes the coordinates of the mouse pointer along with the URL specified in the <a> tag to the web server. The server... | [
{
"code": null,
"e": 2790,
"s": 2374,
"text": "To use an image with ismap attribute, you simply put your image inside a hyper link and use ismap attribute which makes it special image and when the user clicks some place within the image, the browser passes the coordinates of the mouse pointer along ... |
Stack using two queues | Practice | GeeksforGeeks | Implement a Stack using two queues q1 and q2.
Example 1:
Input:
push(2)
push(3)
pop()
push(4)
pop()
Output: 3 4
Explanation:
push(2) the stack will be {2}
push(3) the stack will be {2 3}
pop() poped element will be 3 the
stack will be {2}
push(4) the stack will be {2 4}
pop() poped element will be 4
Exa... | [
{
"code": null,
"e": 284,
"s": 238,
"text": "Implement a Stack using two queues q1 and q2."
},
{
"code": null,
"e": 295,
"s": 284,
"text": "Example 1:"
},
{
"code": null,
"e": 555,
"s": 295,
"text": "Input:\npush(2)\npush(3)\npop()\npush(4)\npop()\nOutput: 3 4... |
Swift - Continue Statement | The continue statement in Swift 4 tells a loop to stop what it is doing and start again at the beginning of the next iteration through the loop.
For a for loop, the continue statement causes the conditional test and increments the portions of the loop to execute. For while and do...while loops, the continue statement c... | [
{
"code": null,
"e": 2398,
"s": 2253,
"text": "The continue statement in Swift 4 tells a loop to stop what it is doing and start again at the beginning of the next iteration through the loop."
},
{
"code": null,
"e": 2633,
"s": 2398,
"text": "For a for loop, the continue statemen... |
How to append an element in an array in JavaScript? - GeeksforGeeks | 06 Mar, 2019
There are several methods for adding new elements to a JavaScript array.
push(): The push() method will add an element to the end of an array, while its twin function, the pop() method, will remove an element from the end of the array. If you need to add an element or multiple elements to the end of an arr... | [
{
"code": null,
"e": 24604,
"s": 24576,
"text": "\n06 Mar, 2019"
},
{
"code": null,
"e": 24677,
"s": 24604,
"text": "There are several methods for adding new elements to a JavaScript array."
},
{
"code": null,
"e": 25665,
"s": 24677,
"text": "push(): The push(... |
Check if all rows of a matrix are circular rotations of each other in Python | Suppose, we are provided with a matrix of the size n*n, containing integer numbers. We have to find out if all the rows of that matrix are circular rotations of its previous row. In case of first row, it should be a circular rotation of the n-th row.
So, if the input is like
then the output will be True.
To solve this,... | [
{
"code": null,
"e": 1313,
"s": 1062,
"text": "Suppose, we are provided with a matrix of the size n*n, containing integer numbers. We have to find out if all the rows of that matrix are circular rotations of its previous row. In case of first row, it should be a circular rotation of the n-th row."
... |
Rebuilding indexes in MongoDB? | To rebuild indexes, use reIndex(). Let us first create an index. Following is the query −
> db.demo42.createIndex({"StudentFirstName":1});
This will produce the following output −
{
"createdCollectionAutomatically" : true,
"numIndexesBefore" : 1,
"numIndexesAfter" : 2,
"ok" : 1
}
Following is the query to r... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "To rebuild indexes, use reIndex(). Let us first create an index. Following is the query −"
},
{
"code": null,
"e": 1201,
"s": 1152,
"text": "> db.demo42.createIndex({\"StudentFirstName\":1});"
},
{
"code": null,
"e": 1242... |
Largest area rectangular sub-matrix with equal number of 1's and 0's - GeeksforGeeks | 26 Sep, 2017
Given a binary matrix. The problem is to find the largest area rectangular sub-matrix with equal number of 1’s and 0’s.
Examples:
Input : mat[][] = { {0, 0, 1, 1},
{0, 1, 1, 0},
{1, 1, 1, 0},
{1, 0, 0, 1} }
Output : 8 sq. units
(Top, left): (0, 0)... | [
{
"code": null,
"e": 24935,
"s": 24907,
"text": "\n26 Sep, 2017"
},
{
"code": null,
"e": 25055,
"s": 24935,
"text": "Given a binary matrix. The problem is to find the largest area rectangular sub-matrix with equal number of 1’s and 0’s."
},
{
"code": null,
"e": 25065,... |
FTP protocol client in Python | The all important The FTP class in ftplib module implements the client side of the FTP protocol.
To establish connection with a FTP server, obtain FTP object.
The FTP class supports following methods −
Connect to the given host and port. The default port number is 21, as specified by the FTP protocol specification.
Ret... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "The all important The FTP class in ftplib module implements the client side of the FTP protocol."
},
{
"code": null,
"e": 1221,
"s": 1159,
"text": "To establish connection with a FTP server, obtain FTP object."
},
{
"code": n... |
Cassandra - Update Data | UPDATE is the command used to update data in a table. The following keywords are used while updating data in a table −
Where − This clause is used to select the row to be updated.
Where − This clause is used to select the row to be updated.
Set − Set the value using this keyword.
Set − Set the value using this keyword.... | [
{
"code": null,
"e": 2406,
"s": 2287,
"text": "UPDATE is the command used to update data in a table. The following keywords are used while updating data in a table −"
},
{
"code": null,
"e": 2467,
"s": 2406,
"text": "Where − This clause is used to select the row to be updated."
... |
Introduction to Convolutional Neural Networks (CNN) with TensorFlow | by Marco Peixeiro | Towards Data Science | Recent advances in deep learning have made computer vision applications leap forward: from unlocking our mobile phone with our face, to safer self-driving cars.
Convolutional neural networks (CNN) are the architecture behind computer vision applications. In this post, you will learn about the foundations of CNNs and co... | [
{
"code": null,
"e": 332,
"s": 171,
"text": "Recent advances in deep learning have made computer vision applications leap forward: from unlocking our mobile phone with our face, to safer self-driving cars."
},
{
"code": null,
"e": 657,
"s": 332,
"text": "Convolutional neural netw... |
C++ Program for Recursive Bubble Sort? | In this section we will see another approach of famous bubble sort technique. We have used bubble sort in iterative manner. But here we will see recursive approach of the bubble sort. The recursive bubble sort algorithm is look like this.
begin
if n = 1, return
for i in range 1 to n-2, do
if arr[i] > arr[i+... | [
{
"code": null,
"e": 1301,
"s": 1062,
"text": "In this section we will see another approach of famous bubble sort technique. We have used bubble sort in iterative manner. But here we will see recursive approach of the bubble sort. The recursive bubble sort algorithm is look like this."
},
{
... |
Explaining DBSCAN Clustering. Using DBSCAN to identify employee... | by Kamil Mysiak | Towards Data Science | Density-based spatial clustering of applications with noise (DBSCAN) is an unsupervised clustering ML algorithm. Unsupervised in the sense that it does not use pre-labeled targets to cluster the data points. Clustering in the sense that it attempts to group similar data points into artificial groups or clusters. It is ... | [
{
"code": null,
"e": 584,
"s": 172,
"text": "Density-based spatial clustering of applications with noise (DBSCAN) is an unsupervised clustering ML algorithm. Unsupervised in the sense that it does not use pre-labeled targets to cluster the data points. Clustering in the sense that it attempts to gro... |
Set upper_bound() function in C++ STL | In this article we are going to discuss the set::upper_bound() in C++ STL, their syntax, working and their return values.
Sets in C++ STL are the containers which must have unique elements in a general order. Sets must have unique elements because the value of the element identifies the element. Once added a value in s... | [
{
"code": null,
"e": 1184,
"s": 1062,
"text": "In this article we are going to discuss the set::upper_bound() in C++ STL, their syntax, working and their return values."
},
{
"code": null,
"e": 1517,
"s": 1184,
"text": "Sets in C++ STL are the containers which must have unique el... |
How to create a Binomial distribution graph using Plotly, Python | by Usama Bin Tariq | Towards Data Science | Sometimes, Python graphs are necessary elements of your argument or the data case you are trying to build. This tutorial is about creating a binomial or normal distribution graph. We would start by declaring an array of numbers that are binomially distributed. We can do this by simply importing binom from scipy.stats.
... | [
{
"code": null,
"e": 492,
"s": 172,
"text": "Sometimes, Python graphs are necessary elements of your argument or the data case you are trying to build. This tutorial is about creating a binomial or normal distribution graph. We would start by declaring an array of numbers that are binomially distrib... |
A table detection, cell recognition and text extraction algorithm to convert tables in images to excel files | by Hucker Marius | Towards Data Science | Let’s say you have a table in an article, pdf or image and want to transfer it into an excel sheet or dataframe to have the possibility to edit it. Especially in the field of preprocessing for Machine Learning this algorithm will be exceptionally helpful to convert many images and tables to editable data. In the case t... | [
{
"code": null,
"e": 779,
"s": 172,
"text": "Let’s say you have a table in an article, pdf or image and want to transfer it into an excel sheet or dataframe to have the possibility to edit it. Especially in the field of preprocessing for Machine Learning this algorithm will be exceptionally helpful ... |
Check For Star Graph | A graph is given; we have to check the given graph is a star graph or not.
By traversing the graph, we have to find the number of vertices has degree one, and number of vertices, whose degree is n-1. (Here n is the number of vertices in the given graph). When the number of vertices with degree 1 is n-1 and a number of ... | [
{
"code": null,
"e": 1137,
"s": 1062,
"text": "A graph is given; we have to check the given graph is a star graph or not."
},
{
"code": null,
"e": 1444,
"s": 1137,
"text": "By traversing the graph, we have to find the number of vertices has degree one, and number of vertices, who... |
ExpressJS - Best Practices | Unlike Django and Rails which have a defined way of doing things, file structure, etc., Express does not follow a defined way. This means you can structure the application the way you like. But as your application grows in size, it is very difficult to maintain it if it doesn't have a well-defined structure. In this ch... | [
{
"code": null,
"e": 2498,
"s": 2061,
"text": "Unlike Django and Rails which have a defined way of doing things, file structure, etc., Express does not follow a defined way. This means you can structure the application the way you like. But as your application grows in size, it is very difficult to ... |
JavaScript | Pass string parameter in onClick function - GeeksforGeeks | 21 Jun, 2019
The task is to pass a string as a parameter on onClick function using javascript, we’re going to discuss few techniques.
Example 1: This example simply put the argument which is string in the onClick attribute of the button which calls a function with a string as an argument using onClick() method.
<!DOCTY... | [
{
"code": null,
"e": 25024,
"s": 24996,
"text": "\n21 Jun, 2019"
},
{
"code": null,
"e": 25145,
"s": 25024,
"text": "The task is to pass a string as a parameter on onClick function using javascript, we’re going to discuss few techniques."
},
{
"code": null,
"e": 25324... |
Bisect Algorithm Functions in Python | This module provides support for maintaining a list in sorted order without having to sort the list after each insertion of new element. We will focus on two functions namely insort_left and insort_right.
This function returns the sorted list after inserting number in the required position, if the element is already pr... | [
{
"code": null,
"e": 1267,
"s": 1062,
"text": "This module provides support for maintaining a list in sorted order without having to sort the list after each insertion of new element. We will focus on two functions namely insort_left and insort_right."
},
{
"code": null,
"e": 1724,
"... |
Matplotlib – How to set xticks and yticks with imshow plot? | To set xticks and yticks with imshow() plot, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Get the current axis.
Create a random dataset.
Display the data as an image, i.e., on a 2D regular raster.
Set x and y ticks using set_xticks() and set_yticks() meth... | [
{
"code": null,
"e": 1141,
"s": 1062,
"text": "To set xticks and yticks with imshow() plot, we can take the following steps −"
},
{
"code": null,
"e": 1217,
"s": 1141,
"text": "Set the figure size and adjust the padding between and around the subplots."
},
{
"code": null,... |
How to remove only the first word from columns values with a MySQL query? | To remove only the first word from column values, use substring(). Following is the syntax −
select substring(yourColumnName,locate(' ',yourColumnName)+1) AS anyAliasName from yourTableName;
Let us first create a table −
mysql> create table DemoTable
(
Title text
);
Query OK, 0 rows affected (0.50 sec)
Insert some r... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "To remove only the first word from column values, use substring(). Following is the syntax −"
},
{
"code": null,
"e": 1253,
"s": 1155,
"text": "select substring(yourColumnName,locate(' ',yourColumnName)+1) AS anyAliasName from yourTa... |
List Comprehensions in Python | Towards Data Science | List is a built-in data structure in Python and a collection of data points in square brackets. Other built-in data structures in Python are set, tuple, and dictionary.
list_a = [4, 'data', 3.2, True]list_a[4, 'data', 3.2, True]
In this post, we will cover list comprehensions in python and their advantages. Although li... | [
{
"code": null,
"e": 341,
"s": 172,
"text": "List is a built-in data structure in Python and a collection of data points in square brackets. Other built-in data structures in Python are set, tuple, and dictionary."
},
{
"code": null,
"e": 401,
"s": 341,
"text": "list_a = [4, 'dat... |
Java Program to Find the closest pair from two sorted arrays | To find the closest pair from two sorted array, the Java code is as follows −
Live Demo
public class Demo {
void closest_pair(int my_arr_1[], int my_arr_2[], int arr_1_len, int arr_2_len, int sum){
int diff = Integer.MAX_VALUE;
int result_l = 0, result_r = 0;
int l = 0, r = arr_2_len-1;
whil... | [
{
"code": null,
"e": 1140,
"s": 1062,
"text": "To find the closest pair from two sorted array, the Java code is as follows −"
},
{
"code": null,
"e": 1151,
"s": 1140,
"text": " Live Demo"
},
{
"code": null,
"e": 2177,
"s": 1151,
"text": "public class Demo {\n ... |
Defining a discrete colormap for imshow in Matplotlib | To define a discrete colormap for imshow in matplotlib, we can take following the steps −
Create data using numpy.
Create data using numpy.
Initialize the data using get_cmap, so that scatter knows.
Initialize the data using get_cmap, so that scatter knows.
Using imshow() method with colormap, display the data as an im... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "To define a discrete colormap for imshow in matplotlib, we can take following the steps −"
},
{
"code": null,
"e": 1177,
"s": 1152,
"text": "Create data using numpy."
},
{
"code": null,
"e": 1202,
"s": 1177,
"text... |
How to clear an ImageView in Android using Kotlin? | This example demonstrates how to clear an ImageView in Android using Kotlin.
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"?>
<RelativeLa... | [
{
"code": null,
"e": 1139,
"s": 1062,
"text": "This example demonstrates how to clear an ImageView in Android using Kotlin."
},
{
"code": null,
"e": 1267,
"s": 1139,
"text": "Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to... |
Python - Extract words starting with K in String List - GeeksforGeeks | 01 Aug, 2020
Given list of phrases, extract all the Strings with begin with character K.
Input : test_list = [“Gfg is good for learning”, “Gfg is for geeks”, “I love G4G”], K = lOutput : [‘learning’, ‘love’]Explanation : All elements with L as starting letter are extracted.
Input : test_list = [“Gfg is good for learnin... | [
{
"code": null,
"e": 24541,
"s": 24513,
"text": "\n01 Aug, 2020"
},
{
"code": null,
"e": 24617,
"s": 24541,
"text": "Given list of phrases, extract all the Strings with begin with character K."
},
{
"code": null,
"e": 24803,
"s": 24617,
"text": "Input : test_l... |
Check if binary representations of two numbers are anagram in Python | Suppose we have two numbers x and y we have to check whether the binary representation of x and y are anagram of each other or not.
So, if the input is like x = 9 y = 12, then the output will be True as binary representation of 9 is 1001 and binary representation of 12 is 1100, so these two are anagram of each other.
T... | [
{
"code": null,
"e": 1194,
"s": 1062,
"text": "Suppose we have two numbers x and y we have to check whether the binary representation of x and y are anagram of each other or not."
},
{
"code": null,
"e": 1381,
"s": 1194,
"text": "So, if the input is like x = 9 y = 12, then the ou... |
How to find set difference between two Numpy arrays? | In this program, we will find the set difference of two numpy arrays. We will use the setdiff1d() function in the numpy library. This function takes two parameters: array1 and array2 and returns the unique values in array1 that are not in array2.
Step 1: Import numpy.
Step 2: Define two numpy arrays.
Step 3: Find the s... | [
{
"code": null,
"e": 1309,
"s": 1062,
"text": "In this program, we will find the set difference of two numpy arrays. We will use the setdiff1d() function in the numpy library. This function takes two parameters: array1 and array2 and returns the unique values in array1 that are not in array2."
},
... |
How to expire session after 1 min of inactivity in express-session of Express.js ? - GeeksforGeeks | 09 Sep, 2021
In this article, we will see how to expire the session after 1 min of inactivity in express-session of Express.js.
Prerequisites
Installation of Node.js on Windows
To set up Node Project in Editor see here.
Requires Modules:
npm install express
npm install express-session
Call API:
var session = require('e... | [
{
"code": null,
"e": 29225,
"s": 29197,
"text": "\n09 Sep, 2021"
},
{
"code": null,
"e": 29340,
"s": 29225,
"text": "In this article, we will see how to expire the session after 1 min of inactivity in express-session of Express.js."
},
{
"code": null,
"e": 29354,
... |
Guide to implementing Linear Regression in Pyspark and R | by Kieran Tan Kah Wang | Towards Data Science | Which programming tool should I use to build my Linear Regression model? Is there any differences in terms of the prediction accuracy? Which is simpler to implement with just a few lines of codes? Does the size of my training data plays a difference? Let’s explore all these questions in this article.
The dataset I’ve u... | [
{
"code": null,
"e": 473,
"s": 171,
"text": "Which programming tool should I use to build my Linear Regression model? Is there any differences in terms of the prediction accuracy? Which is simpler to implement with just a few lines of codes? Does the size of my training data plays a difference? Let’... |
io.ReadFull() Function in Golang with Examples - GeeksforGeeks | 05 May, 2020
In Go language, io packages supply fundamental interfaces to the I/O primitives. And its principal job is to enclose the ongoing implementations of such king of primitives. The ReadFull() function in Go language is used to read from the stated reader “r” into the stated buffer “buf” and the bytes copied is... | [
{
"code": null,
"e": 23919,
"s": 23891,
"text": "\n05 May, 2020"
},
{
"code": null,
"e": 24412,
"s": 23919,
"text": "In Go language, io packages supply fundamental interfaces to the I/O primitives. And its principal job is to enclose the ongoing implementations of such king of pr... |
Bad Character Heuristic | The bad character heuristic method is one of the approaches of Boyer Moore Algorithm. Another approach is Good Suffix Heuristic. In this method we will try to find a bad character, that means a character of the main string, which is not matching with the pattern. When the mismatch has occurred, we will shift the entire... | [
{
"code": null,
"e": 1476,
"s": 1062,
"text": "The bad character heuristic method is one of the approaches of Boyer Moore Algorithm. Another approach is Good Suffix Heuristic. In this method we will try to find a bad character, that means a character of the main string, which is not matching with th... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.