title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
PHP | basename( ) Function - GeeksforGeeks | 26 Apr, 2018
The basename() function in PHP is an inbuilt function which is used to return the base name of a file if the path of the file is provided as a parameter to the basename() function.
Syntax:
string basename ( $path , $suffix )
Parameters: The basename() function in PHP accepts two parameters which are path a... | [
{
"code": null,
"e": 42139,
"s": 42111,
"text": "\n26 Apr, 2018"
},
{
"code": null,
"e": 42320,
"s": 42139,
"text": "The basename() function in PHP is an inbuilt function which is used to return the base name of a file if the path of the file is provided as a parameter to the bas... |
How to pause/play animation using CSS ? - GeeksforGeeks | 06 Apr, 2021
CSS helps to animate HTML elements without using JavaScript. You can play and pause the animation applied to HTML elements using animation-play-state property of CSS.
paused – Pauses an ongoing animation.
running – Starts a paused animation (default value).
Create HTML file
Create CSS file:Specify the posi... | [
{
"code": null,
"e": 26621,
"s": 26593,
"text": "\n06 Apr, 2021"
},
{
"code": null,
"e": 26788,
"s": 26621,
"text": "CSS helps to animate HTML elements without using JavaScript. You can play and pause the animation applied to HTML elements using animation-play-state property of C... |
How to Trim a String in Golang? - GeeksforGeeks | 26 Aug, 2019
In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every character is represented by one or more bytes using UTF-8 Encoding. You can trim a string in different ways using the following list of functions. All t... | [
{
"code": null,
"e": 26151,
"s": 26123,
"text": "\n26 Aug, 2019"
},
{
"code": null,
"e": 26589,
"s": 26151,
"text": "In Go language, strings are different from other languages like Java, C++, Python, etc. It is a sequence of variable-width characters where each and every characte... |
PyQt5 – How to hide label | label.setHidden method - GeeksforGeeks | 26 Mar, 2020
In this article, we will see how we can hide the Label in the PyQt5 application. A label is a graphical control element which displays text on a form. It is usually a static control; having no interactivity. A label is generally used to identify a nearby text box or other widget.
In order to hide the label... | [
{
"code": null,
"e": 25829,
"s": 25801,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 26110,
"s": 25829,
"text": "In this article, we will see how we can hide the Label in the PyQt5 application. A label is a graphical control element which displays text on a form. It is usuall... |
Using slicers for dynamic chart adjustment in PowerBI | by Maciek Lasota | Towards Data Science | If you have a large number of measures in your report and you are running out of space this can be very helpful to clean up your report. Instead of showing a separate chart for all of your measures and cluttering your report just use SWITCH() to create a slicer that will adjust what users see on one or more charts.
It’... | [
{
"code": null,
"e": 489,
"s": 172,
"text": "If you have a large number of measures in your report and you are running out of space this can be very helpful to clean up your report. Instead of showing a separate chart for all of your measures and cluttering your report just use SWITCH() to create a ... |
Azure Synapse Dedicated SQL Pool Schema Design Options Benchmark | by Andriy Zabavskyy | Towards Data Science | The market of MPP engines is pretty broad and the cloud big players have their offerings that constantly evolve. So it’s really interesting to have a better understanding of their capacities and how they perform.
Let’s review Azure’s Synapse Dedicated SQL Pool MPP database platform, which is the evolution of Microsoft’... | [
{
"code": null,
"e": 384,
"s": 171,
"text": "The market of MPP engines is pretty broad and the cloud big players have their offerings that constantly evolve. So it’s really interesting to have a better understanding of their capacities and how they perform."
},
{
"code": null,
"e": 577,
... |
How to create a full screen search box with CSS and JavaScript? | Following is the code to create a full screen search box with CSS and JavaScript −
Live Demo
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/fontawesome.min.css">
<style>
body {
font-family: Arial;
}
* {
box-sizing: border-box;
}
.showBtn {... | [
{
"code": null,
"e": 1145,
"s": 1062,
"text": "Following is the code to create a full screen search box with CSS and JavaScript −"
},
{
"code": null,
"e": 1156,
"s": 1145,
"text": " Live Demo"
},
{
"code": null,
"e": 3299,
"s": 1156,
"text": "<!DOCTYPE html>\n... |
How to get Row and Column Count from ResultSet in JDBC | The last() method of the ResultSet interface moves the cursor to the last row of the ResultSet and, the getRow() method returns the index/position of the current row.
Therefore, to get the number of rows move the cursor to the last row using the last() method and get the position of that (last) row using the getRow() m... | [
{
"code": null,
"e": 1229,
"s": 1062,
"text": "The last() method of the ResultSet interface moves the cursor to the last row of the ResultSet and, the getRow() method returns the index/position of the current row."
},
{
"code": null,
"e": 1389,
"s": 1229,
"text": "Therefore, to g... |
Python 3 - os.chflags() Method | The method chflags() sets the flags of path to the numeric flags. The flags may take a combination (bitwise OR) of the various values described below.
Note − This method is available Python version 2.6 onwards. Most of the flags can be changed by super-user only.
Following is the syntax for chflags() method −
os.chflag... | [
{
"code": null,
"e": 2491,
"s": 2340,
"text": "The method chflags() sets the flags of path to the numeric flags. The flags may take a combination (bitwise OR) of the various values described below."
},
{
"code": null,
"e": 2604,
"s": 2491,
"text": "Note − This method is available... |
Java Collection | Set 1 (ArrayList) Part-1 | Practice | GeeksforGeeks | ArrayList are dynamic size arrays. Try this problem using ArrayList.
Given a ArrayList of N elements and a integer Q defining the type of query(which will be either 1 or 2) :
Q = 1 includes two integers p and r. Which means insert the value r at index p in the ArrayList and print the whole updated ArrayList.
Q = 2 incl... | [
{
"code": null,
"e": 295,
"s": 226,
"text": "ArrayList are dynamic size arrays. Try this problem using ArrayList."
},
{
"code": null,
"e": 712,
"s": 295,
"text": "Given a ArrayList of N elements and a integer Q defining the type of query(which will be either 1 or 2) :\nQ = 1 incl... |
Get the city, state, and country names from latitude and longitude using Python - GeeksforGeeks | 22 Oct, 2020
In this article, we are going to write a python script to get the city, state, and country names by using latitude and longitude using the Geopy module.geopy makes it easy for Python developers to locate the coordinates of addresses, cities, countries, and landmarks across the world.
To install the Geopy m... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n22 Oct, 2020"
},
{
"code": null,
"e": 24577,
"s": 24292,
"text": "In this article, we are going to write a python script to get the city, state, and country names by using latitude and longitude using the Geopy module.geopy makes... |
Yii - Validation | You should never trust the data received from users. To validate a model with user inputs, you should call yii\base\Model::validate() method. It returns a Boolean value if the validation succeeds. If there are errors, you may get them from the yii\base\Model::$errors property.
To make the validate() function work, you ... | [
{
"code": null,
"e": 3111,
"s": 2833,
"text": "You should never trust the data received from users. To validate a model with user inputs, you should call yii\\base\\Model::validate() method. It returns a Boolean value if the validation succeeds. If there are errors, you may get them from the yii\\ba... |
Implement multiple COUNT() in a single MySQL query | For this, use CASE statement. Let us first create a table −
mysql> create table DemoTable
-> (
-> LastName varchar(100)
-> );
Query OK, 0 rows affected (0.60 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable values('Smith');
Query OK, 1 row affected (0.17 sec)
mysql> in... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "For this, use CASE statement. Let us first create a table −"
},
{
"code": null,
"e": 1234,
"s": 1122,
"text": "mysql> create table DemoTable\n -> (\n -> LastName varchar(100)\n -> );\nQuery OK, 0 rows affected (0.60 sec)"
},
... |
How to Create TreeMap Objects using Comparable Interface in Java? - GeeksforGeeks | 21 Sep, 2021
Comparable interface is found in java.lang package which is used to order the objects of a user-defined class on the basis of a single attribute only. This interface contains a single method compareTo(Object). It is used to compare the current object with the specified objects and can be used o sort user-d... | [
{
"code": null,
"e": 23557,
"s": 23529,
"text": "\n21 Sep, 2021"
},
{
"code": null,
"e": 23915,
"s": 23557,
"text": "Comparable interface is found in java.lang package which is used to order the objects of a user-defined class on the basis of a single attribute only. This interfa... |
Character Recognition with Python | by Mate Pocs | Towards Data Science | If you have an analytical mindset, and ever went on a virtual apartment-hunting trip, you have probably run into the issue I have personally always found infuriating: you can almost never search by property size, let alone by individual room sizes. However, this information is quite often available in the form of a flo... | [
{
"code": null,
"e": 572,
"s": 171,
"text": "If you have an analytical mindset, and ever went on a virtual apartment-hunting trip, you have probably run into the issue I have personally always found infuriating: you can almost never search by property size, let alone by individual room sizes. Howeve... |
Ionic - Select | Ionic Select will create a simple menu with select options for the user to choose. This Select Menu will look differently on different platforms, since its styling is handled by the browser.
First, we will create a label and add the item-input and the item-select classes. The second class will add additional styling to... | [
{
"code": null,
"e": 2654,
"s": 2463,
"text": "Ionic Select will create a simple menu with select options for the user to choose. This Select Menu will look differently on different platforms, since its styling is handled by the browser."
},
{
"code": null,
"e": 3053,
"s": 2654,
... |
Divide Each Row of Matrix by Vector Elements in R - GeeksforGeeks | 17 May, 2021
In this article, we will discuss how to divide each row of the matrix by vector elements in R Programming Language.
Initially, the transpose of the matrix is computed, to interchange the rows and columns. Initially, if the dimensions of the matrix were n * m , transpose converts the dimensions to m * n. Th... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n17 May, 2021"
},
{
"code": null,
"e": 25358,
"s": 25242,
"text": "In this article, we will discuss how to divide each row of the matrix by vector elements in R Programming Language."
},
{
"code": null,
"e": 25900,
... |
Minesweeper Solver - GeeksforGeeks | 28 Sep, 2021
Given a 2D array arr[][] of dimensions N*M, representing a minesweeper matrix, where each cell contains an integer from the range [0, 9], representing the number of mines in itself and all the eight cells adjacent to it, the task is to solve the minesweeper and uncover all the mines in the matrix. Print ‘X... | [
{
"code": null,
"e": 24591,
"s": 24563,
"text": "\n28 Sep, 2021"
},
{
"code": null,
"e": 25035,
"s": 24591,
"text": "Given a 2D array arr[][] of dimensions N*M, representing a minesweeper matrix, where each cell contains an integer from the range [0, 9], representing the number o... |
LinkedHashMap and LinkedHashSet in Java | Hash table and linked list implementation of the Map interface, with predictable iteration order. Let us see an example −
Live Demo
import java.util.*;
public class Demo {
public static void main(String args[]){
LinkedHashMap<Integer, String> my_set;
my_set = new LinkedHashMap<Integer, String>();
... | [
{
"code": null,
"e": 1184,
"s": 1062,
"text": "Hash table and linked list implementation of the Map interface, with predictable iteration order. Let us see an example −"
},
{
"code": null,
"e": 1195,
"s": 1184,
"text": " Live Demo"
},
{
"code": null,
"e": 1715,
"s... |
MongoDB - Limit Records | In this chapter, we will learn how to limit records using MongoDB.
To limit the records in MongoDB, you need to use limit() method. The method accepts one number type argument, which is the number of documents that you want to be displayed.
The basic syntax of limit() method is as follows −
>db.COLLECTION_NAME.find().l... | [
{
"code": null,
"e": 2620,
"s": 2553,
"text": "In this chapter, we will learn how to limit records using MongoDB."
},
{
"code": null,
"e": 2794,
"s": 2620,
"text": "To limit the records in MongoDB, you need to use limit() method. The method accepts one number type argument, which... |
MNIST Handwritten Digits Classification using a Convolutional Neural Network (CNN) | by Krut Patel | Towards Data Science | The goal of this post is to implement a CNN to classify MNIST handwritten digit images using PyTorch.
This post is a part of a 2 part series on introduction to convolution neural network (CNN).
Part 1 — Basic concepts revolving around CNNs
Part 2 — Pytorch Implementation of a CNN to classify MNIST handwritten digits
Th... | [
{
"code": null,
"e": 273,
"s": 171,
"text": "The goal of this post is to implement a CNN to classify MNIST handwritten digit images using PyTorch."
},
{
"code": null,
"e": 365,
"s": 273,
"text": "This post is a part of a 2 part series on introduction to convolution neural network... |
How to compile a Python 3 app to an .exe using Tkinter? | Python is well-known for its rich library of extensions and packages. We can import and install the necessary packages from the library. However, if we require to run a Tkinter application with an executable file in Windows Operating System, then we can use the Pyinstaller package in Python. It converts a Python-based ... | [
{
"code": null,
"e": 1432,
"s": 1062,
"text": "Python is well-known for its rich library of extensions and packages. We can import and install the necessary packages from the library. However, if we require to run a Tkinter application with an executable file in Windows Operating System, then we can... |
Difference Between HTML and CSS | In this post, we will understand the difference between HTML and CSS
It refers to Hyper Text Markup Language.
It refers to Hyper Text Markup Language.
It helps create web pages and applications.
It helps create web pages and applications.
It helps define structure of web page.
It helps define structure of web page.
It ... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "In this post, we will understand the difference between HTML and CSS"
},
{
"code": null,
"e": 1172,
"s": 1131,
"text": "It refers to Hyper Text Markup Language."
},
{
"code": null,
"e": 1213,
"s": 1172,
"text": "I... |
How to call an existing function in a database using JDBC API? | You can call a function using CallableStatement object just like stored procedures, to call a function using a JDBC program you need to.
Connect to the database.
Connect to the database.
Create a PreparedStatement object and to its constructor pass the function call in String format.
Create a PreparedStatement object a... | [
{
"code": null,
"e": 1199,
"s": 1062,
"text": "You can call a function using CallableStatement object just like stored procedures, to call a function using a JDBC program you need to."
},
{
"code": null,
"e": 1224,
"s": 1199,
"text": "Connect to the database."
},
{
"code"... |
How to treat NULL as 0 and add columns in MySQL? | Use the concept of IFNULL() method to treat NULL as 0. Let us first create a table −
mysql> create table DemoTable
(
Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
Value1 int,
Value2 int
);
Query OK, 0 rows affected (0.64 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable(Va... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "Use the concept of IFNULL() method to treat NULL as 0. Let us first create a table −"
},
{
"code": null,
"e": 1295,
"s": 1147,
"text": "mysql> create table DemoTable\n(\n Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,\n Value1 int,\... |
Choose the Best Python Web Scraping Library for Your Application | by Sara A. Metwalli | Towards Data Science | Living in today’s world, we are surrounded by different data all around us. The ability to collect and use this data in our projects is a must-have skill for every data scientist.
There are so many tutorials online about how to use specific Python libraries to harvest online data. However, you can rarely find tutorials... | [
{
"code": null,
"e": 227,
"s": 47,
"text": "Living in today’s world, we are surrounded by different data all around us. The ability to collect and use this data in our projects is a must-have skill for every data scientist."
},
{
"code": null,
"e": 430,
"s": 227,
"text": "There a... |
Arc length from given Angle - GeeksforGeeks | 07 Nov, 2021
An angle is a geometrical figure when two rays meet at a common point on a plane. These rays form the sides of the angle and the meeting point is referred as the vertex of the angle. There is something that we need to keep in mind that the plane that forms an angle doesn’t need to be a Euclidean plane. Now... | [
{
"code": null,
"e": 24986,
"s": 24958,
"text": "\n07 Nov, 2021"
},
{
"code": null,
"e": 25423,
"s": 24986,
"text": "An angle is a geometrical figure when two rays meet at a common point on a plane. These rays form the sides of the angle and the meeting point is referred as the v... |
Python Deep Learning - Implementations | In this implementation of Deep learning, our objective is to predict the customer attrition or churning data for a certain bank - which customers are likely to leave this bank service. The Dataset used is relatively small and contains 10000 rows with 14 columns. We are using Anaconda distribution, and frameworks like T... | [
{
"code": null,
"e": 2222,
"s": 1794,
"text": "In this implementation of Deep learning, our objective is to predict the customer attrition or churning data for a certain bank - which customers are likely to leave this bank service. The Dataset used is relatively small and contains 10000 rows with 14... |
Bootstrap Form TextArea | The textarea is used when you need multiple lines of input. You can try to run the following code to work with textarea in Bootstrap Forms
Live Demo
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap Forms</title>
<meta name = "viewport" content="width = device-width, initial-scale = 1">
<link rel = "s... | [
{
"code": null,
"e": 1201,
"s": 1062,
"text": "The textarea is used when you need multiple lines of input. You can try to run the following code to work with textarea in Bootstrap Forms"
},
{
"code": null,
"e": 1211,
"s": 1201,
"text": "Live Demo"
},
{
"code": null,
"... |
Apache Pig - Reading Data | In general, Apache Pig works on top of Hadoop. It is an analytical tool that analyzes large datasets that exist in the Hadoop File System. To analyze data using Apache Pig, we have to initially load the data into Apache Pig. This chapter explains how to load data to Apache Pig from HDFS.
In MapReduce mode, Pig reads (l... | [
{
"code": null,
"e": 2973,
"s": 2684,
"text": "In general, Apache Pig works on top of Hadoop. It is an analytical tool that analyzes large datasets that exist in the Hadoop File System. To analyze data using Apache Pig, we have to initially load the data into Apache Pig. This chapter explains how to... |
C# Program to find all substrings in a string | Use the substring() method in C# to find all substrings in a string.
Let’s say our string is −
Xyz
Loop through the length of the string and use the Substring function from the beginning to the end of the string −
for (int start = 0; start <= str.Length - i; start++) {
string substr = str.Substring(start, i);
Con... | [
{
"code": null,
"e": 1131,
"s": 1062,
"text": "Use the substring() method in C# to find all substrings in a string."
},
{
"code": null,
"e": 1157,
"s": 1131,
"text": "Let’s say our string is −"
},
{
"code": null,
"e": 1161,
"s": 1157,
"text": "Xyz"
},
{
... |
Difference between Set and MultiSet in C++ | In C++, both Set and MultiSet are the type of data structures which are used to store the data for easy accessing and insertion. On the basis of characteristics of both these data structures we can distinguish between Set and MultiSet.
Following are the important differences between Set and MultiSet −
Set
#include
#inc... | [
{
"code": null,
"e": 1298,
"s": 1062,
"text": "In C++, both Set and MultiSet are the type of data structures which are used to store the data for easy accessing and insertion. On the basis of characteristics of both these data structures we can distinguish between Set and MultiSet."
},
{
"co... |
Create a Weather app using Flask | Python - GeeksforGeeks | 17 Sep, 2019
Prerequisite : Flask installation
Flask is a lightweight framework written in Python. It is lightweight because it does not require particular tools or libraries and allow rapid web development. today we will create a weather app using flask as a web framework. this weather web app will provide current wea... | [
{
"code": null,
"e": 24662,
"s": 24634,
"text": "\n17 Sep, 2019"
},
{
"code": null,
"e": 24696,
"s": 24662,
"text": "Prerequisite : Flask installation"
},
{
"code": null,
"e": 25002,
"s": 24696,
"text": "Flask is a lightweight framework written in Python. It i... |
How to plot a Pandas Dataframe with Matplotlib? - GeeksforGeeks | 24 Jan, 2021
Prerequisites:
Pandas
Matplotlib
Data visualization is the most important part of any analysis. Matplotlib is an amazing python library which can be used to plot pandas dataframe. There are various ways in which a plot can be generated depending upon the requirement.
Bar Plot is one such example. To plot... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 23917,
"s": 23901,
"text": "Prerequisites: "
},
{
"code": null,
"e": 23924,
"s": 23917,
"text": "Pandas"
},
{
"code": null,
"e": 23935,
"s": 23924,
"te... |
C++ String Library - erase | It erases part of the string, reducing its length.
Following is the declaration for std::string::erase.
string& insert (size_t pos, const string& str);
string& erase (size_t pos = 0, size_t len = npos);
string& erase (size_t pos = 0, size_t len = npos);
pos − It is an insertion point.
pos − It is an insertion point.
s... | [
{
"code": null,
"e": 2654,
"s": 2603,
"text": "It erases part of the string, reducing its length."
},
{
"code": null,
"e": 2707,
"s": 2654,
"text": "Following is the declaration for std::string::erase."
},
{
"code": null,
"e": 2755,
"s": 2707,
"text": "string&... |
How do I get the dialer to open with phone number displayed in Android? | This example demonstrates how do I get the dialer to open with the open number displayed 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" encod... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "This example demonstrates how do I get the dialer to open with the open number displayed in android."
},
{
"code": null,
"e": 1292,
"s": 1163,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fil... |
Conditional removal of labels in Matplotlib pie chart | To remove labels from a Matplotlib pie chart based on a condition, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Create a Pandas dataframe of wwo-dimensional, size-mutable, potentially heterogeneous tabular data.
Plot a pie chart, using pie() method with c... | [
{
"code": null,
"e": 1163,
"s": 1062,
"text": "To remove labels from a Matplotlib pie chart based on a condition, we can take the following steps −"
},
{
"code": null,
"e": 1239,
"s": 1163,
"text": "Set the figure size and adjust the padding between and around the subplots."
},... |
How to convert a numerical column into factor column in R? | Often, we find that the values that represent factor levels are recorded as numerical values, therefore, we need to convert those numerical values to factor. In this way, we can use the factor column properly in our analysis otherwise R program will treat the factors as numerical values and the analysis output will be ... | [
{
"code": null,
"e": 1393,
"s": 1062,
"text": "Often, we find that the values that represent factor levels are recorded as numerical values, therefore, we need to convert those numerical values to factor. In this way, we can use the factor column properly in our analysis otherwise R program will tre... |
How to Find the Antilog of Values in Excel? - GeeksforGeeks | 18 Jul, 2021
Logarithmic functions are mostly used when we deal with exponents. So, while dealing with a logarithmic function many times we need to calculate the antilog value. Antilog is simply the reverse of the logarithm.
In Excel, we have a direct formula to calculate the log of any values. The functions available... | [
{
"code": null,
"e": 24725,
"s": 24694,
"text": " \n18 Jul, 2021\n"
},
{
"code": null,
"e": 24937,
"s": 24725,
"text": "Logarithmic functions are mostly used when we deal with exponents. So, while dealing with a logarithmic function many times we need to calculate the antilog val... |
Different Ways to Programmatically Restart an Android App on Button Click - GeeksforGeeks | 26 Feb, 2021
Sometimes we want to refresh an Activity, but there it is not possible to refresh. In that place, if we restart our app then it automatically gets refreshed. Also, we can use this to restart our app whenever it crashes. Most of the time when we open any app then it fetches all the data currently available.... | [
{
"code": null,
"e": 25060,
"s": 25032,
"text": "\n26 Feb, 2021"
},
{
"code": null,
"e": 25525,
"s": 25060,
"text": "Sometimes we want to refresh an Activity, but there it is not possible to refresh. In that place, if we restart our app then it automatically gets refreshed. Also,... |
What is Has-a relationship in Java? | These relationships are mainly based on the usage. This determines whether a certain class HAS-A certain thing. This relationship helps to reduce duplication of code as well as bugs.
public class Vehicle{}
public class Speed{}
public class Van extends Vehicle {
private Speed sp;
}
This shows that class Van HAS-A Spe... | [
{
"code": null,
"e": 1245,
"s": 1062,
"text": "These relationships are mainly based on the usage. This determines whether a certain class HAS-A certain thing. This relationship helps to reduce duplication of code as well as bugs."
},
{
"code": null,
"e": 1347,
"s": 1245,
"text": ... |
8086 program to convert a 16 bit Decimal number to Octal - GeeksforGeeks | 26 Jun, 2019
Problem: We are given a 16 bit decimal number we have to print the number in octal format.
Examples:
Input: d1 = 16
Output:20
Input: d1 = 123
Output: 173
Explanation:
Load the value stored into registerDivide the value by 8 to convert it to octalPush the remainder into the stackIncrease the countRepeat t... | [
{
"code": null,
"e": 24700,
"s": 24672,
"text": "\n26 Jun, 2019"
},
{
"code": null,
"e": 24791,
"s": 24700,
"text": "Problem: We are given a 16 bit decimal number we have to print the number in octal format."
},
{
"code": null,
"e": 24801,
"s": 24791,
"text": ... |
Count number of Distinct Substring in a String - GeeksforGeeks | 08 Mar, 2022
Given a string, count all distinct substrings of the given string.Examples:
Input : abcd
Output : abcd abc ab a bcd bc b cd c d
All Elements are Distinct
Input : aaa
Output : aaa aa a aa a a
All elements are not Distinct
Prerequisite : Print subarrays of a given arrayThe idea is to use hash table (Has... | [
{
"code": null,
"e": 26929,
"s": 26901,
"text": "\n08 Mar, 2022"
},
{
"code": null,
"e": 27007,
"s": 26929,
"text": "Given a string, count all distinct substrings of the given string.Examples: "
},
{
"code": null,
"e": 27153,
"s": 27007,
"text": "Input : abcd... |
Generating Word Cloud in Python - GeeksforGeeks | 05 Jul, 2021
Word Cloud is a data visualization technique used for representing text data in which the size of each word indicates its frequency or importance. Significant textual data points can be highlighted using a word cloud. Word clouds are widely used for analyzing data from social network websites.
For generati... | [
{
"code": null,
"e": 25711,
"s": 25683,
"text": "\n05 Jul, 2021"
},
{
"code": null,
"e": 26006,
"s": 25711,
"text": "Word Cloud is a data visualization technique used for representing text data in which the size of each word indicates its frequency or importance. Significant text... |
Ruby | Math sin() function - GeeksforGeeks | 04 Dec, 2020
The sin() is an inbuilt function in Ruby returns the sine of a given angle expressed in radians which is in range [-inf, +inf]. The returned value is in range [-1, +1].
Syntax: Math.sin(value)
Parameters: The function accepts one mandatory parameter value whose corresponding sine is returned.
Return Val... | [
{
"code": null,
"e": 25121,
"s": 25093,
"text": "\n04 Dec, 2020"
},
{
"code": null,
"e": 25291,
"s": 25121,
"text": "The sin() is an inbuilt function in Ruby returns the sine of a given angle expressed in radians which is in range [-inf, +inf]. The returned value is in range [-1,... |
Solidity - Operators - GeeksforGeeks | 11 May, 2022
In any programming language, operators play a vital role i.e. they create a foundation for the programming. Similarly, the functionality of Solidity is also incomplete without the use of operators. Operators allow users to perform different operations on operands. Solidity supports the following types of o... | [
{
"code": null,
"e": 25717,
"s": 25689,
"text": "\n11 May, 2022"
},
{
"code": null,
"e": 26065,
"s": 25717,
"text": "In any programming language, operators play a vital role i.e. they create a foundation for the programming. Similarly, the functionality of Solidity is also incomp... |
Find subset with maximum sum under given condition - GeeksforGeeks | 03 Jun, 2021
Given values[] and labels[] of n items and a positive integer limit, We need to choose a subset of these items in such a way that the number of the same type of label in the subset should be <= limit and sum of values are maximum among all possible subset choices.
Examples:
Input: values[] = [5, 3, 7, 1,... | [
{
"code": null,
"e": 26041,
"s": 26013,
"text": "\n03 Jun, 2021"
},
{
"code": null,
"e": 26306,
"s": 26041,
"text": "Given values[] and labels[] of n items and a positive integer limit, We need to choose a subset of these items in such a way that the number of the same type of la... |
How to Change the Position of AlertDialog in Android? - GeeksforGeeks | 21 Dec, 2020
AlertDialog in android is one of the UI widgets which immediately pops up to confirm the user interaction or to confirm the action which is done by the user. In most of the applications, the position of the alert dialog in the center. In this article, it’s been discussed how to change the position of the a... | [
{
"code": null,
"e": 26381,
"s": 26353,
"text": "\n21 Dec, 2020"
},
{
"code": null,
"e": 26936,
"s": 26381,
"text": "AlertDialog in android is one of the UI widgets which immediately pops up to confirm the user interaction or to confirm the action which is done by the user. In mo... |
Broadcasting across arrays in Julia - GeeksforGeeks | 24 Sep, 2021
Julia is a high performance, dynamic programming language that has a high-level syntax. It is free for everyone to use and easy to learn. Julia is used generally for data analysis and visualization purposes.
A grid that contains objects in multiple dimensions is called a Multi-dimensional Array. It can con... | [
{
"code": null,
"e": 25739,
"s": 25711,
"text": "\n24 Sep, 2021"
},
{
"code": null,
"e": 25947,
"s": 25739,
"text": "Julia is a high performance, dynamic programming language that has a high-level syntax. It is free for everyone to use and easy to learn. Julia is used generally f... |
HTTP headers | X-Frame-Options - GeeksforGeeks | 20 Oct, 2021
HTTP headers are used to pass additional information with HTTP response or HTTP requests. The X-Frame-Options is used to prevent the site from clickjacking attacks. It defines whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>. The frame-ancestors direct... | [
{
"code": null,
"e": 25853,
"s": 25825,
"text": "\n20 Oct, 2021"
},
{
"code": null,
"e": 26232,
"s": 25853,
"text": "HTTP headers are used to pass additional information with HTTP response or HTTP requests. The X-Frame-Options is used to prevent the site from clickjacking attacks... |
Difference between PreparedStatement and CallableStatement - GeeksforGeeks | 22 Jul, 2020
1. CallableStatement :It is used when you want to use the database stored procedures. CallableStatement can accept runtime input parameters.
Example –
//Creating CallableStatement object
CallableStatement GFG = con.prepareCall("{call anyProcedure(?, ?, ?)}");
//Use GFG.setter() methods to pass IN parame... | [
{
"code": null,
"e": 25993,
"s": 25965,
"text": "\n22 Jul, 2020"
},
{
"code": null,
"e": 26134,
"s": 25993,
"text": "1. CallableStatement :It is used when you want to use the database stored procedures. CallableStatement can accept runtime input parameters."
},
{
"code": ... |
Testing in Python using doctest module - GeeksforGeeks | 15 Jun, 2018
Docstrings in Python are used not only for the description of a class or a function to provide a better understanding of the code and use but, also used for Testing purposes.
The Doctest Module finds patterns in the docstring that looks like interactive shell commands.
The input and expected output are inc... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n15 Jun, 2018"
},
{
"code": null,
"e": 25712,
"s": 25537,
"text": "Docstrings in Python are used not only for the description of a class or a function to provide a better understanding of the code and use but, also used for Testin... |
Stack get() method in Java with Example - GeeksforGeeks | 24 Dec, 2018
The Java.util.Stack.get() method is used to fetch or retrieve an element at a specific index from a Stack.
Syntax:
Stack.get(int index)
Parameters: This method accepts a mandatory parameter index which is of integer data type. It specifies the position or index of the element to be fetched from the Stack.
... | [
{
"code": null,
"e": 25717,
"s": 25689,
"text": "\n24 Dec, 2018"
},
{
"code": null,
"e": 25824,
"s": 25717,
"text": "The Java.util.Stack.get() method is used to fetch or retrieve an element at a specific index from a Stack."
},
{
"code": null,
"e": 25832,
"s": 258... |
Node.js fs.extra ensureDir() Function - GeeksforGeeks | 07 Oct, 2021
The ensureDir() function make sure that the directory user is requesting exists. If the directory structure does not exist the function will create the structure itself. mkdirs() and mkdirp() are the other names of the function which means we can use them in place of ensureDir() and everything will work as... | [
{
"code": null,
"e": 26267,
"s": 26239,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 26582,
"s": 26267,
"text": "The ensureDir() function make sure that the directory user is requesting exists. If the directory structure does not exist the function will create the structure i... |
Java Program to Convert List to HashSet - GeeksforGeeks | 15 Nov, 2021
The List interface provides a way to store the ordered collection. It is an ordered collection of objects in which duplicate values can be stored. Since List preserves the insertion order, it allows positional access and insertion of elements.
The HashSet class permits the null element. The class also offe... | [
{
"code": null,
"e": 25225,
"s": 25197,
"text": "\n15 Nov, 2021"
},
{
"code": null,
"e": 25469,
"s": 25225,
"text": "The List interface provides a way to store the ordered collection. It is an ordered collection of objects in which duplicate values can be stored. Since List prese... |
Python Program to Count Vowels, Lines, Characters in Text File - GeeksforGeeks | 17 Oct, 2021
In this article, we are going to create a python program that counts vowels, lines, and a number of characters present in a particular text file.
We have to open the file using open() function in python.
Then make three variables, vowel, line and character to count the number of vowels, lines, and characte... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n17 Oct, 2021"
},
{
"code": null,
"e": 25683,
"s": 25537,
"text": "In this article, we are going to create a python program that counts vowels, lines, and a number of characters present in a particular text file."
},
{
"co... |
What is Strict Mode and how to enable it in JavaScript ? - GeeksforGeeks | 08 Nov, 2021
The strict mode of JavaScript, introduced in ECMAScript 5, is a mechanism to opt into a restricted version of JavaScript.” Strict mode modifies the regular JavaScript semantics in the following ways: Some JavaScript silent errors are eliminated by converting them to throw errors.
How to enable strict mode ... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n08 Nov, 2021"
},
{
"code": null,
"e": 26826,
"s": 26545,
"text": "The strict mode of JavaScript, introduced in ECMAScript 5, is a mechanism to opt into a restricted version of JavaScript.” Strict mode modifies the regular JavaScr... |
Convert Series of lists to one Series in Pandas - GeeksforGeeks | 18 Aug, 2020
In this program, we will see how to convert a series of lists of into one series, in other words, we are just merging the different lists into one single list, in Pandas. We will be using the stack() method to perform this task. The line will be Series.apply(Pandas.Series).stack().reset_index(drop = True).... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n18 Aug, 2020"
},
{
"code": null,
"e": 25916,
"s": 25537,
"text": "In this program, we will see how to convert a series of lists of into one series, in other words, we are just merging the different lists into one single list, in ... |
Different plotting using pandas and matplotlib - GeeksforGeeks | 12 May, 2021
We have different types of plots in matplotlib library which can help us to make a suitable graph as you needed. As per the given data, we can make a lot of graph and with the help of pandas, we can create a dataframe before doing plotting of data. Let’s discuss the different types of plot in matplotlib by... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n12 May, 2021"
},
{
"code": null,
"e": 25859,
"s": 25537,
"text": "We have different types of plots in matplotlib library which can help us to make a suitable graph as you needed. As per the given data, we can make a lot of graph ... |
Playit | #myDIV { background-color:lightblue; transform:skewX(10deg));} | [] |
JSTL - SQL <sql:setDataSource> Tag | The <sql:setDataSource> tag sets the data source configuration variable or saves the data-source information in a scoped variable that can be used as input to the other JSTL database actions.
The <sql:setDataSource> tag has the following attributes −
Consider the following information about your MySQL database setup −
... | [
{
"code": null,
"e": 2431,
"s": 2239,
"text": "The <sql:setDataSource> tag sets the data source configuration variable or saves the data-source information in a scoped variable that can be used as input to the other JSTL database actions."
},
{
"code": null,
"e": 2490,
"s": 2431,
... |
Maximum Occuring Character | Practice | GeeksforGeeks | Given a string str. The task is to find the maximum occurring character in the string str. If more than one character occurs the maximum number of time then print the lexicographically smaller character.
Example 1:
Input:
str = testsample
Output: e
Explanation: e is the character which
is having the highest frequency.
... | [
{
"code": null,
"e": 442,
"s": 238,
"text": "Given a string str. The task is to find the maximum occurring character in the string str. If more than one character occurs the maximum number of time then print the lexicographically smaller character."
},
{
"code": null,
"e": 453,
"s": ... |
How to count total number of occurrences of an object in a Python list? | You can use the list class count function to count the occurrences of an object in a Python list. Use this only if you want the count of one object only. It finds the total number of the object you pass it in the list it is called on.
>>> ["red", "blue", "red", "red", "blue"].count("red")
3
If you want to get the coun... | [
{
"code": null,
"e": 1298,
"s": 1062,
"text": "You can use the list class count function to count the occurrences of an object in a Python list. Use this only if you want the count of one object only. It finds the total number of the object you pass it in the list it is called on. "
},
{
"co... |
Boggle | Set 2 (Using Trie) - GeeksforGeeks | 18 Aug, 2021
Given a dictionary, a method to do a lookup in the dictionary and a M x N board where every cell has one character. Find all possible words that can be formed by a sequence of adjacent characters. Note that we can move to any of 8 adjacent characters, but a word should not have multiple instances of the sa... | [
{
"code": null,
"e": 24874,
"s": 24846,
"text": "\n18 Aug, 2021"
},
{
"code": null,
"e": 25200,
"s": 24874,
"text": "Given a dictionary, a method to do a lookup in the dictionary and a M x N board where every cell has one character. Find all possible words that can be formed by a... |
Problem on Numbers - GeeksforGeeks | 04 Aug, 2021
Question 1 : Find the number of zeroes in 155! Solution: Multiplication of 2×5 results into 10. So number of zeroes depend on the number of pairs of 2 and 5. In any factorial, number of 5’s is lesser than the number of 2’s. So, we need to count the maximum power of 5 in 155! [155/5] + [155/52] + [155/53] =... | [
{
"code": null,
"e": 23691,
"s": 23663,
"text": "\n04 Aug, 2021"
},
{
"code": null,
"e": 24044,
"s": 23691,
"text": "Question 1 : Find the number of zeroes in 155! Solution: Multiplication of 2×5 results into 10. So number of zeroes depend on the number of pairs of 2 and 5. In an... |
IMS DB - Cobol Basics | We include DL/I calls inside COBOL application program to communicate with IMS database. We use the following DL/I statements in COBOL program to access the database −
Entry Statement
Goback Statement
Call Statement
It is used to pass the control from the DL/I to the COBOL program. Here is the syntax of the entry state... | [
{
"code": null,
"e": 2114,
"s": 1946,
"text": "We include DL/I calls inside COBOL application program to communicate with IMS database. We use the following DL/I statements in COBOL program to access the database −"
},
{
"code": null,
"e": 2130,
"s": 2114,
"text": "Entry Statemen... |
HTML Text Formatting | The HTML Text Formatting refers to the HTML elements that are designed specially for formatting content in an HTML document.
Following is the syntax −
<tagname>content</tagname>
Following are the text formatting tags in HTML:
Let us see an example of HTML Text Formatting:
Live Demo
<!DOCTYPE html>
<html>
<style>
bod... | [
{
"code": null,
"e": 1187,
"s": 1062,
"text": "The HTML Text Formatting refers to the HTML elements that are designed specially for formatting content in an HTML document."
},
{
"code": null,
"e": 1213,
"s": 1187,
"text": "Following is the syntax −"
},
{
"code": null,
... |
How to create a profile card with CSS? | To create a profile card with CSS, the code is as follows −
Live Demo
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}
.profileCard {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 300px;
margin: auto;
text-align... | [
{
"code": null,
"e": 1122,
"s": 1062,
"text": "To create a profile card with CSS, the code is as follows −"
},
{
"code": null,
"e": 1133,
"s": 1122,
"text": " Live Demo"
},
{
"code": null,
"e": 2276,
"s": 1133,
"text": "<!DOCTYPE html>\n<html>\n<head>\n<style>... |
C++ Program to Implement List in STL | A list is a sequence container that allow non-contiguous memory allocation. List has slow traversal as compared to vector, but once a position has been found, insertion and deletion are quick.
From main(), we have called following functions:
fl.resize() = Returns the resize of list.
fl.push_front() = It is used t... | [
{
"code": null,
"e": 1255,
"s": 1062,
"text": "A list is a sequence container that allow non-contiguous memory allocation. List has slow traversal as compared to vector, but once a position has been found, insertion and deletion are quick."
},
{
"code": null,
"e": 1614,
"s": 1255,
... |
Python math library | isnan() method - GeeksforGeeks | 06 Jan, 2019
Python has math library and has many functions regarding it. One such function is isnan(). This method is used to check whether a given parameter is a valid number or not.
Syntax : math.isnan(x)
Parameters :x [Required] : It is any valid python data type or any number.
Returns: Return type is boolean.-> Re... | [
{
"code": null,
"e": 24728,
"s": 24700,
"text": "\n06 Jan, 2019"
},
{
"code": null,
"e": 24900,
"s": 24728,
"text": "Python has math library and has many functions regarding it. One such function is isnan(). This method is used to check whether a given parameter is a valid number... |
Ethical Hacking - Footprinting | Footprinting is a part of reconnaissance process which is used for gathering possible information about a target computer system or network. Footprinting could be both passive and active. Reviewing a company’s website is an example of passive footprinting, whereas attempting to gain access to sensitive information thro... | [
{
"code": null,
"e": 2869,
"s": 2479,
"text": "Footprinting is a part of reconnaissance process which is used for gathering possible information about a target computer system or network. Footprinting could be both passive and active. Reviewing a company’s website is an example of passive footprinti... |
Count of odd and even sum pairs in an array - GeeksforGeeks | 04 Jun, 2021
Given an array arr[] of N positive integers, the task is to find the number of pairs with odd sum and the number of pairs with even sum.Examples:
Input: arr[] = {1, 2, 3, 4, 5} Output: Odd pairs = 6 Even pairs = 4Input: arr[] = {7, 4, 3, 2} Output: Odd pairs = 4 Even pairs = 2
Naive Approach: The nai... | [
{
"code": null,
"e": 24646,
"s": 24618,
"text": "\n04 Jun, 2021"
},
{
"code": null,
"e": 24794,
"s": 24646,
"text": "Given an array arr[] of N positive integers, the task is to find the number of pairs with odd sum and the number of pairs with even sum.Examples: "
},
{
"... |
Print maximum sum square sub-matrix of given size in C Program. | Given a matrix of NxN find a sub matrix of MxM where M<=N and M>=1 such that addition of all the elements of matrix MxM is maximum. Input of matrix NxN can contain zero, positive and negative integer values.
Input:
{{1, 1, 1, 1, 1},
{2, 2, 2, 2, 2},
{3, 3, 3, 3, 3},
{4, 4, 4, 4, 4},
{5, 5, 5, 5, 5} }
Out... | [
{
"code": null,
"e": 1270,
"s": 1062,
"text": "Given a matrix of NxN find a sub matrix of MxM where M<=N and M>=1 such that addition of all the elements of matrix MxM is maximum. Input of matrix NxN can contain zero, positive and negative integer values."
},
{
"code": null,
"e": 1401,
... |
SymPy - Quick Guide | SymPy is a Python library for performing symbolic computation. It is a computer algebra system (CAS) that can be used either as a standalone application, as a library to other applications. Its live session is also available at https://live.sympy.org/. Since it is a pure Python library, it can be used as interactive mo... | [
{
"code": null,
"e": 2462,
"s": 2019,
"text": "SymPy is a Python library for performing symbolic computation. It is a computer algebra system (CAS) that can be used either as a standalone application, as a library to other applications. Its live session is also available at https://live.sympy.org/. ... |
Python | Plotting Fibonacci spiral fractal using Turtle - GeeksforGeeks | 14 May, 2021
What is Fractal Geometry? Fractal geometry is a special form of graphical representation of mathematical functions or set of numbers generated by a mathematical function. It is a recursive, detailed and infinitely self-similar set of mathematics. These geometrical representations exhibit “Unfolding Symmetr... | [
{
"code": null,
"e": 24743,
"s": 24715,
"text": "\n14 May, 2021"
},
{
"code": null,
"e": 25562,
"s": 24743,
"text": "What is Fractal Geometry? Fractal geometry is a special form of graphical representation of mathematical functions or set of numbers generated by a mathematical fu... |
How to open a browser window in full screen using Selenium WebDriver with C#? | We can open a browser window in full screen using Selenium webdriver in C# by using the method Maximize. This method has to be applied on the webdriver object.
driver.Manage().Window.Maximize();
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using System;
namespace NUnitTestProject1{
pu... | [
{
"code": null,
"e": 1222,
"s": 1062,
"text": "We can open a browser window in full screen using Selenium webdriver in C# by using the method Maximize. This method has to be applied on the webdriver object."
},
{
"code": null,
"e": 1257,
"s": 1222,
"text": "driver.Manage().Window... |
Aptitude - Progression | A succession of numbers formed and arranged in a definite order according to a certain definite rule is called a sequence.
It is a sequence in which each term, except the first one differs the preceding term by a constant. This constant is called the common difference. We denote the first term by a, common difference b... | [
{
"code": null,
"e": 4015,
"s": 3892,
"text": "A succession of numbers formed and arranged in a definite order according to a certain definite rule is called a sequence."
},
{
"code": null,
"e": 4270,
"s": 4015,
"text": "It is a sequence in which each term, except the first one d... |
TypeScript - String valueOf() | This method returns the primitive value of a String object.
string.valueOf( )
Returns the primitive value of a String object.
var str = new String("Hello world");
console.log(str.valueOf( ));
On compiling, it will generate the same code in JavaScript.
Its output is as follows −
Hello world
45 Lectures
4 ... | [
{
"code": null,
"e": 2108,
"s": 2048,
"text": "This method returns the primitive value of a String object."
},
{
"code": null,
"e": 2127,
"s": 2108,
"text": "string.valueOf( )\n"
},
{
"code": null,
"e": 2175,
"s": 2127,
"text": "Returns the primitive value of ... |
R - Survival Analysis | Survival analysis deals with predicting the time when a specific event is going to occur. It is also known as failure time analysis or analysis of time to death. For example predicting the number of days a person with cancer will survive or predicting the time when a mechanical system is going to fail.
The R package na... | [
{
"code": null,
"e": 2840,
"s": 2536,
"text": "Survival analysis deals with predicting the time when a specific event is going to occur. It is also known as failure time analysis or analysis of time to death. For example predicting the number of days a person with cancer will survive or predicting t... |
Python | Average of Float Numbers | 10 Feb, 2020
While working with Python, we can have a problem in which we need to find mean of a list cumulative with float elements. This problem is common in Data Science domain. Let’s discuss certain ways in which this problem can be solved.
Method #1 : Using loop + formulaThe simpler manner to approach this problem... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Feb, 2020"
},
{
"code": null,
"e": 260,
"s": 28,
"text": "While working with Python, we can have a problem in which we need to find mean of a list cumulative with float elements. This problem is common in Data Science domain. Let’s d... |
Concept of Comments in Computer Programming | 29 Aug, 2018
Comments are text notes added to the program to provide explanatory information about the source code. They are used in a programming language to document the program and remind programmers of what tricky things they just did with the code and also helps the later generation for understanding and maintenan... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Aug, 2018"
},
{
"code": null,
"e": 528,
"s": 52,
"text": "Comments are text notes added to the program to provide explanatory information about the source code. They are used in a programming language to document the program and rem... |
Valid Sudoku in Python | Suppose we have one 9x9 Sudoku board. We have to check whether that is valid or now. Only the filled cells need to be validated according to the following rules −
Each row must contain the digits from 1-9 without repetition.
Each column must contain the digits from 1-9 without repetition.
Each of the 9 (3x3) sub-boxes ... | [
{
"code": null,
"e": 1350,
"s": 1187,
"text": "Suppose we have one 9x9 Sudoku board. We have to check whether that is valid or now. Only the filled cells need to be validated according to the following rules −"
},
{
"code": null,
"e": 1412,
"s": 1350,
"text": "Each row must conta... |
Python | Prefix sum list | 13 Jun, 2022
Nowadays, especially in the field of competitive programming, the utility of computing prefix sum is quite popular and features in many problems. Hence, having a one-liner solution to it would possess a great help. Let’s discuss certain way in which this problem can be solved.
Method #1: Using list compre... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 307,
"s": 28,
"text": "Nowadays, especially in the field of competitive programming, the utility of computing prefix sum is quite popular and features in many problems. Hence, having a one-liner sol... |
Inner Class in Python | 11 May, 2022
Python is an Object-Oriented Programming Language, everything in python is related to objects, methods, and properties. A class is a user-defined blueprint or a prototype, which we can use to create the objects of a class. The class is defined by using the class keyword.
Example of class
Python3
# create a... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 May, 2022"
},
{
"code": null,
"e": 324,
"s": 52,
"text": "Python is an Object-Oriented Programming Language, everything in python is related to objects, methods, and properties. A class is a user-defined blueprint or a prototype, wh... |
Understanding the Prototype Chain in JavaScript | 22 Jul, 2020
When you started learning to program, you would have encountered the term object-oriented programming. Here we discover what it meant and you acknowledged that it is for grouping data into “objects” with attributes.The keyword that creates these objects in many programming languages is the class. You defin... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jul, 2020"
},
{
"code": null,
"e": 993,
"s": 28,
"text": "When you started learning to program, you would have encountered the term object-oriented programming. Here we discover what it meant and you acknowledged that it is for group... |
Python | askopenfile() function in Tkinter | 29 Nov, 2021
While working with GUI one may need to open files and read data from it or may require to write data in that particular file. One can achieve this with the help of open() function (python built-in) but one may not be able to select any required file unless provides a path to that particular file in code.Wi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 489,
"s": 54,
"text": "While working with GUI one may need to open files and read data from it or may require to write data in that particular file. One can achieve this with the help of open() fun... |
Python – Divide date range to N equal duration | 03 Aug, 2021
Given two dates, the task is to divide it into equal time duration and get the exact time of each division point.
Input : test_date1 = datetime.datetime(1997, 1, 4), test_date2 = datetime.datetime(1997, 1, 30) N = 7
Output : [datetime.datetime(1997, 1, 4, 0, 0), datetime.datetime(1997, 1, 7, 17, 8, 34, 28... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Aug, 2021"
},
{
"code": null,
"e": 142,
"s": 28,
"text": "Given two dates, the task is to divide it into equal time duration and get the exact time of each division point."
},
{
"code": null,
"e": 245,
"s": 142,
"... |
How to Sort a LinkedList in Java? | 03 Jul, 2022
A Linked List is a linear data structure, in which the elements are not stored at contiguous memory locations.
Sorting the nodes of a Singly Linked list in ascending order:
Original List
Sorted List
We can sort the LinkedList by many sorting techniques:
Bubble sortInsertion sortQuick sortMerge sort
Bubble ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Jul, 2022"
},
{
"code": null,
"e": 139,
"s": 28,
"text": "A Linked List is a linear data structure, in which the elements are not stored at contiguous memory locations."
},
{
"code": null,
"e": 201,
"s": 139,
"tex... |
Count of Array elements to be divided by 2 to make at least K elements equal | 24 May, 2021
Given an integer array arr[] of size N, the task is to find the minimum number of array elements required to be divided by 2, to make at least K elements in the array equal.Example :
Input: arr[] = {1, 2, 2, 4, 5}, N = 5, K = 3 Output: 1 Explanation: Dividing 4 by 2 modifies the array to {1, 2, 2, 2, 5} w... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 May, 2021"
},
{
"code": null,
"e": 238,
"s": 54,
"text": "Given an integer array arr[] of size N, the task is to find the minimum number of array elements required to be divided by 2, to make at least K elements in the array equal.E... |
TreeSet toArray() method in Java with Example | 27 Dec, 2018
The toArray() method of Java TreeSet is used to form an array of the same elements as that of the TreeSet. Basically, it copies all the element from a TreeSet to a new array.
Syntax:
Object[] arr = TreeSet.toArray()
Parameters: The method does not take any parameters.
Return Value: The method returns an ar... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2018"
},
{
"code": null,
"e": 203,
"s": 28,
"text": "The toArray() method of Java TreeSet is used to form an array of the same elements as that of the TreeSet. Basically, it copies all the element from a TreeSet to a new array."... |
What is the fastest way to loop through an array in JavaScript ? | 27 Dec, 2021
JavaScript has a large variety of loops available for performing iterations. The following loops along with their syntax are supported by JavaScript.
for loop: A for loop comprises a variable initialization, a condition for variable evaluation and an expression to determine termination of the loop. It perf... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 178,
"s": 28,
"text": "JavaScript has a large variety of loops available for performing iterations. The following loops along with their syntax are supported by JavaScript."
},
{
"code": nul... |
Select a single column of data as a Series in Pandas | 01 Oct, 2020
In this article, we will discuss how to select a single column of data as a Series in Pandas.
For example, Suppose we have a data frame :
Name Age MotherTongue
Akash 21 Hindi
Ashish 23 Marathi
Diksha 21 Bhojpuri
Radhika 20 Nepali
Ayush 21 Punjabi
Now when we select column Mother Tongue as a Series ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 122,
"s": 28,
"text": "In this article, we will discuss how to select a single column of data as a Series in Pandas."
},
{
"code": null,
"e": 283,
"s": 122,
"text": "For example,... |
Java Math subtractExact(long x, long y) method | 27 Apr, 2018
The java.lang.Math.subtractExact() is a built-in math function in java which returns the difference of thearguments.It throws an exception if the result overflows a long.As subtractExact(long x, long y) is static,so object creation is not required.
Syntax :
public static long subtractExact(long x, long y)
... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n27 Apr, 2018"
},
{
"code": null,
"e": 302,
"s": 53,
"text": "The java.lang.Math.subtractExact() is a built-in math function in java which returns the difference of thearguments.It throws an exception if the result overflows a long.As s... |
Exporting PDF Data using Python | 10 May, 2020
Sometimes, we have to extract data from PDF. we have to copy & paste the data from PDF. It is time-consuming. In Python, there are packages that we can use to extract data from a PDF and export it in a different format using Python. We will learn how to extract data from PDFs.
PDFMiner is a text extraction... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 May, 2020"
},
{
"code": null,
"e": 306,
"s": 28,
"text": "Sometimes, we have to extract data from PDF. we have to copy & paste the data from PDF. It is time-consuming. In Python, there are packages that we can use to extract data fro... |
std::tuple_element() and std::tuple_size() in C++ with Examples - GeeksforGeeks | 10 Jul, 2021
A tuple is an object that can hold a number of elements. The elements can be different data types. The elements of tuples are initialized as arguments in the order in which they will be accessed.
The functions-tuple_element() and tuple_size()are only defined for elements using tuple_like interface.
tuple_e... | [
{
"code": null,
"e": 25343,
"s": 25315,
"text": "\n10 Jul, 2021"
},
{
"code": null,
"e": 25539,
"s": 25343,
"text": "A tuple is an object that can hold a number of elements. The elements can be different data types. The elements of tuples are initialized as arguments in the order... |
HEAD method - Python requests - GeeksforGeeks | 09 Dec, 2021
Requests library is one of the important aspects of Python for making HTTP requests to a specified URL. This article revolves around how one can make HEAD request to a specified URL using requests.head() method. Before checking out the HEAD method, let’s figure out what a Http HEAD request is –
HEAD is a r... | [
{
"code": null,
"e": 25537,
"s": 25509,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 25833,
"s": 25537,
"text": "Requests library is one of the important aspects of Python for making HTTP requests to a specified URL. This article revolves around how one can make HEAD request ... |
How to get the dimensions of the Viewport using AngularJS ? - GeeksforGeeks | 30 Sep, 2020
In this article, we will see how to get the dimensions of the Viewport in AngularJS.
Approach:
The approach is to use clientWidth and innerWidth property.
The maximum of these values should be the width and height respectively.
Example 1: In this example, the height and width are calculated in pixels.
HT... | [
{
"code": null,
"e": 26354,
"s": 26326,
"text": "\n30 Sep, 2020"
},
{
"code": null,
"e": 26439,
"s": 26354,
"text": "In this article, we will see how to get the dimensions of the Viewport in AngularJS."
},
{
"code": null,
"e": 26450,
"s": 26439,
"text": "Appro... |
Java Program to Extract Content from a HTML document - GeeksforGeeks | 30 Nov, 2021
HTML is the core of the web, all the pages you see on the internet are HTML, whether they are dynamically generated by JavaScript, JSP, PHP, ASP, or any other web technology. Your browser actually parses HTML and render it for you But if we need to parse an HTML document and find some elements, tags, attri... | [
{
"code": null,
"e": 25237,
"s": 25209,
"text": "\n30 Nov, 2021"
},
{
"code": null,
"e": 25672,
"s": 25237,
"text": "HTML is the core of the web, all the pages you see on the internet are HTML, whether they are dynamically generated by JavaScript, JSP, PHP, ASP, or any other web ... |
GATE | GATE CS Mock 2018 | Question 39 - GeeksforGeeks | 10 Jan, 2018
Consider the following C-program :
int fun(){ static int num = 16; return num--;} int main(){ for(fun(); fun(); fun()) printf("%d ", fun()); return 0;}
What is output of above program?
(A) Infinite loop(B) 13 10 7 4 1(C) 15 12 8 5 2(D) 14 11 8 5 2Answer: (D)Explanation: Option (D) is correct. Refer... | [
{
"code": null,
"e": 25847,
"s": 25819,
"text": "\n10 Jan, 2018"
},
{
"code": null,
"e": 25882,
"s": 25847,
"text": "Consider the following C-program :"
},
{
"code": "int fun(){ static int num = 16; return num--;} int main(){ for(fun(); fun(); fun()) printf(\"%d \"... |
Program to calculate distance between two points - GeeksforGeeks | 04 May, 2022
You are given two co-ordinates (x1, y1) and (x2, y2) of a two dimensional graph. Find the distance between them.Examples:
Input : x1, y1 = (3, 4)
x2, y2 = (7, 7)
Output : 5
Input : x1, y1 = (3, 4)
x2, y2 = (4, 3)
Output : 1.41421
We will use the distance formula derived from Pythagore... | [
{
"code": null,
"e": 26128,
"s": 26100,
"text": "\n04 May, 2022"
},
{
"code": null,
"e": 26252,
"s": 26128,
"text": "You are given two co-ordinates (x1, y1) and (x2, y2) of a two dimensional graph. Find the distance between them.Examples: "
},
{
"code": null,
"e": 26... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.