title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Docker host network vs bridge network
There are two types of single−host networks available for Docker Networking - “host” and “bridge” networks. Single−host networks mean that their effect is local to each individual host. In case of a host network, a particular Docker Container can directly use the Networking of the host for sending and receiving the pac...
[ { "code": null, "e": 1248, "s": 1062, "text": "There are two types of single−host networks available for Docker Networking - “host” and “bridge” networks. Single−host networks mean that their effect is local to each individual host." }, { "code": null, "e": 1462, "s": 1248, "text...
How to Install Yarn in MacOs/Ubuntu/Windows? - GeeksforGeeks
05 Oct, 2021 Prerequisite: Difference between npm and yarn Yarn in layman’s term is a package manager that can be used in your code or a project that is currently being built, what yarn does is it helps to share the code with fellow mates or within a community of developers, and they can even run the project that we ar...
[ { "code": null, "e": 24561, "s": 24533, "text": "\n05 Oct, 2021" }, { "code": null, "e": 24607, "s": 24561, "text": "Prerequisite: Difference between npm and yarn" }, { "code": null, "e": 24894, "s": 24607, "text": "Yarn in layman’s term is a package manager t...
C library function - isalpha()
The C library function int isalpha(int c) checks if the passed character is alphabetic. Following is the declaration for isalpha() function. int isalpha(int c); c − This is the character to be checked. c − This is the character to be checked. This function returns non-zero value if c is an alphabet, else it returns 0. ...
[ { "code": null, "e": 2095, "s": 2007, "text": "The C library function int isalpha(int c) checks if the passed character is alphabetic." }, { "code": null, "e": 2148, "s": 2095, "text": "Following is the declaration for isalpha() function." }, { "code": null, "e": 2168...
Variables in Scala
31 Oct, 2021 Variables are simply storage locations. Every variable is known by its name and stores some known and unknown piece of information known as value. So one can define a variable by its data type and name, a data type is responsible for allocating memory for the variable. In Scala there are two types of varia...
[ { "code": null, "e": 53, "s": 25, "text": "\n31 Oct, 2021" }, { "code": null, "e": 367, "s": 53, "text": "Variables are simply storage locations. Every variable is known by its name and stores some known and unknown piece of information known as value. So one can define a variabl...
sys.path in Python
01 Oct, 2020 Sys is a built-in Python module that contains parameters specific to the system i.e. it contains variables and methods that interact with the interpreter and are also governed by it. sys.path is a built-in variable within the sys module. It contains a list of directories that the interpreter will search i...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Oct, 2020" }, { "code": null, "e": 236, "s": 52, "text": "Sys is a built-in Python module that contains parameters specific to the system i.e. it contains variables and methods that interact with the interpreter and are also governe...
Matplotlib.pyplot.colors() in Python
03 May, 2020 In Python we can plot graphs for visualization using Matplotlib library. For integrating plots into applications, Matplotlib provides an API. Matplotlib has a module named pyplot which provides a MATLAB-like interface. This function is used to specify the color. It is do-nothing function. We can use this f...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 May, 2020" }, { "code": null, "e": 247, "s": 28, "text": "In Python we can plot graphs for visualization using Matplotlib library. For integrating plots into applications, Matplotlib provides an API. Matplotlib has a module named pyp...
Map.Entry interface in Java with example
28 Sep, 2021 Map.Entry interface in Java provides certain methods to access the entry in the Map. By gaining access to the entry of the Map we can easily manipulate them. Map.Entry is a generic and is defined in the java.util package. Declaration : Interface Map.Entry k -> Key V -> Value Methods: equals (Object o) – It...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Sep, 2021" }, { "code": null, "e": 274, "s": 52, "text": "Map.Entry interface in Java provides certain methods to access the entry in the Map. By gaining access to the entry of the Map we can easily manipulate them. Map.Entry is a g...
Node.js fs.chmod() Method
08 Oct, 2021 The fs.chmod() method is used to change the permissions of a given path. These permissions can be specified using string constants or octal numbers that correspond to their respective file modes. Note: The Windows platform only supports the changing of the write permission. It also does not support the dis...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Oct, 2021" }, { "code": null, "e": 224, "s": 28, "text": "The fs.chmod() method is used to change the permissions of a given path. These permissions can be specified using string constants or octal numbers that correspond to their re...
Flutter – Creating Dialog in using GetX Library
14 May, 2021 When we want to show anything in the form of the dialog then we can create this Dialog using the GetX library in Flutter. When we normally create a dialog in flutter then it uses context and builder to create a Dialog. This is not a good practice for a developer to create Dialogs using contexts and builder...
[ { "code": null, "e": 54, "s": 26, "text": "\n14 May, 2021" }, { "code": null, "e": 527, "s": 54, "text": "When we want to show anything in the form of the dialog then we can create this Dialog using the GetX library in Flutter. When we normally create a dialog in flutter then it ...
C/C++ Tokens
03 Feb, 2022 A token is the smallest element of a program that is meaningful to the compiler. Tokens can be classified as follows: KeywordsIdentifiersConstantsStringsSpecial SymbolsOperators Keywords Identifiers Constants Strings Special Symbols Operators 1.Keywords: Keywords are pre-defined or reserved words in a pr...
[ { "code": null, "e": 53, "s": 25, "text": "\n03 Feb, 2022" }, { "code": null, "e": 173, "s": 53, "text": "A token is the smallest element of a program that is meaningful to the compiler. Tokens can be classified as follows: " }, { "code": null, "e": 233, "s": 173...
Difference between wait and sleep in Java
16 Jun, 2021 Sleep(): This Method is used to pause the execution of current thread for a specified time in Milliseconds. Here, Thread does not lose its ownership of the monitor and resume’s it’s execution Wait(): This method is defined in object class. It tells the calling thread (a.k.a Current Thread) to wait until an...
[ { "code": null, "e": 52, "s": 24, "text": "\n16 Jun, 2021" }, { "code": null, "e": 244, "s": 52, "text": "Sleep(): This Method is used to pause the execution of current thread for a specified time in Milliseconds. Here, Thread does not lose its ownership of the monitor and resume...
Remove shadow of an element in Bootstrap 4
Use the .shadow-none class in Bootstrap to remove shadow. You can try to run the following code to remove an element’s shadow − Live Demo <!DOCTYPE html> <html lang = "en"> <head> <title>Bootstrap Example</title> <meta charset = "utf-8"> <meta name = "viewport" content="width = device-width, initia...
[ { "code": null, "e": 1120, "s": 1062, "text": "Use the .shadow-none class in Bootstrap to remove shadow." }, { "code": null, "e": 1190, "s": 1120, "text": "You can try to run the following code to remove an element’s shadow −" }, { "code": null, "e": 1200, "s": 11...
Create temporary file in specified directory in Java
A temporary file in the specified directory can be created using the method java.io.File.createTempFile(). This method requires three parameters i.e. the prefix to define the file name, the suffix to define the file extension and the directory in which the temporary file is to be created. It also returns the abstract p...
[ { "code": null, "e": 1423, "s": 1062, "text": "A temporary file in the specified directory can be created using the method java.io.File.createTempFile(). This method requires three parameters i.e. the prefix to define the file name, the suffix to define the file extension and the directory in which ...
Get PID of Browser launched by Selenium.
We can PID of browsers launched by Selenium webdriver. First of all, we have to create an object of the webdriver. Next, for example, to launch the browser in the Firefox browser, we have to take the help of webdriver.Firefox() class. The location of the geckodriver.exe file is passed as a parameter to that class. This...
[ { "code": null, "e": 1297, "s": 1062, "text": "We can PID of browsers launched by Selenium webdriver. First of all, we have to create an object of the webdriver. Next, for example, to launch the browser in the Firefox browser, we have to take the help of webdriver.Firefox() class." }, { "cod...
C/C++ Program for Median of two sorted arrays of same size?
Here we will see how to get the median of two sorted array of the same size. We will use C++ STL to store array elements. After getting two arrays, we will merge them into one. As two arrays of same size are merged, then the final array will always hold even number of elements. We need to take two middle elements, then...
[ { "code": null, "e": 1423, "s": 1062, "text": "Here we will see how to get the median of two sorted array of the same size. We will use C++ STL to store array elements. After getting two arrays, we will merge them into one. As two arrays of same size are merged, then the final array will always hold...
k-th smallest element in BST | Practice | GeeksforGeeks
Given a BST and an integer K. Find the Kth Smallest element in the BST. Example 1: Input: 2 / \ 1 3 K = 2 Output: 2 Example 2: Input: 2 / \ 1 3 K = 5 Output: -1 Your Task: You don't need to read input or print anything. Your task is to complete the function KthSmallestEleme...
[ { "code": null, "e": 311, "s": 238, "text": "Given a BST and an integer K. Find the Kth Smallest element in the BST. " }, { "code": null, "e": 322, "s": 311, "text": "Example 1:" }, { "code": null, "e": 375, "s": 322, "text": "Input:\n 2\n / \\\n 1...
Viruses - From Newbie to pro - GeeksforGeeks
25 Nov, 2020 NOTE: Using an online compiler is not going to work here. Please install Python 2.7x and cv2, argparse modules to actually try out this example. Heya friends! Welcome back! Before continuing on with Malicious Logic, I request you to have a look at this great and informative article Worms, Viruses and Beyon...
[ { "code": null, "e": 24576, "s": 24548, "text": "\n25 Nov, 2020" }, { "code": null, "e": 24721, "s": 24576, "text": "NOTE: Using an online compiler is not going to work here. Please install Python 2.7x and cv2, argparse modules to actually try out this example." }, { "cod...
Number.longValue() method in java with examples - GeeksforGeeks
20 Jun, 2018 The java.lang.Number.longValue() is an inbuilt method in java that returns the value of the specified number casted to long data type. This may involve rounding or truncation. Syntax: public abstract long longValue() Parameters: This method does not accepts any parameter. Return value: This method returns...
[ { "code": null, "e": 23557, "s": 23529, "text": "\n20 Jun, 2018" }, { "code": null, "e": 23733, "s": 23557, "text": "The java.lang.Number.longValue() is an inbuilt method in java that returns the value of the specified number casted to long data type. This may involve rounding or...
map operator= in C++ STL - GeeksforGeeks
12 Jul, 2018 The map::operator= is a built function in C++ STL which assigns contents of a container to a different container, replacing its current content. Syntax: map1_name = map2_name Parameters: The map on the left is the container in which the map on the right is to be assigned by destroying the elements of map1....
[ { "code": null, "e": 24126, "s": 24098, "text": "\n12 Jul, 2018" }, { "code": null, "e": 24271, "s": 24126, "text": "The map::operator= is a built function in C++ STL which assigns contents of a container to a different container, replacing its current content." }, { "cod...
How to Create a Dot loading Animation using HTML and CSS? - GeeksforGeeks
14 Aug, 2020 The Dot Loading animation can be used to enhance the user interface of a website, it can be added while the website loads. This animation can be easily created using HTML and CSS. HTML Code: In this section we will create the basic structure of the dot loader using a div tag which will have some span tags ...
[ { "code": null, "e": 24985, "s": 24957, "text": "\n14 Aug, 2020" }, { "code": null, "e": 25165, "s": 24985, "text": "The Dot Loading animation can be used to enhance the user interface of a website, it can be added while the website loads. This animation can be easily created usi...
How to Create a Multi-line Text Input (Text Area) In HTML?
To create a multi-line text input, use the HTML <textarea> tag. You can set the size of a text area using the cols and rows attributes. It is used within a form, to allow users to input text over multiple rows. Here are the attributes of <textarea> tag − You can try to run the following code to create a multi-line text...
[ { "code": null, "e": 1273, "s": 1062, "text": "To create a multi-line text input, use the HTML <textarea> tag. You can set the size of a text area using the cols and rows attributes. It is used within a form, to allow users to input text over multiple rows." }, { "code": null, "e": 1317,...
Objective-C Overview
Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems as well as its applications. Initially, Objective-C was developed ...
[ { "code": null, "e": 2843, "s": 2560, "text": "Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems...
Python - Exceptions Handling
Python provides two very important features to handle any unexpected error in your Python programs and to add debugging capabilities in them − Exception Handling − This would be covered in this tutorial. Here is a list standard Exceptions available in Python: Standard Exceptions. Exception Handling − This would be cove...
[ { "code": null, "e": 2387, "s": 2244, "text": "Python provides two very important features to handle any unexpected error in your Python programs and to add debugging capabilities in them −" }, { "code": null, "e": 2525, "s": 2387, "text": "Exception Handling − This would be cove...
4 Amazing Python Libraries That You Should Try Right Now | by Ismael Araujo | Towards Data Science
I’m a big fan of Python libraries, and I really enjoy them. In fact, some of my most popular blogs are about Python libraries. They have the power to turn hours of work and countless lines of code into two or three, and the best part: they are free. However, most people focus on those most popular libraries and ignore ...
[ { "code": null, "e": 761, "s": 171, "text": "I’m a big fan of Python libraries, and I really enjoy them. In fact, some of my most popular blogs are about Python libraries. They have the power to turn hours of work and countless lines of code into two or three, and the best part: they are free. Howev...
How to assign column names based on existing row in R DataFrame ? - GeeksforGeeks
30 Apr, 2021 In this article, we will discuss how assign column names or headers to a DataFrame based on rows in R Programming Language. unlist() method in R is used to simulate the conversion of a list to vector. It simplifies to produce a vector by preserving all components. Every element is the same as each of the v...
[ { "code": null, "e": 25242, "s": 25214, "text": "\n30 Apr, 2021" }, { "code": null, "e": 25366, "s": 25242, "text": "In this article, we will discuss how assign column names or headers to a DataFrame based on rows in R Programming Language." }, { "code": null, "e": 25...
React ES6 Destructuring
To illustrate destructuring, we'll make a sandwich. Do you take everything out of the refrigerator to make your sandwich? No, you only take out the items you would like to use on your sandwich. Destructuring is exactly the same. We may have an array or object that we are working with, but we only need some of the items...
[ { "code": null, "e": 194, "s": 0, "text": "To illustrate destructuring, we'll make a sandwich. Do you take everything out of the refrigerator to make your sandwich? No, you only take out the items you would like to use on your sandwich." }, { "code": null, "e": 341, "s": 194, "te...
How to handle MalformedURLException in java?
While working with client-server programming in Java (JSE), if you are using java.net.URL class object in your program, you need to instantiate this class by passing a string representing required URL to which you need to establish connection. If the url you have passed in the string which cannot be parsed or, without ...
[ { "code": null, "e": 1435, "s": 1062, "text": "While working with client-server programming in Java (JSE), if you are using java.net.URL class object in your program, you need to instantiate this class by passing a string representing required URL to which you need to establish connection. If the ur...
GATE | GATE-CS-2016 (Set 2) | Question 47 - GeeksforGeeks
12 Aug, 2021 Consider the following program: int f(int *p, int n){ if (n <= 1) return 0; else return max(f(p+1,n-1),p[0]-p[1]);}int main(){ int a[] = {3,5,2,6,4}; printf("%d", f(a,5));} Note: max(x,y) returns the maximum of x and y. The value printed by this program is (A) 2(B) 3(C) 4(D) 5Answer: (B)Explana...
[ { "code": null, "e": 24269, "s": 24241, "text": "\n12 Aug, 2021" }, { "code": null, "e": 24301, "s": 24269, "text": "Consider the following program:" }, { "code": "int f(int *p, int n){ if (n <= 1) return 0; else return max(f(p+1,n-1),p[0]-p[1]);}int main(){ int ...
Small World Model - Using Python Networkx - GeeksforGeeks
14 Jan, 2020 In this article, we will learn how to create a Small World Network using Networx module in Python. Before proceeding that let’s first understand some basics about Small World Phenomenon. What is Small World Phenomenon ?Small World Phenomenon is the study and notion that we are all connected via a small num...
[ { "code": null, "e": 24947, "s": 24919, "text": "\n14 Jan, 2020" }, { "code": null, "e": 25134, "s": 24947, "text": "In this article, we will learn how to create a Small World Network using Networx module in Python. Before proceeding that let’s first understand some basics about ...
Bitonic Travelling Salesman Problem - GeeksforGeeks
13 Jul, 2021 Given a 2D array, arr[][] denoting a list of coordinates of N vertices on 2D space that is already sorted by x-coordinates and y-coordinates, the task is to find the minimum distance of a tour that starts from the leftmost vertex, and strictly goes to the right, and then upon reaching the rightmost vertex,...
[ { "code": null, "e": 26041, "s": 26013, "text": "\n13 Jul, 2021" }, { "code": null, "e": 26421, "s": 26041, "text": "Given a 2D array, arr[][] denoting a list of coordinates of N vertices on 2D space that is already sorted by x-coordinates and y-coordinates, the task is to find t...
Scala Map toList() method with example - GeeksforGeeks
26 Jul, 2019 The toList() method is utilized to display the elements of the map in the list. Method Definition: def toList: List[A] Return Type: It returns all the elements of the map in the list. Example #1: // Scala program of toList()// method // Creating objectobject GfG{ // Main method def main(args:Arra...
[ { "code": null, "e": 25333, "s": 25305, "text": "\n26 Jul, 2019" }, { "code": null, "e": 25413, "s": 25333, "text": "The toList() method is utilized to display the elements of the map in the list." }, { "code": null, "e": 25452, "s": 25413, "text": "Method Def...
C++ Program to Check Whether a Hamiltonian Cycle or Path Exists in a Given Graph
A Hamiltonian cycle is a Hamiltonian Path such that there is an edge (in graph) from the last vertex to the first vertex of the Hamiltonian Path. It is in an undirected graph is a path that visits each vertex of the graph exactly once. Begin 1.function isSafe() is used to check for whether it is adjacent to the prev...
[ { "code": null, "e": 1298, "s": 1062, "text": "A Hamiltonian cycle is a Hamiltonian Path such that there is an edge (in graph) from the last vertex to the first vertex of the Hamiltonian Path. It is in an undirected graph is a path that visits each vertex of the graph exactly once." }, { "co...
How to create a User Menu in PowerShell?
When you are writing a script and if you want to provide the user to select one option among multiple values and based on it to execute the command, we can generally use the Switch command and for it, we will ask the user choice in the below script. There is another .Net method to create a user menu, we will see it aft...
[ { "code": null, "e": 1312, "s": 1062, "text": "When you are writing a script and if you want to provide the user to select one option among multiple values and based on it to execute the command, we can generally use the Switch command and for it, we will ask the user choice in the below script." ...
Legal and illegal declaration and initializations in C
Mention some of the legal and illegal declarations and initializations while doing C programming? Before discussing the legal and illegal statements let’s see how to declare and initialize the variables in C. Following is the syntax of variable declaration − Datatype v1,v2,... vn; Where v1, v2,...vn are names of the va...
[ { "code": null, "e": 1160, "s": 1062, "text": "Mention some of the legal and illegal declarations and initializations while doing C programming?" }, { "code": null, "e": 1271, "s": 1160, "text": "Before discussing the legal and illegal statements let’s see how to declare and init...
Sum of fifth powers of the first n natural numbers
26 Mar, 2021 Write a program to find the sum of Fifth powers of the first n natural numbers 15 + 25+ 35 + 45+ .......+ n5 till n-th term. Examples: Input : 4 Output : 1300 15 + 25 + 35 + 45 = 1300 Input : 6 Output : 15 + 25 + 35 + 45 + 52 + 65 Naive Approach :- In this Simple finding the fifth powers of the ...
[ { "code": null, "e": 53, "s": 25, "text": "\n26 Mar, 2021" }, { "code": null, "e": 190, "s": 53, "text": "Write a program to find the sum of Fifth powers of the first n natural numbers 15 + 25+ 35 + 45+ .......+ n5 till n-th term. Examples: " }, { "code": null, "e": ...
Sync your fork with master in GitHub
12 Jun, 2020 GitHub is a major platform for open source contributions and also an amazing way to gain knowledge contributing to others projects. One learns about the latest modules used, different coding styles and also get in touch with various developers around the world and build the community. While using GitHub an...
[ { "code": null, "e": 28, "s": 0, "text": "\n12 Jun, 2020" }, { "code": null, "e": 314, "s": 28, "text": "GitHub is a major platform for open source contributions and also an amazing way to gain knowledge contributing to others projects. One learns about the latest modules used, d...
Finding Minimum of Two Numbers in Golang
13 Apr, 2020 Go language provides inbuilt support for basic constants and mathematical functions to perform operations on the numbers with the help of the math package. You can find the smallest number among the given two numbers with the help of Min() function provided by the math package. So, you need to add a math p...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Apr, 2020" }, { "code": null, "e": 424, "s": 28, "text": "Go language provides inbuilt support for basic constants and mathematical functions to perform operations on the numbers with the help of the math package. You can find the sm...
Python | Grouping dictionary keys by value
20 Aug, 2020 While performing computations over dictionary, we can come across a problem in which we might have to perform the task of grouping keys according to value, i.e create a list of keys, it is value of. This can other in cases of organising data in case of machine learning. Let’s discuss certain way in which t...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Aug, 2020" }, { "code": null, "e": 641, "s": 28, "text": "While performing computations over dictionary, we can come across a problem in which we might have to perform the task of grouping keys according to value, i.e create a list o...
Implementation of Access Matrix in Distributed OS
08 Jan, 2020 As earlier discussed access matrix is likely to be very sparse and takes up a large chunk of memory. Therefore direct implementation of access matrix for access control is storage inefficient. The inefficiency can be removed by decomposing the access matrix into rows or columns.Rows can be collapsed by del...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Jan, 2020" }, { "code": null, "e": 221, "s": 28, "text": "As earlier discussed access matrix is likely to be very sparse and takes up a large chunk of memory. Therefore direct implementation of access matrix for access control is sto...
File mkdirs() method in Java with examples
28 Jan, 2019 The mkdirs() method is a part of File class. The mkdirs() function is used to create a new directory denoted by the abstract pathname and also all the non existent parent directories of the abstract pathname. If the mkdirs() function fails to create some directory it might have created some of its parent d...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jan, 2019" }, { "code": null, "e": 417, "s": 28, "text": "The mkdirs() method is a part of File class. The mkdirs() function is used to create a new directory denoted by the abstract pathname and also all the non existent parent dire...
Even numbers at even index and odd numbers at odd index
31 May, 2022 Given an array of size n containing equal number of odd and even numbers. The problem is to arrange the numbers in such a way that all the even numbers get the even index and odd numbers get the odd index. Required auxiliary space is O(1).Examples : Input : arr[] = {3, 6, 12, 1, 5, 8} Output : 6 3 12 1 8...
[ { "code": null, "e": 52, "s": 24, "text": "\n31 May, 2022" }, { "code": null, "e": 304, "s": 52, "text": "Given an array of size n containing equal number of odd and even numbers. The problem is to arrange the numbers in such a way that all the even numbers get the even index and...
How to create admin login page using PHP?
30 May, 2022 In this article, we will see how we can create a login page for admin, connected with the database, or whose information to log in to the page is already stored in our database. Follow the steps to create an admin login page using PHP: Approach: Make sure you have XAMPP or WAMP installed on your windows ...
[ { "code": null, "e": 54, "s": 26, "text": "\n30 May, 2022" }, { "code": null, "e": 233, "s": 54, "text": "In this article, we will see how we can create a login page for admin, connected with the database, or whose information to log in to the page is already stored in our databa...
Handling TypeError Exception in Python
20 Aug, 2020 TypeError is one among the several standard Python exceptions. TypeError is raised whenever an operation is performed on an incorrect/unsupported object type. For example, using the + (addition) operator on a string and an integer value will raise TypeError. The general causes for TypeError being raised ar...
[ { "code": null, "e": 28, "s": 0, "text": "\n20 Aug, 2020" }, { "code": null, "e": 287, "s": 28, "text": "TypeError is one among the several standard Python exceptions. TypeError is raised whenever an operation is performed on an incorrect/unsupported object type. For example, usi...
How to extract the host name from URL using JavaScript ?
15 Apr, 2020 To extract the hostname portion from a URL, we can use the location object that represents information about the current URL. It is the element of the window object and a client-side object. Syntax: window.location.propertyname Example 1: In this example, we will use the self URL, where the code will run t...
[ { "code": null, "e": 28, "s": 0, "text": "\n15 Apr, 2020" }, { "code": null, "e": 219, "s": 28, "text": "To extract the hostname portion from a URL, we can use the location object that represents information about the current URL. It is the element of the window object and a clie...
Python | Remove None values from list
03 Jan, 2019 Due to the upcoming of Machine Learning, the focus has now moved on handling the None values than ever before, the reason behind this is that it is the essential step of data preprocessing before it is fed into further techniques to perform. Hence, removal of None values in essential and knowledge of it is...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Jan, 2019" }, { "code": null, "e": 398, "s": 28, "text": "Due to the upcoming of Machine Learning, the focus has now moved on handling the None values than ever before, the reason behind this is that it is the essential step of data ...
Program for FCFS CPU Scheduling | Set 2 (Processes with different arrival times)
14 Dec, 2021 We have already discussed FCFS Scheduling of processes with same arrival time. In this post, scenarios, when processes have different arrival times, are discussed. Given n processes with their burst times and arrival times, the task is to find average waiting time and an average turn around time using FCFS...
[ { "code": null, "e": 52, "s": 24, "text": "\n14 Dec, 2021" }, { "code": null, "e": 588, "s": 52, "text": "We have already discussed FCFS Scheduling of processes with same arrival time. In this post, scenarios, when processes have different arrival times, are discussed. Given n pr...
Read, Write and Parse JSON using Python
18 Aug, 2021 JSON is a lightweight data format for data interchange which can be easily read and written by humans, easily parsed and generated by machines. It is a complete language-independent text format. To work with JSON data, Python has a built-in package called json. Example: s = '{"id":01, "name": "Emily", "la...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 Aug, 2021" }, { "code": null, "e": 315, "s": 52, "text": "JSON is a lightweight data format for data interchange which can be easily read and written by humans, easily parsed and generated by machines. It is a complete language-inde...
Find Kth largest element from right of every element in the array - GeeksforGeeks
16 Mar, 2022 Given an array arr[] of size N and an integer K. The task is to find the Kth largest element from the right of every element in the array. If there are not enough elements to the right then print the same element. Examples: Input: N = 6, K = 3, arr[] = {4, 5, 3, 6, 7, 2}Output: 5 3 2 6 7 2Explanation: The ...
[ { "code": null, "e": 27657, "s": 27629, "text": "\n16 Mar, 2022" }, { "code": null, "e": 27871, "s": 27657, "text": "Given an array arr[] of size N and an integer K. The task is to find the Kth largest element from the right of every element in the array. If there are not enough ...
Header Guard in C++ - GeeksforGeeks
02 Nov, 2020 Header Guards in C++ are conditional compilation directives that help to avoid errors that arise when the same function or variable is defined more than once by the mistake of a programmer. According to C++, when a function or a variable is defined more than once, it yields an error. Below is the program t...
[ { "code": null, "e": 25369, "s": 25341, "text": "\n02 Nov, 2020" }, { "code": null, "e": 25699, "s": 25369, "text": "Header Guards in C++ are conditional compilation directives that help to avoid errors that arise when the same function or variable is defined more than once by th...
Deep Learning with PyTorch | An Introduction - GeeksforGeeks
07 Feb, 2019 PyTorch in a lot of ways behaves like the arrays we love from Numpy. These Numpy arrays, after all, are just tensors. PyTorch takes these tensors and makes it simple to move them to GPUs for the faster processing needed when training neural networks. It also provides a module that automatically calculates ...
[ { "code": null, "e": 25543, "s": 25515, "text": "\n07 Feb, 2019" }, { "code": null, "e": 26071, "s": 25543, "text": "PyTorch in a lot of ways behaves like the arrays we love from Numpy. These Numpy arrays, after all, are just tensors. PyTorch takes these tensors and makes it simp...
How to retrieve the contents of a ResultSet from last to first in JDBC?
Certain SQL queries (especially SELECT) returns tabular data, In JDBC the object of the java.sql.ResultSet interface holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general). The ResultSet object has a cursor/point...
[ { "code": null, "e": 1343, "s": 1062, "text": "Certain SQL queries (especially SELECT) returns tabular data, In JDBC the object of the java.sql.ResultSet interface holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the State...
Android Annotation Processing - GeeksforGeeks
23 Jul, 2021 You’ve undoubtedly seen a lot of annotations as an Android developer: They’re those strange code components that begin with @ and sometimes have parameters connected to them. Annotations link metadata to other code components, allowing you to include extra information in your code. Annotations may be used ...
[ { "code": null, "e": 26491, "s": 26463, "text": "\n23 Jul, 2021" }, { "code": null, "e": 26881, "s": 26491, "text": "You’ve undoubtedly seen a lot of annotations as an Android developer: They’re those strange code components that begin with @ and sometimes have parameters connect...
How to append HTML code to a div using JavaScript ? - GeeksforGeeks
20 Jul, 2021 There are two ways to append HTML code to a div through JavaScript Using the innerHTML attribute Using the insertAdjacentHTML() method Using the innerHTML attribute:To append using the innerHTML attribute, first select the element (div) where you want to append the code. Then, add the code enclosed as stri...
[ { "code": null, "e": 26440, "s": 26412, "text": "\n20 Jul, 2021" }, { "code": null, "e": 26507, "s": 26440, "text": "There are two ways to append HTML code to a div through JavaScript" }, { "code": null, "e": 26537, "s": 26507, "text": "Using the innerHTML att...
How can I encode a URL in Android?
This example demonstrates how do I can encode a URL 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 − Add the following code to res/layout/activity_main.xml. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:a...
[ { "code": null, "e": 1126, "s": 1062, "text": "This example demonstrates how do I can encode a URL in android." }, { "code": null, "e": 1255, "s": 1126, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a ne...
numpy.iscomplex() in Python - GeeksforGeeks
28 Mar, 2022 The numpy.iscomplex() function tests element-wise whether it is a complex number or not(not infinity or not Not a Number) and returns the result as a boolean array. Syntax : numpy.iscomplex(array) Parameters : array : [array_like] Input array whose element we want to test Return : boolean array containi...
[ { "code": null, "e": 25665, "s": 25637, "text": "\n28 Mar, 2022" }, { "code": null, "e": 25840, "s": 25665, "text": "The numpy.iscomplex() function tests element-wise whether it is a complex number or not(not infinity or not Not a Number) and returns the result as a boolean array...
JavaScript Array reduceRight() Method - GeeksforGeeks
04 Oct, 2021 Below is the example of Array reduceRight() method. Example: HTML <!DOCTYPE html><html> <head> <title> JavaScript Array reduceRight() Method </title></head> <body style="text-align:center;"> <h1 style="color: green;">GeeksforGeeks</h1> <p> Click here to get t...
[ { "code": null, "e": 26141, "s": 26113, "text": "\n04 Oct, 2021" }, { "code": null, "e": 26194, "s": 26141, "text": "Below is the example of Array reduceRight() method. " }, { "code": null, "e": 26204, "s": 26194, "text": "Example: " }, { "code": null,...
DecimalField - Django Models - GeeksforGeeks
12 Feb, 2020 DecimalField is a field which stores a fixed-precision decimal number, represented in Python by a Decimal instance. It validates the input using DecimalValidator. Syntax field_name = models.DecimalField(max_digits=None, decimal_places=None, **options) DecimalField.max_digitsThe maximum number of digits all...
[ { "code": null, "e": 24322, "s": 24294, "text": "\n12 Feb, 2020" }, { "code": null, "e": 24485, "s": 24322, "text": "DecimalField is a field which stores a fixed-precision decimal number, represented in Python by a Decimal instance. It validates the input using DecimalValidator."...
Data Definition Commands in DBMS
Data definition commands are used to create, modify and remove database objects such as schemas, tables, views, indexes etc. Common Data Definition commands − The main use of create command is to create a new table in database. It has a predefined syntax in which we specify the columns and their respective data types. ...
[ { "code": null, "e": 1187, "s": 1062, "text": "Data definition commands are used to create, modify and remove database objects such as schemas, tables, views, indexes etc." }, { "code": null, "e": 1221, "s": 1187, "text": "Common Data Definition commands −" }, { "code": n...
Express.js req.param() Function - GeeksforGeeks
27 Apr, 2021 The req.param() function basically returns the value of param name when present. When parameters are passed, then it can be accessed using this function.Syntax: req.param(name [, defaultValue]) Parameter: The name parameter is the name of the parameter.Return Value: String.Installation of express module:...
[ { "code": null, "e": 24295, "s": 24267, "text": "\n27 Apr, 2021" }, { "code": null, "e": 24458, "s": 24295, "text": "The req.param() function basically returns the value of param name when present. When parameters are passed, then it can be accessed using this function.Syntax: "...
When to use @JsonManagedReference and @JsonBackReference annotations using Jackson in Java?
The @JsonManagedReference and @JsonBackReference annotations can be used to create a JSON structure in a bidirectional way. The @JsonManagedReference annotation is a forward reference that includes during the serialization process whereas @JsonBackReference annotation is a backreference that omits during the serializat...
[ { "code": null, "e": 1395, "s": 1062, "text": "The @JsonManagedReference and @JsonBackReference annotations can be used to create a JSON structure in a bidirectional way. The @JsonManagedReference annotation is a forward reference that includes during the serialization process whereas @JsonBackRefer...
JavaScript Function.prototype.call() Method - GeeksforGeeks
24 Jan, 2022 The call() method allows function calls belonging to one object to be assigned and it is called for a different object. It provides a new value of this to the function. The call() method allows you to write a method once and allows it for inheritance in another object, without rewriting the method for the ...
[ { "code": null, "e": 25220, "s": 25192, "text": "\n24 Jan, 2022" }, { "code": null, "e": 25539, "s": 25220, "text": "The call() method allows function calls belonging to one object to be assigned and it is called for a different object. It provides a new value of this to the func...
Introduction to Multilayer Neural Networks with TensorFlow’s Keras API | by Lorraine Li | Towards Data Science
Learn how to build and train a multilayer perceptron using TensorFlow’s high-level API Keras! The development of Keras started in early 2015. As of today, it has evolved into one of the most popular and widely used libraries built on top of Theano and TensorFlow. One of its prominent features is that it has a very intu...
[ { "code": null, "e": 266, "s": 172, "text": "Learn how to build and train a multilayer perceptron using TensorFlow’s high-level API Keras!" }, { "code": null, "e": 595, "s": 266, "text": "The development of Keras started in early 2015. As of today, it has evolved into one of the ...
Clustering sentence embeddings to identify intents in short text | by David Borrelli | Towards Data Science
TL;DR The unsupervised learning problem of clustering short-text messages can be turned into a constrained optimization problem to automatically tune UMAP + HDBSCAN hyperparameters. The chatintents package makes it easy to implement this tuning process. User dialogue interactions can be a tremendous source of informati...
[ { "code": null, "e": 426, "s": 172, "text": "TL;DR The unsupervised learning problem of clustering short-text messages can be turned into a constrained optimization problem to automatically tune UMAP + HDBSCAN hyperparameters. The chatintents package makes it easy to implement this tuning process." ...
JDBC - Transactions
If your JDBC Connection is in auto-commit mode, which it is by default, then every SQL statement is committed to the database upon its completion. That may be fine for simple applications, but there are three reasons why you may want to turn off the auto-commit and manage your own transactions − To increase performance...
[ { "code": null, "e": 2309, "s": 2162, "text": "If your JDBC Connection is in auto-commit mode, which it is by default, then every SQL statement is committed to the database upon its completion." }, { "code": null, "e": 2459, "s": 2309, "text": "That may be fine for simple applica...
PHP | hash_pbkdf2() Function - GeeksforGeeks
29 Oct, 2018 The hash_pbkdf2() function is an inbuilt function in PHP which is used to generate a PBKDF2 key derivation of a supplied password. Syntax: string hash_pbkdf2( $algo, $pass, $salt, $itr, $len, $raw_opt ) Parameters: This function accept six parameters as mention above and describe below. $algo: It is the re...
[ { "code": null, "e": 24581, "s": 24553, "text": "\n29 Oct, 2018" }, { "code": null, "e": 24712, "s": 24581, "text": "The hash_pbkdf2() function is an inbuilt function in PHP which is used to generate a PBKDF2 key derivation of a supplied password." }, { "code": null, ...
Using Bayesian Classifiers to detect Fake News | by Victor Sim | Towards Data Science
There is so much fake news in circulation, it is difficult to find sources of accurate and unfabricated news. This article aims to use the Naive Bayes Classifier to classify real and fake news. The Naive Bayes Classifier is a deterministic algorithm that uses the Bayes theorem to classify data. Let’s look at an example...
[ { "code": null, "e": 365, "s": 171, "text": "There is so much fake news in circulation, it is difficult to find sources of accurate and unfabricated news. This article aims to use the Naive Bayes Classifier to classify real and fake news." }, { "code": null, "e": 493, "s": 365, "...
Use this clustering method if you have many outliers | by Martin Helm | Towards Data Science
If you have ever wanted to segment your data into groups, you have probably tried the famous k-means algorithm for it. Since it is so simple, it is widely used, but its simplicity also comes with several drawbacks. One of them is its sensitivity to outliers, as it uses classic euclidean distance as the dissimilaritymet...
[ { "code": null, "e": 496, "s": 171, "text": "If you have ever wanted to segment your data into groups, you have probably tried the famous k-means algorithm for it. Since it is so simple, it is widely used, but its simplicity also comes with several drawbacks. One of them is its sensitivity to outlie...
Java - FileReader Class
This class inherits from the InputStreamReader class. FileReader is used for reading streams of characters. This class has several constructors to create required objects. Following is the list of constructors provided by the FileReader class. FileReader(File file) This constructor creates a new FileReader, given the F...
[ { "code": null, "e": 2485, "s": 2377, "text": "This class inherits from the InputStreamReader class. FileReader is used for reading streams of characters." }, { "code": null, "e": 2621, "s": 2485, "text": "This class has several constructors to create required objects. Following ...
How to return a Pointer from a Function in C - GeeksforGeeks
19 Aug, 2020 Pointers in C programming language is a variable which is used to store the memory address of another variable. We can pass pointers to the function as well as return pointer from a function. But it is not recommended to return the address of a local variable outside the function as it goes out of scope af...
[ { "code": null, "e": 24563, "s": 24535, "text": "\n19 Aug, 2020" }, { "code": null, "e": 24892, "s": 24563, "text": "Pointers in C programming language is a variable which is used to store the memory address of another variable. We can pass pointers to the function as well as ret...
CouchDB - Updating a Document
You can update a document in CouchDB by sending an HTTP request to the server using PUT method through cURL utility. Following is the syntax to update a document. curl -X PUT http://127.0.0.1:5984/database_name/document_id/ -d '{ "field" : "value", "_rev" : "revision id" }' Suppose there is a document with id 001 in th...
[ { "code": null, "e": 2001, "s": 1838, "text": "You can update a document in CouchDB by sending an HTTP request to the server using PUT method through cURL utility. Following is the syntax to update a document." }, { "code": null, "e": 2113, "s": 2001, "text": "curl -X PUT http://...
jQuery - Event Handling
Any modern web application can't be imagined without an event associated with it. Events are the mechanism to build an interactive web page. jQuery is smart enough to handle any event generated on an HTML page. First let's try to understand what is an event. A jQuery Event is the result of an action that can be detecte...
[ { "code": null, "e": 2581, "s": 2322, "text": "Any modern web application can't be imagined without an event associated with it. Events are the mechanism to build an interactive web page. jQuery is smart enough to handle any event generated on an HTML page. First let's try to understand what is an e...
How to use the front camera in Swift?
To use the front camera in swift we first need to get a list of cameras available in the device we are using. In this article we’ll see how to get the list of devices and then check if the front camera is available or not. We’ll do it in a series of steps. Import AVFoundation Check if the list of cameras exists Filter ...
[ { "code": null, "e": 1319, "s": 1062, "text": "To use the front camera in swift we first need to get a list of cameras available in the device we are using. In this article we’ll see how to get the list of devices and then check if the front camera is available or not. We’ll do it in a series of ste...
Interactive Simulation with Tableau and Jupytab | by Brian Tribondeau | Towards Data Science
This article shows how to let Tableau, a leading interactive data visualization tool, access dynamic data instead of static data. This opens up new applications, such as dashboards that can display real-time data, or the ability of users to display dynamic predictions obtained by machine learning models. We start with ...
[ { "code": null, "e": 478, "s": 172, "text": "This article shows how to let Tableau, a leading interactive data visualization tool, access dynamic data instead of static data. This opens up new applications, such as dashboards that can display real-time data, or the ability of users to display dynami...
Program to convert given Matrix to a Diagonal Matrix in C++
Given with the matrix of size nxn the task it to convert any type of given matrix to a diagonal matrix. Diagonal matrix is the nxn matrix whose all the non-diagonal elements are zero and diagonal elements can be any value. Given below is the diagram of converting non-diagonal elements to 0. [123456789]→[103050709] The ...
[ { "code": null, "e": 1166, "s": 1062, "text": "Given with the matrix of size nxn the task it to convert any type of given matrix to a diagonal matrix." }, { "code": null, "e": 1285, "s": 1166, "text": "Diagonal matrix is the nxn matrix whose all the non-diagonal elements are zero...
Tk - Button Widget
Tk button widget is a clickable widget that triggers an action. The syntax for button widget is shown below − button buttonName options The options available for the button widget are listed below in table − -font fontDescriptor Used to set font for widget. -height number Used to set height for widget. -command action...
[ { "code": null, "e": 2311, "s": 2201, "text": "Tk button widget is a clickable widget that triggers an action. The syntax for button widget is shown below −" }, { "code": null, "e": 2338, "s": 2311, "text": "button buttonName options\n" }, { "code": null, "e": 2410, ...
Get the index of maximum value in DataFrame column - GeeksforGeeks
01 Nov, 2021 Pandas DataFrame is two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Let’s see how can we get the index of maximum value in DataFrame column.Observe this dataset first. We’ll use ‘Weight’ and ‘Salary’ columns of this data in order to get t...
[ { "code": null, "e": 26173, "s": 26145, "text": "\n01 Nov, 2021" }, { "code": null, "e": 26554, "s": 26173, "text": "Pandas DataFrame is two-dimensional size-mutable, potentially heterogeneous tabular data structure with labeled axes (rows and columns). Let’s see how can we get t...
Maximum OR value of a pair in an array - GeeksforGeeks
20 May, 2021 Given an array arr[] of N positive elements. The task is to find the maximum bitwise OR value of a pair from the given array.Examples: Input: arr[] = {4, 8, 12, 16} Output: 28 (12, 16) is the pair with the maximum bitwise OR. 12 | 16 = 28 Input: arr[] = {4, 8, 16, 2} Output: 24 Approach: Iterate over all...
[ { "code": null, "e": 26070, "s": 26042, "text": "\n20 May, 2021" }, { "code": null, "e": 26206, "s": 26070, "text": "Given an array arr[] of N positive elements. The task is to find the maximum bitwise OR value of a pair from the given array.Examples: " }, { "code": null,...
Finding Login Counts and Creation Dates in SQL Server - GeeksforGeeks
11 Jun, 2021 A SQL login is another credential that allows you to access SQL Server. When you log on to Windows or even your e-mail account, for example, you enter your username and password. The logins are made up of such a username and password. As a result, SQL logins are just a username and password. A SQL login is...
[ { "code": null, "e": 25513, "s": 25485, "text": "\n11 Jun, 2021" }, { "code": null, "e": 25806, "s": 25513, "text": "A SQL login is another credential that allows you to access SQL Server. When you log on to Windows or even your e-mail account, for example, you enter your usernam...
Convert a series of date strings to a time series in Pandas Dataframe - GeeksforGeeks
18 Aug, 2020 During the analysis of a dataset, oftentimes it happens that the dates are not represented in proper type and are rather present as simple strings which makes it difficult to process them and perform standard date-time operations on them. pandas.to_datetime() Function helps in converting a date string to ...
[ { "code": null, "e": 25669, "s": 25641, "text": "\n18 Aug, 2020" }, { "code": null, "e": 25909, "s": 25669, "text": "During the analysis of a dataset, oftentimes it happens that the dates are not represented in proper type and are rather present as simple strings which makes it d...
Check if the objects or variables are defined in Julia - isdefined() and @isdefined() Methods - GeeksforGeeks
01 Apr, 2020 The isdefined() is an inbuilt function in julia which is used to test whether the specified global variable or object field is defined or not. The passed parameters can be a module and a symbol or a composite object and field name (as a symbol) or index. Syntax:isdefined(m::Module, s::Symbol)orisdefined(ob...
[ { "code": null, "e": 25599, "s": 25571, "text": "\n01 Apr, 2020" }, { "code": null, "e": 25854, "s": 25599, "text": "The isdefined() is an inbuilt function in julia which is used to test whether the specified global variable or object field is defined or not. The passed parameter...
HTML <button> value Attribute - GeeksforGeeks
16 Feb, 2019 The value attribute for <button> element in HTML is used to specify the initial value of the button element. Syntax: <button value = "value"> Example: <!DOCTYPE html><html> <head> <title>HTML button value Attribute</title> </head> <body style = "text-align:center"> <h1 style = "color...
[ { "code": null, "e": 25058, "s": 25030, "text": "\n16 Feb, 2019" }, { "code": null, "e": 25167, "s": 25058, "text": "The value attribute for <button> element in HTML is used to specify the initial value of the button element." }, { "code": null, "e": 25175, "s": 2...
MySQL | Creating stored function - GeeksforGeeks
18 Jan, 2022 The CREATE FUNCTION statement is used for creating a stored function and user-defined functions. A stored function is a set of SQL statements that perform some operation and return a single value. Just like Mysql in-built function, it can be called from within a Mysql statement. By default, the stored func...
[ { "code": null, "e": 25219, "s": 25191, "text": "\n18 Jan, 2022" }, { "code": null, "e": 25416, "s": 25219, "text": "The CREATE FUNCTION statement is used for creating a stored function and user-defined functions. A stored function is a set of SQL statements that perform some ope...
Matplotlib.figure.Figure.get_size_inches() in Python - GeeksforGeeks
30 Apr, 2020 Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, which contains all the plot elements. This module is used to control the default spacing of the subplots and top level container for all plot elemen...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n30 Apr, 2020" }, { "code": null, "e": 25848, "s": 25537, "text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. The figure module provides the top-level Artist, the Figure, whic...
Naming a thread and fetching name of current thread in Java - GeeksforGeeks
25 Feb, 2022 Thread can be referred to as a lightweight process. Thread uses fewer resources to create and exist in the process; thread shares process resources. The main thread of Java is the thread that is started when the program starts. now let us discuss the eccentric concept of with what ways we can name a thread...
[ { "code": null, "e": 25195, "s": 25167, "text": "\n25 Feb, 2022" }, { "code": null, "e": 25505, "s": 25195, "text": "Thread can be referred to as a lightweight process. Thread uses fewer resources to create and exist in the process; thread shares process resources. The main threa...
Beep() function in C with Examples - GeeksforGeeks
22 Nov, 2020 The Beep function in C is used to make a Beep sound. It generates a tone on the speaker. The function is synchronous, i.e. it waits and doesn’t return to its caller function until the sound is finished. It can be very useful during the Debugging process for finding errors.Header File: #include <windows.h...
[ { "code": null, "e": 25517, "s": 25489, "text": "\n22 Nov, 2020" }, { "code": null, "e": 25805, "s": 25517, "text": "The Beep function in C is used to make a Beep sound. It generates a tone on the speaker. The function is synchronous, i.e. it waits and doesn’t return to its calle...
View Binding in Android Jetpack - GeeksforGeeks
24 May, 2021 View Binding is one of the best features which provides the views to bind with the activity which is ongoing. Replacing the findViewById() method, hence reducing the boilerplate code, generated the instances of the views of the current layout. And most important feature about the View Binding is it’s alway...
[ { "code": null, "e": 25969, "s": 25941, "text": "\n24 May, 2021" }, { "code": null, "e": 26374, "s": 25969, "text": "View Binding is one of the best features which provides the views to bind with the activity which is ongoing. Replacing the findViewById() method, hence reducing t...
Find the non decreasing order array from given array - GeeksforGeeks
21 Oct, 2021 Given an array A[] of size N / 2, the task is to construct the array B[] of size N such that: B[] is sorted in non-decreasing order.A[i] = B[i] + B[n – i + 1]. B[] is sorted in non-decreasing order. A[i] = B[i] + B[n – i + 1]. Note: Array A[] is given in such a way that the answer is always possible.Exam...
[ { "code": null, "e": 26727, "s": 26699, "text": "\n21 Oct, 2021" }, { "code": null, "e": 26823, "s": 26727, "text": "Given an array A[] of size N / 2, the task is to construct the array B[] of size N such that: " }, { "code": null, "e": 26889, "s": 26823, "te...
Shift() vs pop() Method in JavaScript - GeeksforGeeks
18 Jan, 2021 JavaScript shift() and pop() methods are used to remove an element from an array. But there is a little difference between them. Shift() method removes the first element and whereas the pop() method removes the last element from an array. The Shift() returns the removed first element of the array. If the ...
[ { "code": null, "e": 26545, "s": 26517, "text": "\n18 Jan, 2021" }, { "code": null, "e": 26785, "s": 26545, "text": "JavaScript shift() and pop() methods are used to remove an element from an array. But there is a little difference between them. Shift() method removes the first e...
Top 50 TCP/IP interview questions and answers - GeeksforGeeks
08 Sep, 2021 1. Explain the range of TCP/IP classes? 2. What are Pvt. IP address? The private IP address of a system is the IP address that is used to communicate within the same network. Using private IP data, information can be sent or received within the same network. For more details please refer difference between...
[ { "code": null, "e": 25213, "s": 25185, "text": "\n08 Sep, 2021" }, { "code": null, "e": 25253, "s": 25213, "text": "1. Explain the range of TCP/IP classes?" }, { "code": null, "e": 25282, "s": 25253, "text": "2. What are Pvt. IP address?" }, { "code":...
Lodash or Underscore - pick, pickBy, omit, omitBy - GeeksforGeeks
30 Jun, 2020 Javascript is Everywhere. The Javascript is used widely and it’s not limited to just only in your web browser but also widely used in the server-side as well. JavaScript is used by 95% of all the websites. Lodash or Underscore makes coding in Javascript much easier & also makes our code minimal, it works w...
[ { "code": null, "e": 25832, "s": 25804, "text": "\n30 Jun, 2020" }, { "code": null, "e": 26038, "s": 25832, "text": "Javascript is Everywhere. The Javascript is used widely and it’s not limited to just only in your web browser but also widely used in the server-side as well. Java...
Python open() Function
13 Sep, 2021 The python open() function is used to open() internally stored files. It returns the contents of the file as python objects. Syntax: open(file_name, mode) Parameters: file_name: This parameter as the name suggests, is the name of the file that we want to open. mode: This parameter is a string that is used...
[ { "code": null, "e": 53, "s": 25, "text": "\n13 Sep, 2021" }, { "code": null, "e": 178, "s": 53, "text": "The python open() function is used to open() internally stored files. It returns the contents of the file as python objects." }, { "code": null, "e": 209, "s"...
std::mismatch() with examples in C++
06 Jul, 2017 C++ STL has lots of useful functions that helps us to achieve various programming tasks. One such function is “mismatch()” . This function, defined in “algorithm” header file, helps to compare 2 containers for mismatches. This function has 2 versions. Both are discussed in this article. mismatch( start_ite...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Jul, 2017" }, { "code": null, "e": 340, "s": 52, "text": "C++ STL has lots of useful functions that helps us to achieve various programming tasks. One such function is “mismatch()” . This function, defined in “algorithm” header file...
Fractional Knapsack | Practice | GeeksforGeeks
Given weights and values of N items, we need to put these items in a knapsack of capacity W to get the maximum total value in the knapsack. Note: Unlike 0/1 knapsack, you are allowed to break the item. Example 1: Input: N = 3, W = 50 values[] = {60,100,120} weight[] = {10,20,30} Output: 240.00 Explanation:Total maxi...
[ { "code": null, "e": 441, "s": 238, "text": "Given weights and values of N items, we need to put these items in a knapsack of capacity W to get the maximum total value in the knapsack.\nNote: Unlike 0/1 knapsack, you are allowed to break the item. " }, { "code": null, "e": 454, "s": ...
Delete consecutive same words in a sequence
15 Jul, 2022 Given a sequence of n strings, the task is to check if any two similar words come together then they destroy each other than print the number of words left in the sequence after this pairwise destruction. Examples: Input : ab aa aa bcd ab Output : 3 As aa, aa destroys each other so, ab bcd ab is the new s...
[ { "code": null, "e": 52, "s": 24, "text": "\n15 Jul, 2022" }, { "code": null, "e": 257, "s": 52, "text": "Given a sequence of n strings, the task is to check if any two similar words come together then they destroy each other than print the number of words left in the sequence af...
How to refresh entire application when date is changed in angular 9 ?
17 Dec, 2020 In this example, we will see how to refresh the application when the date is changed in angularJS. Approach: First, we need to write the code for displaying the date picker in an HTML file. We can achieve this by giving the input type as the date. After completing the input type, we need to declare a funct...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 Dec, 2020" }, { "code": null, "e": 127, "s": 28, "text": "In this example, we will see how to refresh the application when the date is changed in angularJS." }, { "code": null, "e": 137, "s": 127, "text": "Approac...
C++ Vector Library - insert() Function
The C++ function std::vector::insert() extends vector by inserting new element at position in container. Reallocation happens if there is need of more space. This function increases container size by one. Following is the declaration for std::vector::insert() function form std::vector header. iterator insert (iterator ...
[ { "code": null, "e": 2895, "s": 2737, "text": "The C++ function std::vector::insert() extends vector by inserting new element at position in container. Reallocation happens if there is need of more space." }, { "code": null, "e": 2942, "s": 2895, "text": "This function increases ...
Tips for Writing better Conditionals in JavaScript
29 Sep, 2020 If you are working with JavaScript, you would be writing a lot of code with a lot of conditions involved. At first, conditionals may seem easy to learn, but there is more to it than to write a few if-else statements. Object-oriented programming allows one to avoid conditions and replace them with polymorph...
[ { "code": null, "e": 53, "s": 25, "text": "\n29 Sep, 2020" }, { "code": null, "e": 270, "s": 53, "text": "If you are working with JavaScript, you would be writing a lot of code with a lot of conditions involved. At first, conditionals may seem easy to learn, but there is more to ...
Master Theorem For Subtract and Conquer Recurrences
31 May, 2021 Master theorem is used to determine the Big – O upper bound on functions which possess recurrence, i.e which can be broken into sub problems. Master Theorem For Subtract and Conquer Recurrences: Let T(n) be a function defined on positive n as shown below: for some constants c, a>0, b>0, k>=0 and function...
[ { "code": null, "e": 54, "s": 26, "text": "\n31 May, 2021" }, { "code": null, "e": 312, "s": 54, "text": "Master theorem is used to determine the Big – O upper bound on functions which possess recurrence, i.e which can be broken into sub problems. Master Theorem For Subtract and ...
How to find the first Monday of a given month using NumPy?
02 Dec, 2020 To find the first Monday of a given month, we are going to use the numpy module i.e the numpy.busday_offset() method in numpy module. Syntax: np.busday_offset(‘date’, 0, roll=’forward’, weekmask=’Mon’) Parameters: date: The array of dates to process. offsets: The array of offsets, which is broadcast with d...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Dec, 2020" }, { "code": null, "e": 162, "s": 28, "text": "To find the first Monday of a given month, we are going to use the numpy module i.e the numpy.busday_offset() method in numpy module." }, { "code": null, "e": 230,...
Program to print Sum Triangle for a given array
30 Jun, 2022 Given a array, write a program to construct a triangle where last row contains elements of given array, every element of second last row contains sum of below two elements and so on. Example: Input: arr[] = {4, 7, 3, 6, 7}; Output: 81 40 41 21 19 22 11 10 9 13 4 7 3 6 7 Input: {10, 40, 50} Output: 140 5...
[ { "code": null, "e": 52, "s": 24, "text": "\n30 Jun, 2022" }, { "code": null, "e": 235, "s": 52, "text": "Given a array, write a program to construct a triangle where last row contains elements of given array, every element of second last row contains sum of below two elements an...