title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Linked List Data Structure - GeeksQuiz
29 Sep, 2020 void fun1(struct node* head) { if(head == NULL) return; fun1(head->next); printf("%d ", head->data); } Writing code in comment? Please use ide.geeksforgeeks.org, generate link and share the link here.
[ { "code": null, "e": 29498, "s": 29470, "text": "\n29 Sep, 2020" }, { "code": null, "e": 29616, "s": 29498, "text": "void fun1(struct node* head)\n{\n if(head == NULL)\n return;\n \n fun1(head->next);\n printf(\"%d \", head->data);\n}\n" } ]
Program to Find the Largest Number using Ternary Operator
24 Jun, 2022 The task is to write a program to find the largest number using ternary operator among: Two Numbers Three Numbers Four Numbers Examples: Input : 10, 20 Output : Largest number between two numbers (10, 20) is: 20 Input : 25 75 55 15 Output : Largest number among four numbers (25, 75, 55, 15) is: 75 A ...
[ { "code": null, "e": 52, "s": 24, "text": "\n24 Jun, 2022" }, { "code": null, "e": 141, "s": 52, "text": "The task is to write a program to find the largest number using ternary operator among: " }, { "code": null, "e": 153, "s": 141, "text": "Two Numbers" }...
smatch | Regex (Regular Expressions) in C++
04 Sep, 2018 smatch is an instantiation of the match_results class template for matches on string objects.Functions that can be called using smatch:str(), position(), and length() member functions of the match_results object can be called to get the text that was matched, or the starting position and its length of the ...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Sep, 2018" }, { "code": null, "e": 397, "s": 52, "text": "smatch is an instantiation of the match_results class template for matches on string objects.Functions that can be called using smatch:str(), position(), and length() member ...
Python Program for Smallest K digit number divisible by X
22 Jun, 2022 Integers X and K are given. The task is to find smallest K-digit number divisible by X. Examples: Input : X = 83, K = 5 Output : 10043 10040 is the smallest 5 digit number that is multiple of 83. Input : X = 5, K = 2 Output : 10 An efficient solution would be : Compute MIN : smallest K-digit number (1000....
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Jun, 2022" }, { "code": null, "e": 152, "s": 54, "text": "Integers X and K are given. The task is to find smallest K-digit number divisible by X. Examples:" }, { "code": null, "e": 284, "s": 152, "text": "Input :...
Check if an array is descending, ascending or not sorted in JavaScript
We are required to write a JavaScript function that takes in an array of Numbers. The function should check whether the numbers in the array are in increasing order, or in decreasing order or in no specific order. If the array contains only one element then we should return a message saying not enough elements. And if ...
[ { "code": null, "e": 1276, "s": 1062, "text": "We are required to write a JavaScript function that takes in an array of Numbers. The function\nshould check whether the numbers in the array are in increasing order, or in decreasing order or\nin no specific order." }, { "code": null, "e": ...
Predicting the Future (of Music). Using Python and linear regression to... | by Taylor Fogarty | Towards Data Science
Taylor Fogarty, Peter Worcester, Lata Goudel In the era of Big Data, we have the all-time advantage when it comes to making predictions. With websites like Kaggle.com and OurWorldinData.org, we have endless data at our fingertips- data we can use to predict things like who will win the NCAA tournament in 2020, how many...
[ { "code": null, "e": 217, "s": 172, "text": "Taylor Fogarty, Peter Worcester, Lata Goudel" }, { "code": null, "e": 689, "s": 217, "text": "In the era of Big Data, we have the all-time advantage when it comes to making predictions. With websites like Kaggle.com and OurWorldinData....
C++ program for Find sum of odd factors of a number
Given with a positive integer and the task is to generate the odd factors of a number and finding out the sum of given odd factors. Input-: number = 20 Output-: sum of odd factors is: 6 Input-: number = 18 Output-: sum of odd factors is: 13 So, result = 1 + 5 = 6 Approach used in the below program is as follows − Input...
[ { "code": null, "e": 1194, "s": 1062, "text": "Given with a positive integer and the task is to generate the odd factors of a number and finding out the sum of given odd factors." }, { "code": null, "e": 1303, "s": 1194, "text": "Input-: number = 20\nOutput-: sum of odd factors i...
A Git cheatsheet that all coders need | by Harsh Maheshwari | Towards Data Science
I have a normal love-hate relationship with Git, meaning I love Git when it's just me working on the project, and I hate it when I have to merge my code with someone else's. But then all marriages have their ups and downs, right. The truth is that as a coder, at some point in time, you will need Git, and once you start...
[ { "code": null, "e": 752, "s": 171, "text": "I have a normal love-hate relationship with Git, meaning I love Git when it's just me working on the project, and I hate it when I have to merge my code with someone else's. But then all marriages have their ups and downs, right. The truth is that as a co...
Reverse words in a given string | Practice | GeeksforGeeks
Given a String S, reverse the string without reversing its individual words. Words are separated by dots. Example 1: Input: S = i.like.this.program.very.much Output: much.very.program.this.like.i Explanation: After reversing the whole string(not individual words), the input string becomes much.very.program.this.like.i ...
[ { "code": null, "e": 344, "s": 238, "text": "Given a String S, reverse the string without reversing its individual words. Words are separated by dots." }, { "code": null, "e": 355, "s": 344, "text": "Example 1:" }, { "code": null, "e": 559, "s": 355, "text": "...
Python unittest - assertNotAlmostEqual() function - GeeksforGeeks
29 Aug, 2020 assertNotAlmostEqual() in Python is a unittest library function that is used in unit testing to check whether two given values are not approximately. This function will take five parameters as input and return a boolean value depending upon the assert condition. This function check that first and second a...
[ { "code": null, "e": 24212, "s": 24184, "text": "\n29 Aug, 2020" }, { "code": null, "e": 24476, "s": 24212, "text": "assertNotAlmostEqual() in Python is a unittest library function that is used in unit testing to check whether two given values are not approximately. This function...
Minimum prime number operations to convert A to B - GeeksforGeeks
23 Apr, 2021 Given two integers A and B, the task is to convert A to B with a minimum number of the following operations: Multiply A by any prime number.Divide A by one of its prime divisors. Multiply A by any prime number. Divide A by one of its prime divisors. Print the minimum number of operations required.Example...
[ { "code": null, "e": 24699, "s": 24671, "text": "\n23 Apr, 2021" }, { "code": null, "e": 24810, "s": 24699, "text": "Given two integers A and B, the task is to convert A to B with a minimum number of the following operations: " }, { "code": null, "e": 24880, "s":...
Time-Series Forecasting: Predicting Stock Prices Using Facebook’s Prophet Model | by Serafeim Loukas | Towards Data Science
Traditionally most machine learning (ML) models use as input features some observations (samples / examples) but there is no time dimension in the data. Time-series forecasting models are the models that are capable to predict future values based on previously observed values. Time-series forecasting is widely used for...
[ { "code": null, "e": 325, "s": 172, "text": "Traditionally most machine learning (ML) models use as input features some observations (samples / examples) but there is no time dimension in the data." }, { "code": null, "e": 690, "s": 325, "text": "Time-series forecasting models ar...
Constructor Overloading in C++
As we know function overloading is one of the core feature of the object oriented languages. We can use the same name of the functions; whose parameter sets are different. Here we will see how to overload the constructors of C++ classes. The constructor overloading has few important concepts. Overloaded constructors mu...
[ { "code": null, "e": 1356, "s": 1062, "text": "As we know function overloading is one of the core feature of the object oriented languages. We can use the same name of the functions; whose parameter sets are different. Here we will see how to overload the constructors of C++ classes. The constructor...
Lexicographically Next Permutation in C++
23 Jun, 2022 All the permutations of a word when arranged in a dictionary, the order of words so obtained is called lexicographical order. in Simple words, it is the one that has all its elements sorted in ascending order, and the largest has all its elements sorted in descending order. lexicographically is nothing but...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Jun, 2022" }, { "code": null, "e": 327, "s": 52, "text": "All the permutations of a word when arranged in a dictionary, the order of words so obtained is called lexicographical order. in Simple words, it is the one that has all its ...
ReactJS - Installation
This chapter explains the installation of React library and its related tools in your machine. Before moving to the installation, let us verify the prerequisite first. React provides CLI tools for the developer to fast forward the creation, development and deployment of the React based web application. React CLI tools ...
[ { "code": null, "e": 2335, "s": 2167, "text": "This chapter explains the installation of React library and its related tools in your machine. Before moving to the installation, let us verify the prerequisite first." }, { "code": null, "e": 2645, "s": 2335, "text": "React provides...
How to Convert Any Website to Android App in Android Studio?
19 Aug, 2021 Here, we are going to make an application for the “GeeksForGeeks” website. By making this application we will be able to learn that how we can convert a website to an Android Application just by following simple steps. You can use this concept for your personal website too and learn something new. In this ...
[ { "code": null, "e": 54, "s": 26, "text": "\n19 Aug, 2021" }, { "code": null, "e": 353, "s": 54, "text": "Here, we are going to make an application for the “GeeksForGeeks” website. By making this application we will be able to learn that how we can convert a website to an Android...
std::string::find_last_of in C++ with Examples
06 Aug, 2021 The std::string::find_last_of is a string class member function which is used to find the index of last occurrence of any characters in a string. If the character is present in the string then it returns the index of the last occurrence of that character in the string else it returns string::npos.Header Fi...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Aug, 2021" }, { "code": null, "e": 341, "s": 28, "text": "The std::string::find_last_of is a string class member function which is used to find the index of last occurrence of any characters in a string. If the character is present i...
Relational and Logical Operators in C
Relational operators are used to compare two values in C language. It checks the relationship between two values. If relation is true, it returns 1. However, if the relation is false, it returns 0. Here is the table of relational operators in C language Here is an example of relational operator in C language Live Demo...
[ { "code": null, "e": 1385, "s": 1187, "text": "Relational operators are used to compare two values in C language. It checks the relationship between two values. If relation is true, it returns 1. However, if the relation is false, it returns 0." }, { "code": null, "e": 1441, "s": 138...
endl vs \n in C++
09 Jun, 2022 endl and \n both seem to do the same thing but there is a subtle difference between them. cout << endl inserts a new line and flushes the stream(output buffer), whereas cout << “\n” just inserts a new line. Therefore, cout << endl; can be said equivalent to cout << ‘\n’ << flush; Some other differences b...
[ { "code": null, "e": 52, "s": 24, "text": "\n09 Jun, 2022" }, { "code": null, "e": 143, "s": 52, "text": "endl and \\n both seem to do the same thing but there is a subtle difference between them. " }, { "code": null, "e": 260, "s": 143, "text": "cout << endl ...
QlikView - Set Analysis
QlikView's Set Analysis feature is used to segregate the data in different sheet objects into many sets and keeps the values unchanged in some of them. In simpler terms, it creates an option to not associate some sheet objects with others while the default behavior is all sheet objects get associated with each other. T...
[ { "code": null, "e": 3562, "s": 3054, "text": "QlikView's Set Analysis feature is used to segregate the data in different sheet objects into\nmany sets and keeps the values unchanged in some of them. In simpler terms, it creates an option to not associate some sheet objects with others while the def...
Matplotlib.figure.Figure.tight_layout() in Python
03 May, 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": 28, "s": 0, "text": "\n03 May, 2020" }, { "code": null, "e": 339, "s": 28, "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, which contains a...
Median of two sorted arrays with different sizes in O(log(min(n, m)))
08 Jun, 2022 Given two sorted arrays, a[] and b[], task is to find the median of these sorted arrays, in O(log(min(n, m)), when n is the number of elements in the first array, and m is the number of elements in the second array.Prerequisite : Median of two different sized sorted arrays. Examples : Input : ar1[] = {-...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Jun, 2022" }, { "code": null, "e": 330, "s": 54, "text": "Given two sorted arrays, a[] and b[], task is to find the median of these sorted arrays, in O(log(min(n, m)), when n is the number of elements in the first array, and m is th...
Need of long data type in C
In C or C++, there are four different datatypes, that are used for integer type data. These four datatypes are short, int, long and long long. Each of these datatypes takes different memory spaces. The size varies in different architecture and different operating systems. Sometimes int takes 4-bytes or sometimes it tak...
[ { "code": null, "e": 1586, "s": 1187, "text": "In C or C++, there are four different datatypes, that are used for integer type data. These four datatypes are short, int, long and long long. Each of these datatypes takes different memory spaces. The size varies in different architecture and different...
LinkedHashMap in Java
03 Jun, 2022 The LinkedHashMap Class is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap provided the advantage of quick insertion, search, and deletion but it never maintained the track and order of insertion, which the LinkedHashMap provides where the elements...
[ { "code": null, "e": 52, "s": 24, "text": "\n03 Jun, 2022" }, { "code": null, "e": 403, "s": 52, "text": "The LinkedHashMap Class is just like HashMap with an additional feature of maintaining an order of elements inserted into it. HashMap provided the advantage of quick insertio...
Vector of Maps in C++ with Examples
13 Jun, 2022 Map in STL: Maps are associative containers that store elements in a mapped fashion. Each element has a key value and a mapped value. No two mapped values can have same key values. Vector in STL: Vector is the same as dynamic arrays with the ability to resize itself automatically when an element is inserte...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Jun, 2022" }, { "code": null, "e": 209, "s": 28, "text": "Map in STL: Maps are associative containers that store elements in a mapped fashion. Each element has a key value and a mapped value. No two mapped values can have same key va...
How to get the screenshot of a particular element in the page in Selenium with python?
We can get the screenshot of a particular element in a page in Selenium. While executing any test cases, we might encounter failures for a particular. To pinpoint the failure of a specific element we try to capture a screenshot where the error exists. In an element, there may be errors for reasons listed below − If the...
[ { "code": null, "e": 1439, "s": 1187, "text": "We can get the screenshot of a particular element in a page in Selenium.\nWhile executing any test cases, we might encounter failures for a particular. To\npinpoint the failure of a specific element we try to capture a screenshot where the\nerror exists...
Python SQLite – Connecting to Database
16 May, 2021 In this article, we’ll discuss how to connect to an SQLite Database using the sqlite3 module in Python. Connecting to the SQLite Database can be established using the connect() method, passing the name of the database to be accessed as a parameter. If that database does not exist, then it’ll be created. s...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 May, 2021" }, { "code": null, "e": 132, "s": 28, "text": "In this article, we’ll discuss how to connect to an SQLite Database using the sqlite3 module in Python." }, { "code": null, "e": 334, "s": 132, "text": "Co...
cut command in Linux with examples
19 Feb, 2021 The cut command in UNIX is a command for cutting out the sections from each line of files and writing the result to standard output. It can be used to cut parts of a line by byte position, character and field. Basically the cut command slices a line and extracts the text. It is necessary to specify option ...
[ { "code": null, "e": 54, "s": 26, "text": "\n19 Feb, 2021" }, { "code": null, "e": 498, "s": 54, "text": "The cut command in UNIX is a command for cutting out the sections from each line of files and writing the result to standard output. It can be used to cut parts of a line by ...
Dart – Sort a List
29 Aug, 2021 In Dart programming, the List data type is similar to arrays in other programming languages. A list is used to represent a collection of objects. It is an ordered group of objects. The core libraries in Dart are responsible for the existence of List class, its creation, and manipulation. Sorting of the lis...
[ { "code": null, "e": 53, "s": 25, "text": "\n29 Aug, 2021" }, { "code": null, "e": 549, "s": 53, "text": "In Dart programming, the List data type is similar to arrays in other programming languages. A list is used to represent a collection of objects. It is an ordered group of ob...
Find n-th term of series 1, 3, 6, 10, 15, 21...
07 Jun, 2022 Given a number n, find the n-th term in the series 1, 3, 6, 10, 15, 21... Examples: Input : 3 Output : 6 Input : 4 Output : 10 The given series represent triangular numbers which are sums of natural numbers. Naive approach : The series basically represents sums of natural numbers. First term is sum of s...
[ { "code": null, "e": 53, "s": 25, "text": "\n07 Jun, 2022" }, { "code": null, "e": 127, "s": 53, "text": "Given a number n, find the n-th term in the series 1, 3, 6, 10, 15, 21..." }, { "code": null, "e": 138, "s": 127, "text": "Examples: " }, { "code"...
Segregate Even and Odd numbers
04 Jun, 2021 Given an array A[], write a function that segregates even and odd numbers. The functions should put all even numbers first, and then odd numbers. Example: Input = {12, 34, 45, 9, 8, 90, 3} Output = {12, 34, 8, 90, 45, 9, 3} In the output, the order of numbers can be changed, i.e., in the above example,...
[ { "code": null, "e": 52, "s": 24, "text": "\n04 Jun, 2021" }, { "code": null, "e": 198, "s": 52, "text": "Given an array A[], write a function that segregates even and odd numbers. The functions should put all even numbers first, and then odd numbers." }, { "code": null, ...
ViewStub in Android with Example
19 Sep, 2021 In Android, ViewStub is a zero-sized invisible View and very flexible that we can lazily inflate layout resources at runtime. It is a dumb and lightweight view and it has zero dimension. Depends upon requirement, whenever in need we can inflate at runtime. This is a classic example to handle when there are...
[ { "code": null, "e": 28, "s": 0, "text": "\n19 Sep, 2021" }, { "code": null, "e": 1273, "s": 28, "text": "In Android, ViewStub is a zero-sized invisible View and very flexible that we can lazily inflate layout resources at runtime. It is a dumb and lightweight view and it has zer...
How to improve MongoDB queries with multikey index in array?
For this, use $elemMatch, which is used to query nested objects. Let us create a collection with documents − > db.demo444.insertOne( ... { ... "Information": [{ ... id:1, ... Name:"Chris" ... }] ... } ... ); { "acknowledged" : true, "insertedId" : ObjectId("5e78ea87bbc41e36cc3c...
[ { "code": null, "e": 1171, "s": 1062, "text": "For this, use $elemMatch, which is used to query nested objects. Let us create a collection with documents −" }, { "code": null, "e": 1829, "s": 1171, "text": "> db.demo444.insertOne(\n... {\n... \"Information\": [{\n... ...
How to Build a Regression Model in Python | by Chanin Nantasenamat | Towards Data Science
If you are an aspiring data scientist or a veteran data scientist, this article is for you! In this article, we will be building a simple regression model in Python. To spice things up a bit, we will not be using the widely popular and ubiquitous Boston Housing dataset but instead, we will be using a simple Bioinformat...
[ { "code": null, "e": 654, "s": 172, "text": "If you are an aspiring data scientist or a veteran data scientist, this article is for you! In this article, we will be building a simple regression model in Python. To spice things up a bit, we will not be using the widely popular and ubiquitous Boston H...
How To Model Time Series Data With Linear Regression | by Jiahui Wang | Towards Data Science
Welcome back! This is the 4th post in the column to explore analysing and modeling time series data with Python code. In the previous three posts, we have covered fundamental statistical concepts, analysis of a single time series variable, and analysis of multiple time series variables. From this post onwards, we will ...
[ { "code": null, "e": 448, "s": 46, "text": "Welcome back! This is the 4th post in the column to explore analysing and modeling time series data with Python code. In the previous three posts, we have covered fundamental statistical concepts, analysis of a single time series variable, and analysis of ...
Data visualization with different Charts in Python - GeeksforGeeks
09 Mar, 2018 Data Visualization is the presentation of data in graphical format. It helps people understand the significance of data by summarizing and presenting huge amount of data in a simple and easy-to-understand format and helps communicate information clearly and effectively. Consider this given Data-set for whi...
[ { "code": null, "e": 24974, "s": 24946, "text": "\n09 Mar, 2018" }, { "code": null, "e": 25245, "s": 24974, "text": "Data Visualization is the presentation of data in graphical format. It helps people understand the significance of data by summarizing and presenting huge amount o...
attributes in C++
Attributes are modern ways in C++ to standardize things if their code runs on different compilers. Attributes are used to provide some extra information that is used to enforce conditions (constraints), optimization and do specific code generation if required. These are like an information manual for the compilers to d...
[ { "code": null, "e": 1323, "s": 1062, "text": "Attributes are modern ways in C++ to standardize things if their code runs on different compilers. Attributes are used to provide some extra information that is used to enforce conditions (constraints), optimization and do specific code generation if re...
Get the value associated with a given key in Java HashMap
Use the get() method to get the value associated with a given key. Here is our HashMap and its elements − // Create a hash map HashMap hm = new HashMap(); // Put elements to the map hm.put("Bag", new Integer(1100)); hm.put("Sunglasses", new Integer(2000)); hm.put("Frames", new Integer(800)); hm.put("Wallet", new Intege...
[ { "code": null, "e": 1129, "s": 1062, "text": "Use the get() method to get the value associated with a given key." }, { "code": null, "e": 1168, "s": 1129, "text": "Here is our HashMap and its elements −" }, { "code": null, "e": 1425, "s": 1168, "text": "// Cr...
The Right Way to Use Deep Learning for Tabular Data | Entity Embedding | by Benjamin Lau | Towards Data Science
Recently I took part in a Deep Learning course where I was tasked to work on a project that utilized deep learning techniques. Immediately, the thought of using deep learning or neural networks for tabular data struck my mind as I had worked on structured data for the first 6 months of my career. The use of deep learni...
[ { "code": null, "e": 469, "s": 171, "text": "Recently I took part in a Deep Learning course where I was tasked to work on a project that utilized deep learning techniques. Immediately, the thought of using deep learning or neural networks for tabular data struck my mind as I had worked on structured...
PHP - var_dump() Function
The function var_dump() displays structured information (type and value) about one or more expressions/variables. Arrays and objects are explored recursively with values indented to show structure. All public, private and protected properties of objects will be returned in the output. void var_dump ( mixed $value , mix...
[ { "code": null, "e": 2871, "s": 2757, "text": "The function var_dump() displays structured information (type and value) about one or more expressions/variables." }, { "code": null, "e": 2955, "s": 2871, "text": "Arrays and objects are explored recursively with values indented to ...
Python Number asin() Method
Python number method asin() returns the arc sine of x, in radians. Following is the syntax for asin() method − asin(x) Note − This function is not accessible directly, so we need to import math module and then we need to call this function using math static object. x − This must be a numeric value in the range -1 to ...
[ { "code": null, "e": 2312, "s": 2244, "text": "Python number method asin() returns the arc sine of x, in radians." }, { "code": null, "e": 2356, "s": 2312, "text": "Following is the syntax for asin() method −" }, { "code": null, "e": 2365, "s": 2356, "text": ...
Intro to Markov Chain Multi-Touch Attribution | by Ben Denis Shaffer | Towards Data Science
Attribution modeling is a task that comes up in Digital Marketing. Broadly speaking the objective of Attribution modeling is to improve the assessment of various Advertising Channels in driving Marketing Objectives. Before jumping to the data analysis let’s first set the context for the problem that Markov Chain Attrib...
[ { "code": null, "e": 517, "s": 171, "text": "Attribution modeling is a task that comes up in Digital Marketing. Broadly speaking the objective of Attribution modeling is to improve the assessment of various Advertising Channels in driving Marketing Objectives. Before jumping to the data analysis let...
Chef - Environment Variable
Environment variable is a key way to make Chef recipe run on any particular node successfully. There are multiple ways of doing it, either manually setting them up or by using a Shell script. Setting them via recipe is what we need to perform here. To do this, we need to have a cookbook here we would use test_cookbook ...
[ { "code": null, "e": 2629, "s": 2380, "text": "Environment variable is a key way to make Chef recipe run on any particular node successfully. There are multiple ways of doing it, either manually setting them up or by using a Shell script. Setting them via recipe is what we need to perform here." }...
How to set OnclickListener on a radio button in android?
This example demonstrates how do I set OnclickListener on a radio button 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"?> <R...
[ { "code": null, "e": 1147, "s": 1062, "text": "This example demonstrates how do I set OnclickListener on a radio button in android." }, { "code": null, "e": 1276, "s": 1147, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required d...
Returning two values from a function in PHP
Two variables can’t be explicitly returned, they can be put in a list/array data structure and returned. Live Demo function factors( $n ) { // An empty array is declared $fact = array(); // Loop through it for ( $i = 1; $i < $n; $i++) { // Check if i is the factor of // n, push into array ...
[ { "code": null, "e": 1167, "s": 1062, "text": "Two variables can’t be explicitly returned, they can be put in a list/array data structure and returned." }, { "code": null, "e": 1178, "s": 1167, "text": " Live Demo" }, { "code": null, "e": 1687, "s": 1178, "tex...
How to add options to a drop-down list using jQuery?
22 Jan, 2021 Given an HTML document with a drop-down list menu and our task is to add more options to the drop-down list using jQuery. Approach : To add more option to the existing drop-down list using the append() method : var options = { val1: 'C#', val2: 'PHP' }; ...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jan, 2021" }, { "code": null, "e": 150, "s": 28, "text": "Given an HTML document with a drop-down list menu and our task is to add more options to the drop-down list using jQuery." }, { "code": null, "e": 239, "s": 15...
Largest number possible after removal of K digits
22 Nov, 2021 Given a positive number N, the target is to find the largest number that can be formed after removing any K digits from N.Examples: Input: N = 6358, K = 1 Output: 658Input: N = 2589, K = 2 Output: 89 Approach: Iterate a loop K times. During every iteration, remove every digit from the current value...
[ { "code": null, "e": 54, "s": 26, "text": "\n22 Nov, 2021" }, { "code": null, "e": 188, "s": 54, "text": "Given a positive number N, the target is to find the largest number that can be formed after removing any K digits from N.Examples: " }, { "code": null, "e": 258...
Python | Extract odd length words in String
22 Apr, 2020 Sometimes, while working with Python, we can have a problem in which we need to extract certain length words from a string. This can be extraction of odd length words from the string. This can have application in many domains including day-day programming. Lets discuss certain ways in which this task can b...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Apr, 2020" }, { "code": null, "e": 348, "s": 28, "text": "Sometimes, while working with Python, we can have a problem in which we need to extract certain length words from a string. This can be extraction of odd length words from the...
Find the minimum cost to cross the River
27 Feb, 2022 Given an integer N which is the number of villagers who need to cross a river but there is only one boat on which a maximum of 2 person can travel. Each person i has to pay some specific price Pi to travel alone in the boat. If two person i, j travel in the boat then they have to pay max(Pi, Pj). The task ...
[ { "code": null, "e": 54, "s": 26, "text": "\n27 Feb, 2022" }, { "code": null, "e": 452, "s": 54, "text": "Given an integer N which is the number of villagers who need to cross a river but there is only one boat on which a maximum of 2 person can travel. Each person i has to pay s...
HTML Images
08 Dec, 2021 In this article, we will know the HTML Image, how to add the image in HTML, along with knowing its implementation & usage through the examples. In earlier times, the web pages only contains textual contents, which made them appear quite boring and uninteresting. Fortunately, it wasn’t long enough that the ...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Dec, 2021" }, { "code": null, "e": 559, "s": 52, "text": "In this article, we will know the HTML Image, how to add the image in HTML, along with knowing its implementation & usage through the examples. In earlier times, the web page...
How to preload an audio in HTML5 ?
15 Mar, 2021 In this article, we will preload audio in HTML. We use preload=”auto” attribute to preload the audio file. The HTML Audio Preload Attribute is used to specify how the author thinks the audio should be loaded when the page loads. The audio preload attribute allows the author to indicate to the browser how t...
[ { "code": null, "e": 54, "s": 26, "text": "\n15 Mar, 2021" }, { "code": null, "e": 465, "s": 54, "text": "In this article, we will preload audio in HTML. We use preload=”auto” attribute to preload the audio file. The HTML Audio Preload Attribute is used to specify how the author ...
numpy.round_() in Python
04 Dec, 2020 The numpy.round_() is a mathematical function that rounds an array to the given number of decimals. Syntax : numpy.round_(arr, decimals = 0, out = None)Parameters :array : [array_like] Input array.decimal : [int, optional] Decimal places we want to round off. Default = 0. In case of -ve decimal, it specifi...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Dec, 2020" }, { "code": null, "e": 128, "s": 28, "text": "The numpy.round_() is a mathematical function that rounds an array to the given number of decimals." }, { "code": null, "e": 288, "s": 128, "text": "Syntax...
Understanding Joint Application Development
28 Apr, 2021 Joint Application Development in short JAD is the process which is used to design and develop computer based system/solutions. It collects requirements side by side as per business needs while developing new information systems for a company that means JAD involves the client or end-users in designing and ...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Apr, 2021" }, { "code": null, "e": 674, "s": 52, "text": "Joint Application Development in short JAD is the process which is used to design and develop computer based system/solutions. It collects requirements side by side as per bu...
Taking Input from Users in Julia
28 Jul, 2020 Reading user input is a way of interaction between the program and the user. User inputs are necessary in case of testing a piece of code with varying and legitimate inputs. Reading user inputs from console in Julia can be done through inbuilt I/O methods like : readline() readlines() readline() method rea...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jul, 2020" }, { "code": null, "e": 202, "s": 28, "text": "Reading user input is a way of interaction between the program and the user. User inputs are necessary in case of testing a piece of code with varying and legitimate inputs." ...
ML | Mini Batch K-means clustering algorithm
13 May, 2019 Prerequisite: Optimal value of K in K-Means Clustering K-means is one of the most popular clustering algorithms, mainly because of its good time performance. With the increasing size of the datasets being analyzed, the computation time of K-means increases because of its constraint of needing the whole dat...
[ { "code": null, "e": 54, "s": 26, "text": "\n13 May, 2019" }, { "code": null, "e": 109, "s": 54, "text": "Prerequisite: Optimal value of K in K-Means Clustering" }, { "code": null, "e": 550, "s": 109, "text": "K-means is one of the most popular clustering algo...
Count the number of rows and columns of Pandas dataframe
01 Aug, 2020 In this article, we’ll see how we can get the count of the total number of rows and columns in a Pandas DataFrame. There are different methods by which we can do this. Let’s see all these methods with the help of examples. Example 1: We can use the dataframe.shape to get the count of rows and columns. data...
[ { "code": null, "e": 28, "s": 0, "text": "\n01 Aug, 2020" }, { "code": null, "e": 251, "s": 28, "text": "In this article, we’ll see how we can get the count of the total number of rows and columns in a Pandas DataFrame. There are different methods by which we can do this. Let’s s...
TreeMap put() Method in Java
10 Jul, 2018 The java.util.TreeMap.put() method of TreeMap is used to insert a mapping into a map. This means we can insert a specific key and the value it is mapping to into a particular map. If an existing key is passed then the previous value gets replaced by the new value. If a new pair is passed, then the pair get...
[ { "code": null, "e": 28, "s": 0, "text": "\n10 Jul, 2018" }, { "code": null, "e": 358, "s": 28, "text": "The java.util.TreeMap.put() method of TreeMap is used to insert a mapping into a map. This means we can insert a specific key and the value it is mapping to into a particular ...
Kullback-Leibler Divergence
22 Jan, 2021 Entropy: Entropy is a way of measuring the uncertainty/randomness of a random variable X In other words, entropy measures the amount of information in a random variable. It is normally measured in bits. Joint Entropy: The joint Entropy of a pair of discrete random variables X, Y ~ p (x, y) is the amount of...
[ { "code": null, "e": 28, "s": 0, "text": "\n22 Jan, 2021" }, { "code": null, "e": 117, "s": 28, "text": "Entropy: Entropy is a way of measuring the uncertainty/randomness of a random variable X" }, { "code": null, "e": 231, "s": 117, "text": "In other words, e...
Length of Smallest Subsequence such that sum of elements is greater than equal to K
28 Jun, 2022 Given an array arr[] of size N and a number K, the task is to find the length of the smallest subsequence such that the sum of the subsequence is greater than or equal to number K.Example: Input: arr[] = {2, 3, 1, 5, 6, 3, 7, 9, 14, 10, 2, 5}, K = 35 Output: 4 Smallest subsequence with the sum greater th...
[ { "code": null, "e": 52, "s": 24, "text": "\n28 Jun, 2022" }, { "code": null, "e": 243, "s": 52, "text": "Given an array arr[] of size N and a number K, the task is to find the length of the smallest subsequence such that the sum of the subsequence is greater than or equal to num...
How to Install Perl on Linux? - GeeksforGeeks
06 Oct, 2021 Prerequisite: Introduction to Perl Before, we start with the process of Installing Perl on our System. We must have first-hand knowledge of What the Perl Language is and what it actually does?. Perl is a general-purpose, high level interpreted and dynamic programming language. Perl was originally developed...
[ { "code": null, "e": 24872, "s": 24844, "text": "\n06 Oct, 2021" }, { "code": null, "e": 24907, "s": 24872, "text": "Prerequisite: Introduction to Perl" }, { "code": null, "e": 25484, "s": 24907, "text": "Before, we start with the process of Installing Perl on...
GroupBy() Method in C#
The GroupBy() is an extension method that returns a group of elements from the given collection based on some key value. The following is our array − int[] arr = { 2, 30, 45, 60, 70 }; Now, we will use GroupBy() to group the elements smaller than 50 − arr.GroupBy(b => chkSmaller(b)); The above chkSmaller() finds the el...
[ { "code": null, "e": 1183, "s": 1062, "text": "The GroupBy() is an extension method that returns a group of elements from the given collection based on some key value." }, { "code": null, "e": 1212, "s": 1183, "text": "The following is our array −" }, { "code": null, ...
SAP ABAP - If Statement
‘IF’ is a control statement used to specify one or more conditions. You may also nest the IF control structures in an ABAP program. The following syntax is used for the IF statement. IF<condition_1>. <Statements...>. ENDIF. If the expression evaluates to true, then the IF block of code will be executed. Report Y...
[ { "code": null, "e": 3030, "s": 2898, "text": "‘IF’ is a control statement used to specify one or more conditions. You may also nest the IF control structures in an ABAP program." }, { "code": null, "e": 3081, "s": 3030, "text": "The following syntax is used for the IF statement....
How to access the private methods of a class from outside of the class in Java?
You can access the private methods of a class using java reflection package. Step1 − Instantiate the Method class of the java.lang.reflect package by passing the method name of the method which is declared private. Step2 − Set the method accessible by passing value true to the setAccessible() method. Step3 − Finally, i...
[ { "code": null, "e": 1139, "s": 1062, "text": "You can access the private methods of a class using java reflection package." }, { "code": null, "e": 1277, "s": 1139, "text": "Step1 − Instantiate the Method class of the java.lang.reflect package by passing the method name of the m...
How to remove rows that contains NA values in certain columns of an R data frame?
If we have missing data in our data frame then some of them can be replaced if we have enough information about the characteristic of the case for which the information is missing. But if that information is not available and we do not find any suitable way to replace the missing values then complete.cases function can...
[ { "code": null, "e": 1433, "s": 1062, "text": "If we have missing data in our data frame then some of them can be replaced if we have enough information about the characteristic of the case for which the information is missing. But if that information is not available and we do not find any suitable...
Custom TensorFlow Loss Functions for Advanced Machine Learning | by Haihan Lan | Towards Data Science
In this article, we’ll look at: The use of custom loss functions in advanced ML applications Defining a custom loss function and integrating to a basic Tensorflow neural net model A brief example of knowledge distillation learning using a Gaussian Process reference applied to a few-shot learning problem Links to my oth...
[ { "code": null, "e": 203, "s": 171, "text": "In this article, we’ll look at:" }, { "code": null, "e": 264, "s": 203, "text": "The use of custom loss functions in advanced ML applications" }, { "code": null, "e": 351, "s": 264, "text": "Defining a custom loss f...
Neural Network Optimization. Covering optimizers, momentum, adaptive... | by Matthew Stewart, PhD Researcher | Towards Data Science
“The goal is to hit the sweet spot of maximum value optimization, where foolish risk is balanced against excessive caution.” ― Steven J. Bowen This article is the third in a series of articles aimed at demystifying neural networks and outlining how to design and implement them. In this article, I will discuss the follo...
[ { "code": null, "e": 315, "s": 172, "text": "“The goal is to hit the sweet spot of maximum value optimization, where foolish risk is balanced against excessive caution.” ― Steven J. Bowen" }, { "code": null, "e": 554, "s": 315, "text": "This article is the third in a series of ar...
Python OpenCV – cv2.flip() method - GeeksforGeeks
08 Jul, 2020 OpenCV-Python is a library of programming functions mainly aimed at real-time computer vision. cv2.flip() method is used to flip a 2D array. The function cv::flip flips a 2D array around vertical, horizontal, or both axes. Syntax: cv2.cv.flip(src, flipCode[, dst] ) Parameters:src: Input array.dst: Output a...
[ { "code": null, "e": 24560, "s": 24532, "text": "\n08 Jul, 2020" }, { "code": null, "e": 24783, "s": 24560, "text": "OpenCV-Python is a library of programming functions mainly aimed at real-time computer vision. cv2.flip() method is used to flip a 2D array. The function cv::flip ...
How to add custom fonts to a text in JavaFX?
You can set the desired font to the text node in JavaFX using the setFont() method. This method accepts an object of the class javafx.scene.text.Font. The Font class represents the fonts in JavaFX, this class provides several variants of a method named font().as shown below − font(double size) font(String family) font(...
[ { "code": null, "e": 1213, "s": 1062, "text": "You can set the desired font to the text node in JavaFX using the setFont() method. This method accepts an object of the class javafx.scene.text.Font." }, { "code": null, "e": 1339, "s": 1213, "text": "The Font class represents the f...
Count of pairs whose bitwise AND is a power of 2 - GeeksforGeeks
04 May, 2021 Given an array arr[] of N positive integers. The task is to find the number of pairs whose Bitwise AND value is a power of 2.Examples: Input: arr[] = {2, 1, 3, 4} Output: 2 Explanation: There are 2 pairs (2, 3) and (1, 3) in this array whose Bitwise AND values are: 1. (2 & 3) = 1 = (20) 2. (1 & 3) = 1 = ...
[ { "code": null, "e": 26549, "s": 26521, "text": "\n04 May, 2021" }, { "code": null, "e": 26686, "s": 26549, "text": "Given an array arr[] of N positive integers. The task is to find the number of pairs whose Bitwise AND value is a power of 2.Examples: " }, { "code": null...
Apache Pig - Installation
This chapter explains the how to download, install, and set up Apache Pig in your system. It is essential that you have Hadoop and Java installed on your system before you go for Apache Pig. Therefore, prior to installing Apache Pig, install Hadoop and Java by following the steps given in the following link − http://ww...
[ { "code": null, "e": 2774, "s": 2684, "text": "This chapter explains the how to download, install, and set up Apache Pig in your system." }, { "code": null, "e": 2995, "s": 2774, "text": "It is essential that you have Hadoop and Java installed on your system before you go for Apa...
Data Visualization with Bokeh in Python, Part I: Getting Started | by Will Koehrsen | Towards Data Science
Elevate your visualization game The most sophisticated statistical analysis can be meaningless without an effective means for communicating the results. This point was driven home by a recent experience I had on my research project, where we use data science to improve building energy efficiency. For the past several m...
[ { "code": null, "e": 204, "s": 172, "text": "Elevate your visualization game" }, { "code": null, "e": 774, "s": 204, "text": "The most sophisticated statistical analysis can be meaningless without an effective means for communicating the results. This point was driven home by a r...
Reverse all elements of given circular array starting from index K - GeeksforGeeks
08 Jun, 2021 Given a circular array arr[] of size N and an index K, the task is to reverse all elements of the circular array starting from the index K. Examples: Input: arr[] = {3, 5, 2, 4, 1}, K = 2Output: 4 2 5 3 1Explanation:After reversing the elements of the array from index K to K – 1, the modified arr[] is {4, ...
[ { "code": null, "e": 27047, "s": 27019, "text": "\n08 Jun, 2021" }, { "code": null, "e": 27187, "s": 27047, "text": "Given a circular array arr[] of size N and an index K, the task is to reverse all elements of the circular array starting from the index K." }, { "code": n...
Fine-Tune a Transformer Model for Grammar Correction | by Eric Fillion | Towards Data Science
In this article we’ll discuss how to train a state-of-the-art Transformer model to perform grammar correction. We’ll use a model called T5, which currently outperforms the human baseline on the General Language Understanding Evaluation (GLUE) benchmark — making it one of the most powerful NLP models in existence. T5 wa...
[ { "code": null, "e": 573, "s": 172, "text": "In this article we’ll discuss how to train a state-of-the-art Transformer model to perform grammar correction. We’ll use a model called T5, which currently outperforms the human baseline on the General Language Understanding Evaluation (GLUE) benchmark — ...
ElegantRL: Mastering PPO Algorithms | by Xiao-Yang Liu | Towards Data Science
This article by Xiao-Yang Liu, Steven Li, and Yiyan Zeng (J. Zheng) describes the implementation of Proximal Policy Optimization (PPO) algorithms in the ElegantRL library (Twitter and Github). PPO algorithms are widely used deep RL algorithms nowadays and are chosen as baselines by many research institutes and scholars...
[ { "code": null, "e": 493, "s": 171, "text": "This article by Xiao-Yang Liu, Steven Li, and Yiyan Zeng (J. Zheng) describes the implementation of Proximal Policy Optimization (PPO) algorithms in the ElegantRL library (Twitter and Github). PPO algorithms are widely used deep RL algorithms nowadays and...
Count the triplets | Practice | GeeksforGeeks
N = 4 arr[] = {1, 5, 3, 2} Output: 2 Explanation: There are 2 triplets: 1 + 2 = 3 and 3 +2 = 5 ​Example 2: Input: N = 3 arr[] = {2, 3, 4} Output: 0 Explanation: No such triplet exits Your Task: You don't need to read input or print anything. Your task is to complete the function countTriplet() which takes the ...
[ { "code": null, "e": 354, "s": 250, "text": "\nN = 4\narr[] = {1, 5, 3, 2}\nOutput: 2\nExplanation: There are 2 triplets: \n1 + 2 = 3 and 3 +2 = 5 " }, { "code": null, "e": 370, "s": 354, "text": "​Example 2: " }, { "code": null, "e": 447, "s": 370, "text":...
Python | os.cpu_count() method - GeeksforGeeks
11 Oct, 2021 OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. os.cpu_count() method in Python is used to get the number of CPUs in the system. This me...
[ { "code": null, "e": 25647, "s": 25619, "text": "\n11 Oct, 2021" }, { "code": null, "e": 25866, "s": 25647, "text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable...
How To Parse Data Using Python and Selenium | by Mahbub Zaman | Towards Data Science
Previously I talked about Selenium and how to use it with Ruby. Today, I’ll show you how we can use Selenium with Python. Have a look at the following post if you want to go through the basics of Selenium. In that post, I’ve briefly covered what Selenium is and when we can use it. towardsdatascience.com From this post,...
[ { "code": null, "e": 454, "s": 172, "text": "Previously I talked about Selenium and how to use it with Ruby. Today, I’ll show you how we can use Selenium with Python. Have a look at the following post if you want to go through the basics of Selenium. In that post, I’ve briefly covered what Selenium ...
Concurrency vs Parallelism
Both concurrency and parallelism are used in relation to multithreaded programs but there is a lot of confusion about the similarity and difference between them. The big question in this regard: is concurrency parallelism or not? Although both the terms appear quite similar but the answer to the above question is NO, c...
[ { "code": null, "e": 2357, "s": 1922, "text": "Both concurrency and parallelism are used in relation to multithreaded programs but there is a lot of confusion about the similarity and difference between them. The big question in this regard: is concurrency parallelism or not? Although both the terms...
How to handle windows file upload using Selenium WebDriver?
We can handle windows file upload with Selenium webdriver. This is achieved by the sendKeys method. We have to first identify the element which performs the file selection by mentioning the file path [to be uploaded]. This is only applied to an element having a type attribute set to file as value along with the element...
[ { "code": null, "e": 1280, "s": 1062, "text": "We can handle windows file upload with Selenium webdriver. This is achieved by the sendKeys method. We have to first identify the element which performs the file selection by mentioning the file path [to be uploaded]." }, { "code": null, "e"...
How To Use Riot API With Python. In this tutorial, I will use Riot API... | by Barney H. | Towards Data Science
I recommend reading their document to know the latest change of their API before you start to do anything. The Riot Games API is a REST API the provided developers data to use for building our own applications or websites. Currently, all League of Legends APIs is version 4(Updated 03/19/2020). Since this version, they ...
[ { "code": null, "e": 279, "s": 172, "text": "I recommend reading their document to know the latest change of their API before you start to do anything." }, { "code": null, "e": 543, "s": 279, "text": "The Riot Games API is a REST API the provided developers data to use for buildi...
SQL - AND and OR Conjunctive Operators
The SQL AND & OR operators are used to combine multiple conditions to narrow data in an SQL statement. These two operators are called as the conjunctive operators. These operators provide a means to make multiple comparisons with different operators in the same SQL statement. The AND operator allows the existence of mu...
[ { "code": null, "e": 2617, "s": 2453, "text": "The SQL AND & OR operators are used to combine multiple conditions to narrow data in an SQL statement. These two operators are called as the conjunctive operators." }, { "code": null, "e": 2730, "s": 2617, "text": "These operators pr...
Optimized Link State Routing Protocol - GeeksforGeeks
11 Aug, 2020 OLSR stands for Optimized Link State Routing Protocol. In this, each node periodically floods status of its links. Each node re-broadcasts link state information received from its neighbors. Each node keeps track of link state information received from other nodes. Each node uses above information to deter...
[ { "code": null, "e": 24119, "s": 24091, "text": "\n11 Aug, 2020" }, { "code": null, "e": 24496, "s": 24119, "text": "OLSR stands for Optimized Link State Routing Protocol. In this, each node periodically floods status of its links. Each node re-broadcasts link state information r...
Start an Activity from a Notification in Android?
This example demonstrate about Start an Activity from a Notification 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" ?> <...
[ { "code": null, "e": 1142, "s": 1062, "text": "This example demonstrate about Start an Activity from a Notification in Android" }, { "code": null, "e": 1271, "s": 1142, "text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required detail...
Program to create one triangle stair by using stars in Python
Suppose we have a number n, we have to find a string of stairs with n steps. Here each line in the string is separated by a newline separator. So, if the input is like n = 5, then the output will be * ** *** **** ***** To solve this, we will follow these steps − s := blank string for ...
[ { "code": null, "e": 1205, "s": 1062, "text": "Suppose we have a number n, we have to find a string of stairs with n steps. Here each line in the string is separated by a newline separator." }, { "code": null, "e": 1261, "s": 1205, "text": "So, if the input is like n = 5, then th...
Role of super Keyword in Java Inheritance
Parent class objects can be referred to using the super keyword in Java. It is usually used in the context of inheritance. A program that demonstrates the super keyword in Java is given as follows: Live Demo class A { int a; A(int x) { a = x; } } class B extends A { int b; B(int x, int y) { ...
[ { "code": null, "e": 1260, "s": 1062, "text": "Parent class objects can be referred to using the super keyword in Java. It is usually used in the context of inheritance. A program that demonstrates the super keyword in Java is given as follows:" }, { "code": null, "e": 1271, "s": 126...
Creating an array of objects based on another array of objects JavaScript
Suppose, we have an array of objects containing data about likes of some users like this − const arr = [ {"user":"dan","liked":"yes","age":"22"}, {"user":"sarah","liked":"no","age":"21"}, {"user":"john","liked":"yes","age":"23"}, ]; We are required to write a JavaScript function that takes in one such array. ...
[ { "code": null, "e": 1153, "s": 1062, "text": "Suppose, we have an array of objects containing data about likes of some users like this −" }, { "code": null, "e": 1305, "s": 1153, "text": "const arr = [\n {\"user\":\"dan\",\"liked\":\"yes\",\"age\":\"22\"},\n {\"user\":\"sara...
Java Program to Show Shallow Cloning and Deep Cloning - GeeksforGeeks
03 Jun, 2021 The default version of the clone method creates a shallow copy of an object. In java being object-oriented, object copying is creating a copy of the existing object, so the object copied can be a similar copy of the exact copy of the object of which it is copied. There are 2 ways to copy an object as follo...
[ { "code": null, "e": 23581, "s": 23553, "text": "\n03 Jun, 2021" }, { "code": null, "e": 23892, "s": 23581, "text": "The default version of the clone method creates a shallow copy of an object. In java being object-oriented, object copying is creating a copy of the existing objec...
How to make multipartite graphs using networkx and Matplotlib?
To make multipartite graph in networkx, we can take the following steps − Set the figure size and adjust the padding between and around the subplots. Set the figure size and adjust the padding between and around the subplots. Create a list of subset sizes and colors. Create a list of subset sizes and colors. Define a m...
[ { "code": null, "e": 1136, "s": 1062, "text": "To make multipartite graph in networkx, we can take the following steps −" }, { "code": null, "e": 1212, "s": 1136, "text": "Set the figure size and adjust the padding between and around the subplots." }, { "code": null, ...
Python | Addition of tuples
11 Nov, 2019 Sometimes, while working with records, we might have a common problem of adding contents of one tuple with corresponding index of other tuple. This has application in almost all the domains in which we work with tuple records. Let’s discuss certain ways in which this task can be performed. Method #1 : Usin...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Nov, 2019" }, { "code": null, "e": 319, "s": 28, "text": "Sometimes, while working with records, we might have a common problem of adding contents of one tuple with corresponding index of other tuple. This has application in almost a...
How to Write TestCases For API Calls in Flutter?
16 Oct, 2021 Here we are going to a built app that calls an API and write test cases for it before we dive into it let’s go through some basic concepts. Software testing is a process in which we test code to ensure that it produces the excepted results at any given instance. Flutter tests consist of: Unit test – test f...
[ { "code": null, "e": 28, "s": 0, "text": "\n16 Oct, 2021" }, { "code": null, "e": 168, "s": 28, "text": "Here we are going to a built app that calls an API and write test cases for it before we dive into it let’s go through some basic concepts." }, { "code": null, "e"...
Python | Numpy matrix.round()
23 Apr, 2019 With the help of Numpy matrix.round() method, we are able to round off the values of the given matrix. Syntax : matrix.round() Return : Return rounded values in matrix Example #1 : In the given example we are able to round off the given matrix by using matrix.round() method. # import the important module i...
[ { "code": null, "e": 28, "s": 0, "text": "\n23 Apr, 2019" }, { "code": null, "e": 131, "s": 28, "text": "With the help of Numpy matrix.round() method, we are able to round off the values of the given matrix." }, { "code": null, "e": 155, "s": 131, "text": "Syn...
matplotlib.axes.Axes.step() in Python
13 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": 28, "s": 0, "text": "\n13 Apr, 2020" }, { "code": null, "e": 328, "s": 28, "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, Line2D, Text...
Node.js path.resolve() Method
13 Oct, 2021 The path.resolve() method is used to resolve a sequence of path-segments to an absolute path. It works by processing the sequence of paths from right to left, prepending each of the paths until the absolute path is created. The resulting path is normalized and trailing slashes are removed as required.If no...
[ { "code": null, "e": 28, "s": 0, "text": "\n13 Oct, 2021" }, { "code": null, "e": 448, "s": 28, "text": "The path.resolve() method is used to resolve a sequence of path-segments to an absolute path. It works by processing the sequence of paths from right to left, prepending each ...
PyQtGraph – Symbols
04 Mar, 2022 PyQtGraph is a graphics and user interface Python library for functionalities commonly required in designing and science applications. Its provides fast, interactive graphics for displaying data (plots, video, etc.). A line chart is a type of graph which displays information as a series of data points comm...
[ { "code": null, "e": 28, "s": 0, "text": "\n04 Mar, 2022" }, { "code": null, "e": 599, "s": 28, "text": "PyQtGraph is a graphics and user interface Python library for functionalities commonly required in designing and science applications. Its provides fast, interactive graphics ...
Lodash _.noop() Method
14 Sep, 2020 Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. The Lodash _.noop() method is used to return “undefined” irrespective of the arguments passed to it. Syntax: _.noop() Parameters: This method can take optional para...
[ { "code": null, "e": 28, "s": 0, "text": "\n14 Sep, 2020" }, { "code": null, "e": 169, "s": 28, "text": "Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. " }, { "code": null, "e...
How to set, get and clear cookies in AngularJs?
31 Jul, 2019 In AngularJs, we need to use angular-cookies.js to set, get and clear the cookies. You can use live cdn link for this:https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular-cookies.js We need to include $cookies in your controller and it have to Get, Set and Clear method to get, set and clear cook...
[ { "code": null, "e": 28, "s": 0, "text": "\n31 Jul, 2019" }, { "code": null, "e": 111, "s": 28, "text": "In AngularJs, we need to use angular-cookies.js to set, get and clear the cookies." }, { "code": null, "e": 221, "s": 111, "text": "You can use live cdn li...
Python | Add image widget in Kivy
06 Feb, 2020 Kivy is a platform-independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows, etc. It is basically used to develop the Android application, but it does not mean that it can not be used on Desktop applications. Kivy Tutorial – Learn Kivy with Examples. The Image widget is used to ...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Feb, 2020" }, { "code": null, "e": 264, "s": 28, "text": "Kivy is a platform-independent GUI tool in Python. As it can be run on Android, IOS, Linux and Windows, etc. It is basically used to develop the Android application, but it do...
How to close a dialog box in windows?
17 May, 2020 The dialog box is a graphical control element in the form of a small window that communicates information to the user and prompts them for a response. There are two types of dialog boxes: Modal:These dialog boxes block the interaction with the software that initiated the dialog.These are used when the user...
[ { "code": null, "e": 28, "s": 0, "text": "\n17 May, 2020" }, { "code": null, "e": 179, "s": 28, "text": "The dialog box is a graphical control element in the form of a small window that communicates information to the user and prompts them for a response." }, { "code": nu...
Ways to split string such that each partition starts with distinct character
09 Jun, 2022 Given a string s. Let k be the maximum number of partitions possible of the given string with each partition starts with distinct character. The task is to find the number of ways string s can be split into k partition (non-empty) such that each partition start with distinct character. Examples: Input : ...
[ { "code": null, "e": 54, "s": 26, "text": "\n09 Jun, 2022" }, { "code": null, "e": 353, "s": 54, "text": "Given a string s. Let k be the maximum number of partitions possible of the given string with each partition starts with distinct character. The task is to find the number of...
HP Inc Interview Experience | On-Campus (Internship+FTE)
30 Dec, 2020 HP Inc visited our college in November 2020 for an internship plus performance-based PPO for Bangalore. The internship is of 6 months duration. Round 1: Around 300 students gave round 1. It was a 1 hr test. It was held on hirepro platform. It had 2 sections : AptitudeTechnical Aptitude Technical The techni...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Dec, 2020" }, { "code": null, "e": 172, "s": 28, "text": "HP Inc visited our college in November 2020 for an internship plus performance-based PPO for Bangalore. The internship is of 6 months duration." }, { "code": null, ...