title
stringlengths
3
221
text
stringlengths
17
477k
parsed
listlengths
0
3.17k
SQL - Expressions
An expression is a combination of one or more values, operators and SQL functions that evaluate to a value. These SQL EXPRESSIONs are like formulae and they are written in query language. You can also use them to query the database for a specific set of data. Consider the basic syntax of the SELECT statement as follows...
[ { "code": null, "e": 2713, "s": 2453, "text": "An expression is a combination of one or more values, operators and SQL functions that evaluate to a value. These SQL EXPRESSIONs are like formulae and they are written in query language. You can also use them to query the database for a specific set of...
Why static methods of parent class gets hidden in child class in java?
When we have two classes where, one extends another and if, these two classes have same method including parameters and return type (say, sample) the method in the sub class overrides the method in the super class. i.e. Since it is inheritance. If we instantiate the subclass a copy of superclass’s members is created in...
[ { "code": null, "e": 1277, "s": 1062, "text": "When we have two classes where, one extends another and if, these two classes have same method including parameters and return type (say, sample) the method in the sub class overrides the method in the super class." }, { "code": null, "e": 1...
attributes in C++ - GeeksforGeeks
05 Dec, 2018 Attributes are one of the key features of modern C++ which allows the programmer to specify additional information to the compiler to enforce constraints(conditions), optimise certain pieces of code or do some specific code generation. In simple terms, an attribute acts as an annotation or a note to the co...
[ { "code": null, "e": 24124, "s": 24096, "text": "\n05 Dec, 2018" }, { "code": null, "e": 24692, "s": 24124, "text": "Attributes are one of the key features of modern C++ which allows the programmer to specify additional information to the compiler to enforce constraints(condition...
Check if concatenation of two strings is balanced or not in Python
Suppose we have two bracket sequences s and t with only these characters '(' and ')'. We have to check whether the concatenated string of s and t is balanced or not. The concatenation can be done by s | t or t | s. So, if the input is like s = "()()))", t = "()(()(", then the output will be True because if we concatena...
[ { "code": null, "e": 1277, "s": 1062, "text": "Suppose we have two bracket sequences s and t with only these characters '(' and ')'. We have to check whether the concatenated string of s and t is balanced or not. The concatenation can be done by s | t or t | s." }, { "code": null, "e": 1...
Chained exception in Java
Chained exception helps to relate one exception to other. Often we need to throw a custom exception and want to keep the details of an original exception that in such scenarios we can use the chained exception mechanism. Consider the following example, where we are throwing a custom exception while keeping the message ...
[ { "code": null, "e": 1409, "s": 1062, "text": "Chained exception helps to relate one exception to other. Often we need to throw a custom exception and want to keep the details of an original exception that in such scenarios we can use the chained exception mechanism. Consider the following example, ...
COBOL - Data Types
Data Division is used to define the variables used in a program. To describe data in COBOL, one must understand the following terms − Data Name Level Number Picture Clause Value Clause 01 TOTAL-STUDENTS PIC9(5) VALUE '125'. | | | ...
[ { "code": null, "e": 2156, "s": 2022, "text": "Data Division is used to define the variables used in a program. To describe data in COBOL, one must understand the following terms −" }, { "code": null, "e": 2166, "s": 2156, "text": "Data Name" }, { "code": null, "e": 2...
Stream your data changes in MySQL into ElasticSearch using Debezium, Kafka, and Confluent JDBC Sink Connector | by Rizqi Nugroho | Towards Data Science
Fast search capability, realtime integrated data, nowadays is a necessity if we want to build something like e-catalog or e-commerce. We don’t want our users to get angry because they spend a lot of time just to get information from our portal. We also want the product information that inputted by our product team in t...
[ { "code": null, "e": 573, "s": 172, "text": "Fast search capability, realtime integrated data, nowadays is a necessity if we want to build something like e-catalog or e-commerce. We don’t want our users to get angry because they spend a lot of time just to get information from our portal. We also wa...
A Practitioner’s Guide To Difference-In-Differences Approach | by Leihua Ye, PhD | Towards Data Science
Executive Summary In a perfectly competitive market, conventional economic theory predicts an increase in the minimum wage leads to a rise in unemployment. Cross-sectional studies provide conflicting evidence but not a causal effect. Card and Krueger adopt a DID approach and find the wage increase leads to higher emplo...
[ { "code": null, "e": 65, "s": 47, "text": "Executive Summary" }, { "code": null, "e": 203, "s": 65, "text": "In a perfectly competitive market, conventional economic theory predicts an increase in the minimum wage leads to a rise in unemployment." }, { "code": null, "...
Print colored message with different fonts and sizes in C
C/C++ programming language, the user is provided with functionality to customize the output based on the requirement of the user. C/C++ graphics functions are included in graphics.h header file. Using this library you can create different objects, set the color of text, change the font and size of the text and change t...
[ { "code": null, "e": 1411, "s": 1062, "text": "C/C++ programming language, the user is provided with functionality to customize the output based on the requirement of the user. C/C++ graphics functions are included in graphics.h header file. Using this library you can create different objects, set t...
How do I get the id after INSERT into MySQL database in Python?
First, we need to complete the below requirements. The following are the prerequisites. We need to install MySQL version 8.0.12. We need to install Python version 3.6.3 (32 bit). We need to install pymysql with the help of pip command. To install “pymysql” with the help of pip command. The database name is ‘business’ a...
[ { "code": null, "e": 1150, "s": 1062, "text": "First, we need to complete the below requirements. The following are the prerequisites." }, { "code": null, "e": 1191, "s": 1150, "text": "We need to install MySQL version 8.0.12." }, { "code": null, "e": 1241, "s": 1...
Linking of MySql Database in Node.js Backend Side - GeeksforGeeks
18 Nov, 2020 We can link our MySQL Database in Node.js Backend Side with the mysql module. This module helps in connecting our database with the backend server for storing the data. Prerequisites: Properly installed node in your system. Properly installed npm (node package manager) in your system. MySQL server installe...
[ { "code": null, "e": 24842, "s": 24814, "text": "\n18 Nov, 2020" }, { "code": null, "e": 25011, "s": 24842, "text": "We can link our MySQL Database in Node.js Backend Side with the mysql module. This module helps in connecting our database with the backend server for storing the ...
Nodejs & DevOps: tricks to configure GitHub actions for node. | Towards Data Science
Who has read my articles knows my vision about the future of DevOps and cloud adoption (just DevOps is dead, long life to NoOps to mention one). To explain it without losing myself in out of scope though, I believe in automation and getting ready to go solutions (cloud, tools, etc.) that make us focus on application on...
[ { "code": null, "e": 557, "s": 172, "text": "Who has read my articles knows my vision about the future of DevOps and cloud adoption (just DevOps is dead, long life to NoOps to mention one). To explain it without losing myself in out of scope though, I believe in automation and getting ready to go so...
JavaScript | Classes
25 Nov, 2021 Introduction of new version of JavaScript (ES6) introduced the use of classes instead of functions.Classes are similar to functions.They use class keyword instead of function keyword. They use constructor method to initialise. Syntax: class classname { constructor(parameter) { this.classname = param...
[ { "code": null, "e": 52, "s": 24, "text": "\n25 Nov, 2021" }, { "code": null, "e": 280, "s": 52, "text": "Introduction of new version of JavaScript (ES6) introduced the use of classes instead of functions.Classes are similar to functions.They use class keyword instead of function...
Using Lynx to Browse the Web From the Linux Terminal
03 Oct, 2019 Lynx is a terminal-based web browser for all Linux distributions. It shows the result as plain text on the terminal. It is a classic non-graphical text-mode web browser which displays the pages on the terminal. Lynx does not load images and multimedia contents, hence it is fast as compared to other browser...
[ { "code": null, "e": 28, "s": 0, "text": "\n03 Oct, 2019" }, { "code": null, "e": 662, "s": 28, "text": "Lynx is a terminal-based web browser for all Linux distributions. It shows the result as plain text on the terminal. It is a classic non-graphical text-mode web browser which ...
What is the Shortcut to Auto Import All in Android Studio?
07 Mar, 2021 There are some basics import in Android Studio that is predefined present in Android studio. like Menu, AppBar, MenuItem, Bundle, Toast, etc. When we require those then we import that manually. In case of pasting some code copied from the Internet in Editor, it asks to import every Views and class. You can...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Mar, 2021" }, { "code": null, "e": 492, "s": 52, "text": "There are some basics import in Android Studio that is predefined present in Android studio. like Menu, AppBar, MenuItem, Bundle, Toast, etc. When we require those then we im...
Java Program to Display Floyd’s Triangle
28 Jul, 2021 Floyd’s triangle is a triangle with first natural numbers. It is the right arrangement of the numbers/values or patterns. Basically, it is a left to right arrangement of natural numbers in a right-angled triangle Illustration: Suppose if no of rows to be displayed is 5 then the desired output should displa...
[ { "code": null, "e": 54, "s": 26, "text": "\n28 Jul, 2021" }, { "code": null, "e": 267, "s": 54, "text": "Floyd’s triangle is a triangle with first natural numbers. It is the right arrangement of the numbers/values or patterns. Basically, it is a left to right arrangement of natu...
Parametric & Geometric Continuity of Curves in Computer Graphics
27 Jan, 2022 Prerequisite: B-spline curve, Bezier curve The continuity condition represents that how smoothly a curve transit from one curve segment to another segment. Consider you are given a curve as shown below: There are three kinds of Parametric continuities that exist: (a) Zero-order parametric continuity(_C0 ) ...
[ { "code": null, "e": 28, "s": 0, "text": "\n27 Jan, 2022" }, { "code": null, "e": 71, "s": 28, "text": "Prerequisite: B-spline curve, Bezier curve" }, { "code": null, "e": 231, "s": 71, "text": "The continuity condition represents that how smoothly a curve tra...
Generate a set of Sample data from a Data set in R Programming – sample() Function
28 Jul, 2020 sample() function in R Language creates random sample based on the parameters provided in the function call. It takes either a vector or a positive integer as the object in the function parameter. Syntax:sample(x, size, replace) Parameters:x: indicates either vector or a positive integer or data framesize:...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Jul, 2020" }, { "code": null, "e": 225, "s": 28, "text": "sample() function in R Language creates random sample based on the parameters provided in the function call. It takes either a vector or a positive integer as the object in th...
Node.js Request Module
08 Oct, 2021 The request module is used to make HTTP calls. It is the simplest way of making HTTP calls in node.js using this request module. It follows redirects by default. Feature of Request module: It is easy to get started and easy to use.It is widely used and popular module for making HTTP calls. It is easy to ge...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Oct, 2021" }, { "code": null, "e": 216, "s": 54, "text": "The request module is used to make HTTP calls. It is the simplest way of making HTTP calls in node.js using this request module. It follows redirects by default." }, { ...
Containerization using Docker
08 Jun, 2022 Docker is the containerization platform that is used to package your application and all its dependencies together in the form of containers to make sure that your application works seamlessly in any environment which can be developed or tested or in production. Docker is a tool designed to make it easier ...
[ { "code": null, "e": 54, "s": 26, "text": "\n08 Jun, 2022" }, { "code": null, "e": 424, "s": 54, "text": "Docker is the containerization platform that is used to package your application and all its dependencies together in the form of containers to make sure that your applicatio...
Python Seaborn – Catplot
26 Nov, 2020 Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics. Seaborn helps resolve the two major problems faced by Matplotlib; the problems are? Default Matplotlib parameters Working with data frames As S...
[ { "code": null, "e": 52, "s": 24, "text": "\n26 Nov, 2020" }, { "code": null, "e": 300, "s": 52, "text": "Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics. Seaborn he...
Generators in Dart
21 Jul, 2020 Generators in Dart allows the user to produce a sequence of value easily. One can generate a sequence of values in dart with the help of two generator functions : Synchronous Generator: Returns an Iterable object.Asynchronous Generator: Returns a Stream object. Synchronous Generator: Returns an Iterable ob...
[ { "code": null, "e": 28, "s": 0, "text": "\n21 Jul, 2020" }, { "code": null, "e": 191, "s": 28, "text": "Generators in Dart allows the user to produce a sequence of value easily. One can generate a sequence of values in dart with the help of two generator functions :" }, { ...
Select Pandas dataframe rows between two dates
24 Feb, 2021 Prerequisites: pandas Pandas is an open-source library that is built on top of NumPy library. It is a Python package that offers various data structures and operations for manipulating numerical data and time series. It is mainly popular for importing and analyzing data much easier. Pandas is fast and it h...
[ { "code": null, "e": 54, "s": 26, "text": "\n24 Feb, 2021" }, { "code": null, "e": 76, "s": 54, "text": "Prerequisites: pandas" }, { "code": null, "e": 407, "s": 76, "text": "Pandas is an open-source library that is built on top of NumPy library. It is a Pytho...
How to Use Linux Commands in Windows with Cygwin
11 Oct, 2021 Cygwin is a collection of tools that provide a Linux Operating System’s terminal look, feel, and some of its basic functionality for users of Windows OS who want to have a go over the basic commands of Linux without worrying about installing a Linux OS. To use this tool, first of all, we need to download C...
[ { "code": null, "e": 28, "s": 0, "text": "\n11 Oct, 2021" }, { "code": null, "e": 282, "s": 28, "text": "Cygwin is a collection of tools that provide a Linux Operating System’s terminal look, feel, and some of its basic functionality for users of Windows OS who want to have a go ...
Java Program to Implement the Monoalphabetic Cypher
11 Aug, 2021 Monoalphabetic Cipher is a cipher where the letters of the plain text are mapped to ciphertext letters based on a single alphabetic key. It is a one to one mapping. Given plain text, the task is to implement the Monoalphabetic Cipher. Examples: Input: Welcome to geeksforgeeks Output: Plain text: Welcome t...
[ { "code": null, "e": 54, "s": 26, "text": "\n11 Aug, 2021" }, { "code": null, "e": 219, "s": 54, "text": "Monoalphabetic Cipher is a cipher where the letters of the plain text are mapped to ciphertext letters based on a single alphabetic key. It is a one to one mapping." }, {...
Palindrome pair in an array of words (or strings)
08 Jul, 2022 Given a list of words, find if any of the two words can be joined to form a palindrome. Examples: Input : list[] = {"geekf", "geeks", "or", "keeg", "abc", "bc"} Output : Yes There is a pair "geekf" and "keeg" Input : list[] = {"abc", "xyxcba", "geekst", "or", ...
[ { "code": null, "e": 52, "s": 24, "text": "\n08 Jul, 2022" }, { "code": null, "e": 140, "s": 52, "text": "Given a list of words, find if any of the two words can be joined to form a palindrome." }, { "code": null, "e": 151, "s": 140, "text": "Examples: " }, ...
Plot Multiple Data Sets on the Same Chart in Excel
29 Jun, 2021 Sometimes while dealing with hierarchical data we need to combine two or more various chart types into a single chart for better visualization and analysis. This type of chart having multiple data sets is known as “Combination charts”. In this article, we are going to see how to make combination charts fro...
[ { "code": null, "e": 28, "s": 0, "text": "\n29 Jun, 2021" }, { "code": null, "e": 264, "s": 28, "text": "Sometimes while dealing with hierarchical data we need to combine two or more various chart types into a single chart for better visualization and analysis. This type of chart...
JavaScript Date now() Method
25 Nov, 2021 In this article, we will learn about the Date now() method in Javascript. The date.now() method is used to return the number of milliseconds elapsed since January 1, 1970, 00:00:00 UTC. Since now() is a static method of Date, it will always be used as Date.now(). Syntax: var A = Date.now(); Parameters: Th...
[ { "code": null, "e": 52, "s": 24, "text": "\n25 Nov, 2021" }, { "code": null, "e": 317, "s": 52, "text": "In this article, we will learn about the Date now() method in Javascript. The date.now() method is used to return the number of milliseconds elapsed since January 1, 1970, 00...
Java Program to Check Whether an Element Occurs in a List
07 Jan, 2021 The List Interface in Java represents an ordered collection or sequence. This Interface helps us control where to insert elements and also access elements through an integer index. This Interface is a member of the Java Collections Framework and the java.util package. The classes that implement the List In...
[ { "code": null, "e": 28, "s": 0, "text": "\n07 Jan, 2021" }, { "code": null, "e": 444, "s": 28, "text": "The List Interface in Java represents an ordered collection or sequence. This Interface helps us control where to insert elements and also access elements through an integer i...
Sparse Matrix and its representations | Set 2 (Using List of Lists and Dictionary of keys)
07 Jul, 2022 Prerequisite : Sparse Matrix and its representations Set 1 (Using Arrays and Linked Lists)In this post other two methods of sparse matrix representation are discussed. List of ListsDictionary List of Lists Dictionary List of Lists (LIL) One of the possible representation of sparse matrix is List of Lists...
[ { "code": null, "e": 52, "s": 24, "text": "\n07 Jul, 2022" }, { "code": null, "e": 221, "s": 52, "text": "Prerequisite : Sparse Matrix and its representations Set 1 (Using Arrays and Linked Lists)In this post other two methods of sparse matrix representation are discussed. " },...
java.net.URL Class in Java
28 Mar, 2021 URL is an acronym of Uniform resource locater. It is a pointer to locate resource in www (World Wide Web). A resource can be anything from a simple text file to any other like images, file directory etc. The typical URL may look like http://www.example.com:80/index.html The URL has the following parts: Pr...
[ { "code": null, "e": 28, "s": 0, "text": "\n28 Mar, 2021" }, { "code": null, "e": 233, "s": 28, "text": "URL is an acronym of Uniform resource locater. It is a pointer to locate resource in www (World Wide Web). A resource can be anything from a simple text file to any other like...
Concatenate two PySpark dataframes - GeeksforGeeks
04 Jan, 2022 In this article, we are going to see how to concatenate two pyspark dataframe using Python. Creating Dataframe for demonstration: Python3 # Importing necessary librariesfrom pyspark.sql import SparkSession # Create a spark sessionspark = SparkSession.builder.appName('pyspark - example join').getOrCreate()...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n04 Jan, 2022" }, { "code": null, "e": 25629, "s": 25537, "text": "In this article, we are going to see how to concatenate two pyspark dataframe using Python." }, { "code": null, "e": 25667, "s": 25629, "text":...
Pivot Cache in Excel - GeeksforGeeks
01 Jun, 2021 Excel automatically makes a copy of the source data and saves it in the Pivot Cache when you build a PivotTable. It is a part of the workbook and is linked to the Pivot Table, even though you can’t see it. When you make adjustments to the Pivot Table, it uses the Pivot Cache rather than the data source. Ex...
[ { "code": null, "e": 26289, "s": 26261, "text": "\n01 Jun, 2021" }, { "code": null, "e": 26402, "s": 26289, "text": "Excel automatically makes a copy of the source data and saves it in the Pivot Cache when you build a PivotTable." }, { "code": null, "e": 26781, "s...
unordered_set bucket() function in C++ STL - GeeksforGeeks
28 Sep, 2018 The unordered_set::bucket() method is a builtin function in C++ STL which returns the bucket number of a specific element. That is, this function returns the bucket number where a specific element is stored in the unordered_set container. The bucket is a slot in the unordered_set’s internal hash table wher...
[ { "code": null, "e": 25930, "s": 25902, "text": "\n28 Sep, 2018" }, { "code": null, "e": 26169, "s": 25930, "text": "The unordered_set::bucket() method is a builtin function in C++ STL which returns the bucket number of a specific element. That is, this function returns the bucke...
__closure__ magic function in Python - GeeksforGeeks
11 Oct, 2020 Almost everything in Python is an object, similarly function is an object too and all the function objects have a __closure__ attribute. __closure__ is a dunder/magic function i.e. methods having two underscores as prefix and suffix in the method name A closure is a function object that remembers values in...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n11 Oct, 2020" }, { "code": null, "e": 25789, "s": 25537, "text": "Almost everything in Python is an object, similarly function is an object too and all the function objects have a __closure__ attribute. __closure__ is a dunder/ma...
Lodash _.join() Method - GeeksforGeeks
03 Aug, 2020 The _.join() function is used to converts all elements in the array into a string separated by a separator. Syntax: _.join(array, [separator=',']) Parameter: This method accepts two parameters as mentioned above and described below: array: It is the original array from which join operation is to be perf...
[ { "code": null, "e": 26545, "s": 26517, "text": "\n03 Aug, 2020" }, { "code": null, "e": 26653, "s": 26545, "text": "The _.join() function is used to converts all elements in the array into a string separated by a separator." }, { "code": null, "e": 26663, "s": 26...
How to create Shooting Star Animation Effect using CSS ? - GeeksforGeeks
08 Oct, 2021 The Shooting Star effect is one of the coolest background effects that is used for dark-themed websites. Shooting Stars Animation is an extraordinary illustration of a loading screen that grabs your eye for a considerable length of time for the remainder of the content to load on the website. This effect c...
[ { "code": null, "e": 26621, "s": 26593, "text": "\n08 Oct, 2021" }, { "code": null, "e": 26959, "s": 26621, "text": "The Shooting Star effect is one of the coolest background effects that is used for dark-themed websites. Shooting Stars Animation is an extraordinary illustration ...
Spring - Dependency Injection by Setter Method - GeeksforGeeks
19 Nov, 2021 Dependency Injection is the main functionality provided by Spring IOC(Inversion of Control). The Spring-Core module is responsible for injecting dependencies through either Constructor or Setter methods. The design principle of Inversion of Control emphasizes keeping the Java classes independent of each ot...
[ { "code": null, "e": 25225, "s": 25197, "text": "\n19 Nov, 2021" }, { "code": null, "e": 25770, "s": 25225, "text": "Dependency Injection is the main functionality provided by Spring IOC(Inversion of Control). The Spring-Core module is responsible for injecting dependencies throu...
Visualise COVID-19 case data using Python, Dash, and Plotly | by Meinhard Ploner | Towards Data Science
This article is less about COVID-19, but more about how to create a useful web application using Python & Dash. It is intended as a simple guide to get up & running with the technology, and makes it easy to do it by yourself! I wrote pretty much the same article about how to perform this task using R & Shiny, and inten...
[ { "code": null, "e": 398, "s": 172, "text": "This article is less about COVID-19, but more about how to create a useful web application using Python & Dash. It is intended as a simple guide to get up & running with the technology, and makes it easy to do it by yourself!" }, { "code": null, ...
How to process a simple form data using Python CGI script?
suppose there is an HTML file as below − <form action="getData.py" method="post"> FirstName: <input type="text" name="first_name"> LastName: <input type="text" name="last_name"> <input type="submit" value="go"> </form> after submitting this form it should go to a python page named getData.py, where you should ...
[ { "code": null, "e": 1103, "s": 1062, "text": "suppose there is an HTML file as below −" }, { "code": null, "e": 1290, "s": 1103, "text": "<form action=\"getData.py\" method=\"post\">\n FirstName: <input type=\"text\" name=\"first_name\">\n LastName: <input type=\"text\" name...
Ones and Zeroes in C++
Suppose we have a dominator of m 0s and n 1s respectively. On the other hand, there is an array with binary strings. Now our task is to find the maximum number of strings that we can generate with given m 0s and n 1s. Each 0 and 1 can be used at most once. So if the input is like Array = [“10”, “0001”, “111001”, “1”, “...
[ { "code": null, "e": 1554, "s": 1062, "text": "Suppose we have a dominator of m 0s and n 1s respectively. On the other hand, there is an array with binary strings. Now our task is to find the maximum number of strings that we can generate with given m 0s and n 1s. Each 0 and 1 can be used at most on...
Place the image at the bottom inside a Bootstrap 4 card
To place the image at the bottom inside a card, use the card-img-bottom class. Firstly, set the card body and then use the <img> tag to add an image. The following code snippet is added inside the card class − <div class="card-body"> <h4 class="card-title">Quantitative Aptitude</h4> <p class="card-text">For Entranc...
[ { "code": null, "e": 1141, "s": 1062, "text": "To place the image at the bottom inside a card, use the card-img-bottom class." }, { "code": null, "e": 1272, "s": 1141, "text": "Firstly, set the card body and then use the <img> tag to add an image. The following code snippet is ad...
Python - Mirror Image of String - GeeksforGeeks
02 Sep, 2020 Given a String, perform its mirror imaging, return “Not Possible” if mirror image not possible using english characters. Input : test_str = ‘boid’Output : doibExplanation : d replaced by b and vice-versa as being mirror images. Input : test_str = ‘gfg’Output : Not PossibleExplanation : Valid Mirror image n...
[ { "code": null, "e": 24390, "s": 24362, "text": "\n02 Sep, 2020" }, { "code": null, "e": 24511, "s": 24390, "text": "Given a String, perform its mirror imaging, return “Not Possible” if mirror image not possible using english characters." }, { "code": null, "e": 24618...
Minimum operations of given type to make all elements of a matrix equal - GeeksforGeeks
15 Nov, 2021 Given an integer K and a matrix of N rows and M columns, the task is to find the minimum number of operations required to make all the elements of the matrix equal. In a single operation, K can be added to or subtracted from any element of the matrix. Print -1 if it is impossible to do so. Examples: Input:...
[ { "code": null, "e": 25448, "s": 25420, "text": "\n15 Nov, 2021" }, { "code": null, "e": 25739, "s": 25448, "text": "Given an integer K and a matrix of N rows and M columns, the task is to find the minimum number of operations required to make all the elements of the matrix equal...
Python Program to find sum of array - GeeksforGeeks
22 Oct, 2020 Given an array of integers, find the sum of its elements. Examples : Input : arr[] = {1, 2, 3} Output : 6 1 + 2 + 3 = 6 Input : arr[] = {15, 12, 13, 10} Output : 50 Method 1: # Python 3 code to find sum # of elements in given array def _sum(arr): # initialize a variable # to store the sum ...
[ { "code": null, "e": 26381, "s": 26353, "text": "\n22 Oct, 2020" }, { "code": null, "e": 26439, "s": 26381, "text": "Given an array of integers, find the sum of its elements." }, { "code": null, "e": 26450, "s": 26439, "text": "Examples :" }, { "code":...
How to clone a GitHub repository?
Cloning a repository involves downloading a copy of the source code from source control. In other words, cloning is creating a copy of an existing repository. Consider an example where multiple users are working on a project. This feature can be used by the users to create a development copy. If you have a GitHub repos...
[ { "code": null, "e": 1356, "s": 1062, "text": "Cloning a repository involves downloading a copy of the source code from source control. In other words, cloning is creating a copy of an existing repository. Consider an example where multiple users are working on a project. This feature can be used by...
Alert for unsaved changes in form in JavaScript
Following is the code to display an alert for form’s unsaved changes in JavaScript − Live Demo <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> <style> body { font-family: "Segoe UI", Tahoma, Genev...
[ { "code": null, "e": 1147, "s": 1062, "text": "Following is the code to display an alert for form’s unsaved changes in JavaScript −" }, { "code": null, "e": 1158, "s": 1147, "text": " Live Demo" }, { "code": null, "e": 1821, "s": 1158, "text": "<!DOCTYPE html>...
ReactJS - State Management
State management is one of the important and unavoidable features of any dynamic application. React provides a simple and flexible API to support state management in a React component. Let us understand how to maintain state in React application in this chapter. State represents the value of a dynamic properties of a R...
[ { "code": null, "e": 2296, "s": 2033, "text": "State management is one of the important and unavoidable features of any dynamic application. React provides a simple and flexible API to support state management in a React component. Let us understand how to maintain state in React application in this...
Program to find minimum changes required for alternating binary string in Python
Suppose we have a binary string s. Let us consider an operation where we can flip one bit. The string s is called alternating string if no two adjacent characters are same. We have to find the minimum number of operations needed to make s alternating. So, if the input is like s = "11100011", then the output will be 3 b...
[ { "code": null, "e": 1314, "s": 1062, "text": "Suppose we have a binary string s. Let us consider an operation where we can flip one bit. The string s is called alternating string if no two adjacent characters are same. We have to find the minimum number of operations needed to make s alternating." ...
\limits - Tex Command
\limit - Used to set limits above/below any token of class OP. { \limit } \limit command is used to set limits above/below any token of class OP. \int_a^b f(x)\,dx ∫abf(x)dx \int\limits_a^b f(x)\,dx ∫abf(x)dx \mathop{x}\limits_0^1 x01 \int_a^b f(x)\,dx ∫abf(x)dx \int_a^b f(x)\,dx \int\limits_a^b f(x)\,dx ...
[ { "code": null, "e": 8049, "s": 7986, "text": "\\limit - Used to set limits above/below any token of class OP." }, { "code": null, "e": 8060, "s": 8049, "text": "{ \\limit }" }, { "code": null, "e": 8132, "s": 8060, "text": "\\limit command is used to set limi...
Working with DataFrames in Julia - GeeksforGeeks
02 Aug, 2021 A Data frame is a two-dimensional data structure that resembles a table, where the columns represent variables and rows contain values for those variables. It is mutable and can hold various data types. Julia is a high performance, dynamic programming language which has a high-level syntax. The DataFrame p...
[ { "code": null, "e": 24356, "s": 24328, "text": "\n02 Aug, 2021" }, { "code": null, "e": 24559, "s": 24356, "text": "A Data frame is a two-dimensional data structure that resembles a table, where the columns represent variables and rows contain values for those variables. It is m...
MapReduce - API
In this chapter, we will take a close look at the classes and their methods that are involved in the operations of MapReduce programming. We will primarily keep our focus on the following − JobContext Interface Job Class Mapper Class Reducer Class The JobContext interface is the super interface for all the classes, whi...
[ { "code": null, "e": 1980, "s": 1790, "text": "In this chapter, we will take a close look at the classes and their methods that are involved in the operations of MapReduce programming. We will primarily keep our focus on the following −" }, { "code": null, "e": 2001, "s": 1980, "...
HTML template Tag - GeeksforGeeks
15 Dec, 2021 The <template> tag in HTML is used to store the HTML code fragments, which can be cloned and inserted in an HTML document. The content of the tag is hidden from clients being stored on the client-side. It is inserted until activated using JavaScript. Use JavaScript to get the content from a template, and a...
[ { "code": null, "e": 24919, "s": 24891, "text": "\n15 Dec, 2021" }, { "code": null, "e": 25249, "s": 24919, "text": "The <template> tag in HTML is used to store the HTML code fragments, which can be cloned and inserted in an HTML document. The content of the tag is hidden from cl...
Minimum Sum of Euclidean Distances to all given Points - GeeksforGeeks
11 May, 2021 Given a matrix mat[][] consisting of N pairs of the form {x, y} each denoting coordinates of N points, the task is to find the minimum sum of the Euclidean distances to all points. Examples: Input: mat[][] = { { 0, 1}, { 1, 0 }, { 1, 2 }, { 2, 1 }} Output: 4 Explanation: Average of the set of points, i.e. ...
[ { "code": null, "e": 24822, "s": 24794, "text": "\n11 May, 2021" }, { "code": null, "e": 25003, "s": 24822, "text": "Given a matrix mat[][] consisting of N pairs of the form {x, y} each denoting coordinates of N points, the task is to find the minimum sum of the Euclidean distanc...
Python - Custom Lower bound a List - GeeksforGeeks
11 Oct, 2020 Given a list, assign a custom lower-bound value to it. Input : test_list = [5, 7, 8, 2, 3, 5, 1], K = 3 Output : [5, 7, 8, 3, 3, 5, 3] Explanation : All elements less than 3, assigned 3. Input : test_list = [5, 7, 8, 2, 3, 5, 1], K = 5 Output : [5, 7, 8, 5, 5, 5, 5] Explanation : All elements less than 5, ...
[ { "code": null, "e": 25012, "s": 24984, "text": "\n11 Oct, 2020" }, { "code": null, "e": 25067, "s": 25012, "text": "Given a list, assign a custom lower-bound value to it." }, { "code": null, "e": 25199, "s": 25067, "text": "Input : test_list = [5, 7, 8, 2, 3,...
Merge two BST 's | Practice | GeeksforGeeks
Given two BSTs, return elements of both BSTs in sorted form. Example 1: Input: BST1: 5 / \ 3 6 / \ 2 4 BST2: 2 / \ 1 3 \ 7 / 6 Output: 1 2 2 3 3 4 5 6 6 7 Explanation: After merging and sorting the two BST we get 1...
[ { "code": null, "e": 299, "s": 238, "text": "Given two BSTs, return elements of both BSTs in sorted form." }, { "code": null, "e": 311, "s": 299, "text": "\nExample 1:" }, { "code": null, "e": 579, "s": 311, "text": "Input:\nBST1:\n 5\n / \\\n 3...
Amazing hacks of Python - GeeksforGeeks
27 Dec, 2021 Python is indeed one of the smart and most trending languages. Here are some cool hacks that make python superb among all other languages. List comprehensions: List comprehension is the best and efficient technique to get rid of writing unnecessary lines of code. Read Article to know more. Printing a lis...
[ { "code": null, "e": 25859, "s": 25831, "text": "\n27 Dec, 2021" }, { "code": null, "e": 25999, "s": 25859, "text": "Python is indeed one of the smart and most trending languages. Here are some cool hacks that make python superb among all other languages. " }, { "code": n...
Can we override a protected method in Java?
Yes, the protected method of a superclass can be overridden by a subclass. If the superclass method is protected, the subclass overridden method can have protected or public (but not default or private) which means the subclass overridden method can not have a weaker access specifier. class A { protected void protec...
[ { "code": null, "e": 1348, "s": 1062, "text": "Yes, the protected method of a superclass can be overridden by a subclass. If the superclass method is protected, the subclass overridden method can have protected or public (but not default or private) which means the subclass overridden method can not...
Check if the bracket sequence can be balanced with at most one change in the position of a bracket - GeeksforGeeks
26 Jul, 2021 Given an unbalanced bracket sequence as a string str, the task is to find whether the given string can be balanced by moving at most one bracket from its original place in the sequence to any other position.Examples: Input: str = “)(()” Output: Yes As by moving s[0] to the end will make it valid. “(())”I...
[ { "code": null, "e": 24772, "s": 24744, "text": "\n26 Jul, 2021" }, { "code": null, "e": 24991, "s": 24772, "text": "Given an unbalanced bracket sequence as a string str, the task is to find whether the given string can be balanced by moving at most one bracket from its original ...
What are member functions of a class in C#?
A member function of a class is a function that has its definition or its prototype within the class definition similar to any other variable. It operates on an object of the class of which it is a member, and has access to all the members of a class for that object. The following is an example of a member function − p...
[ { "code": null, "e": 1330, "s": 1062, "text": "A member function of a class is a function that has its definition or its prototype within the class definition similar to any other variable. It operates on an object of the class of which it is a member, and has access to all the members of a class fo...
Complexity Cheat Sheet for Python Operations - GeeksforGeeks
24 Feb, 2022 Prerequisite: List, Dictionaries, Sets Python built-in data structures like list, sets, dictionaries provide a large number of operations making it easier to write concise code but not being aware of their complexity can result in unexpected slow behavior of your python code. For example: A simple dicti...
[ { "code": null, "e": 25579, "s": 25551, "text": "\n24 Feb, 2022" }, { "code": null, "e": 25619, "s": 25579, "text": "Prerequisite: List, Dictionaries, Sets " }, { "code": null, "e": 25858, "s": 25619, "text": "Python built-in data structures like list, sets, d...
Span<T>.Enumerator Struct in C# - GeeksforGeeks
23 Mar, 2022 Span<T> is a new feature introduced with C# 7.2 and supported in the .NET Core 2.1. It provides a type-safe access to a contiguous area of memory. This memory can be located on the heap, stack or formed a unallocated memory. Span<T> is defined as a ref struct, which means it is limited to being allocated o...
[ { "code": null, "e": 26098, "s": 26070, "text": "\n23 Mar, 2022" }, { "code": null, "e": 26631, "s": 26098, "text": "Span<T> is a new feature introduced with C# 7.2 and supported in the .NET Core 2.1. It provides a type-safe access to a contiguous area of memory. This memory can ...
OpenCV - Alpha blending and masking of images - GeeksforGeeks
16 Mar, 2021 Alpha blending is the process of overlaying a foreground image on a background image. We take these two images to blend : gfg.png apple.jpeg Steps : First, we will import OpenCV. We read the two images that we want to blend. The images are displayed. We have a while loop that runs while the choice is 1. En...
[ { "code": null, "e": 24238, "s": 24210, "text": "\n16 Mar, 2021" }, { "code": null, "e": 24324, "s": 24238, "text": "Alpha blending is the process of overlaying a foreground image on a background image." }, { "code": null, "e": 24360, "s": 24324, "text": "We t...
User defined Functions in C - onlinetutorialspoint
PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC EXCEPTIONS COLLECTIONS SWING JDBC JAVA 8 SPRING SPRING BOOT HIBERNATE PYTHON PHP JQUERY PROGRAMMINGJava ExamplesC Examples Java Examples C Examples C Tutorials aws In this tutorial, we are going to learn about...
[ { "code": null, "e": 158, "s": 123, "text": "PROGRAMMINGJava ExamplesC Examples" }, { "code": null, "e": 172, "s": 158, "text": "Java Examples" }, { "code": null, "e": 183, "s": 172, "text": "C Examples" }, { "code": null, "e": 195, "s": 183, ...
Class getEnclosingMethod() method in Java with Examples - GeeksforGeeks
27 Jan, 2022 The getEnclosingMethod() method of java.lang.Class class is used to get the enclosing methods of this class. The method returns the enclosing methods of this class if this class is a local class or anonymous class declared in that method. Else this method returns null.Syntax: public Method getEnclosingMe...
[ { "code": null, "e": 24346, "s": 24318, "text": "\n27 Jan, 2022" }, { "code": null, "e": 24625, "s": 24346, "text": "The getEnclosingMethod() method of java.lang.Class class is used to get the enclosing methods of this class. The method returns the enclosing methods of this class...
C++ Program for Longest Increasing Subsequence - GeeksforGeeks
15 Sep, 2021 The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing order. For example, the length of LIS for {10, 22, 9, 33, 21, 50, 41, 60, 80} is 6 and LIS is {10, 22, 33, 50, 60, 80}. E...
[ { "code": null, "e": 24632, "s": 24604, "text": "\n15 Sep, 2021" }, { "code": null, "e": 24938, "s": 24632, "text": "The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are...
Lazy Loading in ReactJS
In this article, we will learn how to lazily load the pages of our application to make our React application more optimized. React apps are bundled with the preinstalled bundlers like webpack before making the React application to be production ready. When this bundled project is loaded, it loads the whole source code ...
[ { "code": null, "e": 1187, "s": 1062, "text": "In this article, we will learn how to lazily load the pages of our application to make our React application more optimized." }, { "code": null, "e": 1619, "s": 1187, "text": "React apps are bundled with the preinstalled bundlers lik...
Masked-Language Modeling With BERT | by James Briggs | Towards Data Science
BERT, everyone’s favorite transformer costs Google ~$7K to train [1] (and who knows how much in R&D costs). From there, we write a couple of lines of code to use the same model — all for free. BERT has enjoyed unparalleled success in NLP thanks to two unique training approaches, masked-language modeling (MLM), and next...
[ { "code": null, "e": 365, "s": 172, "text": "BERT, everyone’s favorite transformer costs Google ~$7K to train [1] (and who knows how much in R&D costs). From there, we write a couple of lines of code to use the same model — all for free." }, { "code": null, "e": 520, "s": 365, "t...
Java Program to check whether a file exists or not
The method java.io.File.exists() is used to check whether a file exists or not. This method returns true if the file specified by the abstract path name exists and false if it does not exist. A program that demonstrates this is given as follows − Live Demo import java.io.File; public class Demo { public static void...
[ { "code": null, "e": 1254, "s": 1062, "text": "The method java.io.File.exists() is used to check whether a file exists or not. This method returns true if the file specified by the abstract path name exists and false if it does not exist." }, { "code": null, "e": 1309, "s": 1254, ...
Tryit Editor v3.7
Tryit: HTML image
[]
Replace every element with the least greater element on its right - GeeksforGeeks
18 Apr, 2022 Given an array of integers, replace every element with the least greater element on its right side in the array. If there are no greater elements on the right side, replace it with -1. Examples: Input: [8, 58, 71, 18, 31, 32, 63, 92, 43, 3, 91, 93, 25, 80, 28] Output: [18, 63, 80, 25, 32, 43, 80...
[ { "code": null, "e": 24429, "s": 24401, "text": "\n18 Apr, 2022" }, { "code": null, "e": 24614, "s": 24429, "text": "Given an array of integers, replace every element with the least greater element on its right side in the array. If there are no greater elements on the right side...
Select a row of series or dataframe by given integer index - GeeksforGeeks
28 Jul, 2020 Dataframe.iloc[] is used to select a row of series/dataframe by given integer index. Let’s Create a Data Frame: Code: Python3 # import pandas libraryimport pandas as pd # Create the dataframe df = pd.DataFrame({'ID': ['114', '345', '157788', '5626'], 'Product': ['...
[ { "code": null, "e": 23901, "s": 23873, "text": "\n28 Jul, 2020" }, { "code": null, "e": 24014, "s": 23901, "text": "Dataframe.iloc[] is used to select a row of series/dataframe by given integer index. Let’s Create a Data Frame:" }, { "code": null, "e": 24020, "s...
How do we print a variable at the MongoDB command prompt?
In order to print a variable at the MongoDB command prompt, use the following syntax //Declaring and Initializing a variable. var anyVariableName=yourValue; //To print the above variable. yourVariableName; Or print(yourVariableName); Following is how you can declare and initialize a variable at the MongoDB command prom...
[ { "code": null, "e": 1147, "s": 1062, "text": "In order to print a variable at the MongoDB command prompt, use the following syntax" }, { "code": null, "e": 1296, "s": 1147, "text": "//Declaring and Initializing a variable.\nvar anyVariableName=yourValue;\n//To print the above va...
GATE | GATE-CS-2007 | Question 45 - GeeksforGeeks
28 Jun, 2021 What is the time complexity of the following recursive function: int DoSomething (int n) { if (n <= 2) return 1; else return (DoSomething (floor(sqrt(n))) + n);} (A) (n)(B) (nlogn)(C) (logn)(D) (loglogn)(A) A(B) B(C) C(D) DAnswer: (D)Explanation: See Question 5 of https://www.geeksforgeeks.org/da...
[ { "code": null, "e": 25695, "s": 25667, "text": "\n28 Jun, 2021" }, { "code": null, "e": 25760, "s": 25695, "text": "What is the time complexity of the following recursive function:" }, { "code": "int DoSomething (int n) { if (n <= 2) return 1; else return (DoSo...
PositiveSmallIntegerField - Django Models - GeeksforGeeks
12 Feb, 2020 PositiveSmallIntegerField is a integer number represented in Python by a int instance. This field is like a PositiveIntegerField. The default form widget for this field is a NumberInput when localize is False or TextInput otherwise. It supports values from 0 to 32767 in all databases supported by Django.It...
[ { "code": null, "e": 25559, "s": 25531, "text": "\n12 Feb, 2020" }, { "code": null, "e": 25990, "s": 25559, "text": "PositiveSmallIntegerField is a integer number represented in Python by a int instance. This field is like a PositiveIntegerField. The default form widget for this ...
HTML DOM Range insertNode() Method - GeeksforGeeks
07 Jul, 2020 The insertNode() method inserts a node at the start of the Range. The updated Range consists of new inserted node before the Range of the last Range content. Syntax: range.insertNode( newNode ); Parameters: This method accepts single parameter as mentioned above and described below: newNode: The Node to be...
[ { "code": null, "e": 26139, "s": 26111, "text": "\n07 Jul, 2020" }, { "code": null, "e": 26205, "s": 26139, "text": "The insertNode() method inserts a node at the start of the Range." }, { "code": null, "e": 26297, "s": 26205, "text": "The updated Range consis...
Peterson's Algorithm for Mutual Exclusion | Set 2 (CPU Cycles and Memory Fence) - GeeksforGeeks
07 Aug, 2021 Problem: Given 2 process i and j, you need to write a program that can guarantee mutual exclusion between the two without any additional hardware support. We strongly recommend to refer below basic solution discussed in previous article. Peterson’s Algorithm for Mutual Exclusion | Set 1We would be resolvin...
[ { "code": null, "e": 25857, "s": 25829, "text": "\n07 Aug, 2021" }, { "code": null, "e": 26012, "s": 25857, "text": "Problem: Given 2 process i and j, you need to write a program that can guarantee mutual exclusion between the two without any additional hardware support." }, ...
Phonenumbers module in Python - GeeksforGeeks
05 Sep, 2020 Python is a very powerful language and also very rich in libraries. phonenumbers is one of the modules that provides numerous features like providing basic information of a phone number, validation of a phone number etc. Here, we will learn how to use phonenumbers module just by writing simple Python progr...
[ { "code": null, "e": 25849, "s": 25821, "text": "\n05 Sep, 2020" }, { "code": null, "e": 26219, "s": 25849, "text": "Python is a very powerful language and also very rich in libraries. phonenumbers is one of the modules that provides numerous features like providing basic informa...
Java | Exception Handling | Question 4 - GeeksforGeeks
28 Jun, 2021 class Base extends Exception {}class Derived extends Base {} public class Main { public static void main(String args[]) { // some other stuff try { // Some monitored code throw new Derived(); } catch(Base b) { System.out.println("Caught base class exception"); } c...
[ { "code": null, "e": 25658, "s": 25630, "text": "\n28 Jun, 2021" }, { "code": "class Base extends Exception {}class Derived extends Base {} public class Main { public static void main(String args[]) { // some other stuff try { // Some monitored code throw new Derived(); ...
Print all words matching a pattern in CamelCase Notation Dictionary - GeeksforGeeks
08 Jul, 2021 Given a dictionary of words where each word follows CamelCase notation, print all words in the dictionary that match with a given pattern consisting of uppercase characters only.CamelCase is the practice of writing compound words or phrases such that each word or abbreviation begins with a capital letter. ...
[ { "code": null, "e": 25801, "s": 25773, "text": "\n08 Jul, 2021" }, { "code": null, "e": 26210, "s": 25801, "text": "Given a dictionary of words where each word follows CamelCase notation, print all words in the dictionary that match with a given pattern consisting of uppercase c...
Python PIL | Image.histogram() - GeeksforGeeks
12 Dec, 2021 PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which is used to represent a PIL image. The module also provides a number of factory functions, including functions to load images from files, and to...
[ { "code": null, "e": 25537, "s": 25509, "text": "\n12 Dec, 2021" }, { "code": null, "e": 26489, "s": 25537, "text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The Image module provides a class with the same name which...
How to write a running C code without main()?
Here we will see, one program can be written without main or not? The answer is yes. We can write program, that has no main() function. In many places, we have seen that the main() is the entry point of a program execution. Just from the programmers perspective this is true. From the system’s perspective it is not true...
[ { "code": null, "e": 1198, "s": 1062, "text": "Here we will see, one program can be written without main or not? The answer is yes. We can write program, that has no main() function." }, { "code": null, "e": 1478, "s": 1198, "text": "In many places, we have seen that the main() i...
How can I remove items out of a Python tuple?
Tuples in python are immutable. If you want to remove items out of a Python tuple, you can use index slicing to leave out a particular index. For example, a = (1, 2, 3, 4, 5) b = a[:2] + a[3:] print(b) This will give the output: (1, 2, 4, 5) Or you can convert it to a list, remove the item and convert back to a tuple. ...
[ { "code": null, "e": 1217, "s": 1062, "text": "Tuples in python are immutable. If you want to remove items out of a Python tuple, you can use index slicing to leave out a particular index. For example," }, { "code": null, "e": 1264, "s": 1217, "text": "a = (1, 2, 3, 4, 5)\nb = a[...
GATE CS 2021 | Set 2 - GeeksforGeeks
18 Oct, 2021 Pen : Write :: Knife : _______ From the above graph we obtained following information- Year Cost/Unit Cost Price Number of Units 1 3 300 100 2 2 400 200 3 1 300 300 Let selling price of ...
[ { "code": null, "e": 27610, "s": 27582, "text": "\n18 Oct, 2021" }, { "code": null, "e": 27642, "s": 27610, "text": "Pen : Write :: Knife : _______ " }, { "code": null, "e": 27699, "s": 27642, "text": "From the above graph we obtained following information- " ...
Java Examples - Display text in different fonts
How to display text in different fonts? Following example demonstrates how to display text in different fonts using setFont() method of Font class. import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Main extends JPanel { String[] type = { "Serif","SansSerif"}; int[] styles = { Font.P...
[ { "code": null, "e": 2108, "s": 2068, "text": "How to display text in different fonts?" }, { "code": null, "e": 2216, "s": 2108, "text": "Following example demonstrates how to display text in different fonts using setFont() method of Font class." }, { "code": null, "e...
Frequency of vowels and consonants in JavaScript
We are required to write a JavaScript function that takes in a string which contains English alphabets. The function should return an object containing the count of vowels and consonants in the string. Therefore, let’s write the code for this function − The code for this will be − const str = 'This is a sample string, ...
[ { "code": null, "e": 1264, "s": 1062, "text": "We are required to write a JavaScript function that takes in a string which contains English\nalphabets. The function should return an object containing the count of vowels and consonants\nin the string." }, { "code": null, "e": 1316, "s...
Python | Print diagonals of 2D list - GeeksforGeeks
30 Aug, 2021 Given a 2D list (with equal length of sublists), write a Python program to print both the diagonals of the given 2D list. Examples: Input : [[1, 2, 3], [4, 5, 6], [7, 8, 9]] Output : Diagonal 1 - [1, 5, 9] Diagonal 2 - [3, 5, 7] Input : [['a', 'b'], ['c', 'd']] Output : Diagonal 1 - ['a', 'd'] ...
[ { "code": null, "e": 25468, "s": 25440, "text": "\n30 Aug, 2021" }, { "code": null, "e": 25590, "s": 25468, "text": "Given a 2D list (with equal length of sublists), write a Python program to print both the diagonals of the given 2D list." }, { "code": null, "e": 2560...
Python - API.update_status() in Tweepy - GeeksforGeeks
05 Jun, 2020 Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data will be tweets extracted from the user. The first thing to do is get the consumer key, consumer secret, access key and access secret from twitte...
[ { "code": null, "e": 25677, "s": 25649, "text": "\n05 Jun, 2020" }, { "code": null, "e": 26077, "s": 25677, "text": "Twitter is a popular social network where users share messages called tweets. Twitter allows us to mine the data of any user using Twitter API or Tweepy. The data ...
Implementation of lower_bound() and upper_bound() in Array of Pairs in C++ - GeeksforGeeks
01 Aug, 2020 In this article we will discuss the implementation of the lower_bound() and upper_bound() in an array of pairs. lower_bound(): It returns an iterator pointing to the first element in the range [first, last) which has a value greater than or equals to the given value “val”. But in Array of Pairs lower_bound...
[ { "code": null, "e": 26041, "s": 26013, "text": "\n01 Aug, 2020" }, { "code": null, "e": 26153, "s": 26041, "text": "In this article we will discuss the implementation of the lower_bound() and upper_bound() in an array of pairs." }, { "code": null, "e": 26637, "s"...
K difference permutation - GeeksforGeeks
20 May, 2021 Given two integers n and k. Consider first permutation of natural n numbers, P = “1 2 3 ... n”, print a permutation “Result” such that abs(Resulti – Pi) = k where Pi denotes the position of i in permutation P. The value of Pi varies from 1 to n. If there are multiple possible results, then print the lexico...
[ { "code": null, "e": 26723, "s": 26695, "text": "\n20 May, 2021" }, { "code": null, "e": 27057, "s": 26723, "text": "Given two integers n and k. Consider first permutation of natural n numbers, P = “1 2 3 ... n”, print a permutation “Result” such that abs(Resulti – Pi) = k where ...
Python | CAP - Cumulative Accuracy Profile analysis - GeeksforGeeks
09 Sep, 2021 CAP popularly called the ‘Cumulative Accuracy Profile’ is used in the performance evaluation of the classification model. It helps us to understand and conclude about the robustness of the classification model. In order to visualize this, three distinct curves are plotted in our plot: A random plotA plot ...
[ { "code": null, "e": 26081, "s": 26053, "text": "\n09 Sep, 2021" }, { "code": null, "e": 26368, "s": 26081, "text": "CAP popularly called the ‘Cumulative Accuracy Profile’ is used in the performance evaluation of the classification model. It helps us to understand and conclude ab...
Print the string by ignoring alternate occurrences of any character - GeeksforGeeks
20 May, 2021 Given a string of both uppercase and lowercase alphabets, the task is to print the string with alternate occurrences of any character dropped(including space and consider upper and lowercase as same).Examples: Input : It is a long day Dear. Output : It sa longdy ear. Print first I and then ignore next i....
[ { "code": null, "e": 26495, "s": 26467, "text": "\n20 May, 2021" }, { "code": null, "e": 26707, "s": 26495, "text": "Given a string of both uppercase and lowercase alphabets, the task is to print the string with alternate occurrences of any character dropped(including space and c...
Python | Increment 1's in list based on pattern - GeeksforGeeks
30 Jul, 2019 Given a list of binary numbers 0 and 1, Write a Python program to transform the list in such a way that whenever 1 appears after the occurrence of a sequence of 0’s, increment it by n+1, where ‘n’ is the last increment. Examples: Input : [0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1] Output : [0, 1, 0, 0, 2, 2, 0, 0...
[ { "code": null, "e": 25657, "s": 25629, "text": "\n30 Jul, 2019" }, { "code": null, "e": 25877, "s": 25657, "text": "Given a list of binary numbers 0 and 1, Write a Python program to transform the list in such a way that whenever 1 appears after the occurrence of a sequence of 0’...
Tailwind CSS List Style Type - GeeksforGeeks
23 Mar, 2022 This class accepts lots of value in tailwind CSS in which all the properties are covered as in class form. It is the alternative to the CSS List Style Type property. This class specifies the appearance of the list item marker (such as a disc, character, or custom counter style) if the ‘list-style-image’ ha...
[ { "code": null, "e": 37385, "s": 37357, "text": "\n23 Mar, 2022" }, { "code": null, "e": 37712, "s": 37385, "text": "This class accepts lots of value in tailwind CSS in which all the properties are covered as in class form. It is the alternative to the CSS List Style Type propert...
Semantic-UI | Transition - GeeksforGeeks
22 Jun, 2021 Semantic UI is an open-source framework that provides transition animation which is usually used to move the page content in or out of the viewport. It uses jQuery and CSS to create nice user interfaces which are very similar to bootstrap. It has many elements for creating interactive webpages. Classes are...
[ { "code": null, "e": 40451, "s": 40423, "text": "\n22 Jun, 2021" }, { "code": null, "e": 40823, "s": 40451, "text": "Semantic UI is an open-source framework that provides transition animation which is usually used to move the page content in or out of the viewport. It uses jQuery...
Ways to Re-run Last Executed Commands in Linux - GeeksforGeeks
30 Jun, 2021 It would be quite efficient to re-execute the last command. If the command was quite big to type in again, this would be quite a great trick to improve efficiency. So let us see what the commands are to run the last executed command again in the Linux terminal. The ways to run the last executed command are...
[ { "code": null, "e": 25677, "s": 25649, "text": "\n30 Jun, 2021" }, { "code": null, "e": 25997, "s": 25677, "text": "It would be quite efficient to re-execute the last command. If the command was quite big to type in again, this would be quite a great trick to improve efficiency....
Create an Expandable Notification Containing a Picture in Android - GeeksforGeeks
01 Sep, 2020 Notification is a type of message that is generated by any application present inside the mobile phone, suggesting to check the application and this could be anything from an update (Low priority notification) to something that’s not going right in the application (High priority notification). A basic noti...
[ { "code": null, "e": 26803, "s": 26775, "text": "\n01 Sep, 2020" }, { "code": null, "e": 27744, "s": 26803, "text": "Notification is a type of message that is generated by any application present inside the mobile phone, suggesting to check the application and this could be anyth...
MathF.Pow() Method in C# with Examples - GeeksforGeeks
04 Apr, 2019 In C#, MathF.Pow(Single, Single) is a MathF class method. This method is used to calculate a number raise to the power of some other number. Syntax: public static float Pow (float x, float y); Parameters:x: It is a single-precision floating-point number which is to be raised to a power and type of this par...
[ { "code": null, "e": 25671, "s": 25643, "text": "\n04 Apr, 2019" }, { "code": null, "e": 25812, "s": 25671, "text": "In C#, MathF.Pow(Single, Single) is a MathF class method. This method is used to calculate a number raise to the power of some other number." }, { "code": ...
Count numbers with same first and last digits in C++
We are given an interval [first, last]. The goal is to find the count of numbers that have the same first and last digit within this interval. For example, 232 has the same first and last digit as 2. We will do this by traversing from i=first to i=last. For each number I compare its first digit with the last digit, if ...
[ { "code": null, "e": 1262, "s": 1062, "text": "We are given an interval [first, last]. The goal is to find the count of numbers that have the same first and last digit within this interval. For example, 232 has the same first and last digit as 2." }, { "code": null, "e": 1421, "s": 1...
C Language | Set 7 - GeeksforGeeks
27 Mar, 2017 Following questions have been asked in GATE CS 2010 exam. 1. What does the following program print? #include<stdio.h>void f(int *p, int *q){ p = q; *p = 2;}int i = 0, j = 1;int main(){ f(&i, &j); printf("%d %d \n", i, j); getchar(); return 0;} (A) 2 2(B) 2 1(C) 0 1(D) 0 2 Answer (D)See below f() with ...
[ { "code": null, "e": 25315, "s": 25287, "text": "\n27 Mar, 2017" }, { "code": null, "e": 25373, "s": 25315, "text": "Following questions have been asked in GATE CS 2010 exam." }, { "code": null, "e": 25415, "s": 25373, "text": "1. What does the following progr...