title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
Pafy - Getting Watch URL for Each Item of Playlist - GeeksforGeeks
20 Jul, 2020 In this article we will see how we can get the watch URLfrom playlist items in pafy. Pafy is a python library to download YouTube content and retrieve metadata. Pafy object is the object which contains all the information about the given video. A playlist in YouTube is a list, or group, of videos that play...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n20 Jul, 2020" }, { "code": null, "e": 24719, "s": 24292, "text": "In this article we will see how we can get the watch URLfrom playlist items in pafy. Pafy is a python library to download YouTube content and retrieve metadata. Pa...
Assembly - Conditions
Conditional execution in assembly language is accomplished by several looping and branching instructions. These instructions can change the flow of control in a program. Conditional execution is observed in two scenarios − Unconditional jump This is performed by the JMP instruction. Conditional execution often involves...
[ { "code": null, "e": 2308, "s": 2085, "text": "Conditional execution in assembly language is accomplished by several looping and branching instructions. These instructions can change the flow of control in a program. Conditional execution is observed in two scenarios −" }, { "code": null, ...
NumPy Array Copy vs View
The main difference between a copy and a view of an array is that the copy is a new array, and the view is just a view of the original array. The copy owns the data and any changes made to the copy will not affect original array, and any changes made to the original array will not affect the copy. The view does not o...
[ { "code": null, "e": 142, "s": 0, "text": "The main difference between a copy and a view of an array is that\nthe copy is a new array, and the view is just a view of the original array." }, { "code": null, "e": 301, "s": 142, "text": "The copy owns the data and any changes made t...
C Program for Counting Sort - GeeksforGeeks
10 Oct, 2021 Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values (kind of hashing). Then doing some arithmetic to calculate the position of each object in the output sequence. C // C Program for counting sort#include <stdio...
[ { "code": null, "e": 23830, "s": 23802, "text": "\n10 Oct, 2021" }, { "code": null, "e": 24090, "s": 23830, "text": "Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values (kind of hashing...
C++ Program to Find Factorial of a Number using Iteration
Factorial of a non-negative integer n is the product of all the positive integers that are less than or equal to n. For example: The factorial of 6 is 720. 6! = 6 * 5 * 4 * 3 * 2 *1 6! = 720 The factorial of an integer can be found using a recursive program or an iterative program. A for loop can be used to find the fa...
[ { "code": null, "e": 1178, "s": 1062, "text": "Factorial of a non-negative integer n is the product of all the positive integers that are less than or equal to n." }, { "code": null, "e": 1218, "s": 1178, "text": "For example: The factorial of 6 is 720." }, { "code": null...
C program to draw a moving boat using graphics - GeeksforGeeks
26 Jun, 2021 In C graphics, the graphics.h functions are used to draw different shapes like circles, rectangles, etc, display text(any message) in a different format (different fonts and colors). By using the functions in the header graphics.h, programs, animations, and different games can also be made. In this article...
[ { "code": null, "e": 25453, "s": 25425, "text": "\n26 Jun, 2021" }, { "code": null, "e": 25825, "s": 25453, "text": "In C graphics, the graphics.h functions are used to draw different shapes like circles, rectangles, etc, display text(any message) in a different format (different...
multiset count() function in C++ STL
06 Oct, 2021 The multiset::count() function is a built-in function in C++ STL that searches for a specific element in the multiset container and returns the number of occurrences of that element. Syntax: multiset_name.count(val) Parameters: The function accepts a single parameter val which specifies the element to b...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Oct, 2021" }, { "code": null, "e": 212, "s": 28, "text": "The multiset::count() function is a built-in function in C++ STL that searches for a specific element in the multiset container and returns the number of occurrences of that e...
Maximum number of leaf nodes that can be visited within the given budget
18 Aug, 2021 Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can be visited under the given budget if cost of visiting a leaf node is equal to level of that leaf node. Note: Root of the tree is at level 1.Examples: Input: b = 8 10...
[ { "code": null, "e": 52, "s": 24, "text": "\n18 Aug, 2021" }, { "code": null, "e": 333, "s": 52, "text": "Given a binary tree and an integer b representing budget. The task is to find the count of maximum number of leaf nodes that can be visited under the given budget if cost of ...
How to take screenshot of a div using JavaScript ?
30 Jul, 2021 A screenshot of any element in JavaScript can be taken using the html2canvas library. This library can be downloaded from its official website. The below steps show the method to take a screenshot of a <div> element using JavaScript. Step 1: Create a blank HTML document.Step 2: Include the html2canvas libr...
[ { "code": null, "e": 28, "s": 0, "text": "\n30 Jul, 2021" }, { "code": null, "e": 262, "s": 28, "text": "A screenshot of any element in JavaScript can be taken using the html2canvas library. This library can be downloaded from its official website. The below steps show the method...
Java 8 Optional Class
19 Feb, 2022 Every Java Programmer is familiar with NullPointerException. It can crash your code. And it is very hard to avoid it without using too many null checks. So, to overcome this, Java 8 has introduced a new class Optional in java.util package. It can help in writing a neat code without using too many null chec...
[ { "code": null, "e": 54, "s": 26, "text": "\n19 Feb, 2022" }, { "code": null, "e": 556, "s": 54, "text": "Every Java Programmer is familiar with NullPointerException. It can crash your code. And it is very hard to avoid it without using too many null checks. So, to overcome this,...
p5.Camera move() Method
28 Jul, 2020 The move() method of p5.Camera in p5.js is used to move the camera along its local axes by the specified amount. It maintains the current camera orientation while moving. Syntax: move( x, y, z ) Parameters: This method accepts three parameters as mentioned above and described below: x: It is a number that ...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jul, 2020" }, { "code": null, "e": 199, "s": 28, "text": "The move() method of p5.Camera in p5.js is used to move the camera along its local axes by the specified amount. It maintains the current camera orientation while moving." }...
How to Highlight the Searched String Result using JavaScript ?
10 Dec, 2020 Given below is an HTML document which is basically about how to highlight the searched string result. In this article, we are using HTML, CSS, JavaScript, Bootstrap and mark.js to make our website more effective. Moreover, exclusively for highlighting the searched string among a given context or paragraph,...
[ { "code": null, "e": 54, "s": 26, "text": "\n10 Dec, 2020" }, { "code": null, "e": 607, "s": 54, "text": "Given below is an HTML document which is basically about how to highlight the searched string result. In this article, we are using HTML, CSS, JavaScript, Bootstrap and mark....
Java Program to Iterate Over Arrays Using for and foreach Loop
15 Sep, 2021 An array is a group of like-typed variables that are referred to by a common name. Arrays in Java work differently than they do in C/C++. Here, we have explained the for loop and foreach loop to display the elements of an array in Java. For-loop provides a concise way of writing the loop structure. A for s...
[ { "code": null, "e": 28, "s": 0, "text": "\n15 Sep, 2021" }, { "code": null, "e": 265, "s": 28, "text": "An array is a group of like-typed variables that are referred to by a common name. Arrays in Java work differently than they do in C/C++. Here, we have explained the for loop ...
C# | Abstraction
01 Oct, 2021 Data Abstraction is the property by virtue of which only the essential details are exhibited to the user. The trivial or the non-essentials units aren’t exhibited to the user. Data Abstraction may also be defined as the process of identifying only the required characteristics of an object ignoring the irre...
[ { "code": null, "e": 52, "s": 24, "text": "\n01 Oct, 2021" }, { "code": null, "e": 520, "s": 52, "text": "Data Abstraction is the property by virtue of which only the essential details are exhibited to the user. The trivial or the non-essentials units aren’t exhibited to the user...
Automating Machine Learning Workflows with Amazon Glue, Amazon SageMaker and AWS Step Functions Data Science SDK | by Olalekan Elesin | Towards Data Science
Automating machine learning workflows helps to build repeatable and reproducible machine learning models. It is a key step of in putting machine learning projects in production as we want to make sure our models are up-to-date and performant on new data. Amazon Glue, Amazon SageMaker and AWS Step Functions can help aut...
[ { "code": null, "e": 592, "s": 172, "text": "Automating machine learning workflows helps to build repeatable and reproducible machine learning models. It is a key step of in putting machine learning projects in production as we want to make sure our models are up-to-date and performant on new data. ...
Array element moved by k using single moves - GeeksforGeeks
09 May, 2022 Given a list of n integers containing numbers 1-n in a shuffled way and a integer K. N people are standing in a queue to play badminton. At first, the first two players in the queue play a game. Then the loser goes to the end of the queue, and the one who wins plays with the next person from the line, and ...
[ { "code": null, "e": 26615, "s": 26587, "text": "\n09 May, 2022" }, { "code": null, "e": 27013, "s": 26615, "text": "Given a list of n integers containing numbers 1-n in a shuffled way and a integer K. N people are standing in a queue to play badminton. At first, the first two pl...
Bootstrap Confidence intervals for performance metrics in Machine Learning | by David B Rosen | Towards Data Science
If you report your classifier’s performance as having Accuracy=94.8% and F1=92.3% on a test set, this doesn’t mean much without knowing something about the size and composition of the test set. The margin of error of those performance measurements will vary a lot depending on the size of the test set, or, for an imbala...
[ { "code": null, "e": 678, "s": 171, "text": "If you report your classifier’s performance as having Accuracy=94.8% and F1=92.3% on a test set, this doesn’t mean much without knowing something about the size and composition of the test set. The margin of error of those performance measurements will va...
Understanding the Spark insertInto function | by Ronald Ángel | Towards Data Science
Raw Data Ingestion into a Data Lake with spark is a common currently used ETL approach. In some cases, the raw data is cleaned, serialized and exposed as Hive tables used by the analytics team to perform SQL like operations. Thus, spark provides two options for tables creation: managed and external tables. The differen...
[ { "code": null, "e": 561, "s": 47, "text": "Raw Data Ingestion into a Data Lake with spark is a common currently used ETL approach. In some cases, the raw data is cleaned, serialized and exposed as Hive tables used by the analytics team to perform SQL like operations. Thus, spark provides two option...
How to Create Multiple User Accounts in Linux?
Adding a single new user to a Linux system can be achieved through the useradd command. But system admins often get request to add many users. So Linux provides a different to do a bulk addition of many users to a system.This is the newusers command. sudo newusers user_deatils.txt user_details.txt is the file containin...
[ { "code": null, "e": 1313, "s": 1062, "text": "Adding a single new user to a Linux system can be achieved through the useradd command. But system admins often get request to add many users. So Linux provides a different to do a bulk addition of many users to a system.This is the newusers command." ...
Check If It Is a Straight Line in C++
Suppose we have a list of data-points consisting of (x, y) coordinates, we have to check whether the data-points are forming straight line or not. So if the points are like [(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7)], then they are forming straight line. To solve this, we will take the differences between each con...
[ { "code": null, "e": 1322, "s": 1062, "text": "Suppose we have a list of data-points consisting of (x, y) coordinates, we have to check whether the data-points are forming straight line or not. So if the points are like [(1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7)], then they are forming straight...
How To Use Python To Buy Options From Robinhood | by Melvynn Fernandez | Towards Data Science
Just really want to test out my programming skills to mess with stocks. So what are options in trading? They are contracts which give you the right to buy or sell that asset at a price for a period of time. Some people view options as some sort of lottery ticket but I view it like blackjack, where you can do certain st...
[ { "code": null, "e": 119, "s": 47, "text": "Just really want to test out my programming skills to mess with stocks." }, { "code": null, "e": 397, "s": 119, "text": "So what are options in trading? They are contracts which give you the right to buy or sell that asset at a price fo...
Python - Change column names and row indexes in Pandas DataFrame
Pandas is a python library offering many features for data analysis which is not available in python standard library. One such feature is the use of Data Frames. They are rectangular grids representing columns and rows. While creating a Data frame, we decide on the names of the columns and refer them in subsequent dat...
[ { "code": null, "e": 1563, "s": 1062, "text": "Pandas is a python library offering many features for data analysis which is not available in python standard library. One such feature is the use of Data Frames. They are rectangular grids representing columns and rows. While creating a Data frame, we ...
Chaining of Array Methods in JavaScript - GeeksforGeeks
09 Jul, 2020 There are some methods in JavaScript that can loop through the array. We already have a knowledge about these array methods. Filter method ( filter())Map method ( map())Reduce method ( reduce())Find method ( find())Sort method ( sort()) Filter method ( filter()) Map method ( map()) Reduce method ( reduce()...
[ { "code": null, "e": 24474, "s": 24446, "text": "\n09 Jul, 2020" }, { "code": null, "e": 24599, "s": 24474, "text": "There are some methods in JavaScript that can loop through the array. We already have a knowledge about these array methods." }, { "code": null, "e": 2...
JDBC - Statements, PreparedStatement and CallableStatement
Once a connection is obtained we can interact with the database. The JDBC Statement, CallableStatement, and PreparedStatement interfaces define the methods and properties that enable you to send SQL or PL/SQL commands and receive data from your database. They also define methods that help bridge data type differences b...
[ { "code": null, "e": 2417, "s": 2162, "text": "Once a connection is obtained we can interact with the database. The JDBC Statement, CallableStatement, and PreparedStatement interfaces define the methods and properties that enable you to send SQL or PL/SQL commands and receive data from your database...
C program to check if a given string is Keyword or not - GeeksforGeeks
06 Feb, 2019 Given a string, the task is to write a program that checks if the given string is a keyword or not. Keywords are reserved words which cannot be used as variable names. There are 32 keywords in C programming language. Examples: Input: str = "geeks" Output: geeks is not a keyword Input: str = "for" Output: ...
[ { "code": null, "e": 24334, "s": 24306, "text": "\n06 Feb, 2019" }, { "code": null, "e": 24434, "s": 24334, "text": "Given a string, the task is to write a program that checks if the given string is a keyword or not." }, { "code": null, "e": 24502, "s": 24434, ...
Java Applet | Implementing Flood Fill algorithm - GeeksforGeeks
11 May, 2021 Flood Fill Algorithm is to replace a certain closed or a similarly colored field with a specified color. The use of the FloodFill algorithm can be seen in paints and other games such as minesweeper.In this article, FloodFill is used for a connected area by a specified color, in Java Applet by using the Flo...
[ { "code": null, "e": 25092, "s": 25064, "text": "\n11 May, 2021" }, { "code": null, "e": 25460, "s": 25092, "text": "Flood Fill Algorithm is to replace a certain closed or a similarly colored field with a specified color. The use of the FloodFill algorithm can be seen in paints a...
Python Program for Find minimum sum of factors of number
In this article, we will learn about the solution to the problem statement given below − Given a number input , find the minimum sum of factors of the given number. Here we will compute all the factors and their corresponding sum and then find the minimum among them. So to find the minimum sum of the product of number,...
[ { "code": null, "e": 1151, "s": 1062, "text": "In this article, we will learn about the solution to the problem statement given below −" }, { "code": null, "e": 1227, "s": 1151, "text": "Given a number input , find the minimum sum of factors of the given number." }, { "co...
How to display a bold text inside the JTextArea in Java?
A JTextArea class can extend JTextComponent and allow a user to enter multiple lines of text inside it. A JTextArea can generate a CaretListener interface, which can listen to caret update events. We can set a font to a text inside the JTextArea by using setFont() method. import java.awt.*; import javax.swing.*; public...
[ { "code": null, "e": 1335, "s": 1062, "text": "A JTextArea class can extend JTextComponent and allow a user to enter multiple lines of text inside it. A JTextArea can generate a CaretListener interface, which can listen to caret update events. We can set a font to a text inside the JTextArea by usin...
How to handle exception inside a Python for loop?
You can handle exception inside a Python for loop just like you would in a normal code block. This doesn't cause any issues. For example, for i in range(5): try: if i % 2 == 0: raise ValueError("some error") print(i) except ValueError as e: print(e) This will give the output some error 1 some...
[ { "code": null, "e": 1200, "s": 1062, "text": "You can handle exception inside a Python for loop just like you would in a normal code block. This doesn't cause any issues. For example," }, { "code": null, "e": 1339, "s": 1200, "text": "for i in range(5):\n try:\n if i % 2 ...
Tryit Editor v3.7
HTML id attribute Tryit: id as bookmark
[ { "code": null, "e": 28, "s": 10, "text": "HTML id attribute" } ]
What are cin, cout and cerr streams in C++?
cin, cout, cerr, and clog are streams that handle standard inputs and standard outputs. These are stream objects defined in iostream header file. std::cin is an object of class istream that represents the standard input stream oriented to narrow characters (of type char). It corresponds to the C stream stdin. The stand...
[ { "code": null, "e": 1208, "s": 1062, "text": "cin, cout, cerr, and clog are streams that handle standard inputs and standard outputs. These are stream objects defined in iostream header file." }, { "code": null, "e": 1549, "s": 1208, "text": "std::cin is an object of class istre...
gzip - Unix, Linux Command
gunzip, gzip - compress or expand files gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz, while keeping the same ownership m...
[ { "code": null, "e": 10617, "s": 10577, "text": "gunzip, gzip - compress or expand files" }, { "code": null, "e": 10718, "s": 10617, "text": "gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ]\ngzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ]" }, { "code": null, "e":...
Kotlin Operators - GeeksforGeeks
11 Apr, 2022 Operators are the special symbols that perform different operation on operands. For example + and – are operators that perform addition and subtraction respectively. Like Java, Kotlin contains different kinds of operators. Arithmetic operator Relation operator Assignment operator Unary operator Logical op...
[ { "code": null, "e": 24036, "s": 24008, "text": "\n11 Apr, 2022" }, { "code": null, "e": 24260, "s": 24036, "text": "Operators are the special symbols that perform different operation on operands. For example + and – are operators that perform addition and subtraction respectivel...
SSID Full Form - GeeksforGeeks
12 Jun, 2020 Service Set Identifier(SSID) is used to identify any 802.11 Wireless Local Area Network (WLAN). It is also used by clients to identify and connect to the particular Wireless Network. To discuss in layman’s terms, it is the SSID we see when we are trying to connect your device(phone/computer) to a Wireless ...
[ { "code": null, "e": 25755, "s": 25727, "text": "\n12 Jun, 2020" }, { "code": null, "e": 26176, "s": 25755, "text": "Service Set Identifier(SSID) is used to identify any 802.11 Wireless Local Area Network (WLAN). It is also used by clients to identify and connect to the particula...
Create a Tic-Tac-Toe Game using jQuery - GeeksforGeeks
16 Nov, 2021 In this post, we are going to implement 2-player tic-tac-toe using jQuery. It is quite easy to develop with some simple validations and error checks. Player-1 starts playing the game and both the players make their moves in consecutive turns. The player who makes a straight 3-block chain wins the game. Her...
[ { "code": null, "e": 24961, "s": 24933, "text": "\n16 Nov, 2021" }, { "code": null, "e": 25705, "s": 24961, "text": "In this post, we are going to implement 2-player tic-tac-toe using jQuery. It is quite easy to develop with some simple validations and error checks. Player-1 star...
Difference between super() and this() in java - GeeksforGeeks
23 Nov, 2017 Similar article : super and this keywordsuper() as well as this() both are used to make constructor calls. super() is used to call Base class’s constructor(i.e, Parent’s class) while this() is used to call current class’s constructor. Let’s see both of them in detail: super() super() is use to call Base cl...
[ { "code": null, "e": 24370, "s": 24342, "text": "\n23 Nov, 2017" }, { "code": null, "e": 24605, "s": 24370, "text": "Similar article : super and this keywordsuper() as well as this() both are used to make constructor calls. super() is used to call Base class’s constructor(i.e, Pa...
Difference Between System.out.print() and System.out.println() Function in Java - GeeksforGeeks
07 Oct, 2021 In Java, we have the following functions to print anything in the console. System.out.print() and System.out.println() But there is a slight difference between both of them, i.e. System.out.println() prints the content and switch to the next line after execution of the statement whereas System.out.print...
[ { "code": null, "e": 24932, "s": 24901, "text": " \n07 Oct, 2021\n" }, { "code": null, "e": 25007, "s": 24932, "text": "In Java, we have the following functions to print anything in the console." }, { "code": null, "e": 25030, "s": 25007, "text": "System.out.p...
Ubuntu - Command Line
Ubuntu is a Linux based operating system and most Linux users are more familiar with the command line interface. In this chapter, we will go through some of the popular command line’s used in Ubuntu. To invoke the command line, go to the search option and enter the command keyword in the search box. The search result w...
[ { "code": null, "e": 2333, "s": 2133, "text": "Ubuntu is a Linux based operating system and most Linux users are more familiar with the command line interface. In this chapter, we will go through some of the popular command line’s used in Ubuntu." }, { "code": null, "e": 2434, "s": 2...
Find probability that a player wins when probabilities of hitting the target are given - GeeksforGeeks
10 Jan, 2022 Given four integers p, q, r, and s. Two players are playing a game where both the players hit a target and the first player who hits the target wins the game. The probability of the first player hitting the target is p / q and that of the second player hitting the target is r / s. The task is to find the p...
[ { "code": null, "e": 24973, "s": 24945, "text": "\n10 Jan, 2022" }, { "code": null, "e": 25329, "s": 24973, "text": "Given four integers p, q, r, and s. Two players are playing a game where both the players hit a target and the first player who hits the target wins the game. The ...
Gradient Descent Algorithm and Its Variants | by Imad Dabbura | Towards Data Science
Optimization refers to the task of minimizing/maximizing an objective function f(x) parameterized by x. In machine/deep learning terminology, it’s the task of minimizing the cost/loss function J(w) parameterized by the model’s parameters w ∈ R^d. Optimization algorithms (in case of minimization) have one of the followi...
[ { "code": null, "e": 502, "s": 172, "text": "Optimization refers to the task of minimizing/maximizing an objective function f(x) parameterized by x. In machine/deep learning terminology, it’s the task of minimizing the cost/loss function J(w) parameterized by the model’s parameters w ∈ R^d. Optimiza...
Advanced Time Series Analysis in Python: Decomposition, Autocorrelation | Towards Data Science
Following my very well-received post and Kaggle notebook on every single Pandas function to manipulate time series, it is time to take the trajectory of this TS project to visualization. This post is about the core processes that make up an in-depth time series analysis. Specifically, we will talk about: Decomposition ...
[ { "code": null, "e": 359, "s": 172, "text": "Following my very well-received post and Kaggle notebook on every single Pandas function to manipulate time series, it is time to take the trajectory of this TS project to visualization." }, { "code": null, "e": 478, "s": 359, "text": ...
Simple Machine Learning Model in Python in 5 lines of code | by Raman Sah | Towards Data Science
In this blog, we will train a Linear Regression Model and expect to perform correct on a fresh input. The basic idea of any machine learning model is that it is exposed to a large number of inputs and also supplied the output applicable for them. On analysing more and more data, it tries to figure out the relationship ...
[ { "code": null, "e": 273, "s": 171, "text": "In this blog, we will train a Linear Regression Model and expect to perform correct on a fresh input." }, { "code": null, "e": 521, "s": 273, "text": "The basic idea of any machine learning model is that it is exposed to a large number...
Python | bytearray() function - GeeksforGeeks
30 Jul, 2018 bytearray() method returns a bytearray object which is an array of given bytes. It gives a mutable sequence of integers in the range 0 <= x < 256. Syntax: bytearray(source, encoding, errors) Parameters: source[optional]: Initializes the array of bytes encoding[optional]: Encoding of the string errors[optio...
[ { "code": null, "e": 24313, "s": 24285, "text": "\n30 Jul, 2018" }, { "code": null, "e": 24460, "s": 24313, "text": "bytearray() method returns a bytearray object which is an array of given bytes. It gives a mutable sequence of integers in the range 0 <= x < 256." }, { "c...
Big Data Analytics - Introduction to R
This section is devoted to introduce the users to the R programming language. R can be downloaded from the cran website. For Windows users, it is useful to install rtools and the rstudio IDE. The general concept behind R is to serve as an interface to other software developed in compiled languages such as C, C++, and F...
[ { "code": null, "e": 2746, "s": 2554, "text": "This section is devoted to introduce the users to the R programming language. R can be downloaded from the cran website. For Windows users, it is useful to install rtools and the rstudio IDE." }, { "code": null, "e": 2939, "s": 2746, ...
Python Conditions
Python supports the usual logical conditions from mathematics: Equals: a == b Not Equals: a != b Less than: a < b Less than or equal to: a <= b Greater than: a > b Greater than or equal to: a >= b These conditions can be used in several ways, most commonly in "if statements" and loops. An "if statement" is written by u...
[ { "code": null, "e": 63, "s": 0, "text": "Python supports the usual logical conditions from mathematics:" }, { "code": null, "e": 78, "s": 63, "text": "Equals: a == b" }, { "code": null, "e": 97, "s": 78, "text": "Not Equals: a != b" }, { "code": null,...
Check if it is possible to make two matrices strictly increasing by swapping corresponding values only in Python
Suppose we have two matrices of size n x m named mat1 and mat2. We have to check where these two matrices are strictly increasing or not by swapping only two elements in different matrices only when they are at position (i, j) in both matrices. So, if the input is like then the output will be True as we can swap (7, 14...
[ { "code": null, "e": 1307, "s": 1062, "text": "Suppose we have two matrices of size n x m named mat1 and mat2. We have to check where these two matrices are strictly increasing or not by swapping only two elements in different matrices only when they are at position (i, j) in both matrices." }, ...
Basic data structures of xarray. How to create DataArray and Dataset in... | by Udi Yosovzon | Towards Data Science
Xarray is a python package for working with labeled multi-dimensional (a.k.a. N-dimensional, ND) arrays, it includes functions for advanced analytics and visualization. Xarray is heavily inspired by pandas and it uses pandas internally. While pandas is a great tool for working with tabular data, it can get a little awk...
[ { "code": null, "e": 720, "s": 171, "text": "Xarray is a python package for working with labeled multi-dimensional (a.k.a. N-dimensional, ND) arrays, it includes functions for advanced analytics and visualization. Xarray is heavily inspired by pandas and it uses pandas internally. While pandas is a ...
Boost your efficiency and process Excel-files with Python | by Benedikt Droste | Towards Data Science
If you work with data, you will get in touch with excel. Even if you don ́t use it by yourself, your clients or colleagues will use it. Excel is great for what it is made: table calculation for smaller data sets. But I always hated the kind of excel sheets with one million rows and hundreds of columns. This workbooks a...
[ { "code": null, "e": 723, "s": 171, "text": "If you work with data, you will get in touch with excel. Even if you don ́t use it by yourself, your clients or colleagues will use it. Excel is great for what it is made: table calculation for smaller data sets. But I always hated the kind of excel sheet...
How to Improve your Supply Chain with Deep Reinforcement Learning | by Christian Hubbs | Towards Data Science
What has set Amazon apart from the competition in online retail? Their supply chain. In fact, this has long been one of the greatest strengths of one of their chief competitors, Walmart. Supply chains are highly complex systems consisting of hundreds if not thousands of manufacturers and logistics carriers around the w...
[ { "code": null, "e": 358, "s": 171, "text": "What has set Amazon apart from the competition in online retail? Their supply chain. In fact, this has long been one of the greatest strengths of one of their chief competitors, Walmart." }, { "code": null, "e": 1113, "s": 358, "text":...
Saving and Loading Keras model using JSON and YAML files | by Renu Khandelwal | Towards Data Science
How can you share a deep learning model you trained that is giving awesome results with other team members working in a different part of the world or How to save a deep learning model and it’s trained weights during or after training or How to resume training of a model from where you left off? To answer the above que...
[ { "code": null, "e": 469, "s": 172, "text": "How can you share a deep learning model you trained that is giving awesome results with other team members working in a different part of the world or How to save a deep learning model and it’s trained weights during or after training or How to resume tra...
Interpretability in PyTorch, Integrated Gradient | Towards Data Science
Neural networks have been taking the world by storm. Not a week passes without great news about how GPT-3 supposedly automates yet another language task. Or how AI is helping doctors during the current pandemic. But an increasing share of the population is becoming more and more skeptical about the turn AI is taking. D...
[ { "code": null, "e": 384, "s": 172, "text": "Neural networks have been taking the world by storm. Not a week passes without great news about how GPT-3 supposedly automates yet another language task. Or how AI is helping doctors during the current pandemic." }, { "code": null, "e": 667, ...
How to get last 2 characters from string in C# using Regex?
Set the string − string str = "Cookie and Session"; Use the following Regex to get the last 2 characters from string − Regex.Match(str,@"(.{2})\s*$") The following is the code − Live Demo using System; using System.Text.RegularExpressions; public class Demo { public static void Main() { string str = "Cookie a...
[ { "code": null, "e": 1079, "s": 1062, "text": "Set the string −" }, { "code": null, "e": 1114, "s": 1079, "text": "string str = \"Cookie and Session\";" }, { "code": null, "e": 1181, "s": 1114, "text": "Use the following Regex to get the last 2 characters from...
JSTL - fn:startsWith() Function
The fn:startsWith() function determines if an input string starts with a specified substring. The fn:startsWith() function has the following syntax − boolean startsWith(java.lang.String, java.lang.String) Following example explains the functionality of the fn:startsWith() function − <%@ taglib uri = "http://java.sun.c...
[ { "code": null, "e": 2333, "s": 2239, "text": "The fn:startsWith() function determines if an input string starts with a specified substring." }, { "code": null, "e": 2389, "s": 2333, "text": "The fn:startsWith() function has the following syntax −" }, { "code": null, ...
How to use SVG images in HTML5?
To use SVG images in HTML5, use <img> element or <svg>. To add SVG files, you can use <img> <object>, or <embed> element in HTML. Choose any one of them according to your requirement. Here’s how you can add SVG images. If the SVG is saved as a file, it can be directly used as an SVG image: You can try to run the follow...
[ { "code": null, "e": 1246, "s": 1062, "text": "To use SVG images in HTML5, use <img> element or <svg>. To add SVG files, you can use <img> <object>, or <embed> element in HTML. Choose any one of them according to your requirement." }, { "code": null, "e": 1353, "s": 1246, "text":...
C# Tutorial (C Sharp)
C# (C-Sharp) is a programming language developed by Microsoft that runs on the .NET Framework. C# is used to develop web apps, desktop apps, mobile apps, games and much more. Our "Try it Yourself" tool makes it easy to learn C#. You can edit C# code and view the result in your browser. using System; namespace HelloW...
[ { "code": null, "e": 96, "s": 0, "text": "C# (C-Sharp) is a programming language developed by Microsoft that runs on the .NET \nFramework." }, { "code": null, "e": 177, "s": 96, "text": "C# is used to develop web apps, desktop apps, mobile apps, games and much \nmore." }, { ...
Return type of getchar(), fgetc() and getc() in C
Details about getchar(), fgetc() and getc() functions in C programming are given as follows − The getchar() function obtains a character from stdin. It returns the character that was read in the form of an integer or EOF if an error occurs. A program that demonstrates this is as follows − Live Demo #include <stdio.h> ...
[ { "code": null, "e": 1156, "s": 1062, "text": "Details about getchar(), fgetc() and getc() functions in C programming are given as follows −" }, { "code": null, "e": 1303, "s": 1156, "text": "The getchar() function obtains a character from stdin. It returns the character that was...
How to declare variables in JavaScript?
Like many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container. Before you use a variable in a JavaScript program, you must declare it. Variables are declared with the va...
[ { "code": null, "e": 1276, "s": 1062, "text": "Like many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container." }, { "code": null, "e": 14...
Fetch records from interval of past 3 days from current date in MySQL and add the corresponding records
Let us first create a table − mysql> create table DemoTable ( ProductAmount int, PurchaseDate datetime ); Query OK, 0 rows affected (0.94 sec) Note − Let’s say the current date is 2010-09-15. Insert some records in the table using insert command − mysql> insert into DemoTable values(567,'2019-09-10'); Query OK, 1...
[ { "code": null, "e": 1092, "s": 1062, "text": "Let us first create a table −" }, { "code": null, "e": 1211, "s": 1092, "text": "mysql> create table DemoTable\n(\n ProductAmount int,\n PurchaseDate datetime\n);\nQuery OK, 0 rows affected (0.94 sec)" }, { "code": null, ...
Python - Searching Algorithms
Searching is a very basic necessity when you store data in different data structures. The simplest approach is to go across every element in the data structure and match it with the value you are searching for.This is known as Linear search. It is inefficient and rarely used, but creating a program for it gives an idea...
[ { "code": null, "e": 2708, "s": 2327, "text": "Searching is a very basic necessity when you store data in different data structures. The simplest approach is to go across every element in the data structure and match it with the value you are searching for.This is known as Linear search. It is ineff...
Bottom-left to upward-right Traversal in a Binary Tree - GeeksforGeeks
15 Sep, 2021 Given a Binary Tree, the task is to print the Bottom-left to Upward-right Traversal of the given Binary Tree i.e., the level order traversal having level as Bottom-left to Upward-right node. Examples: Input: Below is the given Tree: Output: 2 7 2 5 6 5 11 4 9Explanation: Level 1: 2 7 2 (going upwards from...
[ { "code": null, "e": 24297, "s": 24269, "text": "\n15 Sep, 2021" }, { "code": null, "e": 24488, "s": 24297, "text": "Given a Binary Tree, the task is to print the Bottom-left to Upward-right Traversal of the given Binary Tree i.e., the level order traversal having level as Bottom...
Sum of the series 2^0 + 2^1 + 2^2 +...+ 2^n in C++
In this problem, we are given a number n which defines the n-th term of the series 2^0, 2^1, 2^2, ..., 2^n. Our task is to create a program to find the sum of the series 2^0 + 2^1 + 2^2 +...+ 2^n. Input n=6 Output Explanation sum = 2^0 + 2^1 + 2^2 + 2^3 + 2^4 + 2^5 + 2^6 sum = 1 + 2 + 4 + 8 + 16 + 32 + 64 = 127 A sim...
[ { "code": null, "e": 1259, "s": 1062, "text": "In this problem, we are given a number n which defines the n-th term of the series 2^0, 2^1, 2^2, ..., 2^n. Our task is to create a program to find the sum of the series 2^0 + 2^1 + 2^2 +...+ 2^n." }, { "code": null, "e": 1265, "s": 1259...
Minimum sum of subarray | Practice | GeeksforGeeks
Given an array of integers of size N, for all, i's [1, N], the task is to find the minimum subarray sum in the subarray [i, N]. Input: 1. The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows. 2. The first line of each test case contains a s...
[ { "code": null, "e": 366, "s": 238, "text": "Given an array of integers of size N, for all, i's [1, N], the task is to find the minimum subarray sum in the subarray [i, N]." }, { "code": null, "e": 841, "s": 366, "text": "Input: \n1. The first line of the input contains a single ...
First strictly greater element in a sorted array in Java - GeeksforGeeks
16 Jun, 2021 Given a sorted array and a target value, find the first element that is strictly greater than given element. Examples: Input : arr[] = {1, 2, 3, 5, 8, 12} Target = 5 Output : 4 (Index of 8) Input : {1, 2, 3, 5, 8, 12} Target = 8 Output : 5 (Index of 12) Input : {1, 2, 3, 5, 8, 12} ...
[ { "code": null, "e": 24290, "s": 24262, "text": "\n16 Jun, 2021" }, { "code": null, "e": 24399, "s": 24290, "text": "Given a sorted array and a target value, find the first element that is strictly greater than given element." }, { "code": null, "e": 24410, "s": 2...
BabylonJS - Box
In this section, we will learn how to add box to the scene we created. To create box, following is the syntax. var box = BABYLON.Mesh.CreateBox("box", 6.0, scene, false, BABYLON.Mesh.DEFAULTSIDE); The following are the different parameters to add box − Name − The Name to be given to the box; for example, “box”. Name −...
[ { "code": null, "e": 2254, "s": 2183, "text": "In this section, we will learn how to add box to the scene we created." }, { "code": null, "e": 2294, "s": 2254, "text": "To create box, following is the syntax." }, { "code": null, "e": 2381, "s": 2294, "text": "...
How to create a left-right split pane in Java?
To create a left-right split pane, let us create two components and split them − JComponent one = new JLabel("Left Split"); one.setBorder(BorderFactory.createLineBorder(Color.MAGENTA)); JComponent two = new JLabel("Right Split"); two.setBorder(BorderFactory.createLineBorder(Color.ORANGE)); Now, we will split them. The ...
[ { "code": null, "e": 1143, "s": 1062, "text": "To create a left-right split pane, let us create two components and split them −" }, { "code": null, "e": 1353, "s": 1143, "text": "JComponent one = new JLabel(\"Left Split\");\none.setBorder(BorderFactory.createLineBorder(Color.MAGE...
From scikit-learn to Spark ML. Taking a machine learning project from... | by Scott Johnson | Towards Data Science
In a previous post, I showed how to take a raw dataset of home sales and apply feature engineering techniques in Python with pandas. This allowed us to produce and improve predictions on home sale prices using scikit-learn machine learning models. But what happens when you want to take this sort of project to productio...
[ { "code": null, "e": 420, "s": 172, "text": "In a previous post, I showed how to take a raw dataset of home sales and apply feature engineering techniques in Python with pandas. This allowed us to produce and improve predictions on home sale prices using scikit-learn machine learning models." }, ...
Instant minus() method in Java
An immutable copy of a instant where a time unit is subtracted from it can be obtained using the minus() method in the Instant class in Java. This method requires two parameters i.e. time to be subtracted from the instant and the unit in which it is to be subtracted. It also returns the immutable copy of the instant wh...
[ { "code": null, "e": 1424, "s": 1062, "text": "An immutable copy of a instant where a time unit is subtracted from it can be obtained using the minus() method in the Instant class in Java. This method requires two parameters i.e. time to be subtracted from the instant and the unit in which it is to ...
Deploying Docker containers in AWS Fargate | by Eduardo Vioque | Towards Data Science
Docker is a fantastic tool to encapsulate and deploy applications in an easy and scalable way. Indeed, something I find myself doing very often is wrapping Python libraries into Docker images that I can later use as boilerplates for my projects. In this post, I will illustrate how to register your Docker images in a co...
[ { "code": null, "e": 418, "s": 172, "text": "Docker is a fantastic tool to encapsulate and deploy applications in an easy and scalable way. Indeed, something I find myself doing very often is wrapping Python libraries into Docker images that I can later use as boilerplates for my projects." }, {...
Program to find sum of prime numbers between 1 to n - GeeksforGeeks
27 Jan, 2022 Write a program to find sum of all prime numbers between 1 to n.Examples: Input : 10 Output : 17 Explanation : Primes between 1 to 10 : 2, 3, 5, 7. Input : 11 Output : 28 Explanation : Primes between 1 to 11 : 2, 3, 5, 7, 11. A simple solution is to traverse all numbers from 1 to n. For every number, ...
[ { "code": null, "e": 24321, "s": 24293, "text": "\n27 Jan, 2022" }, { "code": null, "e": 24397, "s": 24321, "text": "Write a program to find sum of all prime numbers between 1 to n.Examples: " }, { "code": null, "e": 24550, "s": 24397, "text": "Input : 10\nOu...
Batch Script – Remove All Spaces
28 Nov, 2021 In this article, we are going to see how to remove all spaces from any string using Batch String. Example : Input: G e e k s f o r G e e k s Output: GeeksforGeeks By using ‘ set ‘ we are getting input of any string.Example: set str=input string Example: set str=input string In the next line using ‘ ...
[ { "code": null, "e": 54, "s": 26, "text": "\n28 Nov, 2021" }, { "code": null, "e": 152, "s": 54, "text": "In this article, we are going to see how to remove all spaces from any string using Batch String." }, { "code": null, "e": 162, "s": 152, "text": "Example...
Java Program to Find the Area of a Triangle
02 Dec, 2020 A triangle is a polygon. It has three edges and three vertices and each vertex from an angle. It is a closed 2-dimensional shape. In this article, we will learn how to find the area of the triangle. There can be two possibilities while calculating the area of the triangle as per cases Using the height and ...
[ { "code": null, "e": 28, "s": 0, "text": "\n02 Dec, 2020" }, { "code": null, "e": 227, "s": 28, "text": "A triangle is a polygon. It has three edges and three vertices and each vertex from an angle. It is a closed 2-dimensional shape. In this article, we will learn how to find th...
Rabin-Karp algorithm for Pattern Searching in Matrix
06 Aug, 2021 Given matrices txt[][] of dimensions m1 x m2 and pattern pat[][] of dimensions n1 x n2, the task is to check whether a pattern exists in the matrix or not, and if yes then print the top most indices of the pat[][] in txt[][]. It is assumed that m1, m2 ≥ n1, n2 Examples: Input: txt[][] = {{G, H, I, P} ...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Aug, 2021" }, { "code": null, "e": 313, "s": 52, "text": "Given matrices txt[][] of dimensions m1 x m2 and pattern pat[][] of dimensions n1 x n2, the task is to check whether a pattern exists in the matrix or not, and if yes then pr...
Perl | index() Function
25 Jun, 2019 This function returns the position of the first occurrence of given substring (or pattern) in a string (or text). We can specify start position. By default, it searches from the beginning(i.e. from index zero). Syntax:# Searches pat in text from given indexindex(text, pat, index) # Searches pat in textinde...
[ { "code": null, "e": 28, "s": 0, "text": "\n25 Jun, 2019" }, { "code": null, "e": 239, "s": 28, "text": "This function returns the position of the first occurrence of given substring (or pattern) in a string (or text). We can specify start position. By default, it searches from t...
Interesting facts about null in Java
09 Jun, 2022 Almost all the programming languages are bonded with null. There is hardly a programmer, who is not troubled by null. In Java, null is associated java.lang.NullPointerException. As it is a class in java.lang package, it is called when we try to perform some operations with or without null, and sometimes we...
[ { "code": null, "e": 52, "s": 24, "text": "\n09 Jun, 2022" }, { "code": null, "e": 491, "s": 52, "text": "Almost all the programming languages are bonded with null. There is hardly a programmer, who is not troubled by null. In Java, null is associated java.lang.NullPointerExcepti...
Literals in Python
01 Sep, 2021 Generally, literals are a notation for representing a fixed value in source code. They can also be defined as raw value or data given in variables or constants. Example: Python3 # Numeric literalsx = 24y = 24.3z = 2+3jprint(x, y, z) 24 24.3 (2+3j) Here 24, 24.3, 2+3j are considered as literals. Python ha...
[ { "code": null, "e": 54, "s": 26, "text": "\n01 Sep, 2021" }, { "code": null, "e": 216, "s": 54, "text": "Generally, literals are a notation for representing a fixed value in source code. They can also be defined as raw value or data given in variables or constants. " }, { ...
Python | os.makedirs() method
08 Dec, 2020 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.All functions in os module raise OSError in the case of invalid or inaccessible file name...
[ { "code": null, "e": 28, "s": 0, "text": "\n08 Dec, 2020" }, { "code": null, "e": 685, "s": 28, "text": "OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of usin...
Routing Path for ExpressJS
23 Aug, 2019 What and Why ?Routing in ExpressJS is used to subdivide and organize the web application into multiple mini-applications each having its own functionality. It provides more functionality by subdividing the web application rather than including all of the functionality on a single page. These mini-applicati...
[ { "code": null, "e": 52, "s": 24, "text": "\n23 Aug, 2019" }, { "code": null, "e": 840, "s": 52, "text": "What and Why ?Routing in ExpressJS is used to subdivide and organize the web application into multiple mini-applications each having its own functionality. It provides more f...
map::operator[] in C++ STL
06 Oct, 2021 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. This operator is used to reference the element present at position given inside the operator. It is similar to the at() function, the onl...
[ { "code": null, "e": 52, "s": 24, "text": "\n06 Oct, 2021" }, { "code": null, "e": 222, "s": 52, "text": "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. " }...
NumPy Array Shape
19 Feb, 2022 The shape of an array can be defined as the number of elements in each dimension. Dimension is the number of indices or subscripts, that we require in order to specify an individual element of an array. In NumPy we will use an attribute called shape which returns a tuple, the elements of the tuple give the...
[ { "code": null, "e": 52, "s": 24, "text": "\n19 Feb, 2022" }, { "code": null, "e": 255, "s": 52, "text": "The shape of an array can be defined as the number of elements in each dimension. Dimension is the number of indices or subscripts, that we require in order to specify an ind...
Java Program For Chocolate Distribution Problem
06 Jan, 2022 Given an array of n integers where each value represents the number of chocolates in a packet. Each packet can have a variable number of chocolates. There are m students, the task is to distribute chocolate packets such that: Each student gets one packet.The difference between the number of chocolates in ...
[ { "code": null, "e": 28, "s": 0, "text": "\n06 Jan, 2022" }, { "code": null, "e": 255, "s": 28, "text": "Given an array of n integers where each value represents the number of chocolates in a packet. Each packet can have a variable number of chocolates. There are m students, the ...
How to bind events on dynamically created elements using jQuery?
To bind events on dynamically created elements, you need to load dynamically. You can try to run the following code to learn how to bind events on dynamically created elements. Here, we will generate a new list item on button click. Live Demo <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/l...
[ { "code": null, "e": 1295, "s": 1062, "text": "To bind events on dynamically created elements, you need to load dynamically. You can try to run the following code to learn how to bind events on dynamically created elements. Here, we will generate a new list item on button click." }, { "code"...
Dimensionality-Reduction with Latent Dirichlet Allocation | by Xiao Ma | Towards Data Science
Dimensionality-reduction is an unsupervised machine learning technique that is often used in conjunction with supervised models. While reducing the dimensionality often makes a feature-based model less interpretable, it’s always very effective in preventing over-fitting and shortening the training time by reducing the ...
[ { "code": null, "e": 734, "s": 171, "text": "Dimensionality-reduction is an unsupervised machine learning technique that is often used in conjunction with supervised models. While reducing the dimensionality often makes a feature-based model less interpretable, it’s always very effective in preventi...
Check whether the given number is Wagstaff prime or not - GeeksforGeeks
26 Apr, 2021 Given a positive integer n, the task is to check if it is a Wagstaff prime or not. Print ‘YES’ if the given number is Wagstaff prime otherwise print ‘NO’.Wagstaff prime: In mathematics, Wagstaff prime is a prime number ‘n’ of the form where ‘q’ is an odd prime.First, few Wagstaff prime numbers are: 3, 11,...
[ { "code": null, "e": 24621, "s": 24593, "text": "\n26 Apr, 2021" }, { "code": null, "e": 24922, "s": 24621, "text": "Given a positive integer n, the task is to check if it is a Wagstaff prime or not. Print ‘YES’ if the given number is Wagstaff prime otherwise print ‘NO’.Wagstaff ...
How to link jQuery from Google CDN?
jQuery is a JavaScript library primarily designed with the purpose to make it easier to use JavaScript on our website. jQuery wraps many lines of JavaScript code into methods that we can call with a single line of code. Google provides CDN support for jQuery via the googleapis.com domain. The latest version of Google C...
[ { "code": null, "e": 1558, "s": 1062, "text": "jQuery is a JavaScript library primarily designed with the purpose to make it easier to use JavaScript on our website. jQuery wraps many lines of JavaScript code into methods that we can call with a single line of code. Google provides CDN support for j...
Design Pattern Quick Guide
Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development. These solutions were obtained by trial and error by numerous software developers over quite a substantial pe...
[ { "code": null, "e": 3085, "s": 2751, "text": "Design patterns represent the best practices used by experienced object-oriented software developers. Design patterns are solutions to general problems that software developers faced during software development.\nThese solutions were obtained by trial a...
List View - Function based Views Django - GeeksforGeeks
27 Aug, 2021 List View refers to a view (logic) to list all or particular instances of a table from the database in a particular order. It is used to display multiple types of data on a single page or view, for example, products on an eCommerce page. Django provides extra-ordinary support for List Views but let’s check...
[ { "code": null, "e": 24292, "s": 24264, "text": "\n27 Aug, 2021" }, { "code": null, "e": 24854, "s": 24292, "text": "List View refers to a view (logic) to list all or particular instances of a table from the database in a particular order. It is used to display multiple types of ...
Batch Script - Printing
Printing can also be controlled from within Batch Script via the NET PRINT command. PRINT [/D:device] [[drive:][path]filename[...]] Where /D:device - Specifies a print device. print c:\example.txt /c /d:lpt1 The above command will print the example.txt file to the parallel port lpt1. As of Windows 2000, many, but not ...
[ { "code": null, "e": 2253, "s": 2169, "text": "Printing can also be controlled from within Batch Script via the NET PRINT command." }, { "code": null, "e": 2302, "s": 2253, "text": "PRINT [/D:device] [[drive:][path]filename[...]]\n" }, { "code": null, "e": 2346, "...
Find average of each array within an array JavaScript
We are required to write a function getAverage() that accepts an array of arrays of numbers and we are required to return a new array of numbers that contains the average of corresponding subarrays. Let’s write the code for this. We will map over the original array, reducing the subarray to their averages like this − c...
[ { "code": null, "e": 1261, "s": 1062, "text": "We are required to write a function getAverage() that accepts an array of arrays of numbers and\nwe are required to return a new array of numbers that contains the average of corresponding\nsubarrays." }, { "code": null, "e": 1381, "s": ...
How to Use Poisson Distribution like You Know What You Are Doing | Towards Data Science
You have been freelancing for 10 years now. So far, your average annual income was about 80,000$. This year, you feel like you are stuck in a rut and decide to hit 6 figures. To do that, you want to start by calculating the probability of this exciting achievement happening but you don’t know how to do so. Turns out, y...
[ { "code": null, "e": 480, "s": 172, "text": "You have been freelancing for 10 years now. So far, your average annual income was about 80,000$. This year, you feel like you are stuck in a rut and decide to hit 6 figures. To do that, you want to start by calculating the probability of this exciting ac...
Count of Leap Years in a given year range
09 Nov, 2021 Given two years L and R, the task is to find the total number of leap years possible in the range (L, R) inclusive.Examples: Input: L = 1, R = 400 Output: 97Input: L = 400, R = 2000 Output: 389 Naive Approach: The idea is to iterate through L to R and check if the year is a leap year or not using thi...
[ { "code": null, "e": 53, "s": 25, "text": "\n09 Nov, 2021" }, { "code": null, "e": 180, "s": 53, "text": "Given two years L and R, the task is to find the total number of leap years possible in the range (L, R) inclusive.Examples: " }, { "code": null, "e": 251, "...
Rotate the matrix right by K times
14 Jun, 2022 Given a matrix of size N*M, and a number K. We have to rotate the matrix K times to the right side. Examples: Input : N = 3, M = 3, K = 2 12 23 34 45 56 67 78 89 91 Output : 23 34 12 56 67 45 89 91 78 Input : N = 2, M = 2, K = 2 1 2 3 ...
[ { "code": null, "e": 54, "s": 26, "text": "\n14 Jun, 2022" }, { "code": null, "e": 166, "s": 54, "text": "Given a matrix of size N*M, and a number K. We have to rotate the matrix K times to the right side. Examples: " }, { "code": null, "e": 399, "s": 166, "t...
How to define attributes of a class in Python?
Everything, almost everything in Python is an object. Every object has attributes and methods. Thus attributes are very fundamental in Python. A class is a construct which is a collection of similar objects. A class also has attributes. There will be a difference between the class attributes and instance attributes. Th...
[ { "code": null, "e": 1470, "s": 1062, "text": "Everything, almost everything in Python is an object. Every object has attributes and methods. Thus attributes are very fundamental in Python. A class is a construct which is a collection of similar objects. A class also has attributes. There will be a ...
10 Minutes to Building a Binary Image Classifier By Applying Transfer Learning to MobileNet in TensorFlow | by Binh Phan | Towards Data Science
This is a short introduction to computer vision — namely, how to build a binary image classifier using transfer learning on the MobileNet model, geared mainly towards new users. This easy-to-follow tutorial is broken down into 3 sections: The dataThe model architectureThe accuracy, ROC curve, and AUC The data The model...
[ { "code": null, "e": 411, "s": 172, "text": "This is a short introduction to computer vision — namely, how to build a binary image classifier using transfer learning on the MobileNet model, geared mainly towards new users. This easy-to-follow tutorial is broken down into 3 sections:" }, { "c...
Java continue Keyword
❮ Java Keywords Skip the iteration if the variable i is 4, but continue with the next iteration: for (int i = 0; i < 10; i++) { if (i == 4) { continue; } System.out.println(i); } Try it Yourself » The continue keyword is used to end the current iteration in a for loop (or a while loop), and continues to t...
[ { "code": null, "e": 18, "s": 0, "text": "\n❮ Java Keywords\n" }, { "code": null, "e": 99, "s": 18, "text": "Skip the iteration if the variable i is 4, but continue with the next iteration:" }, { "code": null, "e": 192, "s": 99, "text": "for (int i = 0; i < 10...
Boundary Value Analysis : Nature of Roots of a Quadratic equation - GeeksforGeeks
04 Mar, 2020 Consider a problem for the determination of the nature of the roots of a quadratic equation where the inputs are 3 variables (a, b, c) and their values may be from the interval [0, 100]. The output may be one of the following depending on the values of the variables: Not a quadratic equation, Real roots, I...
[ { "code": null, "e": 24301, "s": 24273, "text": "\n04 Mar, 2020" }, { "code": null, "e": 24569, "s": 24301, "text": "Consider a problem for the determination of the nature of the roots of a quadratic equation where the inputs are 3 variables (a, b, c) and their values may be from...
Pythonic MetaProgramming With MetaClasses | by Emmett Boudreau | Towards Data Science
Metaprogramming is the construction of code to manipulate code and can allow for some pretty interesting and expressive results in syntax. Metaprogramming is not a concept that is typically associated with Python, but the reality is that Python and meta actually go together in a lot of cool and unique ways. If you’ve e...
[ { "code": null, "e": 595, "s": 172, "text": "Metaprogramming is the construction of code to manipulate code and can allow for some pretty interesting and expressive results in syntax. Metaprogramming is not a concept that is typically associated with Python, but the reality is that Python and meta a...
PHP Sorting Arrays
The elements in an array can be sorted in alphabetical or numerical order, descending or ascending. In this chapter, we will go through the following PHP array sort functions: sort() - sort arrays in ascending order rsort() - sort arrays in descending order asort() - sort associative arrays in ascending order, accordin...
[ { "code": null, "e": 100, "s": 0, "text": "The elements in an array can be sorted in alphabetical or numerical order, descending or ascending." }, { "code": null, "e": 176, "s": 100, "text": "In this chapter, we will go through the following PHP array sort functions:" }, { ...
PL/SQL Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to PL/SQL. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz. ...
[ { "code": null, "e": 2385, "s": 2065, "text": "Following quiz provides Multiple Choice Questions (MCQs) related to PL/SQL. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You c...
Are quotes around tables and columns in a MySQL query really necessary?
If your table name or column name are any reserved words then you need to use quotes around table name and column name in a MySQL query. You need to use backticks around table name and column name. The syntax is as follows: SELECT *FROM `table` where `where`=condition; Here is the query to create a table without quotes...
[ { "code": null, "e": 1286, "s": 1062, "text": "If your table name or column name are any reserved words then you need to use quotes around table name and column name in a MySQL query. You need to use backticks around table name and column name. The syntax is as follows:" }, { "code": null, ...
Google Sheets, Meet Pandas DataFrame | by Nicholas Ballard | Towards Data Science
Maybe it’s from too many hours behind the keyboard. But sometimes my reading and watching on the internet gives me the feeling I’m one of an endangered species of developer. One who’s working inside spreadsheets. Every single day. Can you believe it? Developers, going about their lives like spreadsheets don’t exist. If...
[ { "code": null, "e": 402, "s": 171, "text": "Maybe it’s from too many hours behind the keyboard. But sometimes my reading and watching on the internet gives me the feeling I’m one of an endangered species of developer. One who’s working inside spreadsheets. Every single day." }, { "code": nu...