title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Python | Safe access nested dictionary keys | 14 May, 2020
Sometimes, while working with Python we can have a problem in which we need to get the 2nd degree key of dictionary i.e the nested key. This type of problem is common in case of web development, especially with the advent of NoSQL databases. Let’s discuss certain ways to safely get the nested available key... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 May, 2020"
},
{
"code": null,
"e": 351,
"s": 28,
"text": "Sometimes, while working with Python we can have a problem in which we need to get the 2nd degree key of dictionary i.e the nested key. This type of problem is common in case ... |
Calling a non-member function inside a class in C++ - GeeksforGeeks | 11 Oct, 2021
Member Function: It is a function that can be declared as members of a class. It is usually declared inside the class definition and works on data members of the same class. It can have access to private, public, and protected data members of the same class. This function is declared as shown below:
C++
//... | [
{
"code": null,
"e": 24044,
"s": 24016,
"text": "\n11 Oct, 2021"
},
{
"code": null,
"e": 24345,
"s": 24044,
"text": "Member Function: It is a function that can be declared as members of a class. It is usually declared inside the class definition and works on data members of the s... |
SQL query to check SAP HANA system version | Other option to check the version of SAP HANA database-
Select * from "SYS"."M_DATABASE";
Go to SQL editor and run the above command.
Go to Result tab and you can see the version of your SAP HANA system. | [
{
"code": null,
"e": 1118,
"s": 1062,
"text": "Other option to check the version of SAP HANA database-"
},
{
"code": null,
"e": 1152,
"s": 1118,
"text": "Select * from \"SYS\".\"M_DATABASE\";"
},
{
"code": null,
"e": 1196,
"s": 1152,
"text": "Go to SQL editor ... |
What is fopen() and open() in Linux? | The key difference between the fopen() and the open() function in the Linux operating system is that the open() function is a low-level call, where the fopen() when called simply calls the open() function in the background and it returns a Filepointer directly.
The call to the open() function includes invoking several ... | [
{
"code": null,
"e": 1324,
"s": 1062,
"text": "The key difference between the fopen() and the open() function in the Linux operating system is that the open() function is a low-level call, where the fopen() when called simply calls the open() function in the background and it returns a Filepointer d... |
Financial Question Answering with Jina and BERT — Part 2 | Towards Data Science | Part 1 — Learn how to use the neural search framework, Jina, to build a Financial Question Answering (QA) search application with the FiQA dataset, PyTorch, and Hugging Face transformers.
Part 2 — Learn how evaluate and improve your Financial QA search results with Jina
In the previous tutorial we learned how to build ... | [
{
"code": null,
"e": 360,
"s": 172,
"text": "Part 1 — Learn how to use the neural search framework, Jina, to build a Financial Question Answering (QA) search application with the FiQA dataset, PyTorch, and Hugging Face transformers."
},
{
"code": null,
"e": 443,
"s": 360,
"text":... |
Python - Check if a file or directory exists - GeeksforGeeks | 06 May, 2021
Sometimes the need to check whether a directory or file exists or not becomes important because maybe you want to prevent overwriting to the already existing file, or maybe you want to make sure that the file is available or not before loading it. There are various ways to check that a file or directory al... | [
{
"code": null,
"e": 24188,
"s": 24160,
"text": "\n06 May, 2021"
},
{
"code": null,
"e": 24529,
"s": 24188,
"text": "Sometimes the need to check whether a directory or file exists or not becomes important because maybe you want to prevent overwriting to the already existing file,... |
How to create a lagged variable in R for groups? | Lagged variable is the type of variable that contains the previous value of the variable for which we want to create the lagged variable and the first value is neglected. Therefore, we will always have one missing value in each of the groups, if we are creating a lagged variable that depends on a grouping variable or f... | [
{
"code": null,
"e": 1398,
"s": 1062,
"text": "Lagged variable is the type of variable that contains the previous value of the variable for which we want to create the lagged variable and the first value is neglected. Therefore, we will always have one missing value in each of the groups, if we are ... |
DNSx – DNS Toolkit Allow To Run Multiple DNS Queries - GeeksforGeeks | 23 Aug, 2021
DNS Query is crucial in Penetration Testing. DNS Query, also known as DNS Request, demands data sent from a user’s system or DNS Client to DNS Server. In most cases, DNS Request is passed to ask for the IP address associated with a domain name. But we can customize DNS Requests as per our needs. To resolve... | [
{
"code": null,
"e": 24326,
"s": 24298,
"text": "\n23 Aug, 2021"
},
{
"code": null,
"e": 24981,
"s": 24326,
"text": "DNS Query is crucial in Penetration Testing. DNS Query, also known as DNS Request, demands data sent from a user’s system or DNS Client to DNS Server. In most case... |
Python program to right rotate a list by n - GeeksforGeeks | 28 Mar, 2022
Given a list and an integer n, write a Python program to right rotate the list by n position.
Examples :
Input : n = 2, List_1 = [1, 2, 3, 4, 5, 6]Output : List_1 = [5, 6, 1, 2, 3, 4]Explanation: We get output list after right rotating (clockwise) given list by 2.
Input : n = 3, List_1 = [3, 0, 1, 4, 2, ... | [
{
"code": null,
"e": 24819,
"s": 24791,
"text": "\n28 Mar, 2022"
},
{
"code": null,
"e": 24913,
"s": 24819,
"text": "Given a list and an integer n, write a Python program to right rotate the list by n position."
},
{
"code": null,
"e": 24925,
"s": 24913,
"text... |
Tryit Editor v3.7 | Tryit: HTML paragraphs with hr | [] |
GATE | GATE-CS-2006 | Question 85 - GeeksforGeeks | 15 Oct, 2019
Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5% interest.
1. T1 start
2. T1 B old=12000 new=10000
3. T1 M old=0 new=2000
4. T1 commit
5. T2 start
6. T2 B old=10000 new=10500
7. ... | [
{
"code": null,
"e": 24468,
"s": 24440,
"text": "\n15 Oct, 2019"
},
{
"code": null,
"e": 24642,
"s": 24468,
"text": "Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5%... |
IDE | GeeksforGeeks | A computer science portal for geeks | Please enter your email address or userHandle. | [] |
C# | Multilevel Inheritance - GeeksforGeeks | 23 Jan, 2019
In the Multilevel inheritance, a derived class will inherit a base class and as well as the derived class also act as the base class to other class. For example, three classes called A, B, and C, as shown in the below image, where class C is derived from class B and class B, is derived from class A. In thi... | [
{
"code": null,
"e": 23935,
"s": 23907,
"text": "\n23 Jan, 2019"
},
{
"code": null,
"e": 24382,
"s": 23935,
"text": "In the Multilevel inheritance, a derived class will inherit a base class and as well as the derived class also act as the base class to other class. For example, t... |
How can we check the current MySQL transaction isolation level? | By executing SELECT @@TX_ISOLATION command we can check the current MySQL transaction isolation level.
mysql> SELECT @@TX_ISOLATION;
+-----------------+
| @@TX_ISOLATION |
+-----------------+
| REPEATABLE-READ |
+-----------------+
1 row in set (0.00 sec) | [
{
"code": null,
"e": 1165,
"s": 1062,
"text": "By executing SELECT @@TX_ISOLATION command we can check the current MySQL transaction isolation level."
},
{
"code": null,
"e": 1319,
"s": 1165,
"text": "mysql> SELECT @@TX_ISOLATION;\n+-----------------+\n| @@TX_ISOLATION |\n+-----... |
SIFT Interest Point Detector Using Python – OpenCV | 11 Dec, 2020
SIFT (Scale Invariant Fourier Transform) Detector is used in the detection of interest points on an input image. It allows identification of localized features in images which is essential in applications such as:
Object Recognition in Images
Path detection and obstacle avoidance algorithms
Gesture recog... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Dec, 2020"
},
{
"code": null,
"e": 270,
"s": 54,
"text": "SIFT (Scale Invariant Fourier Transform) Detector is used in the detection of interest points on an input image. It allows identification of localized features in images whic... |
Allocate minimum number of pages | 22 Jun, 2022
Given number of pages in n different books and m students. The books are arranged in ascending order of number of pages. Every student is assigned to read some consecutive books. The task is to assign books in such a way that the maximum number of pages assigned to a student is minimum. Example :
Input :... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 352,
"s": 52,
"text": "Given number of pages in n different books and m students. The books are arranged in ascending order of number of pages. Every student is assigned to read some consecutive bo... |
Python NLTK | nltk.tokenize.SpaceTokenizer() | 07 Jun, 2019
With the help of nltk.tokenize.SpaceTokenizer() method, we are able to extract the tokens from string of words on the basis of space between them by using tokenize.SpaceTokenizer() method.
Syntax : tokenize.SpaceTokenizer()Return : Return the tokens of words.
Example #1 :In this example we can see that by ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Jun, 2019"
},
{
"code": null,
"e": 217,
"s": 28,
"text": "With the help of nltk.tokenize.SpaceTokenizer() method, we are able to extract the tokens from string of words on the basis of space between them by using tokenize.SpaceTokeni... |
Python – Multiple Column Sort in Tuples | 06 Jul, 2021
Sometimes, while working with records, we can have a problem in which we need to perform sort operation on one of the columns, and on other column, if equal elements, opposite sort. This kind of problem can occur as application in many domains such as web development. Lets discuss certain ways in which thi... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 Jul, 2021"
},
{
"code": null,
"e": 360,
"s": 28,
"text": "Sometimes, while working with records, we can have a problem in which we need to perform sort operation on one of the columns, and on other column, if equal elements, opposite... |
JavaScript Math sin( ) Method | 09 Feb, 2022
Below is the example of the Math sin() Method.
Example:<script type="text/javascript"> document.write("When zero is passed as a parameter: " + Math.sin(0));</script>
<script type="text/javascript"> document.write("When zero is passed as a parameter: " +... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Feb, 2022"
},
{
"code": null,
"e": 75,
"s": 28,
"text": "Below is the example of the Math sin() Method."
},
{
"code": null,
"e": 221,
"s": 75,
"text": "Example:<script type=\"text/javascript\"> document.write... |
Program to print a Hollow Triangle inside a Triangle | 24 Nov, 2021
Given a number N(≥ 8), the task is to print a Hollow Triangle inside a Triangle pattern.Example:
Input: N = 9
Output:
*
* *
* *
* * *
* * * * *
* ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 152,
"s": 53,
"text": "Given a number N(≥ 8), the task is to print a Hollow Triangle inside a Triangle pattern.Example: "
},
{
"code": null,
"e": 488,
"s": 152,
"text": "Input:... |
Read JSON file using Python | 07 Jul, 2022
The full-form of JSON is JavaScript Object Notation. It means that a script (executable) file which is made of text in a programming language, is used to store and transfer the data. Python supports JSON through a built-in package called json. To use this feature, we import the json package in Python scrip... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 468,
"s": 52,
"text": "The full-form of JSON is JavaScript Object Notation. It means that a script (executable) file which is made of text in a programming language, is used to store and transfer t... |
Python – String till Substring | 25 Jun, 2022
Sometimes, more than finding a substring, we might need to get the string that is occurring before the substring has been found. Let’s discuss certain ways in which this task can be performed.
The partition function can be used to perform this task in which we just return the part of the partition occurrin... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n25 Jun, 2022"
},
{
"code": null,
"e": 245,
"s": 52,
"text": "Sometimes, more than finding a substring, we might need to get the string that is occurring before the substring has been found. Let’s discuss certain ways in which this task... |
setsid command in Linux with Examples | 08 Apr, 2019
setsid command in Linux system is used to run a program in a new session. The command will call the fork(2) if already a process group leader. Else, it will execute a program in the current process.
Syntax:
setsid [options] program [arguments]
Example: It will execute our shell script in a new session.
Op... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Apr, 2019"
},
{
"code": null,
"e": 227,
"s": 28,
"text": "setsid command in Linux system is used to run a program in a new session. The command will call the fork(2) if already a process group leader. Else, it will execute a program ... |
Java | Class and Object | Question 1 | 28 Jun, 2021
Predict the output of following Java program?
class Test { int i;} class Main { public static void main(String args[]) { Test t; System.out.println(t.i); }
(A) 0(B) garbage value(C) compiler error(D) runtime errorAnswer: (C)Explanation: t is just a reference, the object referred by t is not ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 98,
"s": 52,
"text": "Predict the output of following Java program?"
},
{
"code": "class Test { int i;} class Main { public static void main(String args[]) { Test t; System.out... |
Print “Hello World” with empty or blank main in C++ | 14 Jun, 2022
Write a program in C++ that prints “Hello World”, it has a main function and body of main function is empty.
Following are three different solutions.
We can create a global variable and assign it return value of printf() that prints “Hello World”
CPP
// C++ program to print something with empty main()#inc... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n14 Jun, 2022"
},
{
"code": null,
"e": 163,
"s": 54,
"text": "Write a program in C++ that prints “Hello World”, it has a main function and body of main function is empty."
},
{
"code": null,
"e": 204,
"s": 163,
"text... |
XML External Entity (XXE) and Billion Laughs attack - GeeksforGeeks | 14 Oct, 2020
XXE or XML External Entity attack is a web application vulnerability that affects a website which parses unsafe XML that is driven by the user. XXE attack when performed successfully can disclose local files in the file system of the website. XXE is targeted to access these sensitive local files of the we... | [
{
"code": null,
"e": 23837,
"s": 23809,
"text": "\n14 Oct, 2020"
},
{
"code": null,
"e": 24188,
"s": 23837,
"text": "XXE or XML External Entity attack is a web application vulnerability that affects a website which parses unsafe XML that is driven by the user. XXE attack when per... |
Getting maximum elements in Julia - maximum() and maximum!() Methods - GeeksforGeeks | 19 Aug, 2021
The maximum() is an inbuilt function in julia which is used to return maximum elements in different scenario.
Syntax: maximum(f, itr) or maximum(itr) or maximum(A::AbstractArray; dims)
Parameters:
f: Specified function.
itr: Specified list of elements.
A::AbstractArray: Specified array of different dimens... | [
{
"code": null,
"e": 23865,
"s": 23837,
"text": "\n19 Aug, 2021"
},
{
"code": null,
"e": 23975,
"s": 23865,
"text": "The maximum() is an inbuilt function in julia which is used to return maximum elements in different scenario."
},
{
"code": null,
"e": 24050,
"s": ... |
How to Run a Python Program | There are three different ways to start Python −
Interactive Interpreter
You can start Python from Unix, DOS, or any other system that provides you a command-line interpreter or shell window.
Enter python the command line.
Start coding right away in the interactive interpreter.
$python # Unix/Linux
or
python% # Unix/Li... | [
{
"code": null,
"e": 1111,
"s": 1062,
"text": "There are three different ways to start Python −"
},
{
"code": null,
"e": 1135,
"s": 1111,
"text": "Interactive Interpreter"
},
{
"code": null,
"e": 1254,
"s": 1135,
"text": "You can start Python from Unix, DOS, o... |
BlockingQueue offer() method in Java with examples - GeeksforGeeks | 04 Jul, 2021
There are two types of offer() method for BlockingQueue interface:Note: The offer() method of BlockingQueue has been inherited from the Queue class in Java.
The offer(E e, long timeout, TimeUnit unit) method of BlockingQueue inserts the element passed as parameter to method at the tail of this BlockingQue... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n04 Jul, 2021"
},
{
"code": null,
"e": 24106,
"s": 23948,
"text": "There are two types of offer() method for BlockingQueue interface:Note: The offer() method of BlockingQueue has been inherited from the Queue class in Java. "
},... |
BNY Mellon Internship Interview Experience for Software Developer | On-Campus 2022 - GeeksforGeeks | 05 Oct, 2021
BNY Mellon visited our campus on 21 Sep 2021 for Summer Internship 2022.
Eligibility: Branch – CSE, IT, E&TC, Instru
Criterion: 6.0 CGPA and above, No dead and live backlogs considered.
Pattern: 1 HackerRank coding test + 2 Tech rounds + 1 HR round
Round 1: HackerRank Coding Test
4 questions to be done... | [
{
"code": null,
"e": 25500,
"s": 25472,
"text": "\n05 Oct, 2021"
},
{
"code": null,
"e": 25573,
"s": 25500,
"text": "BNY Mellon visited our campus on 21 Sep 2021 for Summer Internship 2022."
},
{
"code": null,
"e": 25618,
"s": 25573,
"text": "Eligibility: Bra... |
Prolog - Relations | Relationship is one of the main features that we have to properly mention in Prolog. These relationships can be expressed as facts and rules. After that we will see about the family relationships, how we can express family based relationships in Prolog, and also see the recursive relationships of the family.
We will cr... | [
{
"code": null,
"e": 2402,
"s": 2092,
"text": "Relationship is one of the main features that we have to properly mention in Prolog. These relationships can be expressed as facts and rules. After that we will see about the family relationships, how we can express family based relationships in Prolog,... |
Java.lang.Runtime class in Java | 06 May, 2022
In Java, the Runtime class is used to interact with Every Java application that has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime() method.
Example 1:
Java
// Java... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 May, 2022"
},
{
"code": null,
"e": 338,
"s": 54,
"text": "In Java, the Runtime class is used to interact with Every Java application that has a single instance of class Runtime that allows the application to interface with the envir... |
DateFormat Class in Java | 15 Dec, 2021
The java.text.DateFormat is an abstract class that is used to format and parse dates for any locale. It allows us to format date to text and parse text to date. DateFormat class provides many functionalities to obtain, format, parse default date/time.
DateFormat class extends Format class that means it is ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Dec, 2021"
},
{
"code": null,
"e": 280,
"s": 28,
"text": "The java.text.DateFormat is an abstract class that is used to format and parse dates for any locale. It allows us to format date to text and parse text to date. DateFormat cla... |
Sum of all numbers in the given range which are divisible by M | 21 Apr, 2021
Given three numbers A, B and M such that A < B, the task is to find the sum of numbers divisible by M in the range [A, B].
Examples:
Input: A = 25, B = 100, M = 30 Output: 180 Explanation: In the given range [25, 100] 30, 60 and 90 are the numbers which are divisible by M = 30 Therefore, sum of these numb... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n21 Apr, 2021"
},
{
"code": null,
"e": 177,
"s": 54,
"text": "Given three numbers A, B and M such that A < B, the task is to find the sum of numbers divisible by M in the range [A, B]."
},
{
"code": null,
"e": 188,
"s": ... |
Heap and Stack Memory Errors in Java | 12 Sep, 2021
Memory allocation in java is managed by Java virtual machine in Java. It divides the memory into stack and heap memory which is as shown below in the below media as follows:
Stack memory in Java
It is the temporary memory allocation where local variables, reference variables are allocated memory when thei... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Sep, 2021"
},
{
"code": null,
"e": 202,
"s": 28,
"text": "Memory allocation in java is managed by Java virtual machine in Java. It divides the memory into stack and heap memory which is as shown below in the below media as follows:"
... |
FuzzyWuzzy Python library | 29 Jun, 2022
There are many methods of comparing string in python. Some of the main methods are:
Using regexSimple compareUsing difflib
Using regex
Simple compare
Using difflib
But one of the very easy method is by using fuzzywuzzy library where we can have a score out of 100, that denotes two string are equal by givin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Jun, 2022"
},
{
"code": null,
"e": 138,
"s": 54,
"text": "There are many methods of comparing string in python. Some of the main methods are:"
},
{
"code": null,
"e": 177,
"s": 138,
"text": "Using regexSimple com... |
How to add space around table border in HTML? | To set border spacing for an HTML table, use the CSS border-spacing property. It sets the distance between cells in a table,
You can try to run the following code to add space around table border in HTML
<!DOCTYPE html>
<html>
<head>
<style>
table, td, th {
border: 1px solid black;
... | [
{
"code": null,
"e": 1312,
"s": 1187,
"text": "To set border spacing for an HTML table, use the CSS border-spacing property. It sets the distance between cells in a table,"
},
{
"code": null,
"e": 1391,
"s": 1312,
"text": "You can try to run the following code to add space around... |
p5.js | Keyboard | keyIsDown() | 16 Apr, 2019
The keyIsDown() function in p5.js checks the key’s current status that key is down, i.e. pressed. It can be used if you have a movable object, and you want several keys to be able to affect its behavior simultaneously, such as moving a sprite diagonally.
Syntax:
keyIsDown()
Below program illustrates the k... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Apr, 2019"
},
{
"code": null,
"e": 283,
"s": 28,
"text": "The keyIsDown() function in p5.js checks the key’s current status that key is down, i.e. pressed. It can be used if you have a movable object, and you want several keys to be ... |
Python – math.prod() method | 23 Jan, 2020
Math module in Python contains a number of mathematical operations, which can be performed with ease using the module. math.prod() method in Python is used to calculate the product of all the elements present in the given iterable. Most of the built-in containers in Python like list, tuple are iterables. T... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jan, 2020"
},
{
"code": null,
"e": 455,
"s": 28,
"text": "Math module in Python contains a number of mathematical operations, which can be performed with ease using the module. math.prod() method in Python is used to calculate the pr... |
Sub-strings of a string that are prefix of the same string | 22 Apr, 2022
Given a string str, the task is to count all possible sub-strings of the given string that are prefix of the same string.
Examples:
Input: str = “ababc” Output: 7 All possible sub-string are “a”, “ab”, “aba”, “abab”, “ababc”, “a” and “ab”
Input: str = “abdabc” Output: 8
Approach: Traverse the string char... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Apr, 2022"
},
{
"code": null,
"e": 174,
"s": 52,
"text": "Given a string str, the task is to count all possible sub-strings of the given string that are prefix of the same string."
},
{
"code": null,
"e": 185,
"s": 1... |
Powershell - ForEach-Object Cmdlet | ForEach-Object cmdlet can be used to perform operations on each object of a collection of objects.
In these examples, we're see the ForEach-Object cmdlet in action.
In this example, we'll divide integer in an array. We'll refer to each object using $_.
1000,2000,3000 | ForEach-Object -Process {$_/1000}
You can see foll... | [
{
"code": null,
"e": 2267,
"s": 2168,
"text": "ForEach-Object cmdlet can be used to perform operations on each object of a collection of objects."
},
{
"code": null,
"e": 2333,
"s": 2267,
"text": "In these examples, we're see the ForEach-Object cmdlet in action."
},
{
"co... |
p5.js | Mouse | pmouseX | 16 Apr, 2019
The pmouseX variable in p5.js is used to store the horizontal position of the mouse cursor in the frame previous to the currently active frame, relative to the origin of the canvas.
Syntax:
mouseX
Below programs illustrate the pmouseX variable in p5.js:
Example 1: This example uses pmouseX variable to draw... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Apr, 2019"
},
{
"code": null,
"e": 210,
"s": 28,
"text": "The pmouseX variable in p5.js is used to store the horizontal position of the mouse cursor in the frame previous to the currently active frame, relative to the origin of the c... |
Replace all consonants with nearest vowels in a string | 21 Jun, 2022
Given a string with lowercase English alphabets. The task is to replace all the consonants in the string with the nearest vowels. If a consonant is near to two vowels then replace it with the one that comes first in English alphabets. Note: Vowels already present in the string must be left as it is.Example... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Jun, 2022"
},
{
"code": null,
"e": 365,
"s": 53,
"text": "Given a string with lowercase English alphabets. The task is to replace all the consonants in the string with the nearest vowels. If a consonant is near to two vowels then re... |
Condition of schedules to View-equivalent | 28 Jun, 2021
Two schedules S1 and S2 are said to be view-equivalent if below conditions are satisfied :
1) Initial Read If a transaction T1 reading data item A from database in S1 then in S2 also T1 should read A from database.
T1 T2 T3
-------------------
R(A)
W(A)
R(A)
... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 144,
"s": 52,
"text": "Two schedules S1 and S2 are said to be view-equivalent if below conditions are satisfied : "
},
{
"code": null,
"e": 269,
"s": 144,
"text": "1) Initial Re... |
Node.js fsPromises.open() Method | 08 Oct, 2021
The fsPromises.open() method is used to asynchronously open a file that returns a Promise that, when resolved, yields a FileHandle object.
Syntax:
fsPromises.open( filename, flags, mode)
Parameter: This method accept three parameters as mentioned above and described below:
filename: It is a String, Buffer ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Oct, 2021"
},
{
"code": null,
"e": 167,
"s": 28,
"text": "The fsPromises.open() method is used to asynchronously open a file that returns a Promise that, when resolved, yields a FileHandle object."
},
{
"code": null,
"e":... |
MySQL ORDER BY Keyword | The ORDER BY keyword is used to sort the result-set in ascending or
descending order.
The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descending order, use the
DESC keyword.
Below is a selection from the "Customers" table in the Northwind sample database:
The following SQL... | [
{
"code": null,
"e": 87,
"s": 0,
"text": "The ORDER BY keyword is used to sort the result-set in ascending or \ndescending order."
},
{
"code": null,
"e": 221,
"s": 87,
"text": "The ORDER BY keyword sorts the records in ascending order by default. To sort the records in descendin... |
How to sort a dictionary in Python? | A dictionary is a data structure that consists of key and value pairs. We can sort a dictionary using two criteria −
Sort by key − The dictionary is sorted in ascending order of its keys. The values are not taken care of.
Sort by value − The dictionary is sorted in ascending order of the values.
In this approach, the d... | [
{
"code": null,
"e": 1179,
"s": 1062,
"text": "A dictionary is a data structure that consists of key and value pairs. We can sort a dictionary using two criteria −"
},
{
"code": null,
"e": 1284,
"s": 1179,
"text": "Sort by key − The dictionary is sorted in ascending order of its ... |
Android - Loading Spinner | You can show progress of a task in android through loading progress bar. The progress bar comes in two shapes. Loading bar and Loading Spinner. In this chapter we will discuss spinner.
Spinner is used to display progress of those tasks whose total time of completion is unknown. In order to use that, you just need to de... | [
{
"code": null,
"e": 3792,
"s": 3607,
"text": "You can show progress of a task in android through loading progress bar. The progress bar comes in two shapes. Loading bar and Loading Spinner. In this chapter we will discuss spinner."
},
{
"code": null,
"e": 3957,
"s": 3792,
"text"... |
What is the difference between MySQL TRUNCATE and DELETE command? | As we know that TRUNCATE will remove all the rows without removing table’s structure from the database. Same work can be done with the help of DELETE command on removing all the rows from the table. But there is a significant difference of re-initialization of PRIMARY KEY AUTO_INCREMENT between both the commands.
Suppo... | [
{
"code": null,
"e": 1377,
"s": 1062,
"text": "As we know that TRUNCATE will remove all the rows without removing table’s structure from the database. Same work can be done with the help of DELETE command on removing all the rows from the table. But there is a significant difference of re-initializa... |
How to animate Scatterplots on Mapbox using Plotly Express? | by Usama Bin Tariq | Towards Data Science | Plotly Express is a data visualization library that allows us to visualize small bits of data quickly and efficiently. In this tutorial, we will be learning how to make animations using Plotly express’s built-in scatter Mapbox functionality.
The Scatter Mapbox requires the following arguments:
df, which is your Panda’s... | [
{
"code": null,
"e": 414,
"s": 172,
"text": "Plotly Express is a data visualization library that allows us to visualize small bits of data quickly and efficiently. In this tutorial, we will be learning how to make animations using Plotly express’s built-in scatter Mapbox functionality."
},
{
... |
Python | Linear Regression using sklearn - GeeksforGeeks | 28 Nov, 2019
Prerequisite: Linear Regression
Linear Regression is a machine learning algorithm based on supervised learning. It performs a regression task. Regression models a target prediction value based on independent variables. It is mostly used for finding out the relationship between variables and forecasting. Di... | [
{
"code": null,
"e": 24520,
"s": 24492,
"text": "\n28 Nov, 2019"
},
{
"code": null,
"e": 24552,
"s": 24520,
"text": "Prerequisite: Linear Regression"
},
{
"code": null,
"e": 25014,
"s": 24552,
"text": "Linear Regression is a machine learning algorithm based on... |
What is Bitwise XOR Assignment Operator (^=) in JavaScript? | It performs XOR operation on the right operand with the left operand and assigns the result to the left operand.
You can try to run the following code to learn how to work with Bitwise XOR Assignment Operator
Live Demo
<html>
<body>
<script>
var a = 2; // Bit presentation 10
var b = 3; //... | [
{
"code": null,
"e": 1175,
"s": 1062,
"text": "It performs XOR operation on the right operand with the left operand and assigns the result to the left operand."
},
{
"code": null,
"e": 1271,
"s": 1175,
"text": "You can try to run the following code to learn how to work with Bitwi... |
bitset none() in C++ STL - GeeksforGeeks | 12 Nov, 2020
bitset::none() is a built-in STL in C++ which returns True if none of its bits are set. It returns False if a minimum of one bit is set.
Syntax:
bool none()
Parameter: The function accepts no parameter.
Return Value: The function returns a boolean. The boolean value is True if none of its bits are se... | [
{
"code": null,
"e": 23707,
"s": 23679,
"text": "\n12 Nov, 2020"
},
{
"code": null,
"e": 23845,
"s": 23707,
"text": "bitset::none() is a built-in STL in C++ which returns True if none of its bits are set. It returns False if a minimum of one bit is set. "
},
{
"code": nul... |
How to change status bar color to match app Android using Kotlin? | This example demonstrates how to change status bar color to match app Android using Kotlin.
Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to create a new project.
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8... | [
{
"code": null,
"e": 1154,
"s": 1062,
"text": "This example demonstrates how to change status bar color to match app Android using Kotlin."
},
{
"code": null,
"e": 1282,
"s": 1154,
"text": "Step 1 − Create a new project in Android Studio, go to File? New Project and fill all requ... |
Entity Framework - Spatial Data Type | Spatial type support was introduced in Entity Framework 5. A set of operators is also included to allow queries to analyze spatial data. For example, a query can filter based on the distance between two geographic locations.
Entity Framework will allow new spatial data types to be exposed as properties on your classes ... | [
{
"code": null,
"e": 3257,
"s": 3032,
"text": "Spatial type support was introduced in Entity Framework 5. A set of operators is also included to allow queries to analyze spatial data. For example, a query can filter based on the distance between two geographic locations."
},
{
"code": null,
... |
How to use Bar chart graph in android? | This example demonstrates How to use Bar chart graph in android.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.
Step 2 − Open build.gradle(module level) and add library dependency.
apply plugin: 'com.android.application'
android {
pack... | [
{
"code": null,
"e": 1127,
"s": 1062,
"text": "This example demonstrates How to use Bar chart graph in android."
},
{
"code": null,
"e": 1256,
"s": 1127,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a n... |
Find all factorial numbers less than or equal to n - GeeksforGeeks | 15 Mar, 2021
A number N is called a factorial number if it is the factorial of a positive integer. For example, the first few factorial numbers are1, 2, 6, 24, 120, ...Given a number n, print all factorial numbers smaller than or equal to n. Examples :
Input : n = 100
Output : 1 2 6 24
Input : n = 1500
Output : 1 2 ... | [
{
"code": null,
"e": 24289,
"s": 24261,
"text": "\n15 Mar, 2021"
},
{
"code": null,
"e": 24531,
"s": 24289,
"text": "A number N is called a factorial number if it is the factorial of a positive integer. For example, the first few factorial numbers are1, 2, 6, 24, 120, ...Given a ... |
Java Program to place component in bottom-right corner with BorderLayout | We have created a button component here, which will places in bottom-right corner −
JButton button = new JButton("This is Demo Text!");
button.setBackground(Color.blue);
button.setForeground(Color.white);
Create panels now to arrange the above created button component in the bottom right −
JPanel bottomPanel = new JPan... | [
{
"code": null,
"e": 1146,
"s": 1062,
"text": "We have created a button component here, which will places in bottom-right corner −"
},
{
"code": null,
"e": 1267,
"s": 1146,
"text": "JButton button = new JButton(\"This is Demo Text!\");\nbutton.setBackground(Color.blue);\nbutton.s... |
XSD - Date Time | Date and Time data types are used to represent date and time in the XML documents.
The <xs:date> data type is used to represent date in YYYY-MM-DD format.
YYYY − represents year
YYYY − represents year
MM − represents month
MM − represents month
DD − represents day
DD − represents day
Element declaration in XSD −
<xs:el... | [
{
"code": null,
"e": 1787,
"s": 1704,
"text": "Date and Time data types are used to represent date and time in the XML documents."
},
{
"code": null,
"e": 1859,
"s": 1787,
"text": "The <xs:date> data type is used to represent date in YYYY-MM-DD format."
},
{
"code": null,... |
C++ Program to Implement Russian Peasant Multiplication | Russian Peasant algorithm to multiply two numbers. It is a quick algorithm to calculate multiplication of two long numbers.
Begin
Russianpeasant(num1, num2)
Int result=0
while (num2 > 0)
if (num2 and 1)
result = result + n;
num1= num1 left shift 1;
num2= num2left shift 1;
re... | [
{
"code": null,
"e": 1186,
"s": 1062,
"text": "Russian Peasant algorithm to multiply two numbers. It is a quick algorithm to calculate multiplication of two long numbers."
},
{
"code": null,
"e": 1398,
"s": 1186,
"text": "Begin\n Russianpeasant(num1, num2)\n Int result=0\n ... |
Graph Database, GraphQL and Machine Learning for Carbohydrate-Active Enzymes | by Sixing Huang | Towards Data Science | This article shows how to:
1. Convert the CAZy database into Neo4j
2. Analyze the CAZynome of Formosa agariphila KMM 3901 to gain new insights
3. Build a GraphQL API for language-agnostic data access
4. Perform graph embedding and node classification for cellulose degradation prediction
What is the most abundant polyme... | [
{
"code": null,
"e": 199,
"s": 172,
"text": "This article shows how to:"
},
{
"code": null,
"e": 239,
"s": 199,
"text": "1. Convert the CAZy database into Neo4j"
},
{
"code": null,
"e": 315,
"s": 239,
"text": "2. Analyze the CAZynome of Formosa agariphila KMM ... |
Go - Pointer to pointer | A pointer to a pointer is a form of chain of pointers. Normally, a pointer contains the address of a variable. When we define a pointer to a pointer, the first pointer contains the address of the second pointer, which points to the location that contains the actual value as shown below.
A variable that is a pointer to ... | [
{
"code": null,
"e": 2225,
"s": 1937,
"text": "A pointer to a pointer is a form of chain of pointers. Normally, a pointer contains the address of a variable. When we define a pointer to a pointer, the first pointer contains the address of the second pointer, which points to the location that contain... |
GATE | GATE-CS-2001 | Question 23 - GeeksforGeeks | 28 Jun, 2021
Consider a schema R(A,B,C,D) and functional dependencies A->B and C->D.
Then the decomposition of R into R1(AB) and R2(CD) is(A) dependency preserving and lossless join(B) lossless join but not dependency preserving(C) dependency preserving but not lossless join(D) not dependency preserving and not lossles... | [
{
"code": null,
"e": 23985,
"s": 23957,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24057,
"s": 23985,
"text": "Consider a schema R(A,B,C,D) and functional dependencies A->B and C->D."
},
{
"code": null,
"e": 24656,
"s": 24057,
"text": "Then the decomposi... |
Append special characters to column values in MySQL | Let us first create a −
mysql> create table DemoTable1626
-> (
-> Name varchar(20)
-> );
Query OK, 0 rows affected (0.37 sec)
Insert some records in the table using insert −
mysql> insert into DemoTable1626 values('Chris');
Query OK, 1 row affected (0.11 sec)
mysql> insert into DemoTable1626 values('Bob');
Que... | [
{
"code": null,
"e": 1086,
"s": 1062,
"text": "Let us first create a −"
},
{
"code": null,
"e": 1197,
"s": 1086,
"text": "mysql> create table DemoTable1626\n -> (\n -> Name varchar(20)\n -> );\nQuery OK, 0 rows affected (0.37 sec)"
},
{
"code": null,
"e": 1245,
... |
JUnit - Time Test | JUnit provides a handy option of Timeout. If a test case takes more time than the specified number of milliseconds, then JUnit will automatically mark it as failed. The timeout parameter is used along with @Test annotation. Let us see the @Test(timeout) in action.
Create a java class to be tested, say, MessageUtil.java... | [
{
"code": null,
"e": 2237,
"s": 1972,
"text": "JUnit provides a handy option of Timeout. If a test case takes more time than the specified number of milliseconds, then JUnit will automatically mark it as failed. The timeout parameter is used along with @Test annotation. Let us see the @Test(timeout)... |
Profile Memory Consumption of Python functions in a single line of code | by Satyam Kumar | Towards Data Science | Python is a popular language among the data science community known for its robustness and vast presence of frameworks. Python prefers simplicity over complexity which makes it more popular but compromising the performance. Python programs are often prone to memory management issues.
Data Scientists use Python language... | [
{
"code": null,
"e": 456,
"s": 171,
"text": "Python is a popular language among the data science community known for its robustness and vast presence of frameworks. Python prefers simplicity over complexity which makes it more popular but compromising the performance. Python programs are often prone... |
How to Extract Data from JSON Array in Android using Volley Library? | 28 Jan, 2021
In the previous article on JSON Parsing in Android using Volley Library, we have seen how we can get the data from JSON Object in our android app and display that JSON Object in our app. In this article, we will take a look at How to extract data from JSON Array and display that in our app.
JSON Array: JS... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2021"
},
{
"code": null,
"e": 321,
"s": 28,
"text": "In the previous article on JSON Parsing in Android using Volley Library, we have seen how we can get the data from JSON Object in our android app and display that JSON Object ... |
Sum of pairwise products | 31 Jan, 2022
For given any unsigned int n find the final value of ∑(i*j) where (1<=i<=n) and (i <= j <= n).Examples:
Input : n = 3
Output : 25
We get the sum as following. Note that
first term i varies from 1 to 3 and second
term values from value of first term to n.
1*1 + 1*2 + 1*3 + 2*2 + 2*3 + 3*3 = 25
Input : 5
... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n31 Jan, 2022"
},
{
"code": null,
"e": 160,
"s": 54,
"text": "For given any unsigned int n find the final value of ∑(i*j) where (1<=i<=n) and (i <= j <= n).Examples: "
},
{
"code": null,
"e": 374,
"s": 160,
"text": ... |
Python – tensorflow.math.reduce_max() | 14 May, 2021
TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks.
reduce_max() is used to find maximum of elements across dimensions of a tensor.
Syntax: tensorflow.math.reduce_max( input_tensor, axis, keepdims, name)
Parameters:
input_tensor... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 May, 2021"
},
{
"code": null,
"e": 159,
"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": 239,
... |
Count Occurrences of a Given Character using Regex in Java | 15 Nov, 2021
Given a string and a character, the task is to make a function that counts the occurrence of the given character in the string using Regex.
Examples:
Input: str = "geeksforgeeks", c = 'e'
Output: 4
'e' appears four times in str.
Input: str = "abccdefgaa", c = 'a'
Output: 3
'a' appears three times in str.... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n15 Nov, 2021"
},
{
"code": null,
"e": 193,
"s": 53,
"text": "Given a string and a character, the task is to make a function that counts the occurrence of the given character in the string using Regex."
},
{
"code": null,
"e... |
Python | Return new list on element insertion | 28 Jan, 2019
The usual append method adds the new element in the original sequence and does not return any value. But sometimes we require to have a new list each time we add a new element to the list. This kind of problem is common in web development. Let’s discuss certain ways in which this task can be performed.
Met... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jan, 2019"
},
{
"code": null,
"e": 332,
"s": 28,
"text": "The usual append method adds the new element in the original sequence and does not return any value. But sometimes we require to have a new list each time we add a new element... |
How to clear previous appended data on change the dropdown menu in JavaScript ? | 22 Nov, 2019
To clear the previously appended data on change the drop-down is carried out by using jQuery. Appended data must be cleared on change or on toggling the drop-down menu, otherwise previously appended data append with current menu item data. To avoid this issue, jQuery or JavaScript is implemented with help ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Nov, 2019"
},
{
"code": null,
"e": 394,
"s": 28,
"text": "To clear the previously appended data on change the drop-down is carried out by using jQuery. Appended data must be cleared on change or on toggling the drop-down menu, otherw... |
String Constant Pool in Java | 21 Jun, 2020
Consider the following two Java programs, the first program produces output as “Yes”, but the second program produces output “No”. Can you guess the reason?
// Program 1: Comparing two references to objects// created using literals.import java.util.*; class GFG { public static void main(String[] args) ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Jun, 2020"
},
{
"code": null,
"e": 210,
"s": 53,
"text": "Consider the following two Java programs, the first program produces output as “Yes”, but the second program produces output “No”. Can you guess the reason?"
},
{
"co... |
Sort mixed list in Python | 11 May, 2020
Sometimes, while working with Python, we can have a problem in which we need to sort a particular list which has mixed data types. That it contains integers and strings and we need to sort each of them accordingly. Let’s discuss certain ways in which this problem can be solved.
Method #1 : Using sort() + c... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n11 May, 2020"
},
{
"code": null,
"e": 307,
"s": 28,
"text": "Sometimes, while working with Python, we can have a problem in which we need to sort a particular list which has mixed data types. That it contains integers and strings and we... |
Unused local variable in Python | 01 Oct, 2020
A variable defined inside a function block or a looping block loses its scope outside that block is called ad local variable to that block. A local variable cannot be accessed outside the block it is defined.
Example:
Python3
# simple display functiondef func(num): # local variable a = num print(... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 238,
"s": 28,
"text": "A variable defined inside a function block or a looping block loses its scope outside that block is called ad local variable to that block. A local variable cannot be accesse... |
Structures in C | 22 Jun, 2022
What is a structure? A structure is a key word that create user defined data type in C/C++. A structure creates a data type that can be used to group items of possibly different types into a single type.
How to create a structure? ‘struct’ keyword is used to create a structure. Following is an example.... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 258,
"s": 52,
"text": "What is a structure? A structure is a key word that create user defined data type in C/C++. A structure creates a data type that can be used to group items of possibly differ... |
Kibana - Create Dashboard | In our previous chapters, we have seen how to create visualization in the form of vertical bar, horizontal bar, pie chart etc. In this chapter, let us learn how to combine them together in the form of Dashboard. A dashboard is collection of your visualizations created, so that you can take a look at it all together at ... | [
{
"code": null,
"e": 2433,
"s": 2105,
"text": "In our previous chapters, we have seen how to create visualization in the form of vertical bar, horizontal bar, pie chart etc. In this chapter, let us learn how to combine them together in the form of Dashboard. A dashboard is collection of your visuali... |
The What, Why, and How of Sankey Diagrams | by Allison Stafford | Towards Data Science | Sankey diagrams show the flow of resources. They communicate sources and uses of the resources, materials, or costs represented.
The key to reading and interpreting Sankey Diagrams is remembering that the width is proportional to the quantity represented. In the example below, the audience quickly sees that largest des... | [
{
"code": null,
"e": 301,
"s": 172,
"text": "Sankey diagrams show the flow of resources. They communicate sources and uses of the resources, materials, or costs represented."
},
{
"code": null,
"e": 585,
"s": 301,
"text": "The key to reading and interpreting Sankey Diagrams is re... |
MATLAB - The Nested if Statements | It is always legal in MATLAB to nest if-else statements which means you can use one if or elseif statement inside another if or elseif statement(s).
The syntax for a nested if statement is as follows −
if <expression 1>
% Executes when the boolean expression 1 is true
if <expression 2>
% Executes when the ... | [
{
"code": null,
"e": 2290,
"s": 2141,
"text": "It is always legal in MATLAB to nest if-else statements which means you can use one if or elseif statement inside another if or elseif statement(s)."
},
{
"code": null,
"e": 2343,
"s": 2290,
"text": "The syntax for a nested if statem... |
Tryit Editor v3.7 | CSS Grid Intro
Tryit: The column-gap property | [
{
"code": null,
"e": 24,
"s": 9,
"text": "CSS Grid Intro"
}
] |
How can I delete MySQL temporary table? | As we know that MySQL temporary table would be deleted if the current session is terminated. But of still in between the session we want to delete the temporary table than with the help of the DROP statement we can delete the temporary table. It can be understood with the help of the following example −
In this example... | [
{
"code": null,
"e": 1367,
"s": 1062,
"text": "As we know that MySQL temporary table would be deleted if the current session is terminated. But of still in between the session we want to delete the temporary table than with the help of the DROP statement we can delete the temporary table. It can be ... |
Counting the number of words in a Trie - GeeksforGeeks | 25 Feb, 2019
A Trie is used to store dictionary words so that they can be searched efficiently and prefix search can be done. The task is to write a function to count the number of words.
Example :
Input : root
/ \ \
t a b
| | |
h n y
| | \ |
... | [
{
"code": null,
"e": 24241,
"s": 24213,
"text": "\n25 Feb, 2019"
},
{
"code": null,
"e": 24416,
"s": 24241,
"text": "A Trie is used to store dictionary words so that they can be searched efficiently and prefix search can be done. The task is to write a function to count the numbe... |
Node.js os.networkInterfaces() Method - GeeksforGeeks | 12 Oct, 2021
The os.networkInterfaces() method is an inbuilt application programming interface of the os module which is used to get the information about network interfaces of the computer.
Syntax:
os.networkInterfaces()
Parameters: This method does not accept any parameters.
Return Value: This method returns an objec... | [
{
"code": null,
"e": 25002,
"s": 24974,
"text": "\n12 Oct, 2021"
},
{
"code": null,
"e": 25180,
"s": 25002,
"text": "The os.networkInterfaces() method is an inbuilt application programming interface of the os module which is used to get the information about network interfaces of... |
Python List Comprehensions in 5-minutes | by Daniel Bourke | Towards Data Science | Just show me the code! Quick link: Jupyter Notebook on GitHub
Why would you want to do a Python list comprehension?
To save lines of code.
There’s might be more to it than that but in my experience, this is the only reason — if you have a better one, leave a comment and I’ll update the article.
You can get the exact sa... | [
{
"code": null,
"e": 233,
"s": 171,
"text": "Just show me the code! Quick link: Jupyter Notebook on GitHub"
},
{
"code": null,
"e": 287,
"s": 233,
"text": "Why would you want to do a Python list comprehension?"
},
{
"code": null,
"e": 310,
"s": 287,
"text": "T... |
Rendering elegant stock trading agents using Matplotlib and Gym | by Adam King | Towards Data Science | We are going to be extending the code we wrote in the last tutorial to render an insightful visualization of the environment using Matplotlib. If you haven’t read my first article on Creating custom Gym environments from scratch, you should stop here and read that first.
If you are unfamiliar with the matplotlib librar... | [
{
"code": null,
"e": 444,
"s": 172,
"text": "We are going to be extending the code we wrote in the last tutorial to render an insightful visualization of the environment using Matplotlib. If you haven’t read my first article on Creating custom Gym environments from scratch, you should stop here and ... |
How to create a comma separated string from a list of string in C#? | A List of string can be converted to a comma separated string using built in string.Join extension method.
string.Join("," , list);
This type of conversion is really useful when we collect a list of data (Ex: checkbox selected data) from the user and convert the same to a comma separated string and query the database t... | [
{
"code": null,
"e": 1169,
"s": 1062,
"text": "A List of string can be converted to a comma separated string using built in string.Join extension method."
},
{
"code": null,
"e": 1194,
"s": 1169,
"text": "string.Join(\",\" , list);"
},
{
"code": null,
"e": 1401,
"... |
Development of Genetic Algorithm | Towards Data Science | Many people have heard about the big skepticism in the field of artificial intelligence from final consumers: “We have been on the market for 50 years, so we know better what to do”.
You are talking about your AI, but how does it work? Can you write an algorithm for our sales department? How can we interpret the result... | [
{
"code": null,
"e": 355,
"s": 172,
"text": "Many people have heard about the big skepticism in the field of artificial intelligence from final consumers: “We have been on the market for 50 years, so we know better what to do”."
},
{
"code": null,
"e": 495,
"s": 355,
"text": "You... |
equal_range in C++ - GeeksforGeeks | 28 Sep, 2018
std::equal_range is used to find the sub-range within a given range [first, last) that has all the elements equivalent to a given value. It returns the initial and the final bound of such a sub-range.
This function requires the range to be either sorted or partitioned according to some condition such that ... | [
{
"code": null,
"e": 23731,
"s": 23703,
"text": "\n28 Sep, 2018"
},
{
"code": null,
"e": 23932,
"s": 23731,
"text": "std::equal_range is used to find the sub-range within a given range [first, last) that has all the elements equivalent to a given value. It returns the initial and... |
IDE | GeeksforGeeks | A computer science portal for geeks | Please enter your email address or userHandle. | [] |
Cartesian Tree - GeeksforGeeks | 18 Feb, 2022
A Cartesian tree is a tree data structure created from a set of data that obeys the following structural invariants:
The tree obeys in the min (or max) heap property – each node is less (or greater) than its children.An inorder traversal of the nodes yields the values in the same order in which they appe... | [
{
"code": null,
"e": 24011,
"s": 23983,
"text": "\n18 Feb, 2022"
},
{
"code": null,
"e": 24130,
"s": 24011,
"text": "A Cartesian tree is a tree data structure created from a set of data that obeys the following structural invariants: "
},
{
"code": null,
"e": 24346,
... |
MS Project - Quick Guide | Each one of you might be using a different setting for MS Project 2013. To ensure the results are not different from what is shown in this tutorials, ensure the settings as follows. Remember all these are the default settings you will have when you first install MS Project 2013 on your computer.
Step 1 − File → Options... | [
{
"code": null,
"e": 2178,
"s": 1881,
"text": "Each one of you might be using a different setting for MS Project 2013. To ensure the results are not different from what is shown in this tutorials, ensure the settings as follows. Remember all these are the default settings you will have when you firs... |
Write a Java program to capitalize each word in the string? | You can capitalize words in a string using the toUpperCase() method of the String class. This method converts the contents of the current string to Upper case letters.
Live Demo
public class StringToUpperCaseEmp {
public static void main(String[] args) {
String str = "string abc touppercase ";
String st... | [
{
"code": null,
"e": 1230,
"s": 1062,
"text": "You can capitalize words in a string using the toUpperCase() method of the String class. This method converts the contents of the current string to Upper case letters."
},
{
"code": null,
"e": 1241,
"s": 1230,
"text": " Live Demo"
... |
Aurelia - Quick Guide | The best definition of the framework can be found in Aurelia official docs −
Well, it's actually simple. Aurelia is just JavaScript. However, it's not yesterday's JavaScript, but the JavaScript of tomorrow. By using modern tooling we've been able to write Aurelia from the ground up in ECMAScript 2016. This means we hav... | [
{
"code": null,
"e": 2242,
"s": 2165,
"text": "The best definition of the framework can be found in Aurelia official docs −"
},
{
"code": null,
"e": 2573,
"s": 2242,
"text": "Well, it's actually simple. Aurelia is just JavaScript. However, it's not yesterday's JavaScript, but the... |
Bootstrap - Navigation Elements | Bootstrap provides a few different options for styling navigation elements. All of them share the same markup and base class, .nav. Bootstrap also provides a helper class, to share markup and states. Swap modifier classes to switch between each style.
To create a tabbed navigation menu −
Start with a basic unordered li... | [
{
"code": null,
"e": 3583,
"s": 3331,
"text": "Bootstrap provides a few different options for styling navigation elements. All of them share the same markup and base class, .nav. Bootstrap also provides a helper class, to share markup and states. Swap modifier classes to switch between each style."
... |
Search an element in an array where difference between adjacent elements is 1 | 28 Jun, 2022
Given an array where difference between adjacent elements is 1, write an algorithm to search for an element in the array and return the position of the element (return the first occurrence).Examples :
Let element to be searched be x
Input: arr[] = {8, 7, 6, 7, 6, 5, 4, 3, 2, 3, 4, 3}
x = 3
Ou... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 256,
"s": 54,
"text": "Given an array where difference between adjacent elements is 1, write an algorithm to search for an element in the array and return the position of the element (return the fi... |
TCP Congestion Control | 05 Nov, 2021
Prerequisites – Basic Congestion control knowledge
TCP uses a congestion window and a congestion policy that avoid congestion. Previously, we assumed that only the receiver can dictate the sender’s window size. We ignored another entity here, the network. If the network cannot deliver the data as fast as i... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Nov, 2021"
},
{
"code": null,
"e": 105,
"s": 54,
"text": "Prerequisites – Basic Congestion control knowledge"
},
{
"code": null,
"e": 552,
"s": 105,
"text": "TCP uses a congestion window and a congestion policy t... |
PEP 8 : Coding Style guide in Python | 24 Nov, 2020
Indeed coding and applying logic is the foundation of any programming language but there’s also another factor that every coder must keep in mind while coding and that is the coding style. Keeping this in mind, Python maintains a strict way of order and format of scripting.Following this sometimes mandator... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Nov, 2020"
},
{
"code": null,
"e": 541,
"s": 54,
"text": "Indeed coding and applying logic is the foundation of any programming language but there’s also another factor that every coder must keep in mind while coding and that is the... |
Matplotlib.pyplot.hist2d() in Python | 21 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface.
The hist2d() function in pyplot module of matplotlib library is used to make a 2D histogram plot.
Syntax:matplot... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n21 Apr, 2020"
},
{
"code": null,
"e": 223,
"s": 28,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MAT... |
How to Rename Multiple PySpark DataFrame Columns | 29 Jun, 2021
In this article, we will discuss how to rename the multiple columns in PySpark Dataframe. For this we will use withColumnRenamed() and toDF() functions.
Creating Dataframe for demonstration:
Python3
# importing moduleimport pyspark # importing sparksession from pyspark.sql modulefrom pyspark.sql import Sp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 181,
"s": 28,
"text": "In this article, we will discuss how to rename the multiple columns in PySpark Dataframe. For this we will use withColumnRenamed() and toDF() functions."
},
{
"code": ... |
R – if statement | 18 Oct, 2021
If statement is one of the Decision-making statements in the R programming language. It is one of the easiest decision-making statements. It is used to decide whether a certain statement or block of statements will be executed or not i.e if a certain condition is true then a block of statement is executed ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Oct, 2021"
},
{
"code": null,
"e": 376,
"s": 54,
"text": "If statement is one of the Decision-making statements in the R programming language. It is one of the easiest decision-making statements. It is used to decide whether a certa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.