title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
numpy.argmax() in Python - GeeksforGeeks | 28 Mar, 2022
The numpy.argmax() function returns indices of the max element of the array in a particular axis.
Syntax :
numpy.argmax(array, axis = None, out = None)
Parameters :
array : Input array to work on
axis : [int, optional]Along a specified axis like 0 or 1
out : [array optional]Provides a feature to ins... | [
{
"code": null,
"e": 24121,
"s": 24093,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 24220,
"s": 24121,
"text": "The numpy.argmax() function returns indices of the max element of the array in a particular axis. "
},
{
"code": null,
"e": 24230,
"s": 24220,
... |
How to Install Z Shell(zsh) on Linux? - GeeksforGeeks | 05 Oct, 2021
The ZSH or Z Shell is a Unix based shell or can be called as a command-line interpreter. It is an extended version of the good old Bourne shell (sh). It does have some features form Bash with lots of added features like automatic cd (Change Directory), spell check, path expansion, and many more. It also su... | [
{
"code": null,
"e": 24896,
"s": 24868,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 25230,
"s": 24896,
"text": "The ZSH or Z Shell is a Unix based shell or can be called as a command-line interpreter. It is an extended version of the good old Bourne shell (sh). It does have ... |
C# - Switch Statement | A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case.
The syntax for a switch statement in C# is as follows −
switch(expression) {
case constant-expression1 :
statement(s);
... | [
{
"code": null,
"e": 2456,
"s": 2270,
"text": "A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each switch case."
},
{
"code": null,
"e": 2512,
"s": 2456,
"text... |
JavaScript | window.location and document.location Objects - GeeksforGeeks | 13 May, 2020
window.location and document.location: These objects are used for getting the URL (the current or present page address) and avert browser to a new page or window. The main difference between both is their compatibility with the browsers.
The window.location is read/write on all compliant browsers.
The docu... | [
{
"code": null,
"e": 23895,
"s": 23867,
"text": "\n13 May, 2020"
},
{
"code": null,
"e": 24133,
"s": 23895,
"text": "window.location and document.location: These objects are used for getting the URL (the current or present page address) and avert browser to a new page or window. ... |
Print Triangle separated pattern - GeeksforGeeks | 21 Jan, 2022
Given a number N, the task is to print the triangle separated pattern.
Triangle Separated Pattern: Pattern in which four triangles (left, down, right, up) are separated by forward and backward slash, see this below: \*****/ *\***/* **\*/** ***/*** **/*\** */***\* /*****\
Note: N should be an odd number ... | [
{
"code": null,
"e": 24870,
"s": 24842,
"text": "\n21 Jan, 2022"
},
{
"code": null,
"e": 24942,
"s": 24870,
"text": "Given a number N, the task is to print the triangle separated pattern. "
},
{
"code": null,
"e": 25145,
"s": 24942,
"text": "Triangle Separated... |
Underscore.JS - uniq method | _.uniq(array, [isSorted], [iteratee])
uniq method returns a array of unique values from an array. It uses type safe equaliy(===) check. If array is sorted, pass true to run a faster algorithm. A iteratee function can be passed to determine the uniqueness of items.
var _ = require('underscore');
var list1 = [11, 2, 14... | [
{
"code": null,
"e": 2031,
"s": 1992,
"text": "_.uniq(array, [isSorted], [iteratee])\n"
},
{
"code": null,
"e": 2258,
"s": 2031,
"text": "uniq method returns a array of unique values from an array. It uses type safe equaliy(===) check. If array is sorted, pass true to run a faste... |
Erlang - If statement | The first decision making statement we will look at is the ‘if’ statement. The general form of this statement in Erlang is shown in the following program −
if
condition ->
statement#1;
true ->
statement #2
end.
In Erlang, the condition is an expression which evaluates to either true or false. If the condition is... | [
{
"code": null,
"e": 2457,
"s": 2301,
"text": "The first decision making statement we will look at is the ‘if’ statement. The general form of this statement in Erlang is shown in the following program −"
},
{
"code": null,
"e": 2519,
"s": 2457,
"text": "if\ncondition ->\n state... |
VBScript Month Function | The Month function returns a number between 1 and 12 that represents the month of the specified date.
Month(date)
<!DOCTYPE html>
<html>
<body>
<script language = "vbscript" type = "text/vbscript">
document.write(Month("2013-06-30"))
</script>
</body>
</html>
When you save it as .ht... | [
{
"code": null,
"e": 2182,
"s": 2080,
"text": "The Month function returns a number between 1 and 12 that represents the month of the specified date."
},
{
"code": null,
"e": 2196,
"s": 2182,
"text": "Month(date) \n"
},
{
"code": null,
"e": 2377,
"s": 2196,
"te... |
ExpressJS - Scaffolding | Scaffolding allows us to easily create a skeleton for a web application. We manually create our public directory, add middleware, create separate route files, etc. A scaffolding tool sets up all these things for us so that we can directly get started with building our application.
The scaffolder we will use is called ... | [
{
"code": null,
"e": 2344,
"s": 2061,
"text": "Scaffolding allows us to easily create a skeleton for a web application. We manually create our public directory, add middleware, create separate route files, etc. A scaffolding tool sets up all these things for us so that we can directly get started wi... |
What is the difference between BIT and TINYINT in MySQL? | BIT can be used to store the value of 1 bit. It could be 0 or 1. We cannot store, for example 2 with data type BIT. If we try to insert 2 with BIT data type, MySQL raises an error.
TINYINT can be used to store value of 8 bits. The maximum value we can store is 127.We cannot store, for example 987 with 8 bit value. If w... | [
{
"code": null,
"e": 1243,
"s": 1062,
"text": "BIT can be used to store the value of 1 bit. It could be 0 or 1. We cannot store, for example 2 with data type BIT. If we try to insert 2 with BIT data type, MySQL raises an error."
},
{
"code": null,
"e": 1449,
"s": 1243,
"text": "T... |
Display selected slicers in Power BI | by Nikola Ilic | Towards Data Science | Just recently, while presenting my session: “Magnificent 7 — Simple tricks to boost your Power BI Development” at the New Stars of Data conference, one of the questions I’ve received was:
I’ve already answered the question in this article, but then I thought: maybe more people search for the solution to this problem, s... | [
{
"code": null,
"e": 359,
"s": 171,
"text": "Just recently, while presenting my session: “Magnificent 7 — Simple tricks to boost your Power BI Development” at the New Stars of Data conference, one of the questions I’ve received was:"
},
{
"code": null,
"e": 572,
"s": 359,
"text":... |
Get Your Spotify Streaming History With Python | by Vlad Gheorghe | Towards Data Science | This is my first Medium story! Any feedback is appreciated.
If you’re a dedicated Spotifyer like myself, there are lots of things you could learn by looking at your streaming data. Do you tend to listen to sad songs in winter? What happened to your music preferences when you fell in love?
Luckily, Spotify allows you to... | [
{
"code": null,
"e": 231,
"s": 171,
"text": "This is my first Medium story! Any feedback is appreciated."
},
{
"code": null,
"e": 461,
"s": 231,
"text": "If you’re a dedicated Spotifyer like myself, there are lots of things you could learn by looking at your streaming data. Do yo... |
Count number of squares in a rectangle - GeeksforGeeks | 15 Apr, 2021
Given a m x n rectangle, how many squares are there in it?
Examples :
Input: m = 2, n = 2
Output: 5
There are 4 squares of size 1x1 + 1 square of size 2x2.
Input: m = 4, n = 3
Output: 20
There are 12 squares of size 1x1 +
6 squares of size 2x2 +
2 squares of size 3x3.
Let us first ... | [
{
"code": null,
"e": 24513,
"s": 24485,
"text": "\n15 Apr, 2021"
},
{
"code": null,
"e": 24572,
"s": 24513,
"text": "Given a m x n rectangle, how many squares are there in it?"
},
{
"code": null,
"e": 24584,
"s": 24572,
"text": "Examples : "
},
{
"code... |
Understanding Array IndexOutofBoundsException in C# | Array IndexOutofBoundsException occurs in Java. The equivalent of it in C# is IndexOutOfRangeException.
The IndexOutOfRangeException occurs when Index is outside the bounds of the array.
Live Demo
using System;
using System.IO;
using System.Collections.Generic;
namespace Demo {
class Program {
static void Mai... | [
{
"code": null,
"e": 1166,
"s": 1062,
"text": "Array IndexOutofBoundsException occurs in Java. The equivalent of it in C# is IndexOutOfRangeException."
},
{
"code": null,
"e": 1249,
"s": 1166,
"text": "The IndexOutOfRangeException occurs when Index is outside the bounds of the ar... |
ASP.NET Core - Routing | In MVC framework, we have three components, each with its own focus on a specific part of the job. In order for all of this to work, we need to find a way to send these HTTP requests to the right controller. In ASP.NET Core MVC, this process is known as routing. Routing is the process of directing an HTTP request to a ... | [
{
"code": null,
"e": 2793,
"s": 2461,
"text": "In MVC framework, we have three components, each with its own focus on a specific part of the job. In order for all of this to work, we need to find a way to send these HTTP requests to the right controller. In ASP.NET Core MVC, this process is known as... |
Java Cryptography - Retrieving keys | In this chapter, we will learn how to retrieve a key from the keystore using Java Cryptography.
To retrieve a key from the keystore, follow the steps given below.
The getInstance() method of the KeyStore class of the java.security package accepts a string value representing the type of the keystore and returns a KeySto... | [
{
"code": null,
"e": 2149,
"s": 2053,
"text": "In this chapter, we will learn how to retrieve a key from the keystore using Java Cryptography."
},
{
"code": null,
"e": 2216,
"s": 2149,
"text": "To retrieve a key from the keystore, follow the steps given below."
},
{
"code... |
How to get the indices of the sorted array using NumPy in Python? - GeeksforGeeks | 05 Sep, 2020
We can get the indices of the sorted elements of a given array with the help of argsort() method. This function is used to perform an indirect sort along the given axis using the algorithm specified by the kind keyword. It returns an array of indices of the same shape as arr that that would sort the array.... | [
{
"code": null,
"e": 25665,
"s": 25637,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 25973,
"s": 25665,
"text": "We can get the indices of the sorted elements of a given array with the help of argsort() method. This function is used to perform an indirect sort along the given... |
C Quiz - 101 - GeeksforGeeks | 28 Sep, 2015
int fun(int n);
int main()
{
// ptr is a pointer to function fun()
int (*ptr)(int ) = fun;
// fun() called using pointer
(*ptr)(3);
return 0;
}
int fun(int n)
{
for(;n > 0; n--)
printf("GeeksQuiz ");
}
First and foremost, continue can be used in any of the 3 loops in C. In ca... | [
{
"code": null,
"e": 27530,
"s": 27502,
"text": "\n28 Sep, 2015"
},
{
"code": null,
"e": 27763,
"s": 27530,
"text": "int fun(int n);\n\nint main()\n{\n // ptr is a pointer to function fun()\n int (*ptr)(int ) = fun;\n\n // fun() called using pointer \n (*ptr)(3);\n ... |
A Minimalist End-to-End Scrapy Tutorial (Part III) | by Harry Wang | Towards Data Science | Part I, Part II, Part III, Part IV, Part V
In Part II, you have extracted all the required data from the website and stored them in Items. In Part III, I will introduce Item Pipelines to save the extracted data into a database using ORM (SQLAlchemy) and handle the duplicate data issue.
Each item returned by the spider ... | [
{
"code": null,
"e": 215,
"s": 172,
"text": "Part I, Part II, Part III, Part IV, Part V"
},
{
"code": null,
"e": 459,
"s": 215,
"text": "In Part II, you have extracted all the required data from the website and stored them in Items. In Part III, I will introduce Item Pipelines to... |
How to import a class from another file in Python ? - GeeksforGeeks | 30 Apr, 2021
In this article, we will see How to import a class from another file in Python.
Import in Python is analogous to #include header_file in C/C++. Python modules can get access to code from another module by importing the file/function using import. The import statement is that the commonest way of invoking ... | [
{
"code": null,
"e": 24364,
"s": 24333,
"text": " \n30 Apr, 2021\n"
},
{
"code": null,
"e": 24444,
"s": 24364,
"text": "In this article, we will see How to import a class from another file in Python."
},
{
"code": null,
"e": 24805,
"s": 24444,
"text": "Import ... |
Difference Between sleep and yield Method in Java - GeeksforGeeks | 09 Jun, 2021
In java if a thread doesn’t want to perform any operation for a particular amount of time then we should go for the sleep() method, which causes the currently executing thread to stop for the specified number of milliseconds.
Syntax :
public static native void sleep( long ms) throws InterruptedException ;
... | [
{
"code": null,
"e": 24778,
"s": 24750,
"text": "\n09 Jun, 2021"
},
{
"code": null,
"e": 25004,
"s": 24778,
"text": "In java if a thread doesn’t want to perform any operation for a particular amount of time then we should go for the sleep() method, which causes the currently exec... |
Python | Convert Tuple to integer - GeeksforGeeks | 25 Nov, 2019
Sometimes, while working with records, we can have a problem in which we need to convert the data records to integer by joining them. Let’s discuss certain ways in which this task can be performed.
Method #1 : Using reduce() + lambdaThe combination of above functions can be used to perform this task. In th... | [
{
"code": null,
"e": 26350,
"s": 26322,
"text": "\n25 Nov, 2019"
},
{
"code": null,
"e": 26548,
"s": 26350,
"text": "Sometimes, while working with records, we can have a problem in which we need to convert the data records to integer by joining them. Let’s discuss certain ways in... |
How to get user location in Android - GeeksforGeeks | 18 Jan, 2021
Many apps in Android uses user’s locations be it for ordering cabs or delivering food and items. Here, a simple android app that would return the user’s latitude and longitude is made. Once the latitude and longitude are known, the exact location on Google Maps can be seen using the following query: https:... | [
{
"code": null,
"e": 26117,
"s": 26089,
"text": "\n18 Jan, 2021"
},
{
"code": null,
"e": 26469,
"s": 26117,
"text": "Many apps in Android uses user’s locations be it for ordering cabs or delivering food and items. Here, a simple android app that would return the user’s latitude a... |
What is PHP Output Buffering? | Output Buffering is a method to tell the PHP engine to hold the output data before sending it to the browser. As we know PHP sent the output data to the browser in pieces, but if we utilize the output buffering mechanism, the output data is stored in a variable and sent to the browser as one piece at the end of the scr... | [
{
"code": null,
"e": 1387,
"s": 1062,
"text": "Output Buffering is a method to tell the PHP engine to hold the output data before sending it to the browser. As we know PHP sent the output data to the browser in pieces, but if we utilize the output buffering mechanism, the output data is stored in a ... |
Binary Array Sorting | Practice | GeeksforGeeks | Given a binary array A[] of size N. The task is to arrange the array in increasing order.
Note: The binary array contains only 0 and 1.
Example 1:
Input:
5
1 0 1 1 0
Output:
0 0 1 1 1
Explanation:
After arranging the elements in
increasing order, elements will be as
0 0 1 1 1.
Example 2:
Input:
10
1 0 1 1 1 1... | [
{
"code": null,
"e": 377,
"s": 238,
"text": "Given a binary array A[] of size N. The task is to arrange the array in increasing order.\nNote: The binary array contains only 0 and 1.\n "
},
{
"code": null,
"e": 388,
"s": 377,
"text": "Example 1:"
},
{
"code": null,
"e... |
How to read and write JSON file using Node.js ? | 28 Jan, 2020
Node.js is an open source and cross-platform runtime environment for executing JavaScript code outside of the browser. It is widely used in developing APIs and microservices from small to large companies.
JSON or JavaScript Object Notation is a light weight, text-based data interchange format. Like XML, it... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n28 Jan, 2020"
},
{
"code": null,
"e": 258,
"s": 53,
"text": "Node.js is an open source and cross-platform runtime environment for executing JavaScript code outside of the browser. It is widely used in developing APIs and microservices ... |
Sum of nodes at k-th level in a tree represented as string | 14 Mar, 2022
Given an integer ‘K’ and a binary tree in string format. Every node of a tree has value in range from 0 to 9. We need to find sum of elements at K-th level from root. The root is at level 0. Tree is given in the form: (node value(left subtree)(right subtree))
Examples:
Input : tree = "(0(5(6()())(4()(9()... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Mar, 2022"
},
{
"code": null,
"e": 315,
"s": 54,
"text": "Given an integer ‘K’ and a binary tree in string format. Every node of a tree has value in range from 0 to 9. We need to find sum of elements at K-th level from root. The roo... |
Minimum cost to convert str1 to str2 with the given operations | 08 Jun, 2021
Given two strings of equal lengths str1 and str2 consisting of characters ‘a’ and ‘b’ only. The following operations can be performed on str1:
Any character can be changed from ‘a’ to ‘b’ or from ‘b’ to ‘a’ with 1 unit cost.Any two characters str1[i] and str1[j] can be swapped with cost |i – j|.
Any char... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Jun, 2021"
},
{
"code": null,
"e": 173,
"s": 28,
"text": "Given two strings of equal lengths str1 and str2 consisting of characters ‘a’ and ‘b’ only. The following operations can be performed on str1: "
},
{
"code": null,
... |
How to make div not larger than its contents using CSS? | 16 Apr, 2020
There are three ways to achieve this problem:
By default caseUsing inline-block propertyUsing fit-content property in width and height
By default case
Using inline-block property
Using fit-content property in width and height
In HTML div is by default fit to content inside it. The example goes like this:Ex... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Apr, 2020"
},
{
"code": null,
"e": 74,
"s": 28,
"text": "There are three ways to achieve this problem:"
},
{
"code": null,
"e": 163,
"s": 74,
"text": "By default caseUsing inline-block propertyUsing fit-content pr... |
jQuery | :first-child Selector | 08 Sep, 2021
It is a jQuery Selector used to select every element that is the first child of its parent.Syntax:
$(":first-child")
Return Value: It selects and returns the first child element of its parent.Example-1:
html
<!DOCTYPE html><html><h1> <center> Geeks </center> </h1> <head> <script src="https:/... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Sep, 2021"
},
{
"code": null,
"e": 129,
"s": 28,
"text": "It is a jQuery Selector used to select every element that is the first child of its parent.Syntax: "
},
{
"code": null,
"e": 147,
"s": 129,
"text": "$(\":... |
Designated Initializers in C | 27 Apr, 2022
Standard C90 requires the elements of an initializer to appear in a fixed order, the same as the order of the elements in the array or structure being initialized.In ISO C99 you can give the elements in random order, specifying the array indices or structure field names they apply to, and GNU C allows this... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Apr, 2022"
},
{
"code": null,
"e": 541,
"s": 52,
"text": "Standard C90 requires the elements of an initializer to appear in a fixed order, the same as the order of the elements in the array or structure being initialized.In ISO C99 ... |
Group objects by property in JavaScript | Suppose, we have an array of objects that contains data about some fruits and vegetables like this −
const arr = [
{food: 'apple', type: 'fruit'},
{food: 'potato', type: 'vegetable'},
{food: 'banana', type: 'fruit'},
];
We are required to write a JavaScript function that takes in one such array.
Our function s... | [
{
"code": null,
"e": 1288,
"s": 1187,
"text": "Suppose, we have an array of objects that contains data about some fruits and vegetables like this −"
},
{
"code": null,
"e": 1416,
"s": 1288,
"text": "const arr = [\n {food: 'apple', type: 'fruit'},\n {food: 'potato', type: 'veg... |
Annotating text on individual facet in ggplot2 in R | 23 Aug, 2021
In this article, we will discuss how to annotate a text on the Individual facet in ggplot2 in R Programming Language.
To plot facet in R programming language, we use the facet_grid() function from the ggplot2 library. The facet_grid() is used to form a matrix of panels defined by row and column faceting va... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 146,
"s": 28,
"text": "In this article, we will discuss how to annotate a text on the Individual facet in ggplot2 in R Programming Language."
},
{
"code": null,
"e": 795,
"s": 146,
... |
What is Metasploit? | 20 May, 2022
Metasploit is not just a single tool. It is a complete framework. It is a Ruby-based, modular penetration testing platform that enables you to write, test, and execute exploit code, it is flexible and extremely robust and has tons of tools to perform various simple and complex tasks.
Metasploit has three ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n20 May, 2022"
},
{
"code": null,
"e": 339,
"s": 53,
"text": "Metasploit is not just a single tool. It is a complete framework. It is a Ruby-based, modular penetration testing platform that enables you to write, test, and execute exploi... |
Split a given array into K subarrays minimizing the difference between their maximum and minimum | 21 Aug, 2021
Given a sorted array arr[] of N integers and an integer K, the task is to split the array into K subarrays such that the sum of the difference of maximum and minimum element of each subarray is minimized.
Examples:
Input: arr[] = {1, 3, 3, 7}, K = 4 Output: 0 Explanation: The given array can be split into... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n21 Aug, 2021"
},
{
"code": null,
"e": 257,
"s": 52,
"text": "Given a sorted array arr[] of N integers and an integer K, the task is to split the array into K subarrays such that the sum of the difference of maximum and minimum element ... |
Run python script from anywhere in linux | 03 Nov, 2019
In Linux, there is a way to execute python files from anywhere. This can be done by typing several commands in the terminal.
Basic Shell Commands in Linux
Basics of python
At first, open the terminal and go to the home directory. To go the home directory type the following command.cd ~
cd ~
Create a folder... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Nov, 2019"
},
{
"code": null,
"e": 179,
"s": 54,
"text": "In Linux, there is a way to execute python files from anywhere. This can be done by typing several commands in the terminal."
},
{
"code": null,
"e": 209,
"s"... |
What is the use of %n in printf()? | In C language, %n is a special format specifier. It cause printf() to load the variable pointed by corresponding argument. The loading is done with a value which is equal to the number of characters printed by printf() before the occurrence of %n.
Note − It does not print anything. Another printf() function is used to ... | [
{
"code": null,
"e": 1435,
"s": 1187,
"text": "In C language, %n is a special format specifier. It cause printf() to load the variable pointed by corresponding argument. The loading is done with a value which is equal to the number of characters printed by printf() before the occurrence of %n."
},... |
How to Iterate LinkedHashMap in Reverse Order in Java? | 17 Dec, 2020
The LinkedHashMap is used to maintain an order of elements inserted into it. It provides where the elements can be accessed in their insertion order. A LinkedHashMap contains values based on the key. It implements the Map interface and extends the HashMap class. It contains only unique elements or mappings... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Dec, 2020"
},
{
"code": null,
"e": 337,
"s": 28,
"text": "The LinkedHashMap is used to maintain an order of elements inserted into it. It provides where the elements can be accessed in their insertion order. A LinkedHashMap contains ... |
Kaprekar Number | 18 Apr, 2022
A Kaprekar number is a number whose square when divided into two parts and such that sum of parts is equal to the original number and none of the parts has value 0. (Source : Wiki)Given a number, the task is to check if it is Kaprekar number or not.Examples:
Input : n = 45
Output : Yes
Explanation : 4... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Apr, 2022"
},
{
"code": null,
"e": 313,
"s": 52,
"text": "A Kaprekar number is a number whose square when divided into two parts and such that sum of parts is equal to the original number and none of the parts has value 0. (Source :... |
Contents list – Python Beautifulsoup | 25 Oct, 2020
The contents list is provided by Beautiful Soup which is a web scraping framework for Python. Web scraping is the process of extracting data from the website using automated tools to make the process faster. The content is a list that contains the tag’s children.
Syntax:
tag.contents
Below given exampl... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Oct, 2020"
},
{
"code": null,
"e": 292,
"s": 28,
"text": "The contents list is provided by Beautiful Soup which is a web scraping framework for Python. Web scraping is the process of extracting data from the website using automated t... |
Python – tensorflow.gather() | 10 Jul, 2020
TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks.
gather() is used to slice the input tensor based on the indices provided.
Syntax: tensorflow.gather( params, indices, validate_indices, axis, batch_dims, name)
Parameters:
pa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jul, 2020"
},
{
"code": null,
"e": 160,
"s": 28,
"text": "TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks. "
},
{
"code": null,
"e": 234,
... |
C# - Type Conversion | Type conversion is converting one type of data to another type. It is also known as Type Casting. In C#, type casting has two forms −
Implicit type conversion − These conversions are performed by C# in a type-safe manner. For example, are conversions from smaller to larger integral types and conversions from derived cl... | [
{
"code": null,
"e": 2404,
"s": 2270,
"text": "Type conversion is converting one type of data to another type. It is also known as Type Casting. In C#, type casting has two forms −"
},
{
"code": null,
"e": 2613,
"s": 2404,
"text": "Implicit type conversion − These conversions are... |
Python - Create a Pipeline in Pandas | To create a pipeline in Pandas, we need to use the pipe() method. At first, import the required pandas library with an alias −
import pandas as pd
Now, create a DataFrame −
dataFrame = pd.DataFrame(
{
"Car": ['BMW', 'Lexus', 'Audi', 'Mustang', 'Bentley', 'Jaguar'],
"Units": [100, 150, 110, 80, 110, 90]
... | [
{
"code": null,
"e": 1189,
"s": 1062,
"text": "To create a pipeline in Pandas, we need to use the pipe() method. At first, import the required pandas library with an alias −"
},
{
"code": null,
"e": 1209,
"s": 1189,
"text": "import pandas as pd"
},
{
"code": null,
"e"... |
T-SQL - Indexes | Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index at the end of a book.
For example, if you want to reference all the pages in a book that discuss a certain topic,... | [
{
"code": null,
"e": 2289,
"s": 2060,
"text": "Indexes are special lookup tables that the database search engine can use to speed up data retrieval. Simply put, an index is a pointer to data in a table. An index in a database is very similar to an index at the end of a book."
},
{
"code": nu... |
JDB - Introduction | Debugging is a technical procedure to find and remove bugs or defects in a program and get expected results. Debugging includes testing and monitoring. It is very complex when the subunits of a program are tightly coupled. We can debug a program using the debugger tools that follow the prescribed APIs. A debugger allow... | [
{
"code": null,
"e": 2142,
"s": 1723,
"text": "Debugging is a technical procedure to find and remove bugs or defects in a program and get expected results. Debugging includes testing and monitoring. It is very complex when the subunits of a program are tightly coupled. We can debug a program using t... |
Redux - Core Concepts | Let us assume our application’s state is described by a plain object called initialState which is as follows −
const initialState = {
isLoading: false,
items: [],
hasError: false
};
Every piece of code in your application cannot change this state. To change the state, you need to dispatch an action.
An action... | [
{
"code": null,
"e": 1926,
"s": 1815,
"text": "Let us assume our application’s state is described by a plain object called initialState which is as follows −"
},
{
"code": null,
"e": 2007,
"s": 1926,
"text": "const initialState = {\n isLoading: false,\n items: [],\n hasErro... |
Java Cryptography - Creating Signature | Digital signatures allow us to verify the author, date and time of signatures, authenticate the message contents. It also includes authentication function for additional capabilities.
In this section, we will learn about the different reasons that call for the use of digital signature. There are several reasons to impl... | [
{
"code": null,
"e": 2371,
"s": 2187,
"text": "Digital signatures allow us to verify the author, date and time of signatures, authenticate the message contents. It also includes authentication function for additional capabilities."
},
{
"code": null,
"e": 2552,
"s": 2371,
"text":... |
Glassmorphism Card Hover Effect | 31 Dec, 2020
Glassmorphism is a modern way of styling web-elements of any web-page and providing a 3D as well as a glass effect. This animation effect can be easily generated by using HTML, CSS, and Vanilla-tilt JS. We can implement Glassmorphism using various CSS properties. It is used to add a glass effect to the giv... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Dec, 2020"
},
{
"code": null,
"e": 436,
"s": 52,
"text": "Glassmorphism is a modern way of styling web-elements of any web-page and providing a 3D as well as a glass effect. This animation effect can be easily generated by using HTM... |
Python | math.factorial() function | 11 Mar, 2019
In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.factorial() function returns the factorial of desired number.
Syntax: math.factorial(x)
Parameter:
x: This is a numeric expression.
Returns: factorial of desired number.
Code #1:
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Mar, 2019"
},
{
"code": null,
"e": 215,
"s": 28,
"text": "In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.factorial() function returns the factorial of desi... |
Scraping And Finding Ordered Words In A Dictionary using Python | 26 Nov, 2018
What are ordered words?
An ordered word is a word in which the letters appear in alphabetic order. For example abbey & dirt. The rest of the words are unordered for example geeks
The task at hand
This task is taken from Rosetta Code and it is not as mundane as it sounds from the above description. To get a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Nov, 2018"
},
{
"code": null,
"e": 52,
"s": 28,
"text": "What are ordered words?"
},
{
"code": null,
"e": 207,
"s": 52,
"text": "An ordered word is a word in which the letters appear in alphabetic order. For examp... |
Update an entire row in MySQL? | To update an entire row in MySQL, use UPDATE command. You need to know the primary key column. The syntax is as follows to update an entire row.
UPDATE yourTableName SET yourColumnName1 = ’yourValue1’ ,yourColumnName2 = ’yourValue2’ ,
yourColumnName3 = ’yourValue3’ ,.......................N
WHERE yourPrimaryKeyCo... | [
{
"code": null,
"e": 1332,
"s": 1187,
"text": "To update an entire row in MySQL, use UPDATE command. You need to know the primary key column. The syntax is as follows to update an entire row."
},
{
"code": null,
"e": 1529,
"s": 1332,
"text": "UPDATE yourTableName SET yourColumnNa... |
HTML Course | Understanding and Building Project Structure | 10 Aug, 2021
Course Navigation
We have created all of the directories needed for our project. Let’s just start writing our HTML code. Since we are designing a single page website – Website with a single HTML page( No internal links ). So, we will write all of our codes in the file “index.html”. We donot need any othe... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Aug, 2021"
},
{
"code": null,
"e": 72,
"s": 52,
"text": "Course Navigation "
},
{
"code": null,
"e": 461,
"s": 72,
"text": "We have created all of the directories needed for our project. Let’s just start writing... |
Launch vs Async in Kotlin Coroutines | 04 May, 2021
Prerequisite: Kotlin Coroutines on Android
The Kotlin team defines coroutines as “lightweight threads”. They are sort of tasks that the actual threads can execute. Coroutines were added to Kotlin in version 1.3 and are based on established concepts from other languages. Kotlin coroutines introduce a new st... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 May, 2021"
},
{
"code": null,
"e": 97,
"s": 54,
"text": "Prerequisite: Kotlin Coroutines on Android"
},
{
"code": null,
"e": 432,
"s": 97,
"text": "The Kotlin team defines coroutines as “lightweight threads”. The... |
How to get the differences between two dates in Android using Kotlin? | This example demonstrates how to create a simple alert dialog with Ok and cancel buttons 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" enco... | [
{
"code": null,
"e": 1290,
"s": 1187,
"text": "This example demonstrates how to create a simple alert dialog with Ok and cancel buttons using Kotlin."
},
{
"code": null,
"e": 1418,
"s": 1290,
"text": "Step 1 − Create a new project in Android Studio, go to File? New Project and fi... |
VBScript - Placements | There is a flexibility given to include VBScript code anywhere in an HTML document. But the most preferred way to include VBScript in your HTML file is as follows −
Script in <head>...</head> section.
Script in <head>...</head> section.
Script in <body>...</body> section.
Script in <body>...</body> section.
Script in <... | [
{
"code": null,
"e": 2379,
"s": 2214,
"text": "There is a flexibility given to include VBScript code anywhere in an HTML document. But the most preferred way to include VBScript in your HTML file is as follows −"
},
{
"code": null,
"e": 2415,
"s": 2379,
"text": "Script in <head>.... |
Find a Fixed Point (Value equal to index) in a given array | 11 Jun, 2022
Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is any Fixed Point present in array, else returns -1. Fixed Point in an array is an index i such that arr[i] is equal to i. Note that integers in array can be negative. Exampl... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Jun, 2022"
},
{
"code": null,
"e": 365,
"s": 52,
"text": "Given an array of n distinct integers sorted in ascending order, write a function that returns a Fixed Point in the array, if there is any Fixed Point present in array, else ... |
Class and Object in Golang | 03 May, 2022
Every human (excluding infants) can relate to encapsulation irrespective of his/her prior knowledge of encapsulation. Do you wonder why? Simple. Recollect all the times when you were sick, and the doctor prescribed all those monstrous capsules dosage for a couple of days until you were okay again! The evil... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 May, 2022"
},
{
"code": null,
"e": 684,
"s": 28,
"text": "Every human (excluding infants) can relate to encapsulation irrespective of his/her prior knowledge of encapsulation. Do you wonder why? Simple. Recollect all the times when y... |
Python | Remove duplicate tuples from list of tuples | 30 Jul, 2019
Given a list of tuples, Write a Python program to remove all the duplicated tuples from the given list.
Examples:
Input : [(1, 2), (5, 7), (3, 6), (1, 2)]
Output : [(1, 2), (5, 7), (3, 6)]
Input : [('a', 'z'), ('a', 'x'), ('z', 'x'), ('a', 'x'), ('z', 'x')]
Output : [('a', 'z'), ('a', 'x'), ('z', 'x')]
M... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jul, 2019"
},
{
"code": null,
"e": 132,
"s": 28,
"text": "Given a list of tuples, Write a Python program to remove all the duplicated tuples from the given list."
},
{
"code": null,
"e": 142,
"s": 132,
"text": "Ex... |
MERN Stack | 07 Oct, 2021
MERN Stack: MERN Stack is a Javascript Stack that is used for easier and faster deployment of full-stack web applications. MERN Stack comprises of 4 technologies namely: MongoDB, Express, React and Node.js. It is designed to make the development process smoother and easier.
Each of these 4 powerful technol... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 327,
"s": 52,
"text": "MERN Stack: MERN Stack is a Javascript Stack that is used for easier and faster deployment of full-stack web applications. MERN Stack comprises of 4 technologies namely: Mong... |
HTML | DOM Image Object | 31 Jan, 2019
The Image Object in HTML DOM is used to represent the HTML < image > element.This tag is used to set or get the properties of < image > element. This element can be accessed by using getElementById() method.
Syntax:
document.getElementById("Image_ID");
This Image_ID is assigned to HTML < image > element.
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Jan, 2019"
},
{
"code": null,
"e": 236,
"s": 28,
"text": "The Image Object in HTML DOM is used to represent the HTML < image > element.This tag is used to set or get the properties of < image > element. This element can be accessed b... |
Java Examples - Use for & foreach loops | How to use for and foreach loops to display elements of an array.
This example displays an integer array using for loop & foreach loops.
public class Main {
public static void main(String[] args) {
int[] intary = { 1,2,3,4};
forDisplay(intary);
foreachDisplay(intary);
}
public static void fo... | [
{
"code": null,
"e": 2135,
"s": 2068,
"text": "How to use for and foreach loops to display elements of an array."
},
{
"code": null,
"e": 2206,
"s": 2135,
"text": "This example displays an integer array using for loop & foreach loops."
},
{
"code": null,
"e": 2789,
... |
How to get the screen size in Tkinter? | Tkinter initially creates a window or frame object where all the widgets, frame are displayed.
Tkinter components adjust the window size and width according to user-defined geometry.
In order to get the screen size, we can use winfo_screenwidth() which returns the screen width and winfo_screenheight() for the height of... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "Tkinter initially creates a window or frame object where all the widgets, frame are displayed."
},
{
"code": null,
"e": 1245,
"s": 1157,
"text": "Tkinter components adjust the window size and width according to user-defined geometry.... |
Java - Applet Basics | An applet is a Java program that runs in a Web browser. An applet can be a fully functional Java application because it has the entire Java API at its disposal.
There are some important differences between an applet and a standalone Java application, including the following −
An applet is a Java class that extends the ... | [
{
"code": null,
"e": 2538,
"s": 2377,
"text": "An applet is a Java program that runs in a Web browser. An applet can be a fully functional Java application because it has the entire Java API at its disposal."
},
{
"code": null,
"e": 2654,
"s": 2538,
"text": "There are some import... |
Syncing Data from Python to AWS RDS | by Onur Okyol | Towards Data Science | Amazon Web Services is the cloud platform provided by the Amazon company. It is one of the most frequently emphasized / sought-after platforms in job postings such as data scientist and data engineer. In today’s world, cloud platforms are becoming more and more important as big data grows day by day. In addition to fle... | [
{
"code": null,
"e": 693,
"s": 171,
"text": "Amazon Web Services is the cloud platform provided by the Amazon company. It is one of the most frequently emphasized / sought-after platforms in job postings such as data scientist and data engineer. In today’s world, cloud platforms are becoming more an... |
spaCy - Convert Command | As name implies, this command will convert files into spaCy’s JavaScript Object Notation (JSON) format especially for the use with the train command and other experiment management functions.
The Convert command is as follows −
python -m spacy convert [input_file] [output_dir] [--file-type] [--converter][--n-sents] [--... | [
{
"code": null,
"e": 2264,
"s": 2072,
"text": "As name implies, this command will convert files into spaCy’s JavaScript Object Notation (JSON) format especially for the use with the train command and other experiment management functions."
},
{
"code": null,
"e": 2300,
"s": 2264,
... |
How to Remove a Column by name and index using Dplyr Package in R | 21 Jul, 2021
In this article, we are going to remove columns by name and index in the R programming language using dplyr package.
Dataset in use:
We can remove a column with select() method by its column name.
Syntax:
select(dataframe,-column_name)
Where, dataframe is the input dataframe and column_name is the name of ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Jul, 2021"
},
{
"code": null,
"e": 145,
"s": 28,
"text": "In this article, we are going to remove columns by name and index in the R programming language using dplyr package."
},
{
"code": null,
"e": 161,
"s": 145,
... |
Python program to insert an element into sorted list | 04 Dec, 2021
Given a sorted list and an element, Write a Python program to insert the element into the given list in sorted position.
Examples:
Input : list = [1, 2, 4], n = 3
Output : list = [1, 2, 3, 4]
Input : list = ['a', 'b', 'c', 'd'], n = 'e'
Output : list = ['a', 'b', 'c', 'd', 'e']
Approach #1 :This approach... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Dec, 2021"
},
{
"code": null,
"e": 149,
"s": 28,
"text": "Given a sorted list and an element, Write a Python program to insert the element into the given list in sorted position."
},
{
"code": null,
"e": 159,
"s": 149... |
Generate all possible combinations of K numbers that sums to N | 20 Oct, 2021
Given two integers N and K, the task is to find all valid combinations of K numbers that adds up to N based on the following conditions:
Only numbers from the range [1, 9] used.
Each number can only be used at most once.
Examples:
Input: N = 7, K = 3Output: 1 2 4Explanation: The only possible combination i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Oct, 2021"
},
{
"code": null,
"e": 189,
"s": 52,
"text": "Given two integers N and K, the task is to find all valid combinations of K numbers that adds up to N based on the following conditions:"
},
{
"code": null,
"e": ... |
Intermediate Methods of Stream in Java | 17 Dec, 2021
The Stream API is used to process collections of objects. A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result. The method provided by the stream are broadly categorized as
Intermediate Methods
Terminal Methods
Here, we will be discussing the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Dec, 2021"
},
{
"code": null,
"e": 265,
"s": 28,
"text": "The Stream API is used to process collections of objects. A stream is a sequence of objects that supports various methods which can be pipelined to produce the desired result.... |
Walmart Interview Experience for SDE-3 | 23 Jun, 2021
Round 1(DSA): Write code for following programs, optimize and deduce the time complexities:
Given the arrival and departure times of all trains that reach a railway station, the task is to find the minimum number of platforms required for the railway station so that no train waits.We are given two arrays t... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2021"
},
{
"code": null,
"e": 144,
"s": 52,
"text": "Round 1(DSA): Write code for following programs, optimize and deduce the time complexities:"
},
{
"code": null,
"e": 772,
"s": 144,
"text": "Given the arr... |
Python EasyGUI – Choice Box | 05 Sep, 2020
Choice Box : It is used to display a window having a multiple options i.e items in EasyGUI, it can be used where there is a need to select any one item among a group of items, it consist of title, message to be displayed, group of items and a pair of “Ok”, “Cancel” button to confirm the selection of the it... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Sep, 2020"
},
{
"code": null,
"e": 378,
"s": 28,
"text": "Choice Box : It is used to display a window having a multiple options i.e items in EasyGUI, it can be used where there is a need to select any one item among a group of items,... |
Pascal - Program Structures | Before we study basic building blocks of the Pascal programming language, let us look a bare minimum Pascal program structure so that we can take it as a reference in upcoming chapters.
A Pascal program basically consists of the following parts −
Program name
Uses command
Type declarations
Constant declarations
Variabl... | [
{
"code": null,
"e": 2269,
"s": 2083,
"text": "Before we study basic building blocks of the Pascal programming language, let us look a bare minimum Pascal program structure so that we can take it as a reference in upcoming chapters."
},
{
"code": null,
"e": 2330,
"s": 2269,
"text... |
How to convert a Base64 string into a BitMap image in Android App using Kotlin? | This example demonstrates how to convert a Base64 string into a BitMap image in Android App 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" e... | [
{
"code": null,
"e": 1168,
"s": 1062,
"text": "This example demonstrates how to convert a Base64 string into a BitMap image in Android App using Kotlin."
},
{
"code": null,
"e": 1296,
"s": 1168,
"text": "Step 1 − Create a new project in Android Studio, go to File? New Project and... |
Minimum number of substrings the given string can be splitted into that satisfy the given conditions - GeeksforGeeks | 27 May, 2021
Given a string str and a string array arr[], the task is to find the minimum count of substrings this can be split into such that every substring is present in the given string array arr[].
Examples:
Input: str = “111112”, arr[] = {“11”, “111”, “11111”, “2”}Output: 2 “11111” and “2” are the required subst... | [
{
"code": null,
"e": 25696,
"s": 25668,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 25886,
"s": 25696,
"text": "Given a string str and a string array arr[], the task is to find the minimum count of substrings this can be split into such that every substring is present in the... |
Python StdOuts: Don’t Print, Log! | by Normaler Mensch | Towards Data Science | Often on Python, especially as a beginner, you might print( ) a variable in order to see what is happening in your program. It is possible if you rely on too many print statements throughout your program you will face the nightmare of having to comment them all out towards the end. A much more pythonic way to see what ... | [
{
"code": null,
"e": 612,
"s": 172,
"text": "Often on Python, especially as a beginner, you might print( ) a variable in order to see what is happening in your program. It is possible if you rely on too many print statements throughout your program you will face the nightmare of having to comment th... |
How to Calculate the Area of a Triangle using Python? | Calculating the area of a triangle is a formula that you can easily implement in python. If you have the base and height of the triangle, you can use the following code to get the area of the triangle,
def get_area(base, height):
return 0.5 * base * height
print(get_area(10, 15))
This will give the output:
75
If you... | [
{
"code": null,
"e": 1264,
"s": 1062,
"text": "Calculating the area of a triangle is a formula that you can easily implement in python. If you have the base and height of the triangle, you can use the following code to get the area of the triangle,"
},
{
"code": null,
"e": 1346,
"s":... |
How to parse a string to an int in C++? | You can use a string stream to parse an int in c++ to an int. You need to do some error checking in this method.
#include<iostream>
#include<sstream>
using namespace std;
int str_to_int(const string &str) {
stringstream ss(str);
int num;
ss >> num;
return num;
}
int main() {
string s = "12345";
int ... | [
{
"code": null,
"e": 1175,
"s": 1062,
"text": "You can use a string stream to parse an int in c++ to an int. You need to do some error checking in this method."
},
{
"code": null,
"e": 1417,
"s": 1175,
"text": "#include<iostream>\n#include<sstream>\nusing namespace std;\n\nint st... |
Kotlin Operators | Operators are used to perform operations on variables and values.
The value is called an operand, while the operation (to be performed between the two operands) is defined by an operator:
In the example below, the numbers 100 and 50 are operands, and the
+ sign is an operator:
var x = 100 + 50
Although the + operator i... | [
{
"code": null,
"e": 66,
"s": 0,
"text": "Operators are used to perform operations on variables and values."
},
{
"code": null,
"e": 188,
"s": 66,
"text": "The value is called an operand, while the operation (to be performed between the two operands) is defined by an operator:"
... |
YOLO — You only look once, real time object detection explained | by Manish Chablani | Towards Data Science | Original paper (CVPR 2016. OpenCV People’s Choice Award) https://arxiv.org/pdf/1506.02640v5.pdf
YOLOv2: https://arxiv.org/pdf/1612.08242v1.pdf
Biggest advantages:
Speed (45 frames per second — better than realtime)
Network understands generalized object representation (This allowed them to train the network on real wor... | [
{
"code": null,
"e": 268,
"s": 172,
"text": "Original paper (CVPR 2016. OpenCV People’s Choice Award) https://arxiv.org/pdf/1506.02640v5.pdf"
},
{
"code": null,
"e": 315,
"s": 268,
"text": "YOLOv2: https://arxiv.org/pdf/1612.08242v1.pdf"
},
{
"code": null,
"e": 335,
... |
YACC program to recognize string with grammar { anbn | n≥0 } - GeeksforGeeks | 08 May, 2019
Problem: Write YACC program to recognize string with grammar { anbn | n≥0 }.
Explanation:Yacc (for “yet another compiler compiler.”) is the standard parser generator for the Unix operating system. An open source program, yacc generates code for the parser in the C programming language. The acronym is usual... | [
{
"code": null,
"e": 24570,
"s": 24542,
"text": "\n08 May, 2019"
},
{
"code": null,
"e": 24647,
"s": 24570,
"text": "Problem: Write YACC program to recognize string with grammar { anbn | n≥0 }."
},
{
"code": null,
"e": 24944,
"s": 24647,
"text": "Explanation:Y... |
Python Program to check if strings are rotations of each other or not | 13 Jun, 2022
Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1? (eg given s1 = ABCD and s2 = CDAB, return true, given s1 = ABCD, and s2 = ACBD , return false) Algorithm: areRotations(str1, str2)
1. Create a temp string and store concatenation of str1 to
str1 in temp.
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 249,
"s": 28,
"text": "Given a string s1 and a string s2, write a snippet to say whether s2 is a rotation of s1? (eg given s1 = ABCD and s2 = CDAB, return true, given s1 = ABCD, and s2 = ACBD , retu... |
Insertion in a Binary Tree in level order | 23 Nov, 2021
Given a binary tree and a key, insert the key into the binary tree at the first position available in level order.
The idea is to do iterative level order traversal of the given tree using queue. If we find a node whose left child is empty, we make new key as left child of the node. Else if we find a no... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Nov, 2021"
},
{
"code": null,
"e": 168,
"s": 52,
"text": "Given a binary tree and a key, insert the key into the binary tree at the first position available in level order. "
},
{
"code": null,
"e": 520,
"s": 170,
... |
Different ways to compare Strings in Golang | 08 Oct, 2020
In Go language, the string is an immutable chain of arbitrary bytes encoded with UTF-8 encoding. You are allowed to compare strings with each other using two different ways:
1. Using comparison operators: Go strings support comparison operators, i.e, ==, !=, >=, <=, <, >. Here, the == and != operator are u... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2020"
},
{
"code": null,
"e": 202,
"s": 28,
"text": "In Go language, the string is an immutable chain of arbitrary bytes encoded with UTF-8 encoding. You are allowed to compare strings with each other using two different ways:"
... |
Simple Attendance Tracker using Python | 28 Nov, 2021
In many colleges, we have an attendance system for each subject, and the lack of the same leads to problems. It is difficult for students to remember the number of leaves taken for a particular subject. If every time paperwork has to be done to track the number of leaves taken by staff and check whether it... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Nov, 2021"
},
{
"code": null,
"e": 419,
"s": 28,
"text": "In many colleges, we have an attendance system for each subject, and the lack of the same leads to problems. It is difficult for students to remember the number of leaves take... |
Pattern compile(String,int) method in Java with Examples | 31 Aug, 2021
The compile(String, int) method of the Pattern class used to create a pattern from the regular expression with the help of flags where both expression and flags are passed as parameters to the method. The Pattern class contains a list of flags (int constants) that can be helpful to make the Pattern matchin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 504,
"s": 54,
"text": "The compile(String, int) method of the Pattern class used to create a pattern from the regular expression with the help of flags where both expression and flags are passed as... |
Python Pandas – Plotting the Autocorrelation Plot | 14 Jan, 2022
Pandas can be used to plot the Autocorrelation Plot on a graph. Plotting the Autocorrelation Plot on a graph can be done using the autocorrelation_plot() method of the plotting module. This function generates the Autocorrelation plot for time series.
Autocorrelation plots are a commonly used tool for check... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 Jan, 2022"
},
{
"code": null,
"e": 279,
"s": 28,
"text": "Pandas can be used to plot the Autocorrelation Plot on a graph. Plotting the Autocorrelation Plot on a graph can be done using the autocorrelation_plot() method of the plottin... |
D3.js stack() method | 09 Sep, 2020
The d3.stack() method constructs a new stack generator with the default settings. This stack generator can be further used to create stacks.
Syntax:
d3.stack()
Parameters: This method takes no parameters.
Return Value: This method returns a new stack generator with the default settings.
Example:
<!DOCTYPE ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Sep, 2020"
},
{
"code": null,
"e": 169,
"s": 28,
"text": "The d3.stack() method constructs a new stack generator with the default settings. This stack generator can be further used to create stacks."
},
{
"code": null,
"e... |
C++ Program for Program to find largest element in an array | 03 Jun, 2022
Given an array arr of size N, the task is to find the largest element in the given array.
Example:
Input: arr[] = {10, 20, 4}Output: 20
Input : arr[] = {20, 10, 20, 4, 100}Output : 100
Approach 1 – Linear Traversal: One of the most simplest and basic approach to solve this problem is to simply traverse t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jun, 2022"
},
{
"code": null,
"e": 119,
"s": 28,
"text": "Given an array arr of size N, the task is to find the largest element in the given array. "
},
{
"code": null,
"e": 129,
"s": 119,
"text": "Example: "
},... |
ISRO | ISRO CS 2015 | Question 14 | 03 Apr, 2018
A hash table with ten buckets with one slot per bucket is shown in the following figure. The symbols S1 to S7 initially entered using a hashing function with linear probing.The maximum number of comparisons needed in searching an item that is not present is
(A) 4(B) 5(C) 6(D) 3Answer: (B)Explanation:
We ha... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Apr, 2018"
},
{
"code": null,
"e": 312,
"s": 54,
"text": "A hash table with ten buckets with one slot per bucket is shown in the following figure. The symbols S1 to S7 initially entered using a hashing function with linear probing.T... |
Optimal Strategy for a Game | Set 2 | 06 Jun, 2021
Problem statement: Consider a row of n coins of values v1 . . . vn, where n is even. We play a game against an opponent by alternating turns. In each turn, a player selects either the first or last coin from the row, removes it from the row permanently, and receives the value of the coin. Determine the max... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jun, 2021"
},
{
"code": null,
"e": 473,
"s": 52,
"text": "Problem statement: Consider a row of n coins of values v1 . . . vn, where n is even. We play a game against an opponent by alternating turns. In each turn, a player selects e... |
New Date-Time API in Java 8 | 24 Sep, 2021
New date-time API is introduced in Java 8 to overcome the following drawbacks of old date-time API :
Not thread safe : Unlike old java.util.Date which is not thread safe the new date-time API is immutable and doesn’t have setter methods.Less operations : In old API there are only few date operations but t... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 156,
"s": 54,
"text": "New date-time API is introduced in Java 8 to overcome the following drawbacks of old date-time API : "
},
{
"code": null,
"e": 411,
"s": 156,
"text": "Not... |
Python | page_source method in Selenium | 06 Mar, 2020
page_source method is used retrieve the page source of the webpage the user is currently accessing. The main use of this method to find something in the page source like finding any data or keyword.
Page source : The source code/page source is the programming behind any webpage.
Syntax :
driver.page_source... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Mar, 2020"
},
{
"code": null,
"e": 227,
"s": 28,
"text": "page_source method is used retrieve the page source of the webpage the user is currently accessing. The main use of this method to find something in the page source like findi... |
Select highest salary in MySQL? | For this, you can use MAX(). The syntax is as follows −
select MAX(yourColumnName) AS anyAliasName from yourTableName;
Let us create a table −
mysql> create table demo44
−> (
−> employee_id int not null auto_increment primary key,
−> employee_name varchar(20),
−> employee_salary int
−> )
−> ;
Query OK, 0 rows affected ... | [
{
"code": null,
"e": 1243,
"s": 1187,
"text": "For this, you can use MAX(). The syntax is as follows −"
},
{
"code": null,
"e": 1306,
"s": 1243,
"text": "select MAX(yourColumnName) AS anyAliasName from yourTableName;"
},
{
"code": null,
"e": 1330,
"s": 1306,
"... |
Minimum number of steps to make all elements of array equal | 05 Nov, 2021
Given two arrays A[] and B[] of the same length, the task is to find the minimum number of steps required to make all the elements of the array equal by replacing the element with the difference of the corresponding element from array B. Note: If this is not possible print -1.Examples:
Input: A[] = {5, 7,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Nov, 2021"
},
{
"code": null,
"e": 342,
"s": 54,
"text": "Given two arrays A[] and B[] of the same length, the task is to find the minimum number of steps required to make all the elements of the array equal by replacing the element... |
Python | Pandas Series.mad() to calculate Mean Absolute Deviation of a Series | 30 Sep, 2019
Pandas provide a method to make Calculation of MAD (Mean Absolute Deviation) very easy. MAD is defined as average distance between each value and mean.
The formula used to calculate MAD is:
Syntax: Series.mad(axis=None, skipna=None, level=None)
Parameters:axis: 0 or ‘index’ for row wise operation and 1 or ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Sep, 2019"
},
{
"code": null,
"e": 204,
"s": 52,
"text": "Pandas provide a method to make Calculation of MAD (Mean Absolute Deviation) very easy. MAD is defined as average distance between each value and mean."
},
{
"code": ... |
How to draw an ellipse using CSS ? | 31 May, 2021
In this article, we will learn how to create an ellipse using CSS. To create an ellipse first we will create a simple rectangle of our desired height and width.
Approach To create Rectangle: In order to create an ellipse of our desired size, we will create a div in HTML and will give it a class named as an... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 May, 2021"
},
{
"code": null,
"e": 189,
"s": 28,
"text": "In this article, we will learn how to create an ellipse using CSS. To create an ellipse first we will create a simple rectangle of our desired height and width."
},
{
... |
ReactJS | useState Hook | 29 Jan, 2021
Functional components are some of the more commonly used components in ReactJS. Most developers prefer using functional components over class-based components for the simple reason that functional components require less coding (on the developer’s part). However, two main features for the class are lost wh... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 Jan, 2021"
},
{
"code": null,
"e": 1234,
"s": 53,
"text": "Functional components are some of the more commonly used components in ReactJS. Most developers prefer using functional components over class-based components for the simple... |
How to implement decrease key or change key in Binary Search Tree? | 28 Jun, 2022
Given a Binary Search Tree, write a function that takes the following three as arguments:
Root of tree Old key value New Key Value
Root of tree
Old key value
New Key Value
The function should change old key value to new key value. The function may assume that old key-value always exists in Binary Sear... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 143,
"s": 52,
"text": "Given a Binary Search Tree, write a function that takes the following three as arguments: "
},
{
"code": null,
"e": 185,
"s": 143,
"text": "Root of tree O... |
How to create a table with date column? | To create a table with only date column, you can use DATE type. Let us first create a table −
mysql> create table DemoTable
(
StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY,
StudentName varchar(20),
StudentAdmissionDate DATE
);
Query OK, 0 rows affected (0.47 sec)
Insert records in the table using ins... | [
{
"code": null,
"e": 1281,
"s": 1187,
"text": "To create a table with only date column, you can use DATE type. Let us first create a table −"
},
{
"code": null,
"e": 1470,
"s": 1281,
"text": "mysql> create table DemoTable\n (\n StudentId int NOT NULL AUTO_INCREMENT PRIMARY KE... |
Node Jimp | Color mix - GeeksforGeeks | 23 Apr, 2019
IntroductionThe mix modifier is an inbuilt color modifier in Nodejs | Jimp which mixes colors by their RGB component values and amount is opacity of overlaying color.Syntax:
image.color([
{ apply: 'mix', params: [color : value] }
]);
Parameter:
color – This parameter stores the color to apply.
value – T... | [
{
"code": null,
"e": 26215,
"s": 26187,
"text": "\n23 Apr, 2019"
},
{
"code": null,
"e": 26389,
"s": 26215,
"text": "IntroductionThe mix modifier is an inbuilt color modifier in Nodejs | Jimp which mixes colors by their RGB component values and amount is opacity of overlaying col... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.