title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Conditional Inheritance in Python - GeeksforGeeks | 25 Aug, 2020
It happens most of the time that given a condition we need to decide whether a particular class should inherit a class or not, for example given a person, if he/she is eligible for an admission in a university only then they should be a student otherwise they should not be a student.
Let’s consider an exam... | [
{
"code": null,
"e": 26384,
"s": 26356,
"text": "\n25 Aug, 2020"
},
{
"code": null,
"e": 26669,
"s": 26384,
"text": "It happens most of the time that given a condition we need to decide whether a particular class should inherit a class or not, for example given a person, if he/sh... |
C++ Signal Handling | Signals are the interrupts delivered to a process by the operating system which can terminate a program prematurely. You can generate interrupts by pressing Ctrl+C on a UNIX, LINUX, Mac OS X or Windows system.
There are signals which can not be caught by the program but there is a following list of signals which you ca... | [
{
"code": null,
"e": 2528,
"s": 2318,
"text": "Signals are the interrupts delivered to a process by the operating system which can terminate a program prematurely. You can generate interrupts by pressing Ctrl+C on a UNIX, LINUX, Mac OS X or Windows system."
},
{
"code": null,
"e": 2772,
... |
How to change semi-structured text into a Pandas dataframe | by Alan Jones | Towards Data Science | These days much of the data you find on the internet are nicely formatted as JSON, Excel files or CSV. But some aren’t.
I needed a simple dataset to illustrate my articles on data visualisation in Python and Julia and decided upon weather data (for London, UK) that was publicly available from the UK Met Office.
The pro... | [
{
"code": null,
"e": 292,
"s": 172,
"text": "These days much of the data you find on the internet are nicely formatted as JSON, Excel files or CSV. But some aren’t."
},
{
"code": null,
"e": 485,
"s": 292,
"text": "I needed a simple dataset to illustrate my articles on data visual... |
HTML <fieldset> disabled Attribute - GeeksforGeeks | 04 Jan, 2019
The disabled attribute for <fieldset> element in HTML is used to specify that the group of related form elements is disabled. A disabled fieldset is un-clickable and unusable. It is a boolean attribute.
Syntax:
<fieldset disabled>fieldset content...</fieldset>
Example:
<!DOCTYPE html> <html> <head> ... | [
{
"code": null,
"e": 23739,
"s": 23711,
"text": "\n04 Jan, 2019"
},
{
"code": null,
"e": 23942,
"s": 23739,
"text": "The disabled attribute for <fieldset> element in HTML is used to specify that the group of related form elements is disabled. A disabled fieldset is un-clickable a... |
How to count the number of checkboxes in a page in Selenium with python? | We can count the total number of checkboxes in a page in Selenium with the help of find_elements method. While working on any checkboxes, we will always find an attribute type in the html code and its value should be checkbox.
This characteristic is only applicable to checkboxes on that particular page and to no other ... | [
{
"code": null,
"e": 1289,
"s": 1062,
"text": "We can count the total number of checkboxes in a page in Selenium with the help of find_elements method. While working on any checkboxes, we will always find an attribute type in the html code and its value should be checkbox."
},
{
"code": null... |
How to add a variable description in R? | To add a variable description in R, we can use comment function and if we want to have a look at the description then structure call of the data frame will be used. For example, if we have a data frame say df that contains a column x then we can describe x by using the command comment(df$x)<-c("The name of this variabl... | [
{
"code": null,
"e": 1438,
"s": 1062,
"text": "To add a variable description in R, we can use comment function and if we want to have a look at the description then structure call of the data frame will be used. For example, if we have a data frame say df that contains a column x then we can describ... |
WPF - Triggers | A trigger basically enables you to change property values or take actions based on the value of a property. So, it allows you to dynamically change the appearance and/or behavior of your control without having to create a new one.
Triggers are used to change the value of any given property, when certain conditions are ... | [
{
"code": null,
"e": 2251,
"s": 2020,
"text": "A trigger basically enables you to change property values or take actions based on the value of a property. So, it allows you to dynamically change the appearance and/or behavior of your control without having to create a new one."
},
{
"code": ... |
numpy.hstack | Variants of numpy.stack function to stack so as to make a single array horizontally.
import numpy as np
a = np.array([[1,2],[3,4]])
print 'First array:'
print a
print '\n'
b = np.array([[5,6],[7,8]])
print 'Second array:'
print b
print '\n'
print 'Horizontal stacking:'
c = np.hstack((a,b))
print c
prin... | [
{
"code": null,
"e": 2328,
"s": 2243,
"text": "Variants of numpy.stack function to stack so as to make a single array horizontally."
},
{
"code": null,
"e": 2570,
"s": 2328,
"text": "import numpy as np \na = np.array([[1,2],[3,4]]) \n\nprint 'First array:' \nprint a \nprint '\\n'... |
Write a C program that displays contents of a given file like 'more' utility in Linux - GeeksforGeeks | 08 May, 2017
Write a C program that displays contents of given line page by page. Given number of lines to show as ‘n’ at a time and a file name, the program should first show n lines, then wait for user to hit a key before showing next n lines and so on.
We strongly recommend to minimize the browser and try this yours... | [
{
"code": null,
"e": 23817,
"s": 23789,
"text": "\n08 May, 2017"
},
{
"code": null,
"e": 24060,
"s": 23817,
"text": "Write a C program that displays contents of given line page by page. Given number of lines to show as ‘n’ at a time and a file name, the program should first show ... |
Building a Streamlit app to visualise Covid-19 data | by Sam Ho | Towards Data Science | Our World in Data (OWID) is an open-source, online research publication. They have a wide range of public data sets covering topics such as disease, climate change, social injustice and poverty.
The goal of our work is to make the knowledge on the big problems accessible and understandable....Our World in Data is about... | [
{
"code": null,
"e": 367,
"s": 172,
"text": "Our World in Data (OWID) is an open-source, online research publication. They have a wide range of public data sets covering topics such as disease, climate change, social injustice and poverty."
},
{
"code": null,
"e": 566,
"s": 367,
... |
Python | sympy.integrate() method - GeeksforGeeks | 12 Jun, 2019
With the help of sympy.integrate() method, we can find the integration of mathematical expressions in the form of variables by using sympy.integrate() method.
Syntax : sympy.integrate(expression, reference variable)Return : Return integration of mathematical expression.
Example #1 :In this example we can s... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n12 Jun, 2019"
},
{
"code": null,
"e": 24060,
"s": 23901,
"text": "With the help of sympy.integrate() method, we can find the integration of mathematical expressions in the form of variables by using sympy.integrate() method."
}... |
How to create a big font text using JavaScript? | To create a big font text, use the JavaScript big() method. This method causes a string to be displayed in a big font as if it were in a BIG tag.
You can try to run the following code to create a big font text −
Live Demo
<html>
<head>
<title>JavaScript String big() Method</title>
</head>
<body>
<... | [
{
"code": null,
"e": 1208,
"s": 1062,
"text": "To create a big font text, use the JavaScript big() method. This method causes a string to be displayed in a big font as if it were in a BIG tag."
},
{
"code": null,
"e": 1274,
"s": 1208,
"text": "You can try to run the following cod... |
\atop - Tex Command | \atop - Command to create fractions without horizontal fraction bar
{ sub-formula1 \atop sub-formula2 }
\atop command creates a fraction like structure.
a+1 \atop b
a+1b
a \atop b+2
ab+2
{a+1 \atop b+2}+c
a+1b+2+c
a+1 \atop b
a+1b
a+1 \atop b
a \atop b+2
ab+2
a \atop b+2
{a+1 \atop b... | [
{
"code": null,
"e": 8054,
"s": 7986,
"text": "\\atop - Command to create fractions without horizontal fraction bar"
},
{
"code": null,
"e": 8090,
"s": 8054,
"text": "{ sub-formula1 \\atop sub-formula2 }"
},
{
"code": null,
"e": 8139,
"s": 8090,
"text": "\\ato... |
Cleansing and transforming schema drifted CSV files into relational data in Azure Databricks | by Dhyanendra Singh Rathore | Towards Data Science | Data is the blood of a business. Data comes in varying shapes and sizes, making it a constant challenging task to find the means of processing and consumption, without which it holds no value whatsoever.
This article looks at how to leverage Apache Spark’s parallel analytics capabilities to iteratively cleanse and tran... | [
{
"code": null,
"e": 376,
"s": 172,
"text": "Data is the blood of a business. Data comes in varying shapes and sizes, making it a constant challenging task to find the means of processing and consumption, without which it holds no value whatsoever."
},
{
"code": null,
"e": 682,
"s": ... |
TimeZone getTimeZone() Method in Java with Examples - GeeksforGeeks | 02 Jan, 2019
The getTimeZone() method of TimeZone class in Java is used to know the actual TimeZone for any passed TimeZone ID.
Syntax:
public static TimeZone getTimeZone(String the_ID)
Parameters: The method takes one parameter the_ID of string datatype which refers to the ID of which the TimeZone is needed to be know... | [
{
"code": null,
"e": 24163,
"s": 24135,
"text": "\n02 Jan, 2019"
},
{
"code": null,
"e": 24278,
"s": 24163,
"text": "The getTimeZone() method of TimeZone class in Java is used to know the actual TimeZone for any passed TimeZone ID."
},
{
"code": null,
"e": 24286,
... |
Find minimum sum of factors of number - GeeksforGeeks | 31 Jan, 2022
Given a number, find minimum sum of its factors.Examples:
Input : 12
Output : 7
Explanation:
Following are different ways to factorize 12 and
sum of factors in different ways.
12 = 12 * 1 = 12 + 1 = 13
12 = 2 * 6 = 2 + 6 = 8
12 = 3 * 4 = 3 + 4 = 7
12 = 2 * 2 * 3 = 2 + 2 + 3 = 7
Therefore minimum sum is ... | [
{
"code": null,
"e": 26139,
"s": 26111,
"text": "\n31 Jan, 2022"
},
{
"code": null,
"e": 26199,
"s": 26139,
"text": "Given a number, find minimum sum of its factors.Examples: "
},
{
"code": null,
"e": 26473,
"s": 26199,
"text": "Input : 12\nOutput : 7\nExplan... |
A Quick Way to Build Applications in Python | by Naser Tamimi | Towards Data Science | Building Python applications that have graphical user interfaces and are doing sophisticated tasks might look difficult. In a recently published article (see the link below), I mentioned how only 7 Python libraries are needed to start building applications.
towardsdatascience.com
This article will show you how to build... | [
{
"code": null,
"e": 429,
"s": 171,
"text": "Building Python applications that have graphical user interfaces and are doing sophisticated tasks might look difficult. In a recently published article (see the link below), I mentioned how only 7 Python libraries are needed to start building application... |
WebSockets - Duplex Communication | Before diving to the need of Web sockets, it is necessary to have a look at the existing techniques, which are used for duplex communication between the server and the client. They are as follows −
Polling
Long Polling
Streaming
Postback and AJAX
HTML5
Polling can be defined as a method, which performs periodic request... | [
{
"code": null,
"e": 2317,
"s": 2119,
"text": "Before diving to the need of Web sockets, it is necessary to have a look at the existing techniques, which are used for duplex communication between the server and the client. They are as follows −"
},
{
"code": null,
"e": 2325,
"s": 231... |
HTML | DOM parentElement Property - GeeksforGeeks | 26 Jul, 2019
The DOM parentElement property is used to returns the parent element of a particular child element. It is a read-only property. The parentElement and parentNode property are similar and the only difference is the parentElement property returns null if the parent node is not an element.
Syntax:
node.parentE... | [
{
"code": null,
"e": 23537,
"s": 23509,
"text": "\n26 Jul, 2019"
},
{
"code": null,
"e": 23824,
"s": 23537,
"text": "The DOM parentElement property is used to returns the parent element of a particular child element. It is a read-only property. The parentElement and parentNode pr... |
Making Menu options with Checkbutton in Tkinter? | The Menu Bar in Tkinter can be created by initializing Menu (parent) instances in the application. We can add checkbuttons in place of add_command to extend the feature of Menu Bar in any application.
To add the menu items using the add_checkbutton(label, options) method, we first initialize a Menu Bar. Once the MenuBa... | [
{
"code": null,
"e": 1263,
"s": 1062,
"text": "The Menu Bar in Tkinter can be created by initializing Menu (parent) instances in the application. We can add checkbuttons in place of add_command to extend the feature of Menu Bar in any application."
},
{
"code": null,
"e": 1725,
"s": ... |
MySQL procedure to call multiple procedures? | Let us first see the syntax, wherein we are calling multiple procedures from a stored procedure −
DELIMITER //
CREATE PROCEDURE yourProcedureName()
BEGIN
CALL yourStoredProcedureName1();
CALL yourStoredProcedureName2();
.
.
N
END
//
DELIMITER //
Let us implement the above syntax to call multiple stored p... | [
{
"code": null,
"e": 1160,
"s": 1062,
"text": "Let us first see the syntax, wherein we are calling multiple procedures from a stored procedure −"
},
{
"code": null,
"e": 1323,
"s": 1160,
"text": "DELIMITER //\nCREATE PROCEDURE yourProcedureName()\nBEGIN\n CALL yourStoredProcedu... |
Properties of Dictionary Keys in Python | Dictionary values have no restrictions. They can be any arbitrary Python object, either standard objects or user-defined objects. However, same is not true for the keys.
There are two important points to remember about dictionary keys −
More than one entry per key not allowed. Which means no duplicate key is allowed. W... | [
{
"code": null,
"e": 1232,
"s": 1062,
"text": "Dictionary values have no restrictions. They can be any arbitrary Python object, either standard objects or user-defined objects. However, same is not true for the keys."
},
{
"code": null,
"e": 1299,
"s": 1232,
"text": "There are tw... |
max() and min() in Python | Finding maximum and minimum values from a given list of values is a very common need in data processing programs. Python has these two functions which handle both numbers and strings. We will see both the scenarios in the below examples.
We take a list of numeric values which has integers and floats. The functions work... | [
{
"code": null,
"e": 1300,
"s": 1062,
"text": "Finding maximum and minimum values from a given list of values is a very common need in data processing programs. Python has these two functions which handle both numbers and strings. We will see both the scenarios in the below examples."
},
{
"... |
C program to design a hot air balloon using graphics - GeeksforGeeks | 23 Apr, 2021
In this article, we will discuss how to design a Hot Air Balloon in the C using Graphics.
Approach:
Draw a circle using the circle() function.
Draw a total of four lines using the line() function which will act as the rope that holds the container.
Implement the container using the rectangle() function.
Co... | [
{
"code": null,
"e": 23817,
"s": 23789,
"text": "\n23 Apr, 2021"
},
{
"code": null,
"e": 23907,
"s": 23817,
"text": "In this article, we will discuss how to design a Hot Air Balloon in the C using Graphics."
},
{
"code": null,
"e": 23917,
"s": 23907,
"text": "... |
How can I make one Python file run another? | There are multiple ways to make one Python file run another.
1. Use it like a module. import the file you want to run and run its functions. For example, say you want to import fileB.py into fileA.py, assuming the files are in the same directory, inside fileA you'd write
import fileB
Now in fileA, you can call any func... | [
{
"code": null,
"e": 1123,
"s": 1062,
"text": "There are multiple ways to make one Python file run another."
},
{
"code": null,
"e": 1334,
"s": 1123,
"text": "1. Use it like a module. import the file you want to run and run its functions. For example, say you want to import fileB... |
JSF - First Application | To create a simple JSF application, we'll use maven-archetype-webapp plugin. In the following example, we'll create a maven-based web application project in C:\JSF folder.
Let's open command console, go the C:\ > JSF directory and execute the following mvn command.
C:\JSF>mvn archetype:create
-DgroupId = com.tutorial... | [
{
"code": null,
"e": 2124,
"s": 1952,
"text": "To create a simple JSF application, we'll use maven-archetype-webapp plugin. In the following example, we'll create a maven-based web application project in C:\\JSF folder."
},
{
"code": null,
"e": 2218,
"s": 2124,
"text": "Let's ope... |
MySQL Stored Procedure calling with INT and VARCHAR values | To call a stored procedure, you can use CALL command. Following is the syntax −
CALL yourStoredProcedureName(parameter if any);
Let us first create a sample procedure. Following is the query to create a stored procedure. Here, we have set two values, one is an INT and another VARCHAR −
mysql> DELIMITER //
mysql> CREATE... | [
{
"code": null,
"e": 1142,
"s": 1062,
"text": "To call a stored procedure, you can use CALL command. Following is the syntax −"
},
{
"code": null,
"e": 1190,
"s": 1142,
"text": "CALL yourStoredProcedureName(parameter if any);"
},
{
"code": null,
"e": 1349,
"s": 11... |
Breadth First Search without using Queue - GeeksforGeeks | 05 May, 2022
Breadth-first search is a graph traversal algorithm which traverse a graph or tree level by level. In this article, BFS for a Graph is implemented using Adjacency list without using a Queue.Examples:
Input:
Output: BFS traversal = 2, 0, 3, 1 Explanation: In the following graph, we start traversal from ve... | [
{
"code": null,
"e": 26379,
"s": 26351,
"text": "\n05 May, 2022"
},
{
"code": null,
"e": 26580,
"s": 26379,
"text": "Breadth-first search is a graph traversal algorithm which traverse a graph or tree level by level. In this article, BFS for a Graph is implemented using Adjacency ... |
How to select element with specific class and title attribute using jQuery? | If your element is having a class and title attribute, still you can select it with jQuery. You can try to run the following code to learn how to select element with specific class and 'title' attribute using jQuery.
Live Demo
<html>
<head>
<title>The Selector Example</title>
<script src = "https://ajax... | [
{
"code": null,
"e": 1279,
"s": 1062,
"text": "If your element is having a class and title attribute, still you can select it with jQuery. You can try to run the following code to learn how to select element with specific class and 'title' attribute using jQuery."
},
{
"code": null,
"e":... |
Angular PrimeNG Sidebar Component - GeeksforGeeks | 07 Oct, 2021
Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make responsive websites with very much ease. In this article, we will know how to use the Sidebar component in Angular PrimeNG. We will also learn about... | [
{
"code": null,
"e": 26354,
"s": 26326,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 26753,
"s": 26354,
"text": "Angular PrimeNG is an open-source framework with a rich set of native Angular UI components that are used for great styling and this framework is used to make resp... |
Mathematics | Random Variables - GeeksforGeeks | 19 Jul, 2020
Random variable is basically a function which maps from the set of sample space to set of real numbers. The purpose is to get an idea about result of a particular situation where we are given probabilities of different outcomes. See below example for more clarity.
Example :
Suppose that two coins (unbiased... | [
{
"code": null,
"e": 31387,
"s": 31359,
"text": "\n19 Jul, 2020"
},
{
"code": null,
"e": 31652,
"s": 31387,
"text": "Random variable is basically a function which maps from the set of sample space to set of real numbers. The purpose is to get an idea about result of a particular ... |
Lua - Data Types | Lua is a dynamically typed language, so the variables don't have types, only the values have types. Values can be stored in variables, passed as parameters and returned as results.
In Lua, though we don't have variable data types, but we have types for the values. The list of data types for values are given below.
nil
... | [
{
"code": null,
"e": 2284,
"s": 2103,
"text": "Lua is a dynamically typed language, so the variables don't have types, only the values have types. Values can be stored in variables, passed as parameters and returned as results."
},
{
"code": null,
"e": 2419,
"s": 2284,
"text": "I... |
How To Place Legend Outside the Plot with Seaborn in Python? - GeeksforGeeks | 16 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. Basically, it helps us stylize our basic plot made using matplotlib. Moreover, it also provides us different plotting techniques to ease our Ex... | [
{
"code": null,
"e": 25555,
"s": 25527,
"text": "\n16 Nov, 2020"
},
{
"code": null,
"e": 25978,
"s": 25555,
"text": "Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics.... |
How to Detect Keypress using JavaScript ? - GeeksforGeeks | 31 Aug, 2020
In this article, keyboard detection is performed using HTML and CSS.HTML stands for “Hypertext Markup Language”. HTML language helps the developer to create and design the web page elements like links, sections, paragraphs, headings, and blockquotes for web applications.
CSS stands for “Cascading Style She... | [
{
"code": null,
"e": 25947,
"s": 25919,
"text": "\n31 Aug, 2020"
},
{
"code": null,
"e": 26219,
"s": 25947,
"text": "In this article, keyboard detection is performed using HTML and CSS.HTML stands for “Hypertext Markup Language”. HTML language helps the developer to create and de... |
Bootstrap-5 Badges - GeeksforGeeks | 05 May, 2022
Bootstrap 5 is the latest major release by Bootstrap where they have revamped the UI and made various changes. Badges are used for creating labels. Badges scale to match the size of the immediate parent element by using relative font sizing.
Syntax:
<div class="badge bg-type"> Contents... <div>
Types: Fo... | [
{
"code": null,
"e": 28538,
"s": 28510,
"text": "\n05 May, 2022"
},
{
"code": null,
"e": 28780,
"s": 28538,
"text": "Bootstrap 5 is the latest major release by Bootstrap where they have revamped the UI and made various changes. Badges are used for creating labels. Badges scale to... |
ES6 - Proxy API | ES6 implements intercession form of meta programming using Proxies. Similar to ReflectAPI, the Proxy API is another way of implementing meta programming in ES6. The Proxy object is used to define custom behavior for fundamental operations. A proxy object performs some operations on behalf of the real object.
The variou... | [
{
"code": null,
"e": 2587,
"s": 2277,
"text": "ES6 implements intercession form of meta programming using Proxies. Similar to ReflectAPI, the Proxy API is another way of implementing meta programming in ES6. The Proxy object is used to define custom behavior for fundamental operations. A proxy objec... |
Break a long line into multiple lines in Python - GeeksforGeeks | 23 Dec, 2020
Breaking a long line has nothing to do with the output, it is just trying to fix how our code appears. Writing a really long line in a single line makes code appear less clean and there are chances one may confuse it to be complex. Breaking down the same line can increase the readability of the code, rule ... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n23 Dec, 2020"
},
{
"code": null,
"e": 24805,
"s": 24292,
"text": "Breaking a long line has nothing to do with the output, it is just trying to fix how our code appears. Writing a really long line in a single line makes code appea... |
N-Base modified Binary Search algorithm - GeeksforGeeks | 28 Jan, 2022
N-Base modified Binary Search is an algorithm based on number bases that can be used to find an element in a sorted array arr[]. This algorithm is an extension of Bitwise binary search and has a similar running time.
Examples:
Input: arr[] = {0, 1, 4, 5, 8, 11, 15, 21, 45, 70, 100}, target = 45Output: 7Ex... | [
{
"code": null,
"e": 27683,
"s": 27655,
"text": "\n28 Jan, 2022"
},
{
"code": null,
"e": 27900,
"s": 27683,
"text": "N-Base modified Binary Search is an algorithm based on number bases that can be used to find an element in a sorted array arr[]. This algorithm is an extension of ... |
Convert.ToSingle Method in C# | Convert a specified value to a single-precision floating-point number using the Convert.ToSingle() method in C#.
Here is our bool −
bool boolVal = false;
Now, let us use the ToSingle() method to convert the value to a single precision floating-point.
float floatVal;
floatVal = Convert.ToSingle(boolVal);
Live Demo
usin... | [
{
"code": null,
"e": 1175,
"s": 1062,
"text": "Convert a specified value to a single-precision floating-point number using the Convert.ToSingle() method in C#."
},
{
"code": null,
"e": 1194,
"s": 1175,
"text": "Here is our bool −"
},
{
"code": null,
"e": 1216,
"s"... |
Bootstrap 5 alpha | Icons Library - GeeksforGeeks | 14 Aug, 2020
For the very first time, Bootstrap has its own icon library, custom-designed and built for bootstrap components and documentation.
Bootstrap Icons are designed to figure with Bootstrap components, from form controls to navigation. Bootstrap Icons are SVGs, in order that they scale quickly and simply and ma... | [
{
"code": null,
"e": 28360,
"s": 28332,
"text": "\n14 Aug, 2020"
},
{
"code": null,
"e": 28491,
"s": 28360,
"text": "For the very first time, Bootstrap has its own icon library, custom-designed and built for bootstrap components and documentation."
},
{
"code": null,
... |
Default values in a Map in C++ STL | 01 Jun, 2022
Prerequisite: Map in STLA map is a container which is used to store a key-value pair. By default, In Primitive datatypes such as int, char, bool, float in C/C++ are undefined if variables are not initialized, But a Map is initially empty when it is declared. When this map is accessed with the [ ] (e.g map... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n01 Jun, 2022"
},
{
"code": null,
"e": 613,
"s": 52,
"text": "Prerequisite: Map in STLA map is a container which is used to store a key-value pair. By default, In Primitive datatypes such as int, char, bool, float in C/C++ are undefined... |
Preferences DataStore in Android | 24 Jan, 2021
Preference Data Store is used to store data permanently in android. Earlier we had to Shared Preferences for the same but since it is deprecated we are using Data Store now. A sample video is given below to get an idea about what we are going to do in this article. Note that we are going to implement this ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 370,
"s": 28,
"text": "Preference Data Store is used to store data permanently in android. Earlier we had to Shared Preferences for the same but since it is deprecated we are using Data Store now. A... |
Minimum Increment operations to make Array unique | 08 Jul, 2022
Given an array A[] of integers. In one move you can choose any element A[i], and increment it by 1. The task is to return the minimum number of moves needed to make every value in the array A[] unique.Examples:
Input: A[] = [3, 2, 1, 2, 1, 7]
Output: 6
Explanation: After 6 moves, the array could be
[3,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 267,
"s": 54,
"text": "Given an array A[] of integers. In one move you can choose any element A[i], and increment it by 1. The task is to return the minimum number of moves needed to make every val... |
How to specify the double border using CSS ? | 30 Apr, 2021
The task is to specify the double border using CSS. In this article, we are going to use the border-style property to style the border.
Property used:
border-style property: This property is used to set the style of an element’s four borders.
Approach:
Create the HTML page with some elements.
Now, using th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Apr, 2021"
},
{
"code": null,
"e": 164,
"s": 28,
"text": "The task is to specify the double border using CSS. In this article, we are going to use the border-style property to style the border."
},
{
"code": null,
"e": 17... |
Directory traversal tools in Python | 27 Dec, 2019
os.walk() method of the OS module can be used for listing out all the directories. This method basically generates the file names in the directory tree either top-down or bottom-up. For each directory in the tree rooted at directory top (including top itself), it yields a 3-tuple (dirpath, dirnames, filena... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Dec, 2019"
},
{
"code": null,
"e": 341,
"s": 28,
"text": "os.walk() method of the OS module can be used for listing out all the directories. This method basically generates the file names in the directory tree either top-down or bott... |
GATE | GATE-CS-2009 | Question 60 | 27 Jul, 2021
In the following process state transition diagram for a uniprocessor system, assume that there are always some processes in the ready state: Now consider the following statements:
I. If a process makes a transition D, it would result in
another process making transition A immediately.
II. A process P2 ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n27 Jul, 2021"
},
{
"code": null,
"e": 232,
"s": 52,
"text": "In the following process state transition diagram for a uniprocessor system, assume that there are always some processes in the ready state: Now consider the following statem... |
Delete a file in C# | Use File.Delete method to delete a file.
Firstly, set the path of the file you want to delete.
String myPath = @"C:\New\amit.txt";
Now, use the File.Delete method to delete the file.
File.Delete(myPath);
The following is the complete code −
Live Demo
using System;
using System.IO;
public class Program {
public stat... | [
{
"code": null,
"e": 1228,
"s": 1187,
"text": "Use File.Delete method to delete a file."
},
{
"code": null,
"e": 1282,
"s": 1228,
"text": "Firstly, set the path of the file you want to delete."
},
{
"code": null,
"e": 1318,
"s": 1282,
"text": "String myPath = ... |
Ruby | Enumerable find_all() function | 05 Dec, 2019
The find_all() of enumerable is an inbuilt method in Ruby returns the items in the enumerable which satisfies the given condition in the block. It returns an enumerator if no block is given.
Syntax: enu.find_all { |obj| block }
Parameters: The function takes a block whose condition is used to find the elem... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Dec, 2019"
},
{
"code": null,
"e": 219,
"s": 28,
"text": "The find_all() of enumerable is an inbuilt method in Ruby returns the items in the enumerable which satisfies the given condition in the block. It returns an enumerator if no ... |
Python string length | len() | 08 Jul, 2022
Python len() function returns the length of the string.
Syntax: len(string)
Return: It returns an integer which is the length of the string.
len() methods with string in Python.
Python3
string = "Geeksforgeeks"print(len(string))
Output:
13
Here we are counting length of the tuples and list.
Python
# Pyt... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 110,
"s": 53,
"text": "Python len() function returns the length of the string. "
},
{
"code": null,
"e": 131,
"s": 110,
"text": "Syntax: len(string) "
},
{
"code": null,... |
How To Setup And Use Anonsurf On kali Linux | 17 Oct, 2021
Anonsurf is one of the good anonymizing tools of Linux distribution. It helps us make our network tunnel secure. This tool uses TOR iptables to anonymize our network system.
First of all, you can make a separate directory for this tool for your convenience and git clone the following URL or you can simply... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Oct, 2021"
},
{
"code": null,
"e": 203,
"s": 28,
"text": "Anonsurf is one of the good anonymizing tools of Linux distribution. It helps us make our network tunnel secure. This tool uses TOR iptables to anonymize our network system. "... |
SQL | UNIQUE Constraint | 06 Sep, 2018
SQL Constraints
Unique constraint in SQL is used to check whether the sub query has duplicate tuples in it’s result. It returns a boolean value indicating the presence/absence of duplicate tuples. Unique construct returns true only if the sub query has no duplicate tuples, else it return false.
Important P... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n06 Sep, 2018"
},
{
"code": null,
"e": 70,
"s": 54,
"text": "SQL Constraints"
},
{
"code": null,
"e": 350,
"s": 70,
"text": "Unique constraint in SQL is used to check whether the sub query has duplicate tuples in it’... |
wxPython – Change font colour of RadioBox | 01 Sep, 2021
In this article we are going to learn how can we change the foreground colour of Radio Box present in the frame. In order to do that we are going to use SetForegroundColour() method. SetForegroundColour() function takes wx.Colour argument which will be used as foreground colour for Radio Box.
Syntax: wx.R... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Sep, 2021"
},
{
"code": null,
"e": 323,
"s": 28,
"text": "In this article we are going to learn how can we change the foreground colour of Radio Box present in the frame. In order to do that we are going to use SetForegroundColour() ... |
Create a directory in Python | 29 Dec, 2020
The OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of using operating system dependent functionality. The os and os.path modules include many functions to interact with the file system. ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Dec, 2020"
},
{
"code": null,
"e": 555,
"s": 54,
"text": "The OS module in Python provides functions for interacting with the operating system. OS comes under Python’s standard utility modules. This module provides a portable way of... |
How to count the number of words in a string in PHP ? | 27 May, 2020
Given a string containing some words and the task is to count number of words in a string str in PHP. In order to do this task, we have the following approaches:
Approach 1: Using str_word_count() Method: The str_word_count() method is used to counts the number of words in a string.
Syntax:
str_word_count(... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 May, 2020"
},
{
"code": null,
"e": 190,
"s": 28,
"text": "Given a string containing some words and the task is to count number of words in a string str in PHP. In order to do this task, we have the following approaches:"
},
{
... |
Aptitude - Ratios Online Quiz | Following quiz provides Multiple Choice Questions (MCQs) related to Ratios. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
... | [
{
"code": null,
"e": 4212,
"s": 3892,
"text": "Following quiz provides Multiple Choice Questions (MCQs) related to Ratios. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You c... |
How to use Boto3 to paginate through all crawlers present in AWS Glue | In this article, we will see how to paginate through all crawlers present in AWS Glue.
Paginate through all crawlers from AWS Glue Data Catalog that is created in your account.
Problem Statement: Use boto3 library in Python to paginate through all crawlers from AWS Glue Data Catalog that is created in your account
Step... | [
{
"code": null,
"e": 1149,
"s": 1062,
"text": "In this article, we will see how to paginate through all crawlers present in AWS Glue."
},
{
"code": null,
"e": 1239,
"s": 1149,
"text": "Paginate through all crawlers from AWS Glue Data Catalog that is created in your account."
},... |
How to get the day of the week in JavaScript? | To get the day of the week, use the JavaScript getDay() method. JavaScript date getDay() method returns the day of the week for the specified date according to local time. The value returned by getDay() is an integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on.
You can try... | [
{
"code": null,
"e": 1371,
"s": 1062,
"text": "To get the day of the week, use the JavaScript getDay() method. JavaScript date getDay() method returns the day of the week for the specified date according to local time. The value returned by getDay() is an integer corresponding to the day of the week... |
How abstraction is achieved using interfaces in Java? | Abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does it.
Since all the methods of the interface are abstract and the user doesn’t know how a meth... | [
{
"code": null,
"e": 1294,
"s": 1062,
"text": "Abstraction is a process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does it."
},
{
"code":... |
C++ Algorithm Library - fill_n() Function | The C++ function std::algorithm::fill_n() assigns value to the first n elements of the sequence pointed by first.
Following is the declaration for std::algorithm::fill_n() function form std::algorithm header.
template <class OutputIterator, class Size, class T>
OutputIterator fill_n (OutputIterator first, Size n, const... | [
{
"code": null,
"e": 2717,
"s": 2603,
"text": "The C++ function std::algorithm::fill_n() assigns value to the first n elements of the sequence pointed by first."
},
{
"code": null,
"e": 2812,
"s": 2717,
"text": "Following is the declaration for std::algorithm::fill_n() function f... |
Python Data Structure - Quick Guide | Here, we will understand what is data structure with regards to Python programming language.
Data structures are fundamental concepts of computer science which helps is writing efficient programs in any language. Python is a high-level, interpreted, interactive and object-oriented scripting language using which we can ... | [
{
"code": null,
"e": 2420,
"s": 2327,
"text": "Here, we will understand what is data structure with regards to Python programming language."
},
{
"code": null,
"e": 2749,
"s": 2420,
"text": "Data structures are fundamental concepts of computer science which helps is writing effic... |
Java Examples - Printing Array using Method | How to use method overloading for printing different types of array ?
This example displays the way of using overloaded method for printing types of array (integer, double and character).
public class MainClass {
public static void printArray(Integer[] inputArray) {
for (Integer element : inputArray){
... | [
{
"code": null,
"e": 2139,
"s": 2068,
"text": "How to use method overloading for printing different types of array ?"
},
{
"code": null,
"e": 2257,
"s": 2139,
"text": "This example displays the way of using overloaded method for printing types of array (integer, double and chara... |
Insert in a Sorted List | Practice | GeeksforGeeks | Given a linked list sorted in ascending order and an integer called data, insert data in the linked list such that the list remains sorted.
Example 1:
Input:
LinkedList: 25->36->47->58->69->80
data: 19
Output: 19 25 36 47 58 69 80
Example 2:
Input:
LinkedList: 50->100
data: 75
Output: 50 75 100
Your Task:
The task is ... | [
{
"code": null,
"e": 378,
"s": 238,
"text": "Given a linked list sorted in ascending order and an integer called data, insert data in the linked list such that the list remains sorted."
},
{
"code": null,
"e": 389,
"s": 378,
"text": "Example 1:"
},
{
"code": null,
"e"... |
sysinfo() - Unix, Linux System Call | Unix - Home
Unix - Getting Started
Unix - File Management
Unix - Directories
Unix - File Permission
Unix - Environment
Unix - Basic Utilities
Unix - Pipes & Filters
Unix - Processes
Unix - Communication
Unix - The vi Editor
Unix - What is Shell?
Unix - Using Variables
Unix - Special Variables
Unix - Using Arrays
Unix -... | [
{
"code": null,
"e": 1466,
"s": 1454,
"text": "Unix - Home"
},
{
"code": null,
"e": 1489,
"s": 1466,
"text": "Unix - Getting Started"
},
{
"code": null,
"e": 1512,
"s": 1489,
"text": "Unix - File Management"
},
{
"code": null,
"e": 1531,
"s": 1... |
Convert string to integer in Python - GeeksforGeeks | 29 Apr, 2020
In Python an strings can be converted into a integer using the built-in int() function. The int() function takes in any python data type and converts it into a integer.But use of the int() function is not the only way to do so. This type of conversion can also be done using thefloat() keyword, as a float v... | [
{
"code": null,
"e": 24278,
"s": 24250,
"text": "\n29 Apr, 2020"
},
{
"code": null,
"e": 24628,
"s": 24278,
"text": "In Python an strings can be converted into a integer using the built-in int() function. The int() function takes in any python data type and converts it into a int... |
matplotlib.pyplot.magnitude_spectrum() in Python | 22 Apr, 2020
Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MATLAB-like interface. There are various plots which can be used in Pyplot are Line Plot, Contour, Histogram, Scatter, 3D Plot, etc.
Th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2020"
},
{
"code": null,
"e": 333,
"s": 28,
"text": "Matplotlib is a library in Python and it is numerical – mathematical extension for NumPy library. Pyplot is a state-based interface to a Matplotlib module which provides a MAT... |
Three-dimensional Plotting in Python using Matplotlib | 05 Jun, 2021
Matplotlib was introduced keeping in mind, only two-dimensional plotting. But at the time when the release of 1.0 occurred, the 3d utilities were developed upon the 2d and thus, we have 3d implementation of data available today! The 3d plots are enabled by importing the mplot3d toolkit. In this article, we... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jun, 2021"
},
{
"code": null,
"e": 418,
"s": 54,
"text": "Matplotlib was introduced keeping in mind, only two-dimensional plotting. But at the time when the release of 1.0 occurred, the 3d utilities were developed upon the 2d and th... |
CSS - Lists | Lists are very helpful in conveying a set of either numbered or bullet points. This chapter teaches you how to control list type, position, style, etc., using CSS.
We have the following five CSS properties, which can be used to control lists −
The list-style-type allows you to control the shape or appearance of the mar... | [
{
"code": null,
"e": 2924,
"s": 2760,
"text": "Lists are very helpful in conveying a set of either numbered or bullet points. This chapter teaches you how to control list type, position, style, etc., using CSS."
},
{
"code": null,
"e": 3004,
"s": 2924,
"text": "We have the follow... |
Print even and odd numbers in increasing order using two threads in Java | 27 Jan, 2022
Prerequisite: Multithreading
Given an integer N, the task is to write Java Program to print the first N natural numbers in increasing order using two threads.
Examples:
Input: N = 10Output: 1 2 3 4 5 6 7 8 9 10
Input: N = 18Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Approach: The idea is to creat... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Jan, 2022"
},
{
"code": null,
"e": 83,
"s": 54,
"text": "Prerequisite: Multithreading"
},
{
"code": null,
"e": 213,
"s": 83,
"text": "Given an integer N, the task is to write Java Program to print the first N nat... |
SQLite - PRIMARY KEY | A primary key is a field in a table which uniquely identifies the each rows/records in a database table. Primary keys must contain unique values. A primary key column cannot have NULL values.
A table can have only one primary key, which may consist of single or multiple fields. When multiple fields are used as a primar... | [
{
"code": null,
"e": 2964,
"s": 2772,
"text": "A primary key is a field in a table which uniquely identifies the each rows/records in a database table. Primary keys must contain unique values. A primary key column cannot have NULL values."
},
{
"code": null,
"e": 3132,
"s": 2964,
... |
Correcting Words using NLTK in Python | 18 Jul, 2021
nltk stands for Natural Language Toolkit and is a powerful suite consisting of libraries and programs that can be used for statistical natural language processing. The libraries can implement tokenization, classification, parsing, stemming, tagging, semantic reasoning, etc. This toolkit can make machines u... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Jul, 2021"
},
{
"code": null,
"e": 362,
"s": 28,
"text": "nltk stands for Natural Language Toolkit and is a powerful suite consisting of libraries and programs that can be used for statistical natural language processing. The librari... |
Add packages to Anaconda environment in Python | 21 Aug, 2021
Let’s see some methods that can be used to install packages to Anaconda environment.
There are many ways one can add pre-built packages to anaconda environment. So, let’s see how to direct the path in anaconda and install them.
Using pip command :
Open Anaconda Command prompt as administratorUse cd\ to ... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n21 Aug, 2021"
},
{
"code": null,
"e": 139,
"s": 53,
"text": "Let’s see some methods that can be used to install packages to Anaconda environment. "
},
{
"code": null,
"e": 283,
"s": 139,
"text": "There are many ways... |
Python | Convert flattened dictionary into nested dictionary | 16 Aug, 2021
Given a flattened dictionary, the task is to convert that dictionary into a nested dictionary where keys are needed to be split at ‘_’ considering where nested dictionary will be started.
Method #1: Using Naive Approach
Python3
# Python code to demonstrate# conversion of flattened dictionary# into nested ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Aug, 2021"
},
{
"code": null,
"e": 216,
"s": 28,
"text": "Given a flattened dictionary, the task is to convert that dictionary into a nested dictionary where keys are needed to be split at ‘_’ considering where nested dictionary will... |
Python – Closest Pair to Kth index element in Tuple | 10 Jun, 2020
Sometimes, while working with Python records, we can have a problem in which we need to find the tuple nearest to certain tuple, query on a particular index. This kind of problem can have application in data domains such as web development. Let’s discuss certain ways in which this task can be performed.
In... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Jun, 2020"
},
{
"code": null,
"e": 359,
"s": 54,
"text": "Sometimes, while working with Python records, we can have a problem in which we need to find the tuple nearest to certain tuple, query on a particular index. This kind of pro... |
Sum 2D array in Python using map() function | In this tutorial, we are going to find the sum of a 2D array using map function in Python.
The map function takes two arguments i.e., function and iterable. It passes every element of the iterable to the function and stores the result in map object. We can covert the map object into an iterable.
Let's see how to find t... | [
{
"code": null,
"e": 1278,
"s": 1187,
"text": "In this tutorial, we are going to find the sum of a 2D array using map function in Python."
},
{
"code": null,
"e": 1484,
"s": 1278,
"text": "The map function takes two arguments i.e., function and iterable. It passes every element o... |
Number of non-decreasing sub-arrays of length K | 03 Mar, 2022
Given an array arr[] of length N, the task is to find the number of non-decreasing sub-arrays of length K.Examples:
Input: arr[] = {1, 2, 3, 2, 5}, K = 2 Output: 3 {1, 2}, {2, 3} and {2, 5} are the increasing subarrays of length 2.Input: arr[] = {1, 2, 3, 2, 5}, K = 1 Output: 5
Naive approach Generat... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n03 Mar, 2022"
},
{
"code": null,
"e": 172,
"s": 54,
"text": "Given an array arr[] of length N, the task is to find the number of non-decreasing sub-arrays of length K.Examples: "
},
{
"code": null,
"e": 337,
"s": 172,
... |
Program for Celsius To Fahrenheit conversion | 24 May, 2022
Given a Temperature ‘n’ in Celsius scale, your task is to convert it into Fahrenheit scale.Examples:
Input : 0
Output : 32
Input : -40
Output : -40
Formula for converting Celsius scale to Fahrenheit scale
T(°F) = T(°C) × 9/5 + 32
C
C++
Java
Python3
C#
PHP
Javascript
/* Program to convert temperature fr... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 May, 2022"
},
{
"code": null,
"e": 154,
"s": 52,
"text": "Given a Temperature ‘n’ in Celsius scale, your task is to convert it into Fahrenheit scale.Examples: "
},
{
"code": null,
"e": 202,
"s": 154,
"text": "Inp... |
Python set operations (union, intersection, difference and symmetric difference) | 18 Dec, 2017
This article demonstrates different operations on Python sets.Examples:
Input :
A = {0, 2, 4, 6, 8}
B = {1, 2, 3, 4, 5}
Output :
Union : [0, 1, 2, 3, 4, 5, 6, 8]
Intersection : [2, 4]
Difference : [8, 0, 6]
Symmetric difference : [0, 1, 3, 5, 6, 8]
In Python, below quick operands can be used for diff... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n18 Dec, 2017"
},
{
"code": null,
"e": 125,
"s": 53,
"text": "This article demonstrates different operations on Python sets.Examples:"
},
{
"code": null,
"e": 308,
"s": 125,
"text": "Input :\nA = {0, 2, 4, 6, 8}\nB =... |
Python | Pandas Series.str.isdigit() | 23 Aug, 2019
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Pandas str.isdigit() method is used to check if all characters in each string in series are d... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Aug, 2019"
},
{
"code": null,
"e": 242,
"s": 28,
"text": "Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages and makes imp... |
How to Embed Matplotlib Graph in PyQt5? | 20 Jan, 2022
In this article, we will see how we can plot the graphs in the PyQt5 window using matplotlib.Matplotlib is an amazing visualization library in Python for 2D plots of arrays. Matplotlib is a multi-platform data visualization library built on NumPy arrays and designed to work with the broader SciPy stack. It... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n20 Jan, 2022"
},
{
"code": null,
"e": 667,
"s": 52,
"text": "In this article, we will see how we can plot the graphs in the PyQt5 window using matplotlib.Matplotlib is an amazing visualization library in Python for 2D plots of arrays. ... |
turtle.width() function in Python | 20 Jul, 2020
The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a version of Python installed with Tk support.
This method is used to set or return the line thickness. Set the line thickness to width o... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Jul, 2020"
},
{
"code": null,
"e": 245,
"s": 28,
"text": "The turtle module provides turtle graphics primitives, in both object-oriented and procedure-oriented ways. Because it uses Tkinter for the underlying graphics, it needs a ver... |
numpy string operations | find() function | 23 Jan, 2019
numpy.core.defchararray.find(arr, sub, start=0, end=None) is another function for doing string operations in numpy.It returns the lowest index in the string where substring sub is found for each element in arr within the range start to end.It returns -1 otherwise.
Parameters:arr : array_like of str or unic... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jan, 2019"
},
{
"code": null,
"e": 293,
"s": 28,
"text": "numpy.core.defchararray.find(arr, sub, start=0, end=None) is another function for doing string operations in numpy.It returns the lowest index in the string where substring su... |
Stack elements() method in Java with Example | 24 Dec, 2018
The Java.util.Stack.elements() method of Stack class in Java is used to get the enumeration of the values present in the Stack.
Syntax:
Enumeration enu = Stack.elements()
Parameters: The method does not take any parameters.
Return value: The method returns an enumeration of the values of the Stack.
Below p... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n24 Dec, 2018"
},
{
"code": null,
"e": 181,
"s": 53,
"text": "The Java.util.Stack.elements() method of Stack class in Java is used to get the enumeration of the values present in the Stack."
},
{
"code": null,
"e": 189,
... |
Python - Remote Procedure Call | Remote Procedure Call (RPC) system enables you to call a function available on a remote server using the same syntax which is used when calling a function in a local library. This is useful in two situations.
You can utilize the processing power from multiple machines using rpc without changing the code for making the ... | [
{
"code": null,
"e": 2669,
"s": 2460,
"text": "Remote Procedure Call (RPC) system enables you to call a function available on a remote server using the same syntax which is used when calling a function in a local library. This is useful in two situations."
},
{
"code": null,
"e": 2832,
... |
expr command in Linux with examples | 15 May, 2019
The expr command in Unix evaluates a given expression and displays its corresponding output. It is used for:
Basic operations like addition, subtraction, multiplication, division, and modulus on integers.
Evaluating regular expressions, string operations like substring, length of strings etc.
Syntax:
$expr... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n15 May, 2019"
},
{
"code": null,
"e": 163,
"s": 54,
"text": "The expr command in Unix evaluates a given expression and displays its corresponding output. It is used for:"
},
{
"code": null,
"e": 259,
"s": 163,
"text... |
How to create comma separated list from an array in PHP ? | 31 Jul, 2021
The comma separated list can be created by using implode() function. The implode() is a builtin function in PHP and is used to join the elements of an array. implode() is an alias for PHP | join() function and works exactly same as that of join() function.If we have an array of elements, we can use the imp... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 Jul, 2021"
},
{
"code": null,
"e": 543,
"s": 28,
"text": "The comma separated list can be created by using implode() function. The implode() is a builtin function in PHP and is used to join the elements of an array. implode() is an a... |
Mongoose | updateMany() Function | 20 May, 2020
The updateMany() function is same as update(), except MongoDB will update all documents that match the filter. It is used when the user wants to update all documents according to the condition.
Installation of mongoose module:
You can visit the link to Install mongoose module. You can install this package ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 May, 2020"
},
{
"code": null,
"e": 222,
"s": 28,
"text": "The updateMany() function is same as update(), except MongoDB will update all documents that match the filter. It is used when the user wants to update all documents according... |
Program to reverse a string (Iterative and Recursive) | 08 Jul, 2022
Given a string, write a recursive program to reverse it.
Method 1 (Using Stack)
C++
Java
Python3
C#
Javascript
// C++ program to reverse a string using stack#include <bits/stdc++.h>using namespace std; void recursiveReverse(string &str){ stack<char> st; for (int i=0; i<str.length(); i++) st.... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n08 Jul, 2022"
},
{
"code": null,
"e": 110,
"s": 52,
"text": "Given a string, write a recursive program to reverse it. "
},
{
"code": null,
"e": 137,
"s": 112,
"text": "Method 1 (Using Stack) "
},
{
"code": ... |
Using the super Keyword to Call a Base Class Constructor in Java | 05 May, 2021
We prefer inheritance to reuse the code available in existing classes. In Java, Inheritance is the concept in which one class inherits the properties of another class. In the below example there are two classes Programming and DP while Programming is Parent class and DP is child class. From the main class,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 May, 2021"
},
{
"code": null,
"e": 600,
"s": 54,
"text": "We prefer inheritance to reuse the code available in existing classes. In Java, Inheritance is the concept in which one class inherits the properties of another class. In the... |
Protractor - Core APIS(CONTDâ¦) | In this chapter, let us learn some more core APIs of Protractor.
Element is one of the global functions exposed by protractor. This function takes a locater and returns the following −
ElementFinder, that finds a single element based on the locator.
ElementArrayFinder, that finds an array of elements based on the locat... | [
{
"code": null,
"e": 1956,
"s": 1891,
"text": "In this chapter, let us learn some more core APIs of Protractor."
},
{
"code": null,
"e": 2076,
"s": 1956,
"text": "Element is one of the global functions exposed by protractor. This function takes a locater and returns the following... |
Check if a string has all characters with same frequency with one variation allowed | 05 Jul, 2022
Given a string of lowercase alphabets, find if it can be converted to a Valid String by removing 1 or 0 characters. A “valid” string is string str such that for all distinct characters in str each such character occurs the same number of times in it.
Examples :
Input : string str = "abbca"
Output : Yes
We... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 305,
"s": 54,
"text": "Given a string of lowercase alphabets, find if it can be converted to a Valid String by removing 1 or 0 characters. A “valid” string is string str such that for all distinct ... |
Wand shadow() function – Python | 22 Aug, 2021
The shadow() function is an inbuilt function in the Python Wand ImageMagick library which is used to generates an image shadow.
Syntax:
shadow(alpha, sigma, x, y)
Parameters: This function accepts four parameters as mentioned above and defined below:
alpha: This parameter stores the ratio of the transparen... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Aug, 2021"
},
{
"code": null,
"e": 156,
"s": 28,
"text": "The shadow() function is an inbuilt function in the Python Wand ImageMagick library which is used to generates an image shadow."
},
{
"code": null,
"e": 164,
"... |
Python Operators for Sets and Dictionaries | 11 Oct, 2020
Following article mainly discusses operators used in Sets and Dictionaries. Operators help to combine the existing value to larger syntactic expressions by using various keywords and symbols.
Sets: Set class is used to represent the collection of elements without duplicates, and without any inherent order... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n11 Oct, 2020"
},
{
"code": null,
"e": 247,
"s": 54,
"text": "Following article mainly discusses operators used in Sets and Dictionaries. Operators help to combine the existing value to larger syntactic expressions by using various key... |
sciPy stats.sem() function | Python | 18 Feb, 2019
scipy.stats.sem(arr, axis=0, ddof=0) function is used to compute the standard error of the mean of the input data.
Parameters :arr : [array_like]Input array or object having the elements to calculate the standard error.axis : Axis along which the mean is to be computed. By default axis = 0.ddof : Degree of... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n18 Feb, 2019"
},
{
"code": null,
"e": 143,
"s": 28,
"text": "scipy.stats.sem(arr, axis=0, ddof=0) function is used to compute the standard error of the mean of the input data."
},
{
"code": null,
"e": 379,
"s": 143,
... |
NumPy.histogram() Method in Python | 16 Dec, 2021
A histogram is the best way to visualize the frequency distribution of a dataset by splitting it into small equal-sized intervals called bins. The Numpy histogram function is similar to the hist() function of matplotlib library, the only difference is that the Numpy histogram gives the numerical representa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n16 Dec, 2021"
},
{
"code": null,
"e": 420,
"s": 28,
"text": "A histogram is the best way to visualize the frequency distribution of a dataset by splitting it into small equal-sized intervals called bins. The Numpy histogram function is ... |
Draw a Chessboard in Java Applet - GeeksforGeeks | 22 Apr, 2022
Given task is to draw a Chessboard in Java Applet
Approach:
Create a rectangle with length and breadth of 20 unit each, with 10 rows and columns of chess.As soon as even position occurs in row and column change the color of a rectangle with BLACK, else it will be WHITE
Create a rectangle with length and b... | [
{
"code": null,
"e": 23892,
"s": 23864,
"text": "\n22 Apr, 2022"
},
{
"code": null,
"e": 23943,
"s": 23892,
"text": "Given task is to draw a Chessboard in Java Applet "
},
{
"code": null,
"e": 23953,
"s": 23943,
"text": "Approach:"
},
{
"code": null,
... |
How to delay a JavaScript function call using JavaScript? | To delay a function call, use setTimeout() function.
setTimeout(functionname, milliseconds, arg1, arg2, arg3...)
The following are the parameters −
functionname − The function name for the function to be executed.
milliseconds − The number of milliseconds.
arg1, arg2, arg3 − These are the arguments passed to the functi... | [
{
"code": null,
"e": 1115,
"s": 1062,
"text": "To delay a function call, use setTimeout() function."
},
{
"code": null,
"e": 1175,
"s": 1115,
"text": "setTimeout(functionname, milliseconds, arg1, arg2, arg3...)"
},
{
"code": null,
"e": 1210,
"s": 1175,
"text":... |
LISP - Basic Syntax | LISP programs are made up of three basic building blocks −
atom
atom
list
list
string
string
An atom is a number or string of contiguous characters. It includes numbers and special characters.
Following are examples of some valid atoms −
hello-from-tutorials-point
name
123008907
*hello*
Block#221
abc123
A list is a seq... | [
{
"code": null,
"e": 2119,
"s": 2060,
"text": "LISP programs are made up of three basic building blocks −"
},
{
"code": null,
"e": 2124,
"s": 2119,
"text": "atom"
},
{
"code": null,
"e": 2129,
"s": 2124,
"text": "atom"
},
{
"code": null,
"e": 2134,... |
Is it mandatory to close JDBC connections? | At the end of your JDBC program, it is required explicitly to close all the connections to the database to end each database session. However, if you forget, Java's garbage collector will close the connection when it cleans up stale objects.
Relying on the garbage collection, especially in database programming, is a ve... | [
{
"code": null,
"e": 1304,
"s": 1062,
"text": "At the end of your JDBC program, it is required explicitly to close all the connections to the database to end each database session. However, if you forget, Java's garbage collector will close the connection when it cleans up stale objects."
},
{
... |
How to cast a list of strings to a string array? | The java.util.ArrayList.toArray() method returns an array containing all of the elements in this list in proper sequence (from first to last element).This acts as bridge between array-based and collection-based APIs.
You can convert a list to array using this method of the List class −
Live Demo
import java.util.Array... | [
{
"code": null,
"e": 1279,
"s": 1062,
"text": "The java.util.ArrayList.toArray() method returns an array containing all of the elements in this list in proper sequence (from first to last element).This acts as bridge between array-based and collection-based APIs."
},
{
"code": null,
"e":... |
How do I use the conditional operator in C/C++? | This conditional operator is also known as the Ternary Operator. This operator has three phase.
Exp1 ? Exp2 : Exp3;
where Exp1, Exp2, and Exp3 are expressions. Notice the use and placement of the colon. The value of a ? expression is determined like this: Exp1 is evaluated. If it is true, then Exp2 is evaluated and bec... | [
{
"code": null,
"e": 1158,
"s": 1062,
"text": "This conditional operator is also known as the Ternary Operator. This operator has three phase."
},
{
"code": null,
"e": 1178,
"s": 1158,
"text": "Exp1 ? Exp2 : Exp3;"
},
{
"code": null,
"e": 1517,
"s": 1178,
"tex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.