title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Implementing next_permutation() in Java with Examples - GeeksforGeeks | 28 Mar, 2022
Given an array or string, the task is to find the next lexicographically greater permutation of it in Java.Examples:
Input: string = "gfg"
Output: ggf
Input: arr[] = {1, 2, 3}
Output: {1, 3, 2}
In C++, there is a specific function that saves us from a lot of code. It’s in the header file #include<algori... | [
{
"code": null,
"e": 23583,
"s": 23555,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 23702,
"s": 23583,
"text": "Given an array or string, the task is to find the next lexicographically greater permutation of it in Java.Examples: "
},
{
"code": null,
"e": 23780,
... |
How to open URL in a new window using JavaScript ? - GeeksforGeeks | 31 Dec, 2019
In HTML, the anchor tag is used to open new windows and tabs in a very straightforward manner. However, there is a need to do the same using JavaScript. In JavaScript, window.open() proves to be helpful. The window.open() method is used to open a new browser window or a new tab depending on the browser set... | [
{
"code": null,
"e": 24529,
"s": 24501,
"text": "\n31 Dec, 2019"
},
{
"code": null,
"e": 24867,
"s": 24529,
"text": "In HTML, the anchor tag is used to open new windows and tabs in a very straightforward manner. However, there is a need to do the same using JavaScript. In JavaScr... |
ggplot2 - Background Colors | There are ways to change the entire look of your plot with one function as mentioned below. But if you want to simply change the background color of the panel you can, use the following −
We can change the background color using following command which helps in changing the panel (panel.background) −
> ggplot(iris, aes... | [
{
"code": null,
"e": 2210,
"s": 2022,
"text": "There are ways to change the entire look of your plot with one function as mentioned below. But if you want to simply change the background color of the panel you can, use the following −"
},
{
"code": null,
"e": 2324,
"s": 2210,
"te... |
WPF - Dialog Box | All standalone applications have a main window that exposes some functionality and displays some data over which the application operates through a GUI. An application may also display additional windows to do the following −
Display some specific information to users
Gather useful information from users
Both display a... | [
{
"code": null,
"e": 2246,
"s": 2020,
"text": "All standalone applications have a main window that exposes some functionality and displays some data over which the application operates through a GUI. An application may also display additional windows to do the following −"
},
{
"code": null,... |
How to remove disabled attribute using jQuery? | To remove disabled attribute using jQuery, use the removeAttr() method. You need to first remove the property using the prop() method. It will set the underlying Boolean value to false.
You can try to run the following code to learn how to remove disabled attribute using jQuery:
Live Demo
<!DOCTYPE html>
<html>
<head>
... | [
{
"code": null,
"e": 1248,
"s": 1062,
"text": "To remove disabled attribute using jQuery, use the removeAttr() method. You need to first remove the property using the prop() method. It will set the underlying Boolean value to false."
},
{
"code": null,
"e": 1342,
"s": 1248,
"text... |
GATE | GATE-CS-2003 | Question 90 - GeeksforGeeks | 28 Jun, 2021
Let G = ({S}, {a, b} R, S) be a context free grammar where the rule set R isS → a S b | SS | εWhich of the following statements is true?(A) G is not ambiguous(B) There exist x, y, ∈ L (G) such that xy ∉ L(G)(C) There is a deterministic pushdown automaton that accepts L(G)(D) We can find a deterministic fi... | [
{
"code": null,
"e": 24472,
"s": 24444,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24841,
"s": 24472,
"text": "Let G = ({S}, {a, b} R, S) be a context free grammar where the rule set R isS → a S b | SS | εWhich of the following statements is true?(A) G is not ambiguous(B) T... |
How to deal with warning message `stat_bin()` using `bins = 30`. Pick better value with `binwidth`. in R while creating a histogram? | The default value for bins is 30 but if we don’t pass that in geom_histogram then the warning message is shown by R in most of the cases. To avoid that, we can simply put bins=30 inside the geom_histogram() function. This will stop showing the warning message.
Consider the below data frame −
x<-rnorm(50000,5,1)
df<-dat... | [
{
"code": null,
"e": 1323,
"s": 1062,
"text": "The default value for bins is 30 but if we don’t pass that in geom_histogram then the warning message is shown by R in most of the cases. To avoid that, we can simply put bins=30 inside the geom_histogram() function. This will stop showing the warning m... |
Simple Edge Detection Model using Python | by Behic Guven | Towards Data Science | In this post, I will show you how to detect the edges in an image. Writing an edge detection program will give you some understanding of computer vision and self-driving cars. Edge detection is commonly used to understand objects in an image. It also helps the machines to make better predictions. Writing an edge detect... | [
{
"code": null,
"e": 642,
"s": 172,
"text": "In this post, I will show you how to detect the edges in an image. Writing an edge detection program will give you some understanding of computer vision and self-driving cars. Edge detection is commonly used to understand objects in an image. It also help... |
What is Motion UI? - GeeksforGeeks | 15 Sep, 2020
A good design is an essential aspect of a website or app. These are important as it helps to build a good user interface. Transitions and animations are great tools and can help bring a much-needed elegance to the web. In the early days, the static design was used, but now the motion design is very popular... | [
{
"code": null,
"e": 23837,
"s": 23809,
"text": "\n15 Sep, 2020"
},
{
"code": null,
"e": 24147,
"s": 23837,
"text": "A good design is an essential aspect of a website or app. These are important as it helps to build a good user interface. Transitions and animations are great tool... |
How to take user input using HTML forms? | Using HTML forms, you can easily take user input. The <form> tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc.
Let’s learn about the <input> tag, which helps you to take user input using the type attribute. The attrib... | [
{
"code": null,
"e": 1276,
"s": 1062,
"text": "Using HTML forms, you can easily take user input. The <form> tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc."
},
{
"code": null,
"e": 14... |
Refining margins over the years. How have crude processing and refined... | by Ranganath Venkataraman | Towards Data Science | In my last post, we saw that the Gulf Coast is largely responsible for refinery processing in the United States. So, why do refineries process crude into refined products? To recognize profits between products and crude.
As always, note that all data used in visualizations below is publicly available from the U.S. Ener... | [
{
"code": null,
"e": 392,
"s": 171,
"text": "In my last post, we saw that the Gulf Coast is largely responsible for refinery processing in the United States. So, why do refineries process crude into refined products? To recognize profits between products and crude."
},
{
"code": null,
"e... |
Read NetCDF Data with Python. Access a slightly confusing, yet... | by Konrad Hafen | Towards Data Science | Network common data form (NetCDF) is commonly used to store multidimensional geographic data. Some examples of these data are temperature, precipitation, and wind speed. Variables stored in NetCDF are often measured multiple times per day over large (continental) areas. With multiple measurements per day, data values a... | [
{
"code": null,
"e": 775,
"s": 171,
"text": "Network common data form (NetCDF) is commonly used to store multidimensional geographic data. Some examples of these data are temperature, precipitation, and wind speed. Variables stored in NetCDF are often measured multiple times per day over large (cont... |
Maximize the total profit of all the persons - GeeksforGeeks | 26 Aug, 2021
There is a hierarchical structure in an organization. A party is to be organized. No two immediate subordinates can come to the party. A profit is associated with every person. You have to maximize the total profit of all the persons who come to the party.Hierarchical Structure In a hierarchical organizati... | [
{
"code": null,
"e": 24567,
"s": 24539,
"text": "\n26 Aug, 2021"
},
{
"code": null,
"e": 25074,
"s": 24567,
"text": "There is a hierarchical structure in an organization. A party is to be organized. No two immediate subordinates can come to the party. A profit is associated with ... |
File Searching using C# | To search files from the list of files in a directory, try to run the following code −
using System;
using System.IO;
namespace Demo {
class Program {
static void Main(string[] args) {
//creating a DirectoryInfo object
DirectoryInfo mydir = new DirectoryInfo(@"d:\amit");
// getting... | [
{
"code": null,
"e": 1149,
"s": 1062,
"text": "To search files from the list of files in a directory, try to run the following code −"
},
{
"code": null,
"e": 1653,
"s": 1149,
"text": "using System;\nusing System.IO;\n\nnamespace Demo {\n class Program {\n static void Main... |
Breaking the Enigma Code in Python with MCMC (Marvel themed) | by Jack J | Towards Data Science | Knowledge is Power. This rule can be applied to almost any domain, yet it is arguably never more relevant than during times of war. The ability to predict your enemies next move is equally difficult as it is rewarding, a task which is made considerably easier if one could read their plans ahead of time.
This is somethi... | [
{
"code": null,
"e": 477,
"s": 172,
"text": "Knowledge is Power. This rule can be applied to almost any domain, yet it is arguably never more relevant than during times of war. The ability to predict your enemies next move is equally difficult as it is rewarding, a task which is made considerably ea... |
Golang Program to count the set bits in an integer. | For example, 101, 11, 11011 and 1001001 set bits count 2, 2, 4 and 3 respectively.
Approach to solve this problem
Step 1 − Convert number into binary representation.
Step 2 − Count the number of 1s; return count.
Live Demo
package main
import (
"fmt"
"strconv"
)
func NumOfSetBits(n int) int{
count := 0
for... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "For example, 101, 11, 11011 and 1001001 set bits count 2, 2, 4 and 3 respectively."
},
{
"code": null,
"e": 1176,
"s": 1145,
"text": "Approach to solve this problem"
},
{
"code": null,
"e": 1228,
"s": 1176,
"text"... |
HTML <meta> content Attribute | The content attribute of the <meta> element is used to set the meta information in an HTML document. This can be the information for the description or the keywords, for name attribute.
Following is the syntax:
<meta content="text">
Above, the text is the meta information.
Let us now see an example to implement the con... | [
{
"code": null,
"e": 1248,
"s": 1062,
"text": "The content attribute of the <meta> element is used to set the meta information in an HTML document. This can be the information for the description or the keywords, for name attribute."
},
{
"code": null,
"e": 1273,
"s": 1248,
"text... |
Java program to print a prime number | Any whole number which is greater than 1 and has only two factors that is 1 and the number itself, is called a prime number. Other than these two number it has no positive divisor. For example −
7 = 1 × 7
Few prime number are − 1, 2, 3, 5 , 7, 11 etc.
1. Take integer variable A
2. Divide the variable A with (A-1 to 2)
... | [
{
"code": null,
"e": 1257,
"s": 1062,
"text": "Any whole number which is greater than 1 and has only two factors that is 1 and the number itself, is called a prime number. Other than these two number it has no positive divisor. For example −"
},
{
"code": null,
"e": 1267,
"s": 1257,
... |
How to convert an object x to a string representation in Python? | Most commonly used str() function from Python library returns a string representation of object.
>>> no=100
>>> str(no)
'100'
>>> L1=[1,2,3,4]
>>> str(L1)
'[1, 2, 3, 4]'
>>> d={'a': 1, 'b': 2, 'c': 3, 'd': 4}
>>> str(d)
"{'a': 1, 'b': 2, 'c': 3, 'd': 4}"
However, repr() returns a default and unambiguous representation ... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "Most commonly used str() function from Python library returns a string representation of object."
},
{
"code": null,
"e": 1317,
"s": 1159,
"text": ">>> no=100\n>>> str(no)\n'100'\n>>> L1=[1,2,3,4]\n>>> str(L1)\n'[1, 2, 3, 4]'\n>>> d=... |
Java program to calculate the GCD of a given number using recursion | You can calculate the GCD of given two numbers, using recursion as shown in the following program.
import java.util.Scanner;
public class GCDUsingRecursion {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter first number :: ");
int firstNum = sc... | [
{
"code": null,
"e": 1161,
"s": 1062,
"text": "You can calculate the GCD of given two numbers, using recursion as shown in the following program."
},
{
"code": null,
"e": 1734,
"s": 1161,
"text": "import java.util.Scanner;\npublic class GCDUsingRecursion {\n public static void ... |
How to set a proxy for wget on Linux? | Wget is a Linux command line utility that is used to retrieve files from World Wide Web(WWW) and makes use of protocols like HTTPS and FTP. It is a freely available package and can be downloaded and installed on any Linux supporting architecture.
One of the key features of wget is its ability to automatically start dow... | [
{
"code": null,
"e": 1309,
"s": 1062,
"text": "Wget is a Linux command line utility that is used to retrieve files from World Wide Web(WWW) and makes use of protocols like HTTPS and FTP. It is a freely available package and can be downloaded and installed on any Linux supporting architecture."
},
... |
Egg Dropping Puzzle | Practice | GeeksforGeeks | You are given N identical eggs and you have access to a K-floored building from 1 to K.
There exists a floor f where 0 <= f <= K such that any egg dropped at a floor higher than f will break, and any egg dropped at or below floor f will not break. There are few rules given below.
An egg that survives a fall can be use... | [
{
"code": null,
"e": 326,
"s": 238,
"text": "You are given N identical eggs and you have access to a K-floored building from 1 to K."
},
{
"code": null,
"e": 520,
"s": 326,
"text": "There exists a floor f where 0 <= f <= K such that any egg dropped at a floor higher than f will b... |
How to filter String stream and map to lower case in Java? Perform sort as well. | Let’s say the following is String array, which we have converted to List −
Arrays.asList("DE", "GH", "JK", "MN", "PQ", "RS", "TU", "VW", "XY", "BC")
Now filter String stream and map to lower case −
.stream()
.filter(a-> a.startsWith("V"))
.map(String::toLowerCase)
To sort now, use the sorted() and display using forEach... | [
{
"code": null,
"e": 1137,
"s": 1062,
"text": "Let’s say the following is String array, which we have converted to List −"
},
{
"code": null,
"e": 1211,
"s": 1137,
"text": "Arrays.asList(\"DE\", \"GH\", \"JK\", \"MN\", \"PQ\", \"RS\", \"TU\", \"VW\", \"XY\", \"BC\")"
},
{
... |
Gradle - Build a JAVA Project | This chapter explains how to build a java project using Gradle build file.
First of all, we have to add java plugin to the build script, because, it provides the tasks to compile Java source code, to run the unit tests, to create a Javadoc and to create a JAR file.
Use the following line in build.gradle file.
apply plu... | [
{
"code": null,
"e": 1957,
"s": 1882,
"text": "This chapter explains how to build a java project using Gradle build file."
},
{
"code": null,
"e": 2148,
"s": 1957,
"text": "First of all, we have to add java plugin to the build script, because, it provides the tasks to compile Jav... |
First uppercase letter in a string (Iterative and Recursive) - GeeksforGeeks | 12 Jan, 2022
Given a string find its first uppercase letterExamples :
Input : geeksforgeeKs
Output : K
Input : geekS
Output : S
Method 1: linear search Using linear search, find the first character which is capital
C++
Java
Python3
C#
PHP
Javascript
// C++ program to find the first// uppercase letter using linear ... | [
{
"code": null,
"e": 25623,
"s": 25595,
"text": "\n12 Jan, 2022"
},
{
"code": null,
"e": 25681,
"s": 25623,
"text": "Given a string find its first uppercase letterExamples : "
},
{
"code": null,
"e": 25741,
"s": 25681,
"text": "Input : geeksforgeeKs\nOutput : ... |
HTML <img> referrerpolicy Attribute - GeeksforGeeks | 02 Mar, 2022
The HTML <img> referrerpolicy attribute is used to specify the reference information that will be sent to the server when fetching the image.
Syntax:
<img referrerpolicy="value">
Attribute Values :
no-referrer: It specifies that no reference information will be sent along with a request.
no-referrer-wh... | [
{
"code": null,
"e": 24894,
"s": 24866,
"text": "\n02 Mar, 2022"
},
{
"code": null,
"e": 25037,
"s": 24894,
"text": "The HTML <img> referrerpolicy attribute is used to specify the reference information that will be sent to the server when fetching the image. "
},
{
"code"... |
Regularization Techniques And Their Implementation In TensorFlow(Keras) | by Richmond Alake | Towards Data Science | Deep Neural Networks(DNN) have a vast amount of weights parameters internal to the architecture that learn a range of values. These range of values are the essential key to enabling the neural network to solve huge complex functions.
The deeper a neural network is, the more representational power it possesses, but, the... | [
{
"code": null,
"e": 405,
"s": 171,
"text": "Deep Neural Networks(DNN) have a vast amount of weights parameters internal to the architecture that learn a range of values. These range of values are the essential key to enabling the neural network to solve huge complex functions."
},
{
"code":... |
SOAP - Fault | If an error occurs during processing, the response to a SOAP message is a SOAP fault element in the body of the message, and the fault is returned to the sender of the SOAP message.
The SOAP fault mechanism returns specific information about the error, including a predefined code, a description, and the address of the ... | [
{
"code": null,
"e": 1896,
"s": 1714,
"text": "If an error occurs during processing, the response to a SOAP message is a SOAP fault element in the body of the message, and the fault is returned to the sender of the SOAP message."
},
{
"code": null,
"e": 2075,
"s": 1896,
"text": "... |
Difference between Inter and Intra Frame Compression - GeeksforGeeks | 24 Nov, 2021
In Compression, we reduce the size of our data to achieve high efficiency and easy storage. It is quite cumbersome to transfer files having large size so we need to compress it. Compressed file takes less time for data transmission and reduce the cost of storage.
Compression Ratio = B1 / B2
where, B1 = T... | [
{
"code": null,
"e": 24510,
"s": 24482,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 24775,
"s": 24510,
"text": "In Compression, we reduce the size of our data to achieve high efficiency and easy storage. It is quite cumbersome to transfer files having large size so we need t... |
Socket.IO - Quick Guide | Socket.IO is a JavaScript library for real-time web applications. It enables real-time, bi-directional communication between web clients and servers. It has two parts − a client-side library that runs in the browser, and a server-side library for node.js. Both components have an identical API.
A real-time application (... | [
{
"code": null,
"e": 2160,
"s": 1865,
"text": "Socket.IO is a JavaScript library for real-time web applications. It enables real-time, bi-directional communication between web clients and servers. It has two parts − a client-side library that runs in the browser, and a server-side library for node.j... |
TensorFlow - Basics | In this chapter, we will learn about the basics of TensorFlow. We will begin by understanding the data structure of tensor.
Tensors are used as the basic data structures in TensorFlow language. Tensors represent the connecting edges in any flow diagram called the Data Flow Graph. Tensors are defined as multidimensional... | [
{
"code": null,
"e": 2439,
"s": 2315,
"text": "In this chapter, we will learn about the basics of TensorFlow. We will begin by understanding the data structure of tensor."
},
{
"code": null,
"e": 2651,
"s": 2439,
"text": "Tensors are used as the basic data structures in TensorFlo... |
Assigning multiple characters in an int in C language - GeeksforGeeks | 30 Apr, 2018
Consider the following C program.
#include <stdio.h>int main(void){ int a = 'd'; printf("%d\n", a); /*OUTPUT - 100 (ASCII Code for character d)*/ int b = 'dd'; printf("%d", b); /*OUTPUT - 25700 (Explanation in detail given below)*/ return 0;}
Output :
100
25700
We can easily gue... | [
{
"code": null,
"e": 24321,
"s": 24293,
"text": "\n30 Apr, 2018"
},
{
"code": null,
"e": 24355,
"s": 24321,
"text": "Consider the following C program."
},
{
"code": "#include <stdio.h>int main(void){ int a = 'd'; printf(\"%d\\n\", a); /*OUTPUT - 100 (ASCII Code... |
XQuery - concat Function | The concat function is used to concatenate various strings.
concat($input as xs:anyAtomicType?) as xs:string
$input − one or more inputs separated by comma.
$input − one or more inputs separated by comma.
let $bookTitle := "Learn XQuery in 24 hours"
let $updatedTitle := concat($bookTitle,",price: 200$")
return
<res... | [
{
"code": null,
"e": 1932,
"s": 1872,
"text": "The concat function is used to concatenate various strings."
},
{
"code": null,
"e": 1981,
"s": 1932,
"text": "concat($input as xs:anyAtomicType?) as xs:string"
},
{
"code": null,
"e": 2029,
"s": 1981,
"text": "$i... |
PostgreSQL - UPDATE Query | The PostgreSQL UPDATE Query is used to modify the existing records in a table. You can use WHERE clause with UPDATE query to update the selected rows. Otherwise, all the rows would be updated.
The basic syntax of UPDATE query with WHERE clause is as follows −
UPDATE table_name
SET column1 = value1, column2 = value2....... | [
{
"code": null,
"e": 3018,
"s": 2825,
"text": "The PostgreSQL UPDATE Query is used to modify the existing records in a table. You can use WHERE clause with UPDATE query to update the selected rows. Otherwise, all the rows would be updated."
},
{
"code": null,
"e": 3085,
"s": 3018,
... |
When should we write our own assignment operator in C++? - GeeksforGeeks | 28 Sep, 2018
The answer is same as Copy Constructor. If a class doesn’t contain pointers, then there is no need to write assignment operator and copy constructor. The compiler creates a default copy constructor and assignment operators for every class. The compiler created copy constructor and assignment operator may n... | [
{
"code": null,
"e": 25206,
"s": 25178,
"text": "\n28 Sep, 2018"
},
{
"code": null,
"e": 25681,
"s": 25206,
"text": "The answer is same as Copy Constructor. If a class doesn’t contain pointers, then there is no need to write assignment operator and copy constructor. The compiler ... |
JqueryUI - Menu | A menu widget usually consists of a main menu bar with pop up menus. Items in pop up menus often have sub pop up menus. A menu can be created using the markup elements as long as the parent-child relation is maintained (using <ul> or <ol>). Each menu item has an anchor element.
The Menu Widget in jQueryUI can be used f... | [
{
"code": null,
"e": 2543,
"s": 2264,
"text": "A menu widget usually consists of a main menu bar with pop up menus. Items in pop up menus often have sub pop up menus. A menu can be created using the markup elements as long as the parent-child relation is maintained (using <ul> or <ol>). Each menu it... |
R - If...Else Statement | An if statement can be followed by an optional else statement which executes when the boolean expression is false.
The basic syntax for creating an if...else statement in R is −
if(boolean_expression) {
// statement(s) will execute if the boolean expression is true.
} else {
// statement(s) will execute if the bo... | [
{
"code": null,
"e": 2517,
"s": 2402,
"text": "An if statement can be followed by an optional else statement which executes when the boolean expression is false."
},
{
"code": null,
"e": 2580,
"s": 2517,
"text": "The basic syntax for creating an if...else statement in R is −"
}... |
BigInteger doubleValue() Method in Java - GeeksforGeeks | 04 Dec, 2018
The java.math.BigInteger.doubleValue() converts this BigInteger to a double value. If the value return by this function is too big for a magnitude to represent as a double then it will be converted to Double.NEGATIVE_INFINITY or Double.POSITIVE_INFINITY as appropriate. There is a chance that this conversio... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 24323,
"s": 23948,
"text": "The java.math.BigInteger.doubleValue() converts this BigInteger to a double value. If the value return by this function is too big for a magnitude to represent as ... |
How to Get Local IP Address of System using PHP ? - GeeksforGeeks | 02 Mar, 2020
IP (Internet Protocol) Address is an address of your network hardware. It helps in connecting your computer to other devices on your network and all over the world. An IP Address is made up of numbers or characters combined by ‘.’ symbol.
Example: It is an example of IP address.
506.457.14.512
All devices ... | [
{
"code": null,
"e": 24874,
"s": 24846,
"text": "\n02 Mar, 2020"
},
{
"code": null,
"e": 25113,
"s": 24874,
"text": "IP (Internet Protocol) Address is an address of your network hardware. It helps in connecting your computer to other devices on your network and all over the world... |
Version control your database Part 1: creating migrations and seeding | by Mike Huls | Towards Data Science | If you are not working with migrations in your database you’re missing out. Like Git manages changes to source code, you can use migrations to keep track of changes to your database. Execute and revert changes and get your database back into a previous state.
Setting up migrations is easier than you think and the advan... | [
{
"code": null,
"e": 432,
"s": 172,
"text": "If you are not working with migrations in your database you’re missing out. Like Git manages changes to source code, you can use migrations to keep track of changes to your database. Execute and revert changes and get your database back into a previous st... |
PyTorch – torch.linalg.solve() Method | To solve a square system of linear equations with unique solution, we could apply the torch.linalg.solve() method. This method takes two parameters −
first, the coefficient matrix A, and
first, the coefficient matrix A, and
second, the right-hand tensor b.
second, the right-hand tensor b.
Where A is a square matrix and... | [
{
"code": null,
"e": 1212,
"s": 1062,
"text": "To solve a square system of linear equations with unique solution, we could apply the torch.linalg.solve() method. This method takes two parameters −"
},
{
"code": null,
"e": 1249,
"s": 1212,
"text": "first, the coefficient matrix A,... |
13 ways to access data in Python. How to get data from local files... | by John Micah Reid | Towards Data Science | Most Python analysis starts by importing data into your environment. But what if that data is stuck in a database? Or behind an API? Or in a bunch of tiny files?
Luckily, Python is incredibly flexible and has a lot of open-source libraries for accessing and processing data. In this tutorial we’ll look at 13 methods for... | [
{
"code": null,
"e": 334,
"s": 172,
"text": "Most Python analysis starts by importing data into your environment. But what if that data is stuck in a database? Or behind an API? Or in a bunch of tiny files?"
},
{
"code": null,
"e": 636,
"s": 334,
"text": "Luckily, Python is incre... |
Ways to write n as sum of two or more positive integers | 24 Jan, 2022
For a given number n > 0, find the number of different ways in which n can be written as a sum of at two or more positive integers.Examples:
Input : n = 5
Output : 6
Explanation : All possible six ways are :
4 + 1
3 + 2
3 + 1 + 1
2 + 2 + 1
2 + 1 + 1 + 1
1 + 1 + 1 + 1 + 1
Input : 4
Output : 4
Explanation... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jan, 2022"
},
{
"code": null,
"e": 197,
"s": 54,
"text": "For a given number n > 0, find the number of different ways in which n can be written as a sum of at two or more positive integers.Examples: "
},
{
"code": null,
... |
java.lang.reflect.Method Class in Java | 10 Mar, 2021
java.lang.reflect.Method class provides necessary details about one method on a certain category or interface and provides access for the same. The reflected method could also be a category method or an instance method (including an abstract method).
This class allows broadening of conversions to occur whe... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Mar, 2021"
},
{
"code": null,
"e": 279,
"s": 28,
"text": "java.lang.reflect.Method class provides necessary details about one method on a certain category or interface and provides access for the same. The reflected method could also... |
Generate five random numbers from the normal distribution using NumPy | 29 Aug, 2020
In Numpy we are provided with the module called random module that allows us to work with random numbers. The random module provides different methods for data distribution. In this article, we have to create an array of specified shape and fill it random numbers or values such that these values are part o... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 504,
"s": 53,
"text": "In Numpy we are provided with the module called random module that allows us to work with random numbers. The random module provides different methods for data distribution. ... |
Weighted Job Scheduling in O(n Log n) time | 22 Feb, 2022
Given N jobs where every job is represented by following three elements of it.
Start TimeFinish TimeProfit or Value Associated
Start Time
Finish Time
Profit or Value Associated
Find the maximum profit subset of jobs such that no two jobs in the subset overlap.Example:
Input: Number of Jobs n = 4
Jo... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Feb, 2022"
},
{
"code": null,
"e": 131,
"s": 52,
"text": "Given N jobs where every job is represented by following three elements of it."
},
{
"code": null,
"e": 179,
"s": 131,
"text": "Start TimeFinish TimeProfi... |
How to take Screenshots in ElectronJS ? | 11 Jun, 2020
ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable of running on Windows, macOS, and Linux operating systems. It combines the Chromium engine and NodeJS into a Single Runtime.
Electro... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 Jun, 2020"
},
{
"code": null,
"e": 328,
"s": 28,
"text": "ElectronJS is an Open Source Framework used for building Cross-Platform native desktop applications using web technologies such as HTML, CSS, and JavaScript which are capable ... |
isocalendar() Function Of Datetime.date Class In Python | 28 Jul, 2021
The isocalendar() function is used to return a tuple containing ISO Year, ISO Week Number, and ISO Weekday.
Note:
According to ISO standard 8601 and ISO standard 2015, Thursday is the middle day of a week.
Therefore, ISO years always start with Monday.
ISO years can have either 52 full weeks or 53 full wee... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jul, 2021"
},
{
"code": null,
"e": 136,
"s": 28,
"text": "The isocalendar() function is used to return a tuple containing ISO Year, ISO Week Number, and ISO Weekday."
},
{
"code": null,
"e": 142,
"s": 136,
"text":... |
Subset array sum by generating all the subsets | 04 Feb, 2022
Given an array of size N and a sum, the task is to check whether some array elements can be added to sum to N . Note: At least one element should be included to form the sum.(i.e. sum cant be zero) Examples:
Input: array = -1, 2, 4, 121, N = 5
Output: YES
The array elements 2, 4, -1 can be added to sum t... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Feb, 2022"
},
{
"code": null,
"e": 264,
"s": 54,
"text": "Given an array of size N and a sum, the task is to check whether some array elements can be added to sum to N . Note: At least one element should be included to form the sum.... |
R program to find prime and composite numbers in an interval | 03 Mar, 2021
A natural number (1, 2, 3, 4, 5 and so on) is called a prime number if it is greater than 1 and cannot be written as the product of two smaller natural numbers. The numbers greater than 1 that are not prime are called composite numbers.
A composite number is a positive integer that can be formed by multipl... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Mar, 2021"
},
{
"code": null,
"e": 265,
"s": 28,
"text": "A natural number (1, 2, 3, 4, 5 and so on) is called a prime number if it is greater than 1 and cannot be written as the product of two smaller natural numbers. The numbers gr... |
Stack add(int, Object) method in Java with Example | 24 Dec, 2018
The add(int, Object) method of Stack Class inserts an element at a specified index in the Stack. It shifts the element currently at that position (if any) and any subsequent elements to the right (will change their indices by adding one).
Syntax:
void add(int index, Object element)
Parameters: This method ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Dec, 2018"
},
{
"code": null,
"e": 267,
"s": 28,
"text": "The add(int, Object) method of Stack Class inserts an element at a specified index in the Stack. It shifts the element currently at that position (if any) and any subsequent e... |
How to create a pop up message when a button is pressed in Python – Tkinter? | 26 Dec, 2020
In this article, we will see how to create a button and how to show a popup message when a button is pressed in Python. Tkinter is a standard Python Package for creating GUI applications. Tkinter may be a set of wrappers that implement the Tk widgets as Python classes. Python, when combined with Tkinter, p... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Dec, 2020"
},
{
"code": null,
"e": 403,
"s": 28,
"text": "In this article, we will see how to create a button and how to show a popup message when a button is pressed in Python. Tkinter is a standard Python Package for creating GUI a... |
\subseteq - Tex Command | \subseteq - Used to create subseteq symbol.
{ \subseteq}
\subseteq command draws subseteq symbol. | [
{
"code": null,
"e": 8164,
"s": 8120,
"text": "\\subseteq - Used to create subseteq symbol."
},
{
"code": null,
"e": 8177,
"s": 8164,
"text": "{ \\subseteq}"
}
] |
Throwable printStackTrace() method in Java with Examples | 15 Oct, 2021
The printStackTrace() method of Java.lang.Throwable class used to print this Throwable along with other details like class name and line number where the exception occurred means its backtrace. This method prints a stack trace for this Throwable object on the standard error output stream. The first line of... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n15 Oct, 2021"
},
{
"code": null,
"e": 573,
"s": 54,
"text": "The printStackTrace() method of Java.lang.Throwable class used to print this Throwable along with other details like class name and line number where the exception occurred m... |
How to convert a list to matrix in R? | If we have a list that contain vectors having even number of elements in total then we can create a matrix of those elements. example, if a list contain 8 vectors and the total number of elements in those 8 vectors is 100 or any other multiple of 2 then we can create a matrix of those elements. This can be done by usin... | [
{
"code": null,
"e": 1549,
"s": 1187,
"text": "If we have a list that contain vectors having even number of elements in total then we can create a matrix of those elements. example, if a list contain 8 vectors and the total number of elements in those 8 vectors is 100 or any other multiple of 2 then... |
How to get Month and Date of JavaScript in two digit format ? | 24 May, 2019
Given a date and the task is to get the Month and Date in 2 digit format. Use JavaScript methods to get the Month and Date in 2 digit format.
JavaScript getDate() Method: This method returns the day of the month (from 1 to 31) for the defined date.Syntax:Date.getDate()Return value: It returns a number, fro... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 May, 2019"
},
{
"code": null,
"e": 170,
"s": 28,
"text": "Given a date and the task is to get the Month and Date in 2 digit format. Use JavaScript methods to get the Month and Date in 2 digit format."
},
{
"code": null,
"... |
Calculate sum of all numbers present in a string | 04 Jul, 2022
Given a string containing alphanumeric characters, calculate sum of all numbers present in the string.
Examples:
Input: 1abc23
Output: 24
Input: geeks4geeks
Output: 4
Input: 1abc2x30yz67
Output: 100
Input: 123abc
Output: 123
Difficulty level: Rookie
The only tricky part in this question is that mul... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n04 Jul, 2022"
},
{
"code": null,
"e": 155,
"s": 52,
"text": "Given a string containing alphanumeric characters, calculate sum of all numbers present in the string."
},
{
"code": null,
"e": 166,
"s": 155,
"text": "Ex... |
Maven - Build Automation | Build Automation defines the scenario where dependent project(s) build process gets started once the project build is successfully completed, in order to ensure that dependent project(s) is/are stable.
Example
Consider a team is developing a project bus-core-api on which two other projects app-web-ui and app-desktop-ui... | [
{
"code": null,
"e": 2396,
"s": 2194,
"text": "Build Automation defines the scenario where dependent project(s) build process gets started once the project build is successfully completed, in order to ensure that dependent project(s) is/are stable."
},
{
"code": null,
"e": 2404,
"s":... |
Oracle : ERP Software | 07 Apr, 2021
An ERP system are the software tools that are used to manage Enterprise Data. ERP System helps various organizations to deal with supply chain, receiving, inventory management, production planning, finance/accounting, Human Resource Management and other business function.
Oracle ERP :Oracle Corporation was... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 301,
"s": 28,
"text": "An ERP system are the software tools that are used to manage Enterprise Data. ERP System helps various organizations to deal with supply chain, receiving, inventory management... |
Python | Pandas Series.str.find() | 23 Jun, 2021
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.Pandas str.find() method is used to search a substring in each string present in a series. If ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jun, 2021"
},
{
"code": null,
"e": 562,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes imp... |
PHP – Mysql Joins | 31 Mar, 2021
In this article, we are going to join two tables using PHP and display them on the web page.
Introduction :
PHP is a server-side scripting language, which is used to connect with databases. Using this, we can get data from the database using PHP scripts. The database language that can be used to communica... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n31 Mar, 2021"
},
{
"code": null,
"e": 146,
"s": 52,
"text": "In this article, we are going to join two tables using PHP and display them on the web page. "
},
{
"code": null,
"e": 161,
"s": 146,
"text": "Introductio... |
JavaScript method to get the URL without query string | 30 May, 2019
The task is to get the URL name of the page without using a query string with the help of JavaScript.
replace() method: This method searches a string for a defined value, or a regular expression, and returns a new string with the replaced defined value.Syntax:string.replace(searchVal, newvalue)Parameters:s... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 May, 2019"
},
{
"code": null,
"e": 130,
"s": 28,
"text": "The task is to get the URL name of the page without using a query string with the help of JavaScript."
},
{
"code": null,
"e": 657,
"s": 130,
"text": "repl... |
Push Relabel Algorithm | Set 2 (Implementation) | 30 Jun, 2022
We strongly recommend to refer below article before moving on to this article. Push Relabel Algorithm | Set 1 (Introduction and Illustration)
Problem Statement:
Given a graph that represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink ‘t’ in the graph, find ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 194,
"s": 52,
"text": "We strongly recommend to refer below article before moving on to this article. Push Relabel Algorithm | Set 1 (Introduction and Illustration)"
},
{
"code": null,
... |
Python | os.open() method | 06 Sep, 2019
OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality.
os.open() method in Python is used to open a specified file path and set various flags a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Sep, 2019"
},
{
"code": null,
"e": 247,
"s": 28,
"text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin... |
Python – Multiply all cross list element pairs | 06 Mar, 2020
Sometimes, while working with Python list, we can have a problem in which we need to perform multiplication of each element of list with other list. This can have application in both web development and day-day programming. Lets discuss certain ways in which this task can be performed.
Method #1 : Using li... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Mar, 2020"
},
{
"code": null,
"e": 315,
"s": 28,
"text": "Sometimes, while working with Python list, we can have a problem in which we need to perform multiplication of each element of list with other list. This can have application ... |
Extract Single Column as DataFrame in R | 16 May, 2021
In this article, we will see how a single column can be extracted as Dataframe using R programming language.
Database in use:
Data Frame GFG
In this method, a specific column can be extracted from the dataframe using its name using $.
Syntax:
dataframe$column_name
The column returned will be in a form of a... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 May, 2021"
},
{
"code": null,
"e": 137,
"s": 28,
"text": "In this article, we will see how a single column can be extracted as Dataframe using R programming language."
},
{
"code": null,
"e": 154,
"s": 137,
"text"... |
Find the ordering of tasks from given dependencies | 02 Jun, 2022
There are a total of n tasks you have to pick, labeled from 0 to n-1. Some tasks may have prerequisites tasks, for example to pick task 0 you have to first finish tasks 1, which is expressed as a pair: [0, 1] Given the total number of tasks and a list of prerequisite pairs, return the ordering of tasks you... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n02 Jun, 2022"
},
{
"code": null,
"e": 542,
"s": 52,
"text": "There are a total of n tasks you have to pick, labeled from 0 to n-1. Some tasks may have prerequisites tasks, for example to pick task 0 you have to first finish tasks 1, wh... |
Merge two BSTs with limited extra space | 12 Apr, 2022
Given two Binary Search Trees(BST), print the elements of both BSTs in sorted form. The expected time complexity is O(m+n) where m is the number of nodes in the first tree and n is the number of nodes in the second tree. The maximum allowed auxiliary space is O(height of the first tree + height of the seco... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Apr, 2022"
},
{
"code": null,
"e": 379,
"s": 52,
"text": "Given two Binary Search Trees(BST), print the elements of both BSTs in sorted form. The expected time complexity is O(m+n) where m is the number of nodes in the first tree an... |
Sum of maximum of all subarrays | Divide and Conquer | 09 Nov, 2021
Given an array arr[] of length N, the task is to find the sum of the maximum elements of every possible sub-array of the array.Examples:
Input : arr[] = {1, 3, 1, 7}
Output : 42
Max of all sub-arrays:
{1} - 1
{1, 3} - 3
{1, 3, 1} - 3
{1, 3, 1, 7} - 7
{3} - 3
{3, 1} - 3
{3, 1, 7} - 7
{1} - 1
{1, 7} - 7
{... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Nov, 2021"
},
{
"code": null,
"e": 191,
"s": 52,
"text": "Given an array arr[] of length N, the task is to find the sum of the maximum elements of every possible sub-array of the array.Examples: "
},
{
"code": null,
"e"... |
BigInteger compareTo() Method in Java | 12 May, 2022
The java.math.BigInteger.compareTo(BigInteger value) method Compares this BigInteger with the BigInteger passed as the parameter.
Syntax:
public int compareTo(BigInteger val)
Parameter: This method accepts a single mandatory parameter val which is the BigInteger to compare with BigInteger object.
Return ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 May, 2022"
},
{
"code": null,
"e": 159,
"s": 28,
"text": "The java.math.BigInteger.compareTo(BigInteger value) method Compares this BigInteger with the BigInteger passed as the parameter. "
},
{
"code": null,
"e": 167,
... |
Indexed Sequential Search | 14 Mar, 2022
In this searching method, first of all, an index file is created, that contains some specific group or division of required record when the index is obtained, then the partial indexing takes less time cause it is located in a specified group.
Note: When the user makes a request for specific records it will... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Mar, 2022"
},
{
"code": null,
"e": 295,
"s": 52,
"text": "In this searching method, first of all, an index file is created, that contains some specific group or division of required record when the index is obtained, then the partia... |
How to change the TextBox Border Style in C#? | 29 Nov, 2019
In Windows forms, TextBox plays an important role. With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In TextBox, you are allowed to style the border of the TextBox control with the help of BorderStyle property which makes your textbox mor... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Nov, 2019"
},
{
"code": null,
"e": 462,
"s": 28,
"text": "In Windows forms, TextBox plays an important role. With the help of TextBox, the user can enter data in the application, it can be of a single line or of multiple lines. In Te... |
PHPunit | assertEmpty() Function | 31 Jul, 2019
The assertEmpty() function is a builtin function in PHPUnit and is used to assert whether the data holder specified is empty or not. This assertion will return true in the case if the data holder provided is empty else return false. In case of true the asserted test case got passed else test case got faile... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Jul, 2019"
},
{
"code": null,
"e": 338,
"s": 28,
"text": "The assertEmpty() function is a builtin function in PHPUnit and is used to assert whether the data holder specified is empty or not. This assertion will return true in the cas... |
How to Extract Text from Images with Python? | 26 Dec, 2020
OCR (Optical Character Recognition) is the process of electronical conversion of Digital images into machine-encoded text. Where the digital image is generally an image that contains regions that resemble characters of a language. OCR is a field of research in pattern recognition, artificial intelligence a... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n26 Dec, 2020"
},
{
"code": null,
"e": 802,
"s": 54,
"text": "OCR (Optical Character Recognition) is the process of electronical conversion of Digital images into machine-encoded text. Where the digital image is generally an image that ... |
Rearrange string such that no pair of adjacent characters are of the same type | 21 Jun, 2021
Given alphanumeric string str, the task is to rearrange the string such that no two adjacent characters are of the same type, i.e., no two adjacent characters can be alphabets or digits. If no such arrangement is possible, print -1.
Examples:
Input: str = “geeks2020”Output: g2e0e2k0s
Input: str = “IPL20”Ou... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Jun, 2021"
},
{
"code": null,
"e": 286,
"s": 53,
"text": "Given alphanumeric string str, the task is to rearrange the string such that no two adjacent characters are of the same type, i.e., no two adjacent characters can be alphabet... |
Python Pickling | Python pickle module is used for serializing and de-serializing python object structures. The process to converts any kind of python objects (list, dict, etc.) into byte streams (0s and 1s) is called pickling or serialization or flattening or marshalling. We can converts the byte stream (generated through pickling) bac... | [
{
"code": null,
"e": 1564,
"s": 1187,
"text": "Python pickle module is used for serializing and de-serializing python object structures. The process to converts any kind of python objects (list, dict, etc.) into byte streams (0s and 1s) is called pickling or serialization or flattening or marshallin... |
jQuery | Autocomplete Selection Event | 03 Aug, 2021
In the web world, it is a very common practice to use autocomplete typeahead input. For example user address field. For this, a very common UI feature is available in jQuery.In the process of searching a specific value, the jQuery UI autocomplete selection feature provides the user with some string suggest... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 1285,
"s": 28,
"text": "In the web world, it is a very common practice to use autocomplete typeahead input. For example user address field. For this, a very common UI feature is available in jQuery.... |
How to use superscript with ggplot2 in R? | 17 Jun, 2021
In this article, we will see how to use superscript with ggplot2 in the R programming language. You can use Superscript anywhere in the plot where you want. The function will remain the same to use superscript values at all places. Here we will use superscript value at ggplot2 title and at the Label of Axi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Jun, 2021"
},
{
"code": null,
"e": 338,
"s": 28,
"text": "In this article, we will see how to use superscript with ggplot2 in the R programming language. You can use Superscript anywhere in the plot where you want. The function will ... |
Python | Convert Numpy Arrays to Tuples | 04 Oct, 2021
Given a numpy array, write a program to convert numpy array into tuples.Examples –
Input: ([[1, 0, 0, 1, 0], [1, 2, 0, 0, 1]])
Output: ((1, 0, 0, 1, 0), (1, 2, 0, 0, 1))
Input: ([['manjeet', 'akshat'], ['nikhil', 'akash']])
Output: (('manjeet', 'akshat'), ('nikhil', 'akash'))
Given below are various ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n04 Oct, 2021"
},
{
"code": null,
"e": 137,
"s": 53,
"text": "Given a numpy array, write a program to convert numpy array into tuples.Examples – "
},
{
"code": null,
"e": 335,
"s": 137,
"text": "Input: ([[1, 0, 0, 1,... |
Split DataFrame Variable into Multiple Columns in R | 19 Nov, 2021
In this article, we will discuss how to split dataframe variables into multiple columns using R programming language.
The strsplit() method in R is used to split the specified column string vector into corresponding parts. The pattern is used to divide the string into subparts.
Syntax:
strsplit(str, patte... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Nov, 2021"
},
{
"code": null,
"e": 146,
"s": 28,
"text": "In this article, we will discuss how to split dataframe variables into multiple columns using R programming language."
},
{
"code": null,
"e": 308,
"s": 146,
... |
Combinations in a String of Digits | 06 May, 2021
Given an input string of numbers, find all combinations of numbers that can be formed using digits in the same order.Examples:
Input : 123
Output :1 2 3
1 23
12 3
123
Input : 1234
Output : 1 2 3 4
1 2 34
1 23 4
1 234
12 3 4
12 34
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 May, 2021"
},
{
"code": null,
"e": 182,
"s": 54,
"text": "Given an input string of numbers, find all combinations of numbers that can be formed using digits in the same order.Examples: "
},
{
"code": null,
"e": 386,
... |
Python | Locking without Deadlocks | 29 May, 2021
This article focuses on dealing with how to get more than one lock at a time if a multithread program is given along with avoiding the deadlocks.
Multithread programs – Due to the threads that keep on attempting to get multiple locks at once, these are very much prone to deadlocks. Understanding it with a... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 May, 2021"
},
{
"code": null,
"e": 200,
"s": 53,
"text": "This article focuses on dealing with how to get more than one lock at a time if a multithread program is given along with avoiding the deadlocks. "
},
{
"code": null,... |
How to write a Python regular expression to match multiple words anywhere? | The following code using Python regex matches the given multiple words in the given string
import re
s = "These are roses and lilies and orchids, but not marigolds or .."
r = re.compile(r'\broses\b | \bmarigolds\b | \borchids\b', flags=re.I | re.X)
print r.findall(s)
This gives the output
['roses', 'orchids', 'marigold... | [
{
"code": null,
"e": 1278,
"s": 1187,
"text": "The following code using Python regex matches the given multiple words in the given string"
},
{
"code": null,
"e": 1455,
"s": 1278,
"text": "import re\ns = \"These are roses and lilies and orchids, but not marigolds or ..\"\nr = re.... |
Java program to find smallest of the three numbers using ternary operators | The conditional operator is also known as the ternary operator. This operator consists of three operands and is used to evaluate Boolean expressions. The goal of the operator is to decide, which value should be assigned to the variable. The operator is written as −
variable x = (expression) ? value if true: value if fa... | [
{
"code": null,
"e": 1328,
"s": 1062,
"text": "The conditional operator is also known as the ternary operator. This operator consists of three operands and is used to evaluate Boolean expressions. The goal of the operator is to decide, which value should be assigned to the variable. The operator is ... |
Linux Admin - Package Management | Package management in CentOS can be performed in two ways: from the terminal and from the Graphical User Interface.
More often than not a majority of a CentOS administrator's time will be using the terminal. Updating and installing packages for CentOS is no different. With this in mind, we will first explore package ma... | [
{
"code": null,
"e": 2373,
"s": 2257,
"text": "Package management in CentOS can be performed in two ways: from the terminal and from the Graphical User Interface."
},
{
"code": null,
"e": 2681,
"s": 2373,
"text": "More often than not a majority of a CentOS administrator's time wi... |
Convert string to character array in Arduino | There are several libraries built for Arduino whose functions take in character arrays as inputs instead of strings. Thankfully, Arduino has an inbuilt method (toCharArray()) to covert a String to a Character Array. A sample implementation is given below −
void setup() {
// put your setup code here, to run once:
... | [
{
"code": null,
"e": 1319,
"s": 1062,
"text": "There are several libraries built for Arduino whose functions take in character arrays as inputs instead of strings. Thankfully, Arduino has an inbuilt method (toCharArray()) to covert a String to a Character Array. A sample implementation is given belo... |
How to get id from tr tag and display it in a new td with JavaScript? | Let’s say the following is our table −
<table>
<tr id='StudentDetails'>
<th>StudentName</th>
<th>StudentCountryName</th>
</tr>
<tr id='FirstRow'>
<td>JohnDoe</td>
<td>UK</td>
</tr>
<tr id='SecondRow'>
<td>DavidMiller</td>
<td>US</td>
</tr>
</table>
To get id from tr... | [
{
"code": null,
"e": 1101,
"s": 1062,
"text": "Let’s say the following is our table −"
},
{
"code": null,
"e": 1365,
"s": 1101,
"text": "<table>\n <tr id='StudentDetails'>\n <th>StudentName</th>\n <th>StudentCountryName</th>\n </tr>\n <tr id='FirstRow'>\n <td... |
Perl Formats - Writing Reports | As stated earlier that Perl stands for Practical Extraction and Reporting Language, and we'll now discuss using Perl to write reports.
Perl uses a writing template called a 'format' to output reports. To use the format feature of Perl, you must −
Define a Format
Pass the data that will be displayed on the format
Invok... | [
{
"code": null,
"e": 2355,
"s": 2220,
"text": "As stated earlier that Perl stands for Practical Extraction and Reporting Language, and we'll now discuss using Perl to write reports."
},
{
"code": null,
"e": 2468,
"s": 2355,
"text": "Perl uses a writing template called a 'format' ... |
Write and train your own custom machine learning models using PyCaret | by Moez Ali | Towards Data Science | PyCaret is an open-source, low-code machine learning library and end-to-end model management tool built-in Python for automating machine learning workflows. It is incredibly popular for its ease of use, simplicity, and ability to quickly and efficiently build and deploy end-to-end ML prototypes.
PyCaret is an alternate... | [
{
"code": null,
"e": 344,
"s": 47,
"text": "PyCaret is an open-source, low-code machine learning library and end-to-end model management tool built-in Python for automating machine learning workflows. It is incredibly popular for its ease of use, simplicity, and ability to quickly and efficiently bu... |
JavaScript location.host vs location.hostname - GeeksforGeeks | 25 Jul, 2021
In this article, we will learn about how to get information related to the webpage like hostname, port number, etc. We will also see the difference between the location.hostname and location.host.
location object is used to get information about the current web page. host and hostname are properties of loc... | [
{
"code": null,
"e": 26215,
"s": 26187,
"text": "\n25 Jul, 2021"
},
{
"code": null,
"e": 26412,
"s": 26215,
"text": "In this article, we will learn about how to get information related to the webpage like hostname, port number, etc. We will also see the difference between the loc... |
SQL Query for Matching Multiple Values in the Same Column | 29 Oct, 2021
In SQL, for matching multiple values in the same column, we need to use some special words in our query. Below, 3 methods are demonstrated to achieve this using the IN, LIKE and comparison operator(>=). For this article, we will be using the Microsoft SQL Server as our database.
Step 1: Create a Database.... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 335,
"s": 54,
"text": "In SQL, for matching multiple values in the same column, we need to use some special words in our query. Below, 3 methods are demonstrated to achieve this using the IN, LIKE... |
Set contains() method in Java with Examples | 31 Dec, 2018
The Java.util.Set.contains() method is used to check whether a specific element is present in the Set or not. So basically it is used to check if a Set contains any particular element.
Syntax:
boolean contains(Object element)
Parameters: The parameter element is of the type of Set. This is the element that... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Dec, 2018"
},
{
"code": null,
"e": 213,
"s": 28,
"text": "The Java.util.Set.contains() method is used to check whether a specific element is present in the Set or not. So basically it is used to check if a Set contains any particular... |
WML - Overview | The topmost layer in the WAP (Wireless Application Protocol) architecture is made up of WAE (Wireless Application Environment), which consists of WML and WML scripting language.
WML stands for Wireless Markup Language
WML stands for Wireless Markup Language
WML is an application of XML, which is defined in a document-t... | [
{
"code": null,
"e": 2251,
"s": 2073,
"text": "The topmost layer in the WAP (Wireless Application Protocol) architecture is made up of WAE (Wireless Application Environment), which consists of WML and WML scripting language."
},
{
"code": null,
"e": 2291,
"s": 2251,
"text": "WML ... |
Python String Methods | Set 2 (len, count, center, ljust, rjust, isalpha, isalnum, isspace & join) | 07 Jul, 2022
Some of the string methods are covered in the set 3 belowString Methods Part- 1
More methods are discussed in this article
1. len() :- This function returns the length of the string.
2. count(“string”, beg, end) :- This function counts the occurrence of mentioned substring in whole string. This function ta... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 132,
"s": 52,
"text": "Some of the string methods are covered in the set 3 belowString Methods Part- 1"
},
{
"code": null,
"e": 175,
"s": 132,
"text": "More methods are discusse... |
Sort a nearly sorted (or K sorted) array | 12 Jul, 2022
Given an array of n elements, where each element is at most k away from its target position, devise an algorithm that sorts in O(n log k) time. For example, let us consider k is 2, an element at index 7 in the sorted array, can be at indexes 5, 6, 7, 8, 9 in the given array.
Examples:
Input : arr[] = {6, ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n12 Jul, 2022"
},
{
"code": null,
"e": 330,
"s": 54,
"text": "Given an array of n elements, where each element is at most k away from its target position, devise an algorithm that sorts in O(n log k) time. For example, let us consider k... |
Scala Set exists() method with example | 18 Oct, 2019
The exists() method is utilized to test whether a predicate holds for some of the elements of the set or not.
Method Definition: def exists(p: (A) => Boolean): Boolean
Return Type: It returns true if the stated predicate holds true for some elements of the set else it returns false.
Example #1:
// Scala pr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Oct, 2019"
},
{
"code": null,
"e": 138,
"s": 28,
"text": "The exists() method is utilized to test whether a predicate holds for some of the elements of the set or not."
},
{
"code": null,
"e": 196,
"s": 138,
"text... |
Slowloris DDOS Attack Tool in Kali Linux | 28 Mar, 2021
Slowloris is a free and Open source tool available on Github. We can perform a denial of service attack using this tool. It’s a framework written in python. This tool allows a single machine to take down another machine’s web server it uses perfectly legitimate HTTP traffic. It makes a full TCP connection ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Mar, 2021"
},
{
"code": null,
"e": 553,
"s": 52,
"text": "Slowloris is a free and Open source tool available on Github. We can perform a denial of service attack using this tool. It’s a framework written in python. This tool allows ... |
How to replace missing values with median in an R data frame column? | To replace missing values with median, we can use the same trick that is used to replace missing values with mean. For example, if we have a data frame df that contain columns x and y where both of the columns contains some missing values then the missing values can be replaced with median as dfx[is.na(dfx)]<-median(df... | [
{
"code": null,
"e": 1588,
"s": 1187,
"text": "To replace missing values with median, we can use the same trick that is used to replace missing values with mean. For example, if we have a data frame df that contain columns x and y where both of the columns contains some missing values then the missi... |
Construct a graph from given degrees of all vertices | 09 Jul, 2021
This is a C++ program to generate a graph for a given fixed degree sequence. This algorithm generates a undirected graph for the given degree sequence.It does not include self-edge and multiple edges.Examples:
Input : degrees[] = {2, 2, 1, 1}
Output : (0) (1) (2) (3)
(0) 0 1 1 0 ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 266,
"s": 54,
"text": "This is a C++ program to generate a graph for a given fixed degree sequence. This algorithm generates a undirected graph for the given degree sequence.It does not include sel... |
Python Program for QuickSort | 13 Jun, 2022
Just unlikely merge Sort, QuickSort is a divide and conquer algorithm. It picks an element as a pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.
Always pick the first element as a pivotAlways pick the last eleme... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 295,
"s": 54,
"text": "Just unlikely merge Sort, QuickSort is a divide and conquer algorithm. It picks an element as a pivot and partitions the given array around the picked pivot. There are many d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.