title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
What are wildcards arguments in Generics In Java? | Generics is a concept in Java where you can enable a class, interface and, method, accept all (reference) types as parameters. In other words it is the concept which enables the users to choose the reference type that a method, constructor of a class accepts, dynamically. By defining a class as generic you are making i... | [
{
"code": null,
"e": 1430,
"s": 1062,
"text": "Generics is a concept in Java where you can enable a class, interface and, method, accept all (reference) types as parameters. In other words it is the concept which enables the users to choose the reference type that a method, constructor of a class ac... |
JSON.simple - Using JSONValue | JSONValue provide a static method parse() to parse the given json string to return a JSONObject which can then be used to get the values parsed. See the example below.
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
public class JsonDemo {
public static void ma... | [
{
"code": null,
"e": 2391,
"s": 2223,
"text": "JSONValue provide a static method parse() to parse the given json string to return a JSONObject which can then be used to get the values parsed. See the example below."
},
{
"code": null,
"e": 3225,
"s": 2391,
"text": "import org.jso... |
\tfrac - Tex Command | \tfrac - Used to create textstyle fraction.
{ \tfrac}
\tfrac command draws textstyle fraction.
\tfrac ab \frac ab
abab
\tfrac ab \frac ab
abab
\tfrac ab \frac ab
14 Lectures
52 mins
Ashraf Said
11 Lectures
1 hours
Ashraf Said
9 Lectures
1 hours
Emenwa Global, Ejike Ifean... | [
{
"code": null,
"e": 8030,
"s": 7986,
"text": "\\tfrac - Used to create textstyle fraction."
},
{
"code": null,
"e": 8040,
"s": 8030,
"text": "{ \\tfrac}"
},
{
"code": null,
"e": 8081,
"s": 8040,
"text": "\\tfrac command draws textstyle fraction."
},
{
... |
Output of Python Programs | Set 18 (List and Tuples) | 30 Nov, 2021
1) What is the output of the following program?
PYTHON
L = list('123456')L[0] = L[5] = 0L[3] = L[-2]print(L)
a) [0, β2β, β3β, β4β, β5β, 0] b) [β6β, β2β, β3β, β5β, β5β, β6β] c) [β0β, β2β, β3β, β5β, β5β, β0β] d) [0, β2β, β3β, β5β, β5β, 0] Ans. (d) Explanation: L[0] is β1β and L[5] is β6β, both of these elem... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 101,
"s": 52,
"text": "1) What is the output of the following program? "
},
{
"code": null,
"e": 108,
"s": 101,
"text": "PYTHON"
},
{
"code": "L = list('123456')L[0] = L... |
SQL queries on FILM Database | 29 May, 2020
Consider the following tables in Film Database:
ARTIST (Art_id, Art_Name, Art_Gender)
PRODUCER (Prod_id, Prod_Name, Prod_Phone)
FILMS (Film_id, Film_Title, Film_Year, Film_Lang, Prod_id)
CASTING (Art_id, Film_id, Part)
REVIEW (Film_id, Stars)
The data content of these five tables are shown below:
SELEC... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n29 May, 2020"
},
{
"code": null,
"e": 101,
"s": 53,
"text": "Consider the following tables in Film Database:"
},
{
"code": null,
"e": 300,
"s": 101,
"text": "ARTIST (Art_id, Art_Name, Art_Gender) \nPRODUCER (Prod_id... |
How to copy a map to another map in Golang? | 10 May, 2020
Maps in Golang is a collection of unordered pairs of key-value. It is widely used because it provides fast lookups and values that can retrieve, update, or delete with the help of keys. In Map, you can copy a map to another map using the for loop provided by the Go language. In for loop, we fetch the index... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 396,
"s": 28,
"text": "Maps in Golang is a collection of unordered pairs of key-value. It is widely used because it provides fast lookups and values that can retrieve, update, or delete with the hel... |
Time Complexity of Euclidean Algorithm | 27 Jan, 2022
In this article, we will discuss the time complexity of the Euclidean Algorithm which is O(log(min(a, b)) and it is achieved.
Euclidβs Algorithm: It is an efficient method for finding the GCD(Greatest Common Divisor) of two integers. The time complexity of this algorithm is O(log(min(a, b)). Recursively i... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jan, 2022"
},
{
"code": null,
"e": 178,
"s": 52,
"text": "In this article, we will discuss the time complexity of the Euclidean Algorithm which is O(log(min(a, b)) and it is achieved."
},
{
"code": null,
"e": 382,
"s... |
Find maximum volume of a cuboid from the given perimeter and area | 07 Sep, 2021
Given a perimeter P and area A, the task is to calculate the maximum volume that can be made in form of cuboid from the given perimeter and surface area.
Examples :
Input: P = 24, A = 24
Output: 8
Input: P = 20, A = 14
Output: 3
Approach: For a given perimeter of cuboid we have P = 4(l+b+h) β(i), for giv... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n07 Sep, 2021"
},
{
"code": null,
"e": 208,
"s": 54,
"text": "Given a perimeter P and area A, the task is to calculate the maximum volume that can be made in form of cuboid from the given perimeter and surface area."
},
{
"code"... |
Two Repeated Elements | Practice | GeeksforGeeks | You are given an array of N+2 integer elements. All elements of the array are in range 1 to N. Also, all elements occur once except two numbers which occur twice. Find the two repeating numbers.
Example 1:
Input:
N = 4
array[] = {1,2,1,3,4,3}
Output: 1 3
Explanation: In the given array,
1 and 3 are repeated two times.... | [
{
"code": null,
"e": 433,
"s": 238,
"text": "You are given an array of N+2 integer elements. All elements of the array are in range 1 to N. Also, all elements occur once except two numbers which occur twice. Find the two repeating numbers."
},
{
"code": null,
"e": 444,
"s": 433,
... |
Ways to paint N paintings such that adjacent paintings donβt have same colors | 23 Jun, 2022
Given two integers n and m, where n represent some paintings numbered from 1 to n and m represent some colours 1 to m with unlimited amount. The task is to find the number of ways to paint the paintings such that no two consecutive paintings have the same colors.Note: Answer must be calculated in modulo 10... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 406,
"s": 52,
"text": "Given two integers n and m, where n represent some paintings numbered from 1 to n and m represent some colours 1 to m with unlimited amount. The task is to find the number of... |
Convert String to Character Array in C# | 26 May, 2020
Given a string, the task is to convert this string into a character array in C#.
Examples:
Input: string
Output: [s, t, r, i, n, g]
Input: GeeksForGeeks
Output: [G, e, e, k, s, F, o, r, G, e, e, k, s]
Method 1: Naive Approach
Step 1: Get the string.
Step 2: Create a character array of the same l... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 May, 2020"
},
{
"code": null,
"e": 109,
"s": 28,
"text": "Given a string, the task is to convert this string into a character array in C#."
},
{
"code": null,
"e": 119,
"s": 109,
"text": "Examples:"
},
{
"... |
GATE | GATE CS 2018 | Question 56 | 09 Mar, 2018
Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1, 2, ..., 100. There is an edge between vertices u and v if and only if the label of u can be obtained by swapping two adjacent numbers in the label of v. Let y denote the degree of a vertex in G, and z... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n09 Mar, 2018"
},
{
"code": null,
"e": 433,
"s": 52,
"text": "Let G be a graph with 100! vertices, with each vertex labelled by a distinct permutation of the numbers 1, 2, ..., 100. There is an edge between vertices u and v if and only ... |
Name mangling in Python | 23 Jan, 2020
In name mangling process any identifier with two leading underscore and one trailing underscore is textually replaced with _classname__identifier where classname is the name of the current class. It means that any identifier of the form __geek (at least two leading underscores or at most one trailing under... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Jan, 2020"
},
{
"code": null,
"e": 482,
"s": 54,
"text": "In name mangling process any identifier with two leading underscore and one trailing underscore is textually replaced with _classname__identifier where classname is the name ... |
How to Check the OS Version in Linux? | 15 Apr, 2021
When we want to install the software in our system, firstly we must know that whether our current Operating System is supporting this version of the software or not. In Windows, we can easily check it as Windows is totally based on a GUI-based Operating System.
But we prefer to use the Command line instead... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n15 Apr, 2021"
},
{
"code": null,
"e": 316,
"s": 54,
"text": "When we want to install the software in our system, firstly we must know that whether our current Operating System is supporting this version of the software or not. In Windo... |
C# Multithreading | 22 Apr, 2020
Multitasking is the simultaneous execution of multiple tasks or processes over a certain time interval. Windows operating system is an example of multitasking because it is capable of running more than one process at a time like running Google Chrome, Notepad, VLC player, etc. at the same time. The operati... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 1347,
"s": 54,
"text": "Multitasking is the simultaneous execution of multiple tasks or processes over a certain time interval. Windows operating system is an example of multitasking because it is ... |
Prolog | An Introduction | 28 Jun, 2022
Introduction :
Prolog is a logic programming language. It has important role in artificial intelligence. Unlike many other programming languages, Prolog is intended primarily as a declarative programming language. In prolog, logic is expressed as relations (called as Facts and Rules). Core heart of prolog ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n28 Jun, 2022"
},
{
"code": null,
"e": 69,
"s": 54,
"text": "Introduction :"
},
{
"code": null,
"e": 477,
"s": 69,
"text": "Prolog is a logic programming language. It has important role in artificial intelligence. Un... |
memmove() in C/C++ | 10 Dec, 2021
memmove() is used to copy a block of memory from a location to another. It is declared in string.h
// Copies "numBytes" bytes from address "from" to address "to"
void * memmove(void *to, const void *from, size_t numBytes);
Below is a sample C program to show the working of memmove().
C
/* A C program to d... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Dec, 2021"
},
{
"code": null,
"e": 153,
"s": 54,
"text": "memmove() is used to copy a block of memory from a location to another. It is declared in string.h"
},
{
"code": null,
"e": 278,
"s": 153,
"text": "// Cop... |
HTML <html> Tag | 17 Mar, 2022
The <html> tag in HTML is used to define the root of HTML and XHTML documents. The <html> tag tells the browser that it is an HTML document. It is the second outer container for everything that appears in an HTML document followed by the <!DOCTYPE> tag. The <html> tag requires a starting and end tag.Syntax... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n17 Mar, 2022"
},
{
"code": null,
"e": 364,
"s": 53,
"text": "The <html> tag in HTML is used to define the root of HTML and XHTML documents. The <html> tag tells the browser that it is an HTML document. It is the second outer container ... |
How to clear form after submit in Javascript without using reset? | 07 May, 2020
Forms in javascript are used to take the selective or required information from the user. There are various areas and purposes to use forms, i.e, in recruitment, when applying for some kind of jobs, or for asking some types of queries. It is easy to distribute form when it is not online but when it comes t... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 May, 2020"
},
{
"code": null,
"e": 615,
"s": 28,
"text": "Forms in javascript are used to take the selective or required information from the user. There are various areas and purposes to use forms, i.e, in recruitment, when applying... |
Scala | Multithreading | 08 Apr, 2019
A process in which multiple threads executing simultaneously that is called multithreading. It allows you to perform multiple tasks independently.
What are Threads in Scala?
Threads are lightweight sub-processes which occupy less memory. A multi-threaded program contains two or more threads that can run co... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Apr, 2019"
},
{
"code": null,
"e": 175,
"s": 28,
"text": "A process in which multiple threads executing simultaneously that is called multithreading. It allows you to perform multiple tasks independently."
},
{
"code": null,
... |
enum.auto() in Python | 22 Apr, 2020
With the help of enum.auto() method, we can get the assigned integer value automatically by just using enum.auto() method.
Syntax : enum.auto()
Automatically assign the integer value to the values of enum class attributes.
Example #1 :In this example we can see that by using enum.auto() method, we are able... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 151,
"s": 28,
"text": "With the help of enum.auto() method, we can get the assigned integer value automatically by just using enum.auto() method."
},
{
"code": null,
"e": 172,
"s": 1... |
Count of possible subarrays and subsequences using given length of Array | 18 Nov, 2021
Given an integer N which denotes the length of an array, the task is to count the number of subarray and subsequence possible with the given length of the array.Examples:
Input: N = 5 Output: Count of subarray = 15 Count of subsequence = 32Input: N = 3 Output: Count of subarray = 6 Count of subsequence =... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 226,
"s": 53,
"text": "Given an integer N which denotes the length of an array, the task is to count the number of subarray and subsequence possible with the given length of the array.Examples: "
... |
type and isinstance in Python | 05 Jul, 2022
In this article, we will cover about type() and isinstance() function in Python, and what are the differences between type() and isinstance().
Python has a built-in method called type which generally comes in handy while figuring out the type of the variable used in the program in the runtime. The canonica... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 197,
"s": 54,
"text": "In this article, we will cover about type() and isinstance() function in Python, and what are the differences between type() and isinstance()."
},
{
"code": null,
... |
JavaScript Anonymous Functions | 23 Jun, 2022
In this article we will study in detail about what exactly are Anonymous Functions in JavaScript and how to declare them using normal technique and/or with Arrow Function technique itself.
Anonymous Function is a function that does not have any name associated with it. Normally we use the function keyword ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n23 Jun, 2022"
},
{
"code": null,
"e": 242,
"s": 53,
"text": "In this article we will study in detail about what exactly are Anonymous Functions in JavaScript and how to declare them using normal technique and/or with Arrow Function tec... |
How to Create AlertDialog Box Using SweetAlert Dialog Library? | 27 May, 2021
In this article, we will learn about how to add Custom Alert Dialog in an app using SweetAlert Dialog Library. It is a pop-up box which appears in response to any action of the user.AlertBox is very useful when it comes to validation, it can be used to display confirmation messages. Suppose if the user pre... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 May, 2021"
},
{
"code": null,
"e": 586,
"s": 54,
"text": "In this article, we will learn about how to add Custom Alert Dialog in an app using SweetAlert Dialog Library. It is a pop-up box which appears in response to any action of t... |
How to use split () in Android textview? | This example demonstrate about How to use split () in Android textview.
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"?>
<LinearLayout x... | [
{
"code": null,
"e": 1259,
"s": 1187,
"text": "This example demonstrate about How to use split () in Android textview."
},
{
"code": null,
"e": 1388,
"s": 1259,
"text": "Step 1 β Create a new project in Android Studio, go to File β New Project and fill all required details to cre... |
SQL Query to Find Names of the Employees Whose Department Have Number of Employees Less than 2 | 29 Dec, 2021
In SQL, we need to find out the department wise information from the given table containing information about employees. One such data is the name of employee who belong to a department having less than 2(i.e. only 1) employees. We shall use the GROUP BY, IN and COUNT clause to achieve this. This is illust... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 425,
"s": 28,
"text": "In SQL, we need to find out the department wise information from the given table containing information about employees. One such data is the name of employee who belong to a ... |
How to resize Image in Python β Tkinter? | 31 Aug, 2021
Prerequisite:
Tkinter
PIL
Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way to cr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Aug, 2021"
},
{
"code": null,
"e": 42,
"s": 28,
"text": "Prerequisite:"
},
{
"code": null,
"e": 50,
"s": 42,
"text": "Tkinter"
},
{
"code": null,
"e": 54,
"s": 50,
"text": "PIL"
},
{
"c... |
Vectorization in Python | 04 Oct, 2019
We know that most of the application has to deal with a large number of datasets. Hence, a non-computationally-optimal function can become a huge bottleneck in your algorithm and can take result in a model that takes ages to run. To make sure that the code is computationally efficient, we will use vectoriz... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Oct, 2019"
},
{
"code": null,
"e": 368,
"s": 54,
"text": "We know that most of the application has to deal with a large number of datasets. Hence, a non-computationally-optimal function can become a huge bottleneck in your algorithm... |
Iterative HeapSort | Difficulty Level :
Medium
HeapSort is a comparison based sorting technique where we first build Max Heap and then swaps the root element with last element (size times) and maintains the heap property each time to finally make it sorted.
Examples:
Input : 10 20 15 17 9 21
Output : 9 10 15 17 20 21
Input: 12 11 13 5... | [
{
"code": null,
"e": 26,
"s": 0,
"text": "Difficulty Level :\nMedium"
},
{
"code": null,
"e": 238,
"s": 26,
"text": "HeapSort is a comparison based sorting technique where we first build Max Heap and then swaps the root element with last element (size times) and maintains the hea... |
TreeView in Android with Example | 18 Feb, 2021
If you are looking for the new UI designs for the representation of huge data, then there are so many ways for the representation of this type of data. You can use pie charts, graphs, and many more view types for the implementation of these views. For displaying such huge data then we can prefer using a Tr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Feb, 2021"
},
{
"code": null,
"e": 723,
"s": 28,
"text": "If you are looking for the new UI designs for the representation of huge data, then there are so many ways for the representation of this type of data. You can use pie charts,... |
Print all Hamiltonian Cycles in an Undirected Graph | 25 Oct, 2021
Given an undirected Graph consisting of N nodes in the form of an adjacency matrix graph[][] of size N*N, the task is to print all Hamiltonian cycles possible in the given undirected Graph (taking starting vertex as β0β).
A Hamiltonian cycle (or Hamiltonian circuit) is a Hamiltonian Path such that there is... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n25 Oct, 2021"
},
{
"code": null,
"e": 276,
"s": 54,
"text": "Given an undirected Graph consisting of N nodes in the form of an adjacency matrix graph[][] of size N*N, the task is to print all Hamiltonian cycles possible in the given un... |
R - Normal Distribution | In a random collection of data from independent sources, it is generally observed that the distribution of data is normal. Which means, on plotting a graph with the value of the variable in the horizontal axis and the count of the values in the vertical axis we get a bell shape curve. The center of the curve represents... | [
{
"code": null,
"e": 3063,
"s": 2536,
"text": "In a random collection of data from independent sources, it is generally observed that the distribution of data is normal. Which means, on plotting a graph with the value of the variable in the horizontal axis and the count of the values in the vertical... |
Method overloading and null error in Java | 18 Apr, 2022
In Java it is very common to overload methods. Below is an interesting Java program.
Java
public class Test{ // Overloaded methods public void fun(Integer i) { System.out.println("fun(Integer ) "); } public void fun(String name) { System.out.println("fun(String ) "); } ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Apr, 2022"
},
{
"code": null,
"e": 138,
"s": 52,
"text": "In Java it is very common to overload methods. Below is an interesting Java program. "
},
{
"code": null,
"e": 143,
"s": 138,
"text": "Java"
},
{
... |
mkdir() - Unix, Linux System Call | Unix - Home
Unix - Getting Started
Unix - File Management
Unix - Directories
Unix - File Permission
Unix - Environment
Unix - Basic Utilities
Unix - Pipes & Filters
Unix - Processes
Unix - Communication
Unix - The vi Editor
Unix - What is Shell?
Unix - Using Variables
Unix - Special Variables
Unix - Using Arrays
Unix -... | [
{
"code": null,
"e": 1466,
"s": 1454,
"text": "Unix - Home"
},
{
"code": null,
"e": 1489,
"s": 1466,
"text": "Unix - Getting Started"
},
{
"code": null,
"e": 1512,
"s": 1489,
"text": "Unix - File Management"
},
{
"code": null,
"e": 1531,
"s": 1... |
Java Program for Radix Sort | Radix sort is a sorting technique that sorts the elements based on every digit in every element (or number). Based on the ones place digit (which is also known as least significant digit) and tens place digit (which is also known as most significant digit), hundreds place digit, and so on, the elements are sorted.
Foll... | [
{
"code": null,
"e": 1378,
"s": 1062,
"text": "Radix sort is a sorting technique that sorts the elements based on every digit in every element (or number). Based on the ones place digit (which is also known as least significant digit) and tens place digit (which is also known as most significant dig... |
Find smallest and largest element from square matrix diagonals - GeeksforGeeks | 11 Sep, 2021
Given a square matrix of order n*n, find the smallest and largest elements from both diagonals of the given matrix.
Examples:
Input : matrix = {
{1, 2, 3, 4, -10},
{5, 6, 7, 8, 6},
{1, 2, 11, 3, 4},
{5, 6, 70, 5, 8},
{4, 9, 7, 1, 5}};
Output :
P... | [
{
"code": null,
"e": 24904,
"s": 24876,
"text": "\n11 Sep, 2021"
},
{
"code": null,
"e": 25021,
"s": 24904,
"text": "Given a square matrix of order n*n, find the smallest and largest elements from both diagonals of the given matrix. "
},
{
"code": null,
"e": 25032,
... |
COBOL - String Handling | String handling statements in COBOL are used to do multiple functional operations on strings. Following are the string handling statements β
Inspect
String
Unstring
Inspect verb is used to count or replace the characters in a string. String operations can be performed on alphanumeric, numeric, or alphabetic values. Ins... | [
{
"code": null,
"e": 2163,
"s": 2022,
"text": "String handling statements in COBOL are used to do multiple functional operations on strings. Following are the string handling statements β"
},
{
"code": null,
"e": 2171,
"s": 2163,
"text": "Inspect"
},
{
"code": null,
"... |
Can Enum implements an interface in Java?
| Yes, Enum implements an interface in Java, it can be useful when we need to implement some business logic that is tightly coupled with a discriminatory property of a given object or class. An Enum is a special datatype which is added in Java 1.5 version. The Enums are constants, by default they are static and final so ... | [
{
"code": null,
"e": 1441,
"s": 1062,
"text": "Yes, Enum implements an interface in Java, it can be useful when we need to implement some business logic that is tightly coupled with a discriminatory property of a given object or class. An Enum is a special datatype which is added in Java 1.5 version... |
Count the number of non-reachable nodes - GeeksforGeeks | 09 Mar, 2022
Given an undirected graph and a set of vertices, we have to count the number of non-reachable nodes from the given head node using a depth-first search.
Consider below undirected graph with two disconnected components:
In this graph, if we consider 0 as a head node, then the node 0, 1 and 2 are reachable. ... | [
{
"code": null,
"e": 24699,
"s": 24671,
"text": "\n09 Mar, 2022"
},
{
"code": null,
"e": 24852,
"s": 24699,
"text": "Given an undirected graph and a set of vertices, we have to count the number of non-reachable nodes from the given head node using a depth-first search."
},
{
... |
R Markdown Parameters | Drew Seewald | Towards Data Science | Weβve all been in a meeting where someone asks, βcan you run that analysis again for a different time period,β or, βcan you run it for group B instead of group A,β or, βcan you send me that analysis so that I can play around with it?β
There are some problems that we often encounter when trying to fulfill those requests... | [
{
"code": null,
"e": 406,
"s": 171,
"text": "Weβve all been in a meeting where someone asks, βcan you run that analysis again for a different time period,β or, βcan you run it for group B instead of group A,β or, βcan you send me that analysis so that I can play around with it?β"
},
{
"code"... |
3D Plots in MATLAB - GeeksforGeeks | 09 May, 2021
In MATLAB, we can plot different types of modules like 2d plotting and 3d plotting. In this article, we will see what are the various types of 3D plotting.
Mesh Plot: A mesh plot is a 3d surface that creates different types of meshes for different types of expression. To create mesh we have to give the val... | [
{
"code": null,
"e": 24528,
"s": 24500,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 24684,
"s": 24528,
"text": "In MATLAB, we can plot different types of modules like 2d plotting and 3d plotting. In this article, we will see what are the various types of 3D plotting."
},
... |
C# - Miscellaneous Operators | There are few other important operators including sizeof and ? : supported by C#.
StringReader r = obj as StringReader;
using System;
namespace OperatorsAppl {
class Program {
static void Main(string[] args) {
/* example of sizeof operator */
Console.WriteLine("The size of int is {0}",... | [
{
"code": null,
"e": 2353,
"s": 2270,
"text": "There are few other important operators including sizeof and ? : supported by C#."
},
{
"code": null,
"e": 2391,
"s": 2353,
"text": "StringReader r = obj as StringReader;"
},
{
"code": null,
"e": 3054,
"s": 2391,
... |
The Nice Way To Use Docker With VSCode | by Yash Prakash | Towards Data Science | Your next project might contain a lot of complex machine learning code with numerous different libraries and their versions threatening to wreak havoc on your machine. Next comes the process of making sure your colleague can also run your app with the right dependencies installed. This brings forward a new round of hea... | [
{
"code": null,
"e": 500,
"s": 172,
"text": "Your next project might contain a lot of complex machine learning code with numerous different libraries and their versions threatening to wreak havoc on your machine. Next comes the process of making sure your colleague can also run your app with the rig... |
Behave - Installation | Behave installation can be done by the following ways β
For Behave installation, we should have pip β the package installer for the Python language installed in our system. The pip is installed by default, if the Python version is greater than 2(upto 2.7.9).
To install pip, run the below mentioned command β
pip install... | [
{
"code": null,
"e": 2352,
"s": 2296,
"text": "Behave installation can be done by the following ways β"
},
{
"code": null,
"e": 2555,
"s": 2352,
"text": "For Behave installation, we should have pip β the package installer for the Python language installed in our system. The pip i... |
fillpoly() function in C | Now the header file graphics.h contains fillpoly() function which is implemented to draw and fill a polygon such as triangle, rectangle, pentagon, hexagon etc. So this function require same arguments as drawpoly().
void fillpoly( int number, int *polypoints );
In this case,number indicates (n + 1) number of points wher... | [
{
"code": null,
"e": 1277,
"s": 1062,
"text": "Now the header file graphics.h contains fillpoly() function which is implemented to draw and fill a polygon such as triangle, rectangle, pentagon, hexagon etc. So this function require same arguments as drawpoly()."
},
{
"code": null,
"e": 1... |
Transformers in NLP: A beginner friendly explanation | Towards Data Science | No, this article is not about the American sci-fi action movie series β no Optimus Prime here. It is also not about the electrical device that is used to transfer energy from one electrical circuit to another. What is this about then, you ask?
It is about the one in the most sci-fi fields of all time, Artificial Intell... | [
{
"code": null,
"e": 416,
"s": 172,
"text": "No, this article is not about the American sci-fi action movie series β no Optimus Prime here. It is also not about the electrical device that is used to transfer energy from one electrical circuit to another. What is this about then, you ask?"
},
{
... |
Jupyter Notebook - IPyWidgets | IPyWidgets is a Python library of HTML interactive widgets for Jupyter notebook. Each UI element in the library can respond to events and invokes specified event handler functions. They enhance the interactive feature of Jupyter notebook application.
In order to incorporate widgets in the notebook, we have to import th... | [
{
"code": null,
"e": 2911,
"s": 2660,
"text": "IPyWidgets is a Python library of HTML interactive widgets for Jupyter notebook. Each UI element in the library can respond to events and invokes specified event handler functions. They enhance the interactive feature of Jupyter notebook application."
... |
Using Python's matplotlib to visualise spatial data | Towards Data Science | As part of a project to predict house prices, I was handed a large dataset of housing data from King County, Washington, USA. This dataset contained a wide range of house-related data, including the latitude and longitude of each house sold within a one-year period. As latitude and longitude are both continuous numeric... | [
{
"code": null,
"e": 770,
"s": 171,
"text": "As part of a project to predict house prices, I was handed a large dataset of housing data from King County, Washington, USA. This dataset contained a wide range of house-related data, including the latitude and longitude of each house sold within a one-y... |
Introduction to PonyGE2 for Grammatical Evolution | by Peter Adam | Towards Data Science | Grammatical Evolution is a powerful method for algorithm optimisation. Given an objective function and a search space (grammar), it is possible to use evolutionary computing methods to evolve an algorithm to optimally (or at least efficiently) maximise the objective function.
PonyGE2 is a Python3 implementation which m... | [
{
"code": null,
"e": 448,
"s": 171,
"text": "Grammatical Evolution is a powerful method for algorithm optimisation. Given an objective function and a search space (grammar), it is possible to use evolutionary computing methods to evolve an algorithm to optimally (or at least efficiently) maximise th... |
Python 3 - Nested loops | Python programming language allows the usage of one loop inside another loop. The following section shows a few examples to illustrate the concept.
for iterating_var in sequence:
for iterating_var in sequence:
statements(s)
statements(s)
The syntax for a nested while loop statement in Python programming la... | [
{
"code": null,
"e": 2488,
"s": 2340,
"text": "Python programming language allows the usage of one loop inside another loop. The following section shows a few examples to illustrate the concept."
},
{
"code": null,
"e": 2591,
"s": 2488,
"text": "for iterating_var in sequence:\n ... |
Sass - Functions | SASS supports the use of functions by providing some keyword arguments, which are specified using normal CSS function syntax.
p {
color: hsl($hue: 0, $saturation: 50%, $lightness: 50%);
}
HSL stands for hue, saturation, and lightness, which are more intuitive for creating a set of matching colors by using saturatio... | [
{
"code": null,
"e": 1978,
"s": 1852,
"text": "SASS supports the use of functions by providing some keyword arguments, which are specified using normal CSS function syntax."
},
{
"code": null,
"e": 2044,
"s": 1978,
"text": "p {\n color: hsl($hue: 0, $saturation: 50%, $lightness... |
Recursive fibonacci method in Java | The fibonacci series is a series in which each number is the sum of the previous two numbers. The number at a particular position in the fibonacci series can be obtained using a recursive method.
A program that demonstrates this is given as follows:
Live Demo
public class Demo {
public static long fib(long n) {
... | [
{
"code": null,
"e": 1258,
"s": 1062,
"text": "The fibonacci series is a series in which each number is the sum of the previous two numbers. The number at a particular position in the fibonacci series can be obtained using a recursive method."
},
{
"code": null,
"e": 1312,
"s": 1258,... |
What are intent-filters in Android? | An intent filter is an instance of the IntentFilter class. Intent filters are helpful while using implicit intents, It is not going to handle in java code, we have to set it up in AndroidManifest.xml. Android must know what kind of intent it is launching so intent filters give the information to android about intent an... | [
{
"code": null,
"e": 1393,
"s": 1062,
"text": "An intent filter is an instance of the IntentFilter class. Intent filters are helpful while using implicit intents, It is not going to handle in java code, we have to set it up in AndroidManifest.xml. Android must know what kind of intent it is launchin... |
JavaScript | Reverse a string in place. - GeeksforGeeks | 16 May, 2019
In order to reverse the string in its place, Weβre going to use a number of methods and the most preferred ones.Weβre going to use these methods(click to know more).
split()
reverse()
join()
substr()
Example-1: This example reverses the string by first splitting it with (ββ) separator and then reversing it... | [
{
"code": null,
"e": 24123,
"s": 24095,
"text": "\n16 May, 2019"
},
{
"code": null,
"e": 24289,
"s": 24123,
"text": "In order to reverse the string in its place, Weβre going to use a number of methods and the most preferred ones.Weβre going to use these methods(click to know more... |
The Holy Trinity of Topological Machine Learning: Gudhi, Scikit-Learn and Tensorflow | by Mathieu CarrieΜre | Towards Data Science | Hi everyone! Today, I would like to highlight the power of Topological Data Analysis in machine learning and demonstrate how to use it practically using a combination of three Python libraries: Gudhi, Scikit-Learn and Tensorflow.
First things first, letβs talk about Topological Data Analysis (TDA). Itβs a relatively sm... | [
{
"code": null,
"e": 402,
"s": 172,
"text": "Hi everyone! Today, I would like to highlight the power of Topological Data Analysis in machine learning and demonstrate how to use it practically using a combination of three Python libraries: Gudhi, Scikit-Learn and Tensorflow."
},
{
"code": nul... |
Receiver Operating Characteristic Curves Demystified (in Python) | by Syed Sadat Nazrul | Towards Data Science | In Data Science, evaluating model performance is very important and the most commonly used performance metric is the classification score. However, when dealing with fraud datasets with heavy class imbalance, a classification score does not make much sense. Instead, Receiver Operating Characteristic or ROC curves offer... | [
{
"code": null,
"e": 894,
"s": 172,
"text": "In Data Science, evaluating model performance is very important and the most commonly used performance metric is the classification score. However, when dealing with fraud datasets with heavy class imbalance, a classification score does not make much sens... |
How to convert from string to date data type in MongoDB? | To convert from String to date data type, you need to write some script. Let us first create a
collection with documents
>db.stringToDateDataTypeDemo.insertOne({"CustomerName":"Carol","ShippingDate":"2019-
01-21"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5ca2071d66324ffac2a7dc60")
}
>db.stringToDateDat... | [
{
"code": null,
"e": 1183,
"s": 1062,
"text": "To convert from String to date data type, you need to write some script. Let us first create a\ncollection with documents"
},
{
"code": null,
"e": 1721,
"s": 1183,
"text": ">db.stringToDateDataTypeDemo.insertOne({\"CustomerName\":\"C... |
Heap Sort | Practice | GeeksforGeeks | Given an array of size N. The task is to sort the array elements by completing functions heapify() and buildHeap() which are used to implement Heap Sort.
Example 1:
Input:
N = 5
arr[] = {4,1,3,9,7}
Output:
1 3 4 7 9
Explanation:
After sorting elements
using heap sort, elements will be
in order as 1,3,4,7,9.
Example 2... | [
{
"code": null,
"e": 392,
"s": 238,
"text": "Given an array of size N. The task is to sort the array elements by completing functions heapify() and buildHeap() which are used to implement Heap Sort."
},
{
"code": null,
"e": 404,
"s": 392,
"text": "\nExample 1:"
},
{
"code... |
C# How To Add Two Numbers | Learn how to add two numbers in C#:
int x = 5;
int y = 6;
int sum = x + y;
Console.WriteLine(sum); // Print the sum of x + y
Try it Yourself Β»
We just launchedW3Schools videos
Get certifiedby completinga course today!
If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an ... | [
{
"code": null,
"e": 36,
"s": 0,
"text": "Learn how to add two numbers in C#:"
},
{
"code": null,
"e": 126,
"s": 36,
"text": "int x = 5;\nint y = 6;\nint sum = x + y;\nConsole.WriteLine(sum); // Print the sum of x + y\n"
},
{
"code": null,
"e": 146,
"s": 126,
... |
How to get the full URL in ExpressJS ? - GeeksforGeeks | 12 Aug, 2021
URL stands for Uniform Resource Locator. It is used to locate some resources on the internet it can be thought of as a web address. The string you type on your browser search bar to get something from the internet is a URL, so in this process, the browser somehow finds the address of the server associated ... | [
{
"code": null,
"e": 24531,
"s": 24503,
"text": "\n12 Aug, 2021"
},
{
"code": null,
"e": 25174,
"s": 24531,
"text": "URL stands for Uniform Resource Locator. It is used to locate some resources on the internet it can be thought of as a web address. The string you type on your bro... |
3 Data structures | Practice | GeeksforGeeks | Given N operations. Each of type 1 or type 2 or type 3
Type 1: "1 x", insert number x in the priority queue (Greatest element on the top)
Type 2: "2 x", insert number x in the queue (First In First Out)
Type 3: "3 x", insert number x in the stack (First In Last Out)
The task is to print the elements in all three data ... | [
{
"code": null,
"e": 281,
"s": 226,
"text": "Given N operations. Each of type 1 or type 2 or type 3"
},
{
"code": null,
"e": 680,
"s": 281,
"text": "Type 1: \"1 x\", insert number x in the priority queue (Greatest element on the top)\nType 2: \"2 x\", insert number x in the queue... |
What is Git and Why is It So Important? | by Soner YΔ±ldΔ±rΔ±m | Towards Data Science | Linus Torvalds created the Linux operating system and he made it publicly available after a while. His initial purpose was to get comments and feedback about Linux from other people.
People started contributing to and getting involved with Linux. The contributions were not only in the form of code but also ideas and co... | [
{
"code": null,
"e": 355,
"s": 172,
"text": "Linus Torvalds created the Linux operating system and he made it publicly available after a while. His initial purpose was to get comments and feedback about Linux from other people."
},
{
"code": null,
"e": 572,
"s": 355,
"text": "Peo... |
Concept of indexing in Apache Cassandra - GeeksforGeeks | 11 Oct, 2019
Prerequisite β Introduction to Apache CassandraIndex:As we can access data using attributes which having the partition key. For Example, if Emp_id is a column name for Employee table and if it is partition key of that table then we can filter or search data with the help of partition key. In this case we c... | [
{
"code": null,
"e": 23683,
"s": 23655,
"text": "\n11 Oct, 2019"
},
{
"code": null,
"e": 24277,
"s": 23683,
"text": "Prerequisite β Introduction to Apache CassandraIndex:As we can access data using attributes which having the partition key. For Example, if Emp_id is a column name... |
Eroding an image using the OpenCV function erode() | In this program, we will erode an image using the OpenCV function erode(). Erosion of image means to shrink the image. If any of the pixels in a kernel is 0, then all the pixels in the kernel are set to 0. One condition before applying an erosion function on image is that the image should be a grayscale image.
Step 1: ... | [
{
"code": null,
"e": 1374,
"s": 1062,
"text": "In this program, we will erode an image using the OpenCV function erode(). Erosion of image means to shrink the image. If any of the pixels in a kernel is 0, then all the pixels in the kernel are set to 0. One condition before applying an erosion functi... |
How to Collect Data From The New York Times Over Any Period of Time | by Brienna Herold | Towards Data Science | Suppose we want to find out how discourse in The New York Times has evolved over a period of time. These days it would be neat to analyze this, since whenever we visit the front page we get firehosed with news about the coronavirus. How has the pandemic shaped the headlines of one of the most popular newspapers in the ... | [
{
"code": null,
"e": 506,
"s": 171,
"text": "Suppose we want to find out how discourse in The New York Times has evolved over a period of time. These days it would be neat to analyze this, since whenever we visit the front page we get firehosed with news about the coronavirus. How has the pandemic s... |
Minimum number of groups of nodes such that no ancestor is present in the same group - GeeksforGeeks | 07 Jun, 2021
Given a tree of N nodes. The task is to form the minimum number of groups of nodes such that every node belong to exactly one group, and none of its ancestors are in the same group. The parent of each node is given (-1 if a node does not have a parent).Examples:
Input: par[] = {-1, 1, 2, 1, 4} Output: 3 ... | [
{
"code": null,
"e": 24938,
"s": 24910,
"text": "\n07 Jun, 2021"
},
{
"code": null,
"e": 25203,
"s": 24938,
"text": "Given a tree of N nodes. The task is to form the minimum number of groups of nodes such that every node belong to exactly one group, and none of its ancestors are ... |
How to select first and last data row from a MySQL result? | You can select the first and last data row using MIN() and MAX(). The syntax is as follows β
SELECT *
FROM yourTableName
WHERE yourColumnName = (SELECT MIN(yourColumnName) FROM yourTableName)
UNION
SELECT *
FROM yourTableName
WHERE yourColumnName = (SELECT MAX(yourColumnName) FROM yourTableName) ;
To understand the abo... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "You can select the first and last data row using MIN() and MAX(). The syntax is as follows β"
},
{
"code": null,
"e": 1361,
"s": 1155,
"text": "SELECT *\nFROM yourTableName\nWHERE yourColumnName = (SELECT MIN(yourColumnName) FROM you... |
Next higher palindromic number using the same set of digits - GeeksforGeeks | 18 May, 2021
Given a palindromic number num having n number of digits. The problem is to find the smallest palindromic number greater than num using the same set of digits as in num. If no such number can be formed then print βNot Possibleβ. The number could be very large and may or may not even fit into long long int.... | [
{
"code": null,
"e": 25116,
"s": 25088,
"text": "\n18 May, 2021"
},
{
"code": null,
"e": 25424,
"s": 25116,
"text": "Given a palindromic number num having n number of digits. The problem is to find the smallest palindromic number greater than num using the same set of digits as i... |
Removing display of row names from dataframe in R - GeeksforGeeks | 16 May, 2021
The dataframe rows and columns are referenced using unique row and column names for the elements. The dataframe method has an attribute row.names that donβt make any modification to the existing structure of the dataframe, it just ignores the names assigned to rows. As a result, the first column consisting... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n16 May, 2021"
},
{
"code": null,
"e": 25750,
"s": 25242,
"text": "The dataframe rows and columns are referenced using unique row and column names for the elements. The dataframe method has an attribute row.names that donβt make a... |
The Complete Guide of SQL For Data Scientists | by Jun Wu | Towards Data Science | SQL used to rule in the land of Enterprise Data. Before the NoSQL movement, SQL was the main query language used to retrieve data from relational databases. According to a survey done by High Scalability asking IT leaders at DeveloperWeek about the trend for database usage in 2019, SQL is still used more than 60% of th... | [
{
"code": null,
"e": 717,
"s": 172,
"text": "SQL used to rule in the land of Enterprise Data. Before the NoSQL movement, SQL was the main query language used to retrieve data from relational databases. According to a survey done by High Scalability asking IT leaders at DeveloperWeek about the trend ... |
How to find the first 10 characters of a string in C#? | To get the first 10 characters, use the substring() method.
Letβs say the following is our string β
string str = "Cricket is a religion in India!";
Now to get the first 10 characters, set the value 10 in the substring() method as shown below β
string res = str.Substring(0, 10);
Let us see the complete code.
Live Demo
... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "To get the first 10 characters, use the substring() method."
},
{
"code": null,
"e": 1162,
"s": 1122,
"text": "Letβs say the following is our string β"
},
{
"code": null,
"e": 1210,
"s": 1162,
"text": "string str ... |
How to customize spines of Matplotlib figures? | When we plot a figure in Matplotlib, it creates four spines around the figure, top, left, bottom and right. Spines are nothing but a box surrounded with the pictorial representation of the grid which displays some ticks and tickable axes on left(y) and bottom(x).
Let us see how to customize the spines in a given figure... | [
{
"code": null,
"e": 1326,
"s": 1062,
"text": "When we plot a figure in Matplotlib, it creates four spines around the figure, top, left, bottom and right. Spines are nothing but a box surrounded with the pictorial representation of the grid which displays some ticks and tickable axes on left(y) and ... |
Understanding A* Path Algorithms and Implementation with Python | by Adem Akdogan | Towards Data Science | The A* algorithm is one of the most effective path finding algorithms used to find the shortest path between two points. It was first published in 1968 by Peter Hart, Nils Nilsson and Bertram Raphael [1]. Although it initially can be seen as an extension of Dijkstraβs algorithm, it has become one of the most frequently... | [
{
"code": null,
"e": 528,
"s": 172,
"text": "The A* algorithm is one of the most effective path finding algorithms used to find the shortest path between two points. It was first published in 1968 by Peter Hart, Nils Nilsson and Bertram Raphael [1]. Although it initially can be seen as an extension ... |
How to update the _id of a MongoDB Document? | You cannot update it but you can save a new id and remove the old id. Follow some steps in order to update the _id of a MongoDB. The steps are as follows:
Step1: In the first step, you need to store ObjectId into a variable.
anyVariableName=db.yourCollectionName.findOne({_id:yourObjectIdValue)});
Step 2: In the second ... | [
{
"code": null,
"e": 1217,
"s": 1062,
"text": "You cannot update it but you can save a new id and remove the old id. Follow some steps in order to update the _id of a MongoDB. The steps are as follows:"
},
{
"code": null,
"e": 1287,
"s": 1217,
"text": "Step1: In the first step, y... |
Check whether a given number is an ugly number or not - GeeksforGeeks | 03 Mar, 2021
Given an integer N, the task is to find out whether the given number is an Ugly number or not .
Ugly numbers are numbers whose only prime factors are 2, 3 or 5.
Examples:
Input: N = 14 Output: No Explanation: 14 is not ugly since it includes another prime factor 7.
Input: N = 6 Output: Yes Explanation: 6... | [
{
"code": null,
"e": 24717,
"s": 24689,
"text": "\n03 Mar, 2021"
},
{
"code": null,
"e": 24814,
"s": 24717,
"text": "Given an integer N, the task is to find out whether the given number is an Ugly number or not . "
},
{
"code": null,
"e": 24879,
"s": 24814,
"t... |
Matplotlib.axes.Axes.set_title() in Python - GeeksforGeeks | 19 Apr, 2020
Matplotlib is a library in Python and it is numerical β mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute.
The Axe... | [
{
"code": null,
"e": 24900,
"s": 24872,
"text": "\n19 Apr, 2020"
},
{
"code": null,
"e": 25200,
"s": 24900,
"text": "Matplotlib is a library in Python and it is numerical β mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, ... |
MomentJS - Week of year | This method will get/set the week of the year. The output will depend on the locale being used, as first day of week differs from country to country.
moment().week(Number);
moment().week();
moment().weeks(Number);
moment().weeks();
var m = moment().week();
var d = moment().week(50);
var a = moment().week(90);
Print
... | [
{
"code": null,
"e": 2110,
"s": 1960,
"text": "This method will get/set the week of the year. The output will depend on the locale being used, as first day of week differs from country to country."
},
{
"code": null,
"e": 2193,
"s": 2110,
"text": "moment().week(Number);\nmoment()... |
Collision Detection in PyGame - GeeksforGeeks | 18 Aug, 2021
Prerequisite: Introduction to pygame
Collision detection is a very often concept and used in almost games such as ping pong games, space invaders, etc. The simple and straight forward concept is to match up the coordinates of the two objects and set a condition for the happening of collision.
In this artic... | [
{
"code": null,
"e": 24423,
"s": 24395,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 24460,
"s": 24423,
"text": "Prerequisite: Introduction to pygame"
},
{
"code": null,
"e": 24717,
"s": 24460,
"text": "Collision detection is a very often concept and used ... |
Tokenize Text Columns Into Sentences in Pandas | by Baris Sari | Towards Data Science | In this tutorial, Iβm going to show you a few different options you may use for sentence tokenization. Iβm going to use one of my favourite TV showβs data: Seinfeld Chronicles (Donβt worry, I wonβt give you any spoilers :) We will be using the very first dialogues from S1E1). Itβs publicly available on Kaggle platform.... | [
{
"code": null,
"e": 613,
"s": 172,
"text": "In this tutorial, Iβm going to show you a few different options you may use for sentence tokenization. Iβm going to use one of my favourite TV showβs data: Seinfeld Chronicles (Donβt worry, I wonβt give you any spoilers :) We will be using the very first ... |
How to remove html tags from a string in JavaScript? | We can remove HTML/XML tags in a string using regular expressions in javascript. HTML elements such as span, div etc. are present between left and right arrows for instance <div>,<span> etc. So replacing the content within the arrows, along with the arrows, with nothing('') can make our task easy.
str.replace( /(<([^>]... | [
{
"code": null,
"e": 1361,
"s": 1062,
"text": "We can remove HTML/XML tags in a string using regular expressions in javascript. HTML elements such as span, div etc. are present between left and right arrows for instance <div>,<span> etc. So replacing the content within the arrows, along with the arr... |
Terraform 101 | by Shanika Perera | Towards Data Science | If youβre a DevOps engineer or someone that has to deal with DevOps-related work in your day-to-day work-life, Iβm certain that you have heard about the Infrastructure as Code (IaC) concept. Simply, IaC is something that has fallen right out from Heaven to lend a helping hand to everyday struggling DevOps engineers. Ia... | [
{
"code": null,
"e": 784,
"s": 47,
"text": "If youβre a DevOps engineer or someone that has to deal with DevOps-related work in your day-to-day work-life, Iβm certain that you have heard about the Infrastructure as Code (IaC) concept. Simply, IaC is something that has fallen right out from Heaven to... |
Blocking Methods in Java - GeeksforGeeks | 14 Sep, 2021
Blocking methods in java are the particular set of methods that block the thread until its operation is complete. So, they will have to block the current thread until the condition that fulfills their task is satisfied. Since, in nature, these methods are blocking so-called blocking methods. For example, t... | [
{
"code": null,
"e": 24007,
"s": 23979,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 24459,
"s": 24007,
"text": "Blocking methods in java are the particular set of methods that block the thread until its operation is complete. So, they will have to block the current thread un... |
YOLOv4 on Google Colab: Train your Custom Dataset (Traffic signs) with ease | by Quang Nguyen | Towards Data Science | Colab Notebook for training YOLOv4 with custom dataset (traffic signs)
Introduction
Why YOLOv4?
Data preparation
Training with Colab
Predict with YOLOv4
Conclusion
A while ago, I wrote a tutorial on training YOLOv3 with a custom dataset (gun detection) using the free GPU provided by Google Colab. After publishing the t... | [
{
"code": null,
"e": 243,
"s": 172,
"text": "Colab Notebook for training YOLOv4 with custom dataset (traffic signs)"
},
{
"code": null,
"e": 256,
"s": 243,
"text": "Introduction"
},
{
"code": null,
"e": 268,
"s": 256,
"text": "Why YOLOv4?"
},
{
"code":... |
How to match text at the start or end of a string in Python? | Assume you need to check the start or end of a string for a specific text patterns. The common patterns might be filename extensions but can also be anything. I will show you few methods on how you can do this.
A simple way to check the beginning of a string is by using startswith() method.
text = "Is USA colder than A... | [
{
"code": null,
"e": 1273,
"s": 1062,
"text": "Assume you need to check the start or end of a string for a specific text patterns. The common patterns might be filename extensions but can also be anything. I will show you few methods on how you can do this."
},
{
"code": null,
"e": 1354,... |
Convert List of Vectors to DataFrame in R - GeeksforGeeks | 09 May, 2021
In this article, we will discuss how to convert the given list of vectors to Dataframe using the help of different functions in the R Programming Language.
For all the methods discussed below, few functions are common because of their functionality. Let us discuss them first.
as.data.frame() is one of the ... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n09 May, 2021"
},
{
"code": null,
"e": 25398,
"s": 25242,
"text": "In this article, we will discuss how to convert the given list of vectors to Dataframe using the help of different functions in the R Programming Language."
},
... |
Using C codes in Python | Set 1 - GeeksforGeeks | 18 Mar, 2019
Prerequisite: How to Call a C function in Python
Letβs discuss the problem of accessing C code from Python. As it is very evident that many of Pythonβs built-in libraries are written in C. So, to access C is a very important part of making Python talk to existing libraries. There is an extensive C programm... | [
{
"code": null,
"e": 23839,
"s": 23811,
"text": "\n18 Mar, 2019"
},
{
"code": null,
"e": 23888,
"s": 23839,
"text": "Prerequisite: How to Call a C function in Python"
},
{
"code": null,
"e": 24220,
"s": 23888,
"text": "Letβs discuss the problem of accessing C ... |
Deleting a binary tree using the delete keyword in C++ program | In this tutorial, we are going to learn how to delete a binary tree using the delete keyword.
We are going to use a destructor member function to delete the binary. The destructor member function is invoked automatically when the object goes out of the scope or it is destroyed by calling delete.
The destructor member f... | [
{
"code": null,
"e": 1156,
"s": 1062,
"text": "In this tutorial, we are going to learn how to delete a binary tree using the delete keyword."
},
{
"code": null,
"e": 1359,
"s": 1156,
"text": "We are going to use a destructor member function to delete the binary. The destructor me... |
How to handle the ArithmeticException (unchecked) in Java?
| The java.lang.ArithmeticException is an unchecked exception in Java. Usually, one would come across java.lang.ArithmeticException: / by zero which occurs when an attempt is made to divide two numbers and the number in the denominator is zero. ArithmeticException objects may be constructed by the JVM.
Live Demo
public c... | [
{
"code": null,
"e": 1364,
"s": 1062,
"text": "The java.lang.ArithmeticException is an unchecked exception in Java. Usually, one would come across java.lang.ArithmeticException: / by zero which occurs when an attempt is made to divide two numbers and the number in the denominator is zero. Arithmetic... |
Difference between Linker and Loader - GeeksforGeeks | 14 Mar, 2022
In execution of the program, major role is played by two utility programs known as Linker and Loader.
1. Linker : A linker is special program that combines the object files, generated by compiler/assembler, and other pieces of codes to originate an executable file have. exe extension. In the object file, ... | [
{
"code": null,
"e": 24131,
"s": 24103,
"text": "\n14 Mar, 2022"
},
{
"code": null,
"e": 24234,
"s": 24131,
"text": "In execution of the program, major role is played by two utility programs known as Linker and Loader. "
},
{
"code": null,
"e": 24705,
"s": 24234,
... |
Creating array with repeated elements in Julia - repeat() Method - GeeksforGeeks | 26 Mar, 2020
The repeat() is an inbuilt function in julia which is used to construct an array by repeating the specified array elements with the specified number of times.
Syntax:repeat(A::AbstractArray, counts::Integer...)orrepeat(A::AbstractArray; inner, outer)orrepeat(s::AbstractString, r::Integer)orrepeat(c::Abstra... | [
{
"code": null,
"e": 24023,
"s": 23995,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 24182,
"s": 24023,
"text": "The repeat() is an inbuilt function in julia which is used to construct an array by repeating the specified array elements with the specified number of times."
}... |
Redis - Publish Subscribe | Redis Pub/Sub implements the messaging system where the senders (in redis terminology called publishers) sends the messages while the receivers (subscribers) receive them. The link by which the messages are transferred is called channel.
In Redis, a client can subscribe any number of channels.
Following example explain... | [
{
"code": null,
"e": 2283,
"s": 2045,
"text": "Redis Pub/Sub implements the messaging system where the senders (in redis terminology called publishers) sends the messages while the receivers (subscribers) receive them. The link by which the messages are transferred is called channel."
},
{
"... |
Solidity - Style Guide | Style Guide helps to maintain code layout consistent and make code more readable. Following are the best practices following while writing contracts with Solidity.
Indentation β Use 4 spaces instead of tab to maintain indentation level. Avoid mixing spaces with tabs.
Indentation β Use 4 spaces instead of tab to maintai... | [
{
"code": null,
"e": 2719,
"s": 2555,
"text": "Style Guide helps to maintain code layout consistent and make code more readable. Following are the best practices following while writing contracts with Solidity."
},
{
"code": null,
"e": 2823,
"s": 2719,
"text": "Indentation β Use ... |
Python 3 - os.open() Method | The method open() opens the file file and set various flags according to flags and possibly its mode according to mode.The default mode is 0777 (octal), and the current umask value is first masked out.
Following is the syntax for open() method β
os.open(file, flags[, mode]);
file β File name to be opened.
flags β The ... | [
{
"code": null,
"e": 2542,
"s": 2340,
"text": "The method open() opens the file file and set various flags according to flags and possibly its mode according to mode.The default mode is 0777 (octal), and the current umask value is first masked out."
},
{
"code": null,
"e": 2586,
"s":... |
Decision Tree Algorithm for Multiclass problems using Python | by Angel Das | Towards Data Science | Decision tree classifiers are supervised learning models that are useful when we care about interpretability. Think of it like, breaking down the data by making decisions based on multiple questions at each level. The biggest challenge with the decision tree involves understanding the back end algorithm using which a t... | [
{
"code": null,
"e": 884,
"s": 172,
"text": "Decision tree classifiers are supervised learning models that are useful when we care about interpretability. Think of it like, breaking down the data by making decisions based on multiple questions at each level. The biggest challenge with the decision t... |
How MySQL use YEAR data type to store year value in a table? | MySQL permits to declare a column YEAR type, with the help of which we can store year values in that column.
mysql> Create table year1 (Year_Copyright YEAR);
Query OK, 0 rows affected (0.21 sec)
mysql> Insert into year1(Year_Copyright) values (2017);
Query OK, 1 row affected (0.08 sec)
mysql> Select * from year1;
+--... | [
{
"code": null,
"e": 1171,
"s": 1062,
"text": "MySQL permits to declare a column YEAR type, with the help of which we can store year values in that column."
},
{
"code": null,
"e": 1498,
"s": 1171,
"text": "mysql> Create table year1 (Year_Copyright YEAR);\nQuery OK, 0 rows affect... |
Installing TensorFlow on the M1 Mac | by Wei-Meng Lee | Towards Data Science | If you are a Mac user, you probably have one of the latest machines running Apple Silicon. To utilize Appleβs ML Compute framework for native hardware acceleration on M1 Macs, you need to install Appleβs hardware-accelerated TensorFlow and TensorFlow Addons for macOS 11.0+.
This article will show how how to prepare you... | [
{
"code": null,
"e": 447,
"s": 172,
"text": "If you are a Mac user, you probably have one of the latest machines running Apple Silicon. To utilize Appleβs ML Compute framework for native hardware acceleration on M1 Macs, you need to install Appleβs hardware-accelerated TensorFlow and TensorFlow Addo... |
NumPy - Indexing & Slicing | Contents of ndarray object can be accessed and modified by indexing or slicing, just like Python's in-built container objects.
As mentioned earlier, items in ndarray object follows zero-based index. Three types of indexing methods are available β field access, basic slicing and advanced indexing.
Basic slicing is an ex... | [
{
"code": null,
"e": 2370,
"s": 2243,
"text": "Contents of ndarray object can be accessed and modified by indexing or slicing, just like Python's in-built container objects."
},
{
"code": null,
"e": 2541,
"s": 2370,
"text": "As mentioned earlier, items in ndarray object follows z... |
GATE | GATE CS 2012 | Question 41 - GeeksforGeeks | 28 Jun, 2021
Suppose (A, B) and (C,D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in r2. If data in r1 and r2 satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
(A) A(B) B(C) C(D) DAnswer: (A)Explanation: See Questio... | [
{
"code": null,
"e": 25621,
"s": 25593,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25873,
"s": 25621,
"text": "Suppose (A, B) and (C,D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in r2. If data in r1 ... |
Image Enhancement in PIL - GeeksforGeeks | 04 May, 2022
The Python Imaging Library(PIL) adds powerful image processing capabilities. It provides immense file format support, an efficient representation, and fairly powerful image processing capabilities. The core image library is intended for fast access to data stored in very few basic pixel formats. It provide... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n04 May, 2022"
},
{
"code": null,
"e": 25919,
"s": 25555,
"text": "The Python Imaging Library(PIL) adds powerful image processing capabilities. It provides immense file format support, an efficient representation, and fairly power... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.