title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
How to write long strings in Multi-lines C/C++? - GeeksforGeeks | 22 Aug, 2019
Image a situation where we want to use or print a long long string in C or C++, how to do this?
In C/C++, we can break a string at any point in the middle using two double quotes in the middle. Below is a simple example to demonstrate the same.
#include<stdio.h>int main(){ // We can put two double quotes... | [
{
"code": null,
"e": 24232,
"s": 24204,
"text": "\n22 Aug, 2019"
},
{
"code": null,
"e": 24328,
"s": 24232,
"text": "Image a situation where we want to use or print a long long string in C or C++, how to do this?"
},
{
"code": null,
"e": 24477,
"s": 24328,
"te... |
Sentiment Analysis with PySpark. One of the tools I’m deeply interested... | by Ricky Kim | Towards Data Science | One of the tools I’m deeply interested but haven’t had many chances to explore is Apache Spark. Most of the time, Pandas and Scikit-Learn is enough to handle the size of data I’m trying to build a model on. But that also means that I haven’t had a chance to deal with petabytes of data yet, and I want to be prepared for... | [
{
"code": null,
"e": 634,
"s": 272,
"text": "One of the tools I’m deeply interested but haven’t had many chances to explore is Apache Spark. Most of the time, Pandas and Scikit-Learn is enough to handle the size of data I’m trying to build a model on. But that also means that I haven’t had a chance ... |
SQL - ALTER TABLE Command | The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table. You should also use the ALTER TABLE command to add and drop various constraints on an existing table.
The basic syntax of an ALTER TABLE command to add a New Column in an existing table is as follows.
ALTER TABLE table_name ADD c... | [
{
"code": null,
"e": 2646,
"s": 2453,
"text": "The SQL ALTER TABLE command is used to add, delete or modify columns in an existing table. You should also use the ALTER TABLE command to add and drop various constraints on an existing table."
},
{
"code": null,
"e": 2745,
"s": 2646,
... |
How to create rounded and circular images with CSS? | Following is the code to create rounded and circular images with CSS −
Live Demo
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
img {
border-radius: 50%;
width: 300px;
height: 300px;
}
</style>
</head>
<body>
<h1>Rounded Images Example</h1>
<img src=... | [
{
"code": null,
"e": 1133,
"s": 1062,
"text": "Following is the code to create rounded and circular images with CSS −"
},
{
"code": null,
"e": 1144,
"s": 1133,
"text": " Live Demo"
},
{
"code": null,
"e": 1444,
"s": 1144,
"text": "<!DOCTYPE html>\n<html>\n<hea... |
Print matrix in diagonal pattern | Given a 2d array of n*n and the task is to find the antispiral arrangement of the given matrix
Input : arr[4][4]={1,2,3,4,
5,6,7,8,
9,10,11,12
13,14,15,16}
Output : 1 6 11 16 4 7 10 13
START
Step 1 -> declare start variables as r=4, c=4, i and j
Step 2 -> initialize array as mat[r][c] with elements
Step 3 -> L... | [
{
"code": null,
"e": 1157,
"s": 1062,
"text": "Given a 2d array of n*n and the task is to find the antispiral arrangement of the given matrix"
},
{
"code": null,
"e": 1256,
"s": 1157,
"text": "Input : arr[4][4]={1,2,3,4,\n 5,6,7,8,\n 9,10,11,12\n 13,14,15,16}\nOutput : 1 6 ... |
Javascript performance test - for vs for each vs (map, reduce, filter, find). | by Deepak Gupta | Towards Data Science | We all know that for loop are faster than for each or javascript function since under the hood of javascript functions might be using for loops or something else which I’m not sure. I did a simple test with an array of objects and doing some operation via for loop/ for each / javascript functions and observing the time... | [
{
"code": null,
"e": 513,
"s": 171,
"text": "We all know that for loop are faster than for each or javascript function since under the hood of javascript functions might be using for loops or something else which I’m not sure. I did a simple test with an array of objects and doing some operation via... |
Amazon Interview Experience (Onsite) - GeeksforGeeks | 09 Mar, 2021
I had 4 interviews in Amazon Chime. Each one was 55 mins, the first 30 mins were about behavior questions(2-3) and only 25 mins for technical.
Technical:
Given pattern (ex: “ShC” ) and dictionary:"ShipClass","SchoolClass","Traeler","Class"
Return list of strings matching this patern like:
ShC -> "ShipClas... | [
{
"code": null,
"e": 25054,
"s": 25026,
"text": "\n09 Mar, 2021"
},
{
"code": null,
"e": 25197,
"s": 25054,
"text": "I had 4 interviews in Amazon Chime. Each one was 55 mins, the first 30 mins were about behavior questions(2-3) and only 25 mins for technical."
},
{
"code"... |
What is xpath in Selenium? | Xpath is one of the most important locators used in Selenium for identifying web elements. It works in the following ways −
It navigates through the Document Object Model (DOM) with the help of
elements and their attributes for identification.
It navigates through the Document Object Model (DOM) with the help of
elemen... | [
{
"code": null,
"e": 1186,
"s": 1062,
"text": "Xpath is one of the most important locators used in Selenium for identifying web elements. It works in the following ways −"
},
{
"code": null,
"e": 1306,
"s": 1186,
"text": "It navigates through the Document Object Model (DOM) with ... |
Asynchronous Nature in Cypress | Cypress is built on node.js server and it works with Javascript programming
language. Anything which is dependent on node.js is asynchronous in nature and
so Cypress commands work in that mode.
When we have a group of test steps in a test case, all the steps start executing in
parallel without waiting for the previous ... | [
{
"code": null,
"e": 1256,
"s": 1062,
"text": "Cypress is built on node.js server and it works with Javascript programming\nlanguage. Anything which is dependent on node.js is asynchronous in nature and\nso Cypress commands work in that mode."
},
{
"code": null,
"e": 1534,
"s": 1256,... |
Stub | Stubs are used during Top-down integration testing, in order to simulate the behaviour of the lower-level modules that are not yet integrated. Stubs are the modules that act as temporary replacement for a called module and give the same output as that of the actual product.
Stubs are also used when the software needs t... | [
{
"code": null,
"e": 6020,
"s": 5745,
"text": "Stubs are used during Top-down integration testing, in order to simulate the behaviour of the lower-level modules that are not yet integrated. Stubs are the modules that act as temporary replacement for a called module and give the same output as that o... |
Core Dump (Segmentation fault) in C/C++ - GeeksforGeeks | 07 Feb, 2022
Core Dump/Segmentation fault is a specific kind of error caused by accessing memory that “does not belong to you.”
When a piece of code tries to do read and write operation in a read only location in memory or freed block of memory, it is known as core dump.
It is an error indicating memory corruption.
C... | [
{
"code": null,
"e": 24416,
"s": 24388,
"text": "\n07 Feb, 2022"
},
{
"code": null,
"e": 24533,
"s": 24416,
"text": "Core Dump/Segmentation fault is a specific kind of error caused by accessing memory that “does not belong to you.” "
},
{
"code": null,
"e": 24677,
... |
Set NOT NULL attribute to an existing column in MySQL | To set NOT NULL attribute to an existing column, use ALTER TABLE command. Let us first create a table −
mysql> create table DemoTable1949
(
UserId int,
UserName varchar(20)
);
Query OK, 0 rows affected (0.00 sec)
Here is the query to set NOT NULL attribute to an existing column −
mysql> alter table DemoTabl... | [
{
"code": null,
"e": 1166,
"s": 1062,
"text": "To set NOT NULL attribute to an existing column, use ALTER TABLE command. Let us first create a table −"
},
{
"code": null,
"e": 1287,
"s": 1166,
"text": "mysql> create table DemoTable1949\n (\n UserId int,\n UserName varchar(2... |
Create a model with Azure Custom Vision and Python | by Henk Boelman | Towards Data Science | The answer to that is simple, if you build the training process in code you can version it for instance on Github. Having your code versioned means you can read back what you have done, work ina team on it and run it again if you need to.
Let’s dive into the code! Before we start, I assume you have Python 3.6 installed... | [
{
"code": null,
"e": 410,
"s": 171,
"text": "The answer to that is simple, if you build the training process in code you can version it for instance on Github. Having your code versioned means you can read back what you have done, work ina team on it and run it again if you need to."
},
{
"c... |
Protobuf - List/Repeated | Lists are one of the composite datatypes of Protobuf. Protobuf translates this to a java.util.list interface in Java.
Continuing with our theater example, following is the syntax that we need to have to instruct Protobuf that we will be creating a list −
syntax = "proto3";
package theater;
option java_package = "com.tu... | [
{
"code": null,
"e": 2163,
"s": 2045,
"text": "Lists are one of the composite datatypes of Protobuf. Protobuf translates this to a java.util.list interface in Java."
},
{
"code": null,
"e": 2300,
"s": 2163,
"text": "Continuing with our theater example, following is the syntax tha... |
Password Verification in Node.js - GeeksforGeeks | 14 Oct, 2021
In Node for password hashing and verification we can use a npm library known as bcryptjs npm-bcryptjs.
Installation of bcryptjs: Node.js contains an inbuilt crypto module’s randomBytes interface which is used to obtain the secure random numbers.
npm install bcryptjs
Approach:
To hash a password use bcrypt.... | [
{
"code": null,
"e": 24101,
"s": 24073,
"text": "\n14 Oct, 2021"
},
{
"code": null,
"e": 24204,
"s": 24101,
"text": "In Node for password hashing and verification we can use a npm library known as bcryptjs npm-bcryptjs."
},
{
"code": null,
"e": 24347,
"s": 24204,
... |
How to check a variable is an array or not in PHP ? - GeeksforGeeks | 22 Oct, 2021
There are two ways for checking whether the variable is an array or not. We can check whether a variable is an array or not by using the PHP is_array() function and by casting the variable to the array.
Approach 1: We can check whether a variable is an array or not using the is_array() function. The PHP is... | [
{
"code": null,
"e": 24581,
"s": 24553,
"text": "\n22 Oct, 2021"
},
{
"code": null,
"e": 24784,
"s": 24581,
"text": "There are two ways for checking whether the variable is an array or not. We can check whether a variable is an array or not by using the PHP is_array() function an... |
Java ResultSet relative() method with example | When we execute certain SQL queries (SELECT query in general) they return tabular data.
The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.
i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQue... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "When we execute certain SQL queries (SELECT query in general) they return tabular data."
},
{
"code": null,
"e": 1244,
"s": 1150,
"text": "The java.sql.ResultSet interface represents such tabular data returned by the SQL statements."... |
EasyMock - JUnit Integration | In this chapter, we'll learn how to integrate JUnit and EasyMock together. Here we will create a Math Application which uses CalculatorService to perform basic mathematical operations such as addition, subtraction, multiply, and division. We'll use EasyMock to mock the dummy implementation of CalculatorService. In addi... | [
{
"code": null,
"e": 2337,
"s": 1909,
"text": "In this chapter, we'll learn how to integrate JUnit and EasyMock together. Here we will create a Math Application which uses CalculatorService to perform basic mathematical operations such as addition, subtraction, multiply, and division. We'll use Easy... |
How to use a transcript in PowerShell? | Transcript in Powershell is like a recording session. So whenever you start a transcript in PowerShell, it starts recording your commands and outputs and doesn't matter if there is any error output, it gets recorded too. To start the transcript, you need to run Start-Transcript command at the beginning, and then whatev... | [
{
"code": null,
"e": 1418,
"s": 1062,
"text": "Transcript in Powershell is like a recording session. So whenever you start a transcript in PowerShell, it starts recording your commands and outputs and doesn't matter if there is any error output, it gets recorded too. To start the transcript, you nee... |
Count nodes of linked list | Practice | GeeksforGeeks | Given a singly linked list. The task is to find the length of the linked list, where length is defined as the number of nodes in the linked list.
Example 1:
Input:
LinkedList: 1->2->3->4->5
Output: 5
Explanation: Count of nodes in the
linked list is 5, which is its length.
Example 2:
Input:
LinkedList: 2->4->6->7->5-... | [
{
"code": null,
"e": 384,
"s": 238,
"text": "Given a singly linked list. The task is to find the length of the linked list, where length is defined as the number of nodes in the linked list."
},
{
"code": null,
"e": 395,
"s": 384,
"text": "Example 1:"
},
{
"code": null,
... |
Create a chart from JSON data using Fetch GET request (Fetch API) in JavaScript - GeeksforGeeks | 29 Nov, 2021
In this article, we are going to create a simple chart by fetching JSON Data using Fetch() method of Fetch API. The Fetch API allows us to conduct HTTP requests in a simpler way.
The fetch() method: The fetch method fetches a resource thereby returning a promise which is fulfilled once the response is avai... | [
{
"code": null,
"e": 25300,
"s": 25272,
"text": "\n29 Nov, 2021"
},
{
"code": null,
"e": 25479,
"s": 25300,
"text": "In this article, we are going to create a simple chart by fetching JSON Data using Fetch() method of Fetch API. The Fetch API allows us to conduct HTTP requests in... |
How to free up the memory in JavaScript? | Regardless of the programming language, memory life cycle is pretty much always the same −
Allocate the memory you need
Use the allocated memory (read, write)
Release the allocated memory when it is not needed anymore
The second part is explicit in all languages. Use of allocated memory needs to be done by the develope... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "Regardless of the programming language, memory life cycle is pretty much always the same −"
},
{
"code": null,
"e": 1182,
"s": 1153,
"text": "Allocate the memory you need"
},
{
"code": null,
"e": 1221,
"s": 1182,
... |
Computer Networks | Set 11 - GeeksforGeeks | 27 Mar, 2017
Following questions have been asked in GATE CS 2006 exam.
1) Station A uses 32 byte packets to transmit messages to Station B using a sliding window protocol. The round trip delay between A and B is 80 milliseconds and the bottleneck bandwidth on the path between A and B is 128 kbps. What is the optimal wi... | [
{
"code": null,
"e": 23936,
"s": 23908,
"text": "\n27 Mar, 2017"
},
{
"code": null,
"e": 23994,
"s": 23936,
"text": "Following questions have been asked in GATE CS 2006 exam."
},
{
"code": null,
"e": 24298,
"s": 23994,
"text": "1) Station A uses 32 byte packet... |
Java Program for Cocktail Sort | Cocktail Sort works in contrast to bubble sort, wherein elements are iterated from left to right, and the largest element is first brought to its correct position and so on. In cocktail sort, elements are iterated over in both the directions (left and right) in an alternating fashion.
Following is the program for Cockt... | [
{
"code": null,
"e": 1348,
"s": 1062,
"text": "Cocktail Sort works in contrast to bubble sort, wherein elements are iterated from left to right, and the largest element is first brought to its correct position and so on. In cocktail sort, elements are iterated over in both the directions (left and r... |
MFC - Bitmap Button | A bitmap button displays a picture or a picture and text on its face. This is usually intended to make the button a little explicit. A bitmap button is created using the CBitmapButton class, which is derived from CButton.
Here is the list of methods in CBitmapButton class.
AutoLoad
Associates a button in a dialog box w... | [
{
"code": null,
"e": 2289,
"s": 2067,
"text": "A bitmap button displays a picture or a picture and text on its face. This is usually intended to make the button a little explicit. A bitmap button is created using the CBitmapButton class, which is derived from CButton."
},
{
"code": null,
... |
How to build and use custom python packages for data science project | by Priya Brata Sen | Towards Data Science | In data science projects, we use similar steps depending on the nature of the problem. Usually, a data science project consists of problem identification, data collection and preparation, feature engineering, training and testing model, and deployment. In these steps, several functions are used. A data scientist needs ... | [
{
"code": null,
"e": 961,
"s": 47,
"text": "In data science projects, we use similar steps depending on the nature of the problem. Usually, a data science project consists of problem identification, data collection and preparation, feature engineering, training and testing model, and deployment. In ... |
Change the position of cursor in Tkinter's Entry widget - GeeksforGeeks | 05 Apr, 2021
A widget in tkinter, which is used to enter a display a single line of text is called an entry widget. Have you created an entry widget in tkinter which contains a lot of information? Is a lot of text causing an issue to you to move at any other position in it? Don’t worry, we have a solution to this probl... | [
{
"code": null,
"e": 24316,
"s": 24288,
"text": "\n05 Apr, 2021"
},
{
"code": null,
"e": 24749,
"s": 24316,
"text": "A widget in tkinter, which is used to enter a display a single line of text is called an entry widget. Have you created an entry widget in tkinter which contains a... |
Convert an Integer to UTF8 in R Programming - intToUtf8() Function - GeeksforGeeks | 16 Jun, 2020
intToUtf8() function in R Language is used to convert an integer into UTF8 value.
Syntax: intToUtf8(x, multiple)
Parameters:x: Integer or integer vectormultiple: Boolean value to convert into single or multiple strings
Example 1:
# R program to convert an integer to UTF8 # Calling the intToUtf8() function... | [
{
"code": null,
"e": 24476,
"s": 24448,
"text": "\n16 Jun, 2020"
},
{
"code": null,
"e": 24558,
"s": 24476,
"text": "intToUtf8() function in R Language is used to convert an integer into UTF8 value."
},
{
"code": null,
"e": 24589,
"s": 24558,
"text": "Syntax: ... |
CSS | Ordering Flex Items - GeeksforGeeks | 18 Nov, 2019
The order property of CSS can be used for ordering flex items. It specifies the order of a flex item with respect to the other flex items. The element has to be a flexible item for the order property to work. The elements are displayed in ascending order of their order values. If two elements have the same... | [
{
"code": null,
"e": 26004,
"s": 25976,
"text": "\n18 Nov, 2019"
},
{
"code": null,
"e": 26401,
"s": 26004,
"text": "The order property of CSS can be used for ordering flex items. It specifies the order of a flex item with respect to the other flex items. The element has to be a ... |
A Beginner’s guide to XGBoost. This article will have trees.... lots of... | by George Seif | Towards Data Science | Want to be inspired? Come join my Super Quotes newsletter. 😎
XGBoost is an open source library providing a high-performance implementation of gradient boosted decision trees. An underlying C++ codebase combined with a Python interface sitting on top makes for an extremely powerful yet easy to implement package.
The pe... | [
{
"code": null,
"e": 233,
"s": 172,
"text": "Want to be inspired? Come join my Super Quotes newsletter. 😎"
},
{
"code": null,
"e": 485,
"s": 233,
"text": "XGBoost is an open source library providing a high-performance implementation of gradient boosted decision trees. An underly... |
GATE | GATE CS 1996 | Question 15 - GeeksforGeeks | 31 Oct, 2017
Which of the following sequences denotes the post order traversal sequence of the given tree?
a
/ \
b e
/ \ /
c d f
/
g
(A) f e g c d b a(B) g c b d a f e(C) g c d b f e a(D) f e d g c b aAnswer: (C)Explanation:Quiz of this QuestionPlease comment below if you ... | [
{
"code": null,
"e": 24078,
"s": 24050,
"text": "\n31 Oct, 2017"
},
{
"code": null,
"e": 24172,
"s": 24078,
"text": "Which of the following sequences denotes the post order traversal sequence of the given tree?"
},
{
"code": null,
"e": 24245,
"s": 24172,
"text... |
Install Apache Kafka on Windows 10 - 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
This guide helps you to understand how to ins... | [
{
"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,
... |
How to declare a variable within lambda expression in Java? | A lambda expression is a function that expects and accepts input parameters and produces output results. It is an instance of a functional interface and also known as a single abstract method interface (SAM interface) like Runnable, Comparator, Callable and etc. We can declare a variable as a final string[] array and a... | [
{
"code": null,
"e": 1441,
"s": 1062,
"text": "A lambda expression is a function that expects and accepts input parameters and produces output results. It is an instance of a functional interface and also known as a single abstract method interface (SAM interface) like Runnable, Comparator, Callable... |
How to print "Hello World!" using Python? | The basic way to do output to screen is to use the print statement.
>>> print 'Hello, world'
Hello, world
To print multiple things on the same line separated by spaces, use commas between them. For example:
>>> print 'Hello,', 'World'
Hello, World
In Python 3, all print is a function and not a statement. Hence its argu... | [
{
"code": null,
"e": 1130,
"s": 1062,
"text": "The basic way to do output to screen is to use the print statement."
},
{
"code": null,
"e": 1168,
"s": 1130,
"text": ">>> print 'Hello, world'\nHello, world"
},
{
"code": null,
"e": 1269,
"s": 1168,
"text": "To p... |
How to build Spark from source and deploy it to a Kubernetes cluster in 60 minutes | by Nikolay Dimolarov | Towards Data Science | Motivation/Prelude
In my last article I explained the broad strokes of the Hadoop ecosystem and you can read about it here. What is important about that article is the end, which I will blatantly plagiarise from my other article as it serves as the beginning of this one too:
Now, if you have been sort of listening in o... | [
{
"code": null,
"e": 191,
"s": 172,
"text": "Motivation/Prelude"
},
{
"code": null,
"e": 448,
"s": 191,
"text": "In my last article I explained the broad strokes of the Hadoop ecosystem and you can read about it here. What is important about that article is the end, which I will ... |
How to change the file owner and group in Linux? | To change the file owner and group, we use the chown command in the Linux operating system.
We know that Linux is a multiuser operating system so every file or directory belongs to an owner and group.
To change ownership of files or directories we use chown command in the Linux system. This command is also available in... | [
{
"code": null,
"e": 1154,
"s": 1062,
"text": "To change the file owner and group, we use the chown command in the Linux operating system."
},
{
"code": null,
"e": 1263,
"s": 1154,
"text": "We know that Linux is a multiuser operating system so every file or directory belongs to a... |
Running Selenium WebDriver python bindings in chrome. | We can run Selenium webdriver with Python bindings in Chrome. This
can be done by downloading the chromedriver.exe file. Visit the link: https://chromedriver.chromium.org/downloads. There shall be links available
for download for various chromedriver versions.
Select the version which is compatible with the Chrome brow... | [
{
"code": null,
"e": 1323,
"s": 1062,
"text": "We can run Selenium webdriver with Python bindings in Chrome. This\ncan be done by downloading the chromedriver.exe file. Visit the link: https://chromedriver.chromium.org/downloads. There shall be links available\nfor download for various chromedriver ... |
Escape a Large Maze Python | Suppose we have a grid, there are 1 million rows and 1 million columns, we also have one list of blocked cells. Now we will start at the source square and want to reach the target square. In each move, we can walk to a up, down, left, right adjacent square in the grid that isn't in the given list of blocked cells.
We h... | [
{
"code": null,
"e": 1378,
"s": 1062,
"text": "Suppose we have a grid, there are 1 million rows and 1 million columns, we also have one list of blocked cells. Now we will start at the source square and want to reach the target square. In each move, we can walk to a up, down, left, right adjacent squ... |
Arrays asList() method in Java with Examples - GeeksforGeeks | 24 Nov, 2021
The asList() method of java.util.Arrays class is used to return a fixed-size list backed by the specified array. This method acts as a bridge between array-based and collection-based APIs, in combination with Collection.toArray(). The returned list is serializable and implements RandomAccess.
Tip: This run... | [
{
"code": null,
"e": 24962,
"s": 24934,
"text": "\n24 Nov, 2021"
},
{
"code": null,
"e": 25256,
"s": 24962,
"text": "The asList() method of java.util.Arrays class is used to return a fixed-size list backed by the specified array. This method acts as a bridge between array-based a... |
How does parameters 'c' and 'cmap' behave in a Matplotlib scatter plot? | To get a sense of how the parameters c and cmap behave in a Matplotlib scatterplot, we can take the following steps −
Set the figure size and adjust the padding between and around the subplots.
Initialize a variable N to store the number of sample data.
Create x and y data points using numpy.
Plot x and y data points u... | [
{
"code": null,
"e": 1180,
"s": 1062,
"text": "To get a sense of how the parameters c and cmap behave in a Matplotlib scatterplot, we can take the following steps −"
},
{
"code": null,
"e": 1256,
"s": 1180,
"text": "Set the figure size and adjust the padding between and around th... |
Class getDeclaredField() method in Java with Examples - GeeksforGeeks | 16 Dec, 2019
The getDeclaredField() method of java.lang.Class class is used to get the specified field of this class. The method returns the specified field of this class in the form of Field object.
Syntax:
public Field getDeclaredField(String fieldName)
throws NoSuchMethodException,
SecurityExcep... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n16 Dec, 2019"
},
{
"code": null,
"e": 24135,
"s": 23948,
"text": "The getDeclaredField() method of java.lang.Class class is used to get the specified field of this class. The method returns the specified field of this class in th... |
Bootstrap - Helper Classes | This chapter discusses some of the helper classes in Bootstrap that might come in handy.
Use the generic close icon for dismissing content like modals and alerts. Use the class close to get the close icon.
<p>Close Icon Example
<button type = "button" class = "close" aria-hidden = "true">
×
</button>
... | [
{
"code": null,
"e": 3420,
"s": 3331,
"text": "This chapter discusses some of the helper classes in Bootstrap that might come in handy."
},
{
"code": null,
"e": 3537,
"s": 3420,
"text": "Use the generic close icon for dismissing content like modals and alerts. Use the class close... |
Using Lambda Function with Amazon S3 | Amazon S3 service is used for file storage, where you can upload or remove files. We can trigger AWS Lambda on S3 when there are any file uploads in S3 buckets. AWS Lambda has a handler function which acts as a start point for AWS Lambda function. The handler has the details of the events. In this chapter, let us see h... | [
{
"code": null,
"e": 2809,
"s": 2406,
"text": "Amazon S3 service is used for file storage, where you can upload or remove files. We can trigger AWS Lambda on S3 when there are any file uploads in S3 buckets. AWS Lambda has a handler function which acts as a start point for AWS Lambda function. The h... |
memset() in C with examples - GeeksforGeeks | 28 Jun, 2021
memset() is used to fill a block of memory with a particular value.The syntax of memset() function is as follows :
// ptr ==> Starting address of memory to be filled
// x ==> Value to be filled
// n ==> Number of bytes to be filled starting
// from ptr to be filled
void *memset(void *ptr, int ... | [
{
"code": null,
"e": 25571,
"s": 25543,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 25686,
"s": 25571,
"text": "memset() is used to fill a block of memory with a particular value.The syntax of memset() function is as follows :"
},
{
"code": null,
"e": 25893,
... |
How to install Librosa Library in Python? - GeeksforGeeks | 06 Oct, 2021
Librosa is a Python package for music and audio analysis. Librosa is basically used when we work with audio data like in music generation(using LSTM’s), Automatic Speech Recognition.
It provides the building blocks necessary to create the music information retrieval systems. Librosa helps to visualize the ... | [
{
"code": null,
"e": 26143,
"s": 26115,
"text": "\n06 Oct, 2021"
},
{
"code": null,
"e": 26326,
"s": 26143,
"text": "Librosa is a Python package for music and audio analysis. Librosa is basically used when we work with audio data like in music generation(using LSTM’s), Automatic ... |
withContext in Kotlin Coroutines - GeeksforGeeks | 14 Sep, 2020
Prerequisite:
Kotlin Coroutines on Android
Launch vs Async in Kotlin Coroutines
It is known that async and launch are the two ways to start the coroutine. Since It is known that async is used to get the result back, & should be used only when we need the parallel execution, whereas the launch is used when ... | [
{
"code": null,
"e": 25383,
"s": 25355,
"text": "\n14 Sep, 2020"
},
{
"code": null,
"e": 25397,
"s": 25383,
"text": "Prerequisite:"
},
{
"code": null,
"e": 25426,
"s": 25397,
"text": "Kotlin Coroutines on Android"
},
{
"code": null,
"e": 25463,
... |
Maximum number of set bits count in a K-size substring of a Binary String - GeeksforGeeks | 18 May, 2021
Given a binary string S of size N and an integer K. The task is to find the maximum number of set bit appears in a substring of size K.
Examples:
Input: S = “100111010”, K = 3 Output: 3 Explanation: The substring “111” contains 3 set bits.
Input:S = “0000000”, K = 4 Output: 0 Explanation: S doesn’t have a... | [
{
"code": null,
"e": 26277,
"s": 26249,
"text": "\n18 May, 2021"
},
{
"code": null,
"e": 26413,
"s": 26277,
"text": "Given a binary string S of size N and an integer K. The task is to find the maximum number of set bit appears in a substring of size K."
},
{
"code": null,... |
SortedSet in C# with Examples - GeeksforGeeks | 09 Dec, 2021
In C#, SortedSet is a collection of objects in sorted order. It is of the generic type collection and defined under System.Collections.Generic namespace. It also provides many mathematical set operations, such as intersection, union, and difference. It is a dynamic collection means the size of the SortedSe... | [
{
"code": null,
"e": 26525,
"s": 26497,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 26913,
"s": 26525,
"text": "In C#, SortedSet is a collection of objects in sorted order. It is of the generic type collection and defined under System.Collections.Generic namespace. It also p... |
ML | Transfer Learning with Convolutional Neural Networks - GeeksforGeeks | 25 Nov, 2019
Transfer learning as a general term refers to reusing the knowledge learned from one task for another. Specifically for convolutional neural networks (CNNs), many image features are common to a variety of datasets (e.g. lines, edges are seen in almost every image). It is for this reason that, especially fo... | [
{
"code": null,
"e": 25589,
"s": 25561,
"text": "\n25 Nov, 2019"
},
{
"code": null,
"e": 26412,
"s": 25589,
"text": "Transfer learning as a general term refers to reusing the knowledge learned from one task for another. Specifically for convolutional neural networks (CNNs), many ... |
How to hide sensitive credentials using Python - GeeksforGeeks | 14 Sep, 2021
Have you ever been in a situation where you are working on a python project need to share your code with someone or you are hosting your code in a public repository but don’t want to share the sensitive credentials so it isn’t exploited by a random user?
For example, you are making a web app in Django, whe... | [
{
"code": null,
"e": 25811,
"s": 25783,
"text": "\n14 Sep, 2021"
},
{
"code": null,
"e": 26066,
"s": 25811,
"text": "Have you ever been in a situation where you are working on a python project need to share your code with someone or you are hosting your code in a public repositor... |
How to scroll down a webpage in selenium using Java? | We can scroll down a webpage in Selenium using Java. Selenium is unable to handle scrolling directly. It takes the help of the Javascript Executor to perform the scrolling action up to an element.
First of all, we have to locate the element up to which we have to scroll. Next, we shall use the Javascript Executor to ru... | [
{
"code": null,
"e": 1259,
"s": 1062,
"text": "We can scroll down a webpage in Selenium using Java. Selenium is unable to handle scrolling directly. It takes the help of the Javascript Executor to perform the scrolling action up to an element."
},
{
"code": null,
"e": 1592,
"s": 1259... |
Convert characters of a string to opposite case in C++ | We are given a string of any length and the task is to convert the string having uppercase letters to lowercase letters and lowercase letters to uppercase letters.
Input − string str = ”Welcome To The Site!”
Output − wELCOME tO tHE sITE!
Explanation − converted the letters W, T, T, S to lowercase and letters e,l,c,o,m,... | [
{
"code": null,
"e": 1226,
"s": 1062,
"text": "We are given a string of any length and the task is to convert the string having uppercase letters to lowercase letters and lowercase letters to uppercase letters."
},
{
"code": null,
"e": 1270,
"s": 1226,
"text": "Input − string str... |
getline (string) in C++ | It is used to extracts characters from the stream as unformatted input and stores them into s as a c-string, until either the extracted character is the delimiting character, or n characters have been written to s (including the terminating null character). The declaration is like:
basic_istream& getline (char_type* s,... | [
{
"code": null,
"e": 1345,
"s": 1062,
"text": "It is used to extracts characters from the stream as unformatted input and stores them into s as a c-string, until either the extracted character is the delimiting character, or n characters have been written to s (including the terminating null charact... |
How to create a pagination using JavaFX? | Pagination divides content up between pages and allows users to skip between pages or go in order through the content. You can create pagination by instantiating the javafx.scene.control.Pagination class.
The following Example demonstrates the creation of a Pagination.
import javafx.application.Application;
import java... | [
{
"code": null,
"e": 1267,
"s": 1062,
"text": "Pagination divides content up between pages and allows users to skip between pages or go in order through the content. You can create pagination by instantiating the javafx.scene.control.Pagination class."
},
{
"code": null,
"e": 1332,
"... |
Program to convert IntStream to String in Java - GeeksforGeeks | 11 Dec, 2018
Given a Instream containing ASCII values, the task is to convert this Instream into a String containing the characters corresponding to the ASCII values.
Examples:
Input: IntStream = 71, 101, 101, 107, 115
Output: Geeks
Input: IntStream = 71, 101, 101, 107, 115, 70, 111, 114, 71, 101, 101, 107, 115
Output... | [
{
"code": null,
"e": 24149,
"s": 24121,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 24303,
"s": 24149,
"text": "Given a Instream containing ASCII values, the task is to convert this Instream into a String containing the characters corresponding to the ASCII values."
},
{... |
PyTorch – torchvision.transforms – GaussianBlur() | The torchvision.transforms module provides many important transformations that can be used to perform different types of manipulations on the image data. GaussianBlur() transformation is used to blur an image with randomly chosen Gaussian blur.
The GaussianBlur() transformation accepts both PIL and tensor images or a b... | [
{
"code": null,
"e": 1307,
"s": 1062,
"text": "The torchvision.transforms module provides many important transformations that can be used to perform different types of manipulations on the image data. GaussianBlur() transformation is used to blur an image with randomly chosen Gaussian blur."
},
... |
Flattening a JSON object in JavaScript | Suppose, we have the following JSON object that may contain nesting upto any level −
const obj = {
"one": 1,
"two": {
"three": 3
},
"four": {
"five": 5,
"six": {
"seven": 7
},
"eight": 8
},
"nine": 9
};
We are required to write a JavaScript function that takes in... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "Suppose, we have the following JSON object that may contain nesting upto any level −"
},
{
"code": null,
"e": 1322,
"s": 1147,
"text": "const obj = {\n \"one\": 1,\n \"two\": {\n \"three\": 3\n },\n \"four\": {\n \"... |
How to append a list to a Pandas DataFrame using append() in Python? | To append a list to a DataFrame using append(), let us first create a DataFrame. The data is in the form of lists of team rankings for our example −
# data in the form of list of team rankings
Team = [['India', 1, 100],['Australia', 2, 85],['England', 3, 75],['New Zealand', 4 , 65],['South Africa', 5, 50]]
# Creating ... | [
{
"code": null,
"e": 1211,
"s": 1062,
"text": "To append a list to a DataFrame using append(), let us first create a DataFrame. The data is in the form of lists of team rankings for our example −"
},
{
"code": null,
"e": 1483,
"s": 1211,
"text": "# data in the form of list of tea... |
Pass array to MySQL stored routine? | We need to create a stored procedure to display how to pass array to MySQL stored routine. Let us first create a table for our example.
Creating a table
mysql> create table FindDemo
-> (
-> name varchar(100)
-> );
Query OK, 0 rows affected (0.46 sec)
Inserting some records into the table.
mysql> insert into Fi... | [
{
"code": null,
"e": 1198,
"s": 1062,
"text": "We need to create a stored procedure to display how to pass array to MySQL stored routine. Let us first create a table for our example."
},
{
"code": null,
"e": 1215,
"s": 1198,
"text": "Creating a table"
},
{
"code": null,
... |
Alternative Sorting - GeeksforGeeks | 26 Mar, 2021
Given an array of integers, print the array in such a way that the first element is first maximum and second element is first minimum and so on.Examples :
Input : arr[] = {7, 1, 2, 3, 4, 5, 6}
Output : 7 1 6 2 5 3 4
Input : arr[] = {1, 6, 9, 4, 3, 7, 8, 2}
Output : 9 1 8 2 7 3 6 4
A simple solution is... | [
{
"code": null,
"e": 24473,
"s": 24445,
"text": "\n26 Mar, 2021"
},
{
"code": null,
"e": 24630,
"s": 24473,
"text": "Given an array of integers, print the array in such a way that the first element is first maximum and second element is first minimum and so on.Examples : "
},
... |
UnitTest Framework - Quick Guide | Unit testing is a software testing method by which individual units of source code, such as functions, methods, and class are tested to determine whether they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. Unit tests are short code fragments created by programmers dur... | [
{
"code": null,
"e": 2489,
"s": 2098,
"text": "Unit testing is a software testing method by which individual units of source code, such as functions, methods, and class are tested to determine whether they are fit for use. Intuitively, one can view a unit as the smallest testable part of an applicat... |
Rexx - RANDOM | This method returns a random generated number.
RANDOM()
None
None
This method returns a random generated number.
/* Main program */
say RANDOM()
When we run the above program, we will get the following result.
971
Print
Add Notes
Bookmark this page | [
{
"code": null,
"e": 2386,
"s": 2339,
"text": "This method returns a random generated number."
},
{
"code": null,
"e": 2397,
"s": 2386,
"text": "RANDOM() \n"
},
{
"code": null,
"e": 2402,
"s": 2397,
"text": "None"
},
{
"code": null,
"e": 2407,
... |
How to find and display the Multiplication Table in C#? | To display multiplication table, you need to set the numbers and format the output property. Let’s say you want to find the table of 4 from 1 to 10. For that, set a while loop first till 10.
while (a <= 10) {
}
Now format the output to get the result as shown below. Here, n is 4 i.e. table of 4.
Console.WriteLine(" {0}... | [
{
"code": null,
"e": 1253,
"s": 1062,
"text": "To display multiplication table, you need to set the numbers and format the output property. Let’s say you want to find the table of 4 from 1 to 10. For that, set a while loop first till 10."
},
{
"code": null,
"e": 1273,
"s": 1253,
... |
IPython - Installation | IPython is included by default in Anaconda distribution of Python. It can be downloaded from Anaconda’s download page www.anaconda.com/download/ Binaries for all major OS (Windows, MacOS and Linux) and architecture (32 bit and 64 bit) are available on this link.
To install IPython separately in standard Python installa... | [
{
"code": null,
"e": 2923,
"s": 2660,
"text": "IPython is included by default in Anaconda distribution of Python. It can be downloaded from Anaconda’s download page www.anaconda.com/download/ Binaries for all major OS (Windows, MacOS and Linux) and architecture (32 bit and 64 bit) are available on t... |
C++ String Library - find_last_not_of | It searches the string for the first character that does not match any of the characters specified in its arguments.
Following is the declaration for std::string::find_last_not_of.
size_t find_last_not_of (const string& str, size_t pos = npos) const;
size_t find_last_not_of (const string& str, size_t pos = npos) const ... | [
{
"code": null,
"e": 2720,
"s": 2603,
"text": "It searches the string for the first character that does not match any of the characters specified in its arguments."
},
{
"code": null,
"e": 2784,
"s": 2720,
"text": "Following is the declaration for std::string::find_last_not_of."
... |
How to convert JSON results into a date using JavaScript ? - GeeksforGeeks | 31 Oct, 2019
The task is to convert a JSON result to JavaScript Date with the help of JavaScript. There are few two methods which are discussed below:
Approach 1:
Use substr() method to get the integer part of string.
Use the parseInt() method followed by Date() to get the JavaScript date.
Example: This example impleme... | [
{
"code": null,
"e": 37970,
"s": 37942,
"text": "\n31 Oct, 2019"
},
{
"code": null,
"e": 38108,
"s": 37970,
"text": "The task is to convert a JSON result to JavaScript Date with the help of JavaScript. There are few two methods which are discussed below:"
},
{
"code": nul... |
Image Processing — OpenCV Vs PIL. Utilize the Python Libraries to Extract... | by Suraj Gurav | Towards Data Science | The work of a Data Analyst is not limited to work only on readily available data, rather sometimes the data need to be mined from the images also.
This story is all about different types of image feature extraction using Python. Additionally, here you will find a classic comparison of the speed of two image processing ... | [
{
"code": null,
"e": 319,
"s": 172,
"text": "The work of a Data Analyst is not limited to work only on readily available data, rather sometimes the data need to be mined from the images also."
},
{
"code": null,
"e": 519,
"s": 319,
"text": "This story is all about different types... |
Processing XML in Python — ElementTree | by Deepesh Nair | Towards Data Science | Learn how you can parse, explore, modify and populate XML files with the Python ElementTree package, for loops and XPath expressions. As a data scientist, you’ll find that understanding XML is powerful for both web-scraping and general practice in parsing a structured document
Extensible Markup Language (XML) is a mark... | [
{
"code": null,
"e": 450,
"s": 172,
"text": "Learn how you can parse, explore, modify and populate XML files with the Python ElementTree package, for loops and XPath expressions. As a data scientist, you’ll find that understanding XML is powerful for both web-scraping and general practice in parsing... |
What are nested rules in LESS ? - GeeksforGeeks | 09 Jul, 2021
We can very easily define nested rules in LESS. Nested rules are defined as a set of CSS properties that allow the properties of one class to be used for another class and contain the class name as its property. In LESS, you can use class or ID selectors to declare mixin in the same way as CSS styles. It c... | [
{
"code": null,
"e": 25376,
"s": 25348,
"text": "\n09 Jul, 2021"
},
{
"code": null,
"e": 25748,
"s": 25376,
"text": "We can very easily define nested rules in LESS. Nested rules are defined as a set of CSS properties that allow the properties of one class to be used for another c... |
Splitter splitToList() method | Guava | Java - GeeksforGeeks | 31 Jan, 2019
The method splitToList(CharSequence sequence) splits sequence into string components and returns them as an immutable list.
Syntax:
public List<String>
splitToList(CharSequence sequence)
Parameters: This method takes sequence as parameter which is the sequence of characters to split.
Return Value: Th... | [
{
"code": null,
"e": 25022,
"s": 24994,
"text": "\n31 Jan, 2019"
},
{
"code": null,
"e": 25146,
"s": 25022,
"text": "The method splitToList(CharSequence sequence) splits sequence into string components and returns them as an immutable list."
},
{
"code": null,
"e": 25... |
Electron - Audio and Video Capturing | Audio and video capturing are important characteristics if you are building apps for screen sharing, voice memos, etc. They are also useful if you require an application to capture the profile picture.
We will be using the getUserMedia HTML5 API for capturing audio and video streams with Electron. Let us first set up o... | [
{
"code": null,
"e": 2267,
"s": 2065,
"text": "Audio and video capturing are important characteristics if you are building apps for screen sharing, voice memos, etc. They are also useful if you require an application to capture the profile picture."
},
{
"code": null,
"e": 2434,
"s":... |
Largest number in K swaps | Practice | GeeksforGeeks | Given a number K and string str of digits denoting a positive integer, build the largest number possible by performing swap operations on the digits of str at most K times.
Example 1:
Input:
K = 4
str = "1234567"
Output:
7654321
Explanation:
Three swaps can make the
input 1234567 to 7654321, swapping 1
with 7, 2 with ... | [
{
"code": null,
"e": 411,
"s": 238,
"text": "Given a number K and string str of digits denoting a positive integer, build the largest number possible by performing swap operations on the digits of str at most K times."
},
{
"code": null,
"e": 423,
"s": 411,
"text": "\nExample 1:"... |
Tutorial on displaying SHAP force plots in Python HTML | by Liam I. | Towards Data Science | Here’s the source code for this tutorial so that you can follow along, and you can just run app.py to see the results.
SHAP plots can be very useful for model explainability (see here for a great talk on them).
As part of a recent project on displaying a logistic regression of League of Legends data using SHAP (you can... | [
{
"code": null,
"e": 291,
"s": 172,
"text": "Here’s the source code for this tutorial so that you can follow along, and you can just run app.py to see the results."
},
{
"code": null,
"e": 383,
"s": 291,
"text": "SHAP plots can be very useful for model explainability (see here fo... |
How can I check if a string is all uppercase in JavaScript? | You can compare the string against itself in upper case to check if it is
in the upper case.
function isUpperCase(str) {
return str === str.toUpperCase();
}
console.log(isUpperCase('a'))
console.log(isUpperCase('A'))
console.log(isUpperCase('ASDF 123 asd'))
console.log(isUpperCase('TEST 123 TEST'))
This will give th... | [
{
"code": null,
"e": 1155,
"s": 1062,
"text": "You can compare the string against itself in upper case to check if it is\nin the upper case."
},
{
"code": null,
"e": 1365,
"s": 1155,
"text": "function isUpperCase(str) {\n return str === str.toUpperCase();\n}\nconsole.log(isUppe... |
Divide large number represented as string in C++ Program | In this tutorial, we are going to learn how to divide a large number that is represented as a string.
We have given a large number in string format and a divisor. Our program should find a reminder.
First, we will find a part of the given number that is greater than the dividend. And then we will add the remaining digi... | [
{
"code": null,
"e": 1164,
"s": 1062,
"text": "In this tutorial, we are going to learn how to divide a large number that is represented as a string."
},
{
"code": null,
"e": 1261,
"s": 1164,
"text": "We have given a large number in string format and a divisor. Our program should ... |
Serious Software Development Using Jupyter Notebooks | by Dipam Vasani | Towards Data Science | The image below comes from the documentation page of a library called fastcore.
It has the source code hyperlinked so you can easily check the implementation, it has a small pargraph explaning what the function does and, it has tests so you can verify the behavior of the function.
Compare this to your regular Github re... | [
{
"code": null,
"e": 127,
"s": 47,
"text": "The image below comes from the documentation page of a library called fastcore."
},
{
"code": null,
"e": 329,
"s": 127,
"text": "It has the source code hyperlinked so you can easily check the implementation, it has a small pargraph expl... |
Perl | split() Function | 23 Jun, 2020
split() is a string function in Perl which is used to split or you can say to cut a string into smaller sections or pieces. There are different criteria to split a string, like on a single character, a regular expression(pattern), a group of characters or on undefined value etc.. The best thing about this ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Jun, 2020"
},
{
"code": null,
"e": 410,
"s": 28,
"text": "split() is a string function in Perl which is used to split or you can say to cut a string into smaller sections or pieces. There are different criteria to split a string, lik... |
Print the string after the specified character has occurred given no. of times | 16 Jun, 2022
Given a string, a character, and a count, the task is to print the string after the specified character has occurred count number of times. Print “Empty string” in case of any unsatisfying conditions. (Given character is not present, or present but less than given count, or given count completes on last in... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Jun, 2022"
},
{
"code": null,
"e": 463,
"s": 52,
"text": "Given a string, a character, and a count, the task is to print the string after the specified character has occurred count number of times. Print “Empty string” in case of an... |
Closest Palindrome Number (absolute difference Is min) | 14 Mar, 2022
Given a number N. our task is to find the closest Palindrome number whose absolute difference with given number is minimum and absolute difference must be greater than 0.
Examples:
Input : N = 121
Output : 131 or 111
Both having equal absolute difference
with the given number.
Input : N = 1234
Outp... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Mar, 2022"
},
{
"code": null,
"e": 224,
"s": 52,
"text": "Given a number N. our task is to find the closest Palindrome number whose absolute difference with given number is minimum and absolute difference must be greater than 0. "
... |
Tabulation vs Memoization | 30 Dec, 2021
Prerequisite – Dynamic Programming, How to solve Dynamic Programming problems? There are two different ways to store the values so that the values of a sub-problem can be reused. Here, will discuss two patterns of solving dynamic programming (DP) problems:
Tabulation: Bottom UpMemoization: Top Down
Tabul... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n30 Dec, 2021"
},
{
"code": null,
"e": 311,
"s": 52,
"text": "Prerequisite – Dynamic Programming, How to solve Dynamic Programming problems? There are two different ways to store the values so that the values of a sub-problem can be reu... |
Python Program to Efficiently compute sums of diagonals of a matrix | 31 May, 2022
Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix.
A00 A01 A02 A03
A10 A11 A12 A13
A20 A21 A22 A23
A30 A31 A32 A33
The primary diagonal is formed by the elements A00, A11, A22, A33.
Condition for Principal Diag... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n31 May, 2022"
},
{
"code": null,
"e": 174,
"s": 28,
"text": "Given a 2D square matrix, find the sum of elements in Principal and Secondary diagonals. For example, consider the following 4 X 4 input matrix. "
},
{
"code": null,
... |
How to Build Age Calculator in Android Studio? | 22 Dec, 2021
Hello geeks, today we are going to make an application to calculate Age or time period between two dates. By making this application one can calculate his/her exact age, also one can calculate the exact difference between two dates.
Prerequisites:
Before making this application, you can go through the arti... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Dec, 2021"
},
{
"code": null,
"e": 261,
"s": 28,
"text": "Hello geeks, today we are going to make an application to calculate Age or time period between two dates. By making this application one can calculate his/her exact age, also ... |
Explain Encapsulation in PHP. | Object Oriented Programming is a software approach added to PHP5, which helps in building the composite application in an easy way. Some of the OOP concepts added into the PHP5 are an abstraction, interface, static method, and static class, etc...
In this article, we will learn Encapsulation and it's implementation thr... | [
{
"code": null,
"e": 1435,
"s": 1187,
"text": "Object Oriented Programming is a software approach added to PHP5, which helps in building the composite application in an easy way. Some of the OOP concepts added into the PHP5 are an abstraction, interface, static method, and static class, etc..."
},... |
Symfony - Working Example | In this chapter, we will learn how to create a complete MVC based BookStore Application in Symfony Framework. Following are the steps.
Let’s create a new project named “BookStore” in Symfony using the following command.
symfony new BookStore
Create a BooksController in “src/AppBundle/Controller” directory. It is defin... | [
{
"code": null,
"e": 2472,
"s": 2337,
"text": "In this chapter, we will learn how to create a complete MVC based BookStore Application in Symfony Framework. Following are the steps."
},
{
"code": null,
"e": 2557,
"s": 2472,
"text": "Let’s create a new project named “BookStore” in... |
Internal working of Set/HashSet in Java | 11 Dec, 2018
As we know that a set is a well-defined collection of distinct objects. Each member of a set is called an element of the set. So in other words, we can say that a set will never contain duplicate elements. But how in java Set interface implemented classes like HashSet, LinkedHashSet, TreeSet etc. achieve t... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 446,
"s": 52,
"text": "As we know that a set is a well-defined collection of distinct objects. Each member of a set is called an element of the set. So in other words, we can say that a set will ne... |
PHP | floatval() Function | 25 Jun, 2018
The floatval() function is an inbuilt function in PHP which returns the float value of a variable.
Syntax:
float floatval ( $var )
Parameters: This function accepts one parameter which is mandatory and described below:
$var: The variable whose corresponding float value will be returned. This variable shou... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Jun, 2018"
},
{
"code": null,
"e": 127,
"s": 28,
"text": "The floatval() function is an inbuilt function in PHP which returns the float value of a variable."
},
{
"code": null,
"e": 135,
"s": 127,
"text": "Syntax:... |
Python | numpy.fill_diagonal() method | 27 Sep, 2019
With the help of numpy.fill_diagonal() method, we can get filled the diagonals of numpy array with the value passed as the parameter in numpy.fill_diagonal() method.
Syntax : numpy.fill_diagonal(array, value)Return : Return the filled value in the diagonal of an array.
Example #1 :In this example we can se... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Sep, 2019"
},
{
"code": null,
"e": 194,
"s": 28,
"text": "With the help of numpy.fill_diagonal() method, we can get filled the diagonals of numpy array with the value passed as the parameter in numpy.fill_diagonal() method."
},
{... |
VB.Net - CheckBox Control | The CheckBox control allows the user to set true/false or yes/no type options. The user can select or deselect it. When a check box is selected it has the value True, and when it is cleared, it holds the value False.
Let's create two check boxes by dragging CheckBox controls from the Toolbox and dropping on the form.
T... | [
{
"code": null,
"e": 2651,
"s": 2434,
"text": "The CheckBox control allows the user to set true/false or yes/no type options. The user can select or deselect it. When a check box is selected it has the value True, and when it is cleared, it holds the value False."
},
{
"code": null,
"e":... |
Delete Contents From Table Using JDBC | 24 Nov, 2020
JDBC(Java Database Connectivity) is a standard API(application interface) between the java programming language and various databases like Oracle, SQL, PostgreSQL, etc. It connects the front end(for interacting with the users) with the backend(for storing data).
Approach:
1. CREATE DATABASE: Create a datab... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2020"
},
{
"code": null,
"e": 291,
"s": 28,
"text": "JDBC(Java Database Connectivity) is a standard API(application interface) between the java programming language and various databases like Oracle, SQL, PostgreSQL, etc. It con... |
Extract and print words separately from a given Camel Case string | 26 Jun, 2020
Given a string in Camel Case format, we need to extract all the words which are present in the string.
CamelCase is the sequence of one or more than one words having the following properties:
It is a concatenation of one or more words consisting of English letters.All letters in the first word are lowercas... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Jun, 2020"
},
{
"code": null,
"e": 131,
"s": 28,
"text": "Given a string in Camel Case format, we need to extract all the words which are present in the string."
},
{
"code": null,
"e": 220,
"s": 131,
"text": "Cam... |
Python – Pair lists elements to Dictionary | 22 Oct, 2021
Sometimes, while working with records we can have problem in which we can have pair of lists, we need to pair similar like elements to single key value dictionary. This is very peculiar problem but can have applications in data domains. Lets discuss certain ways in which this task can be performed.
Method ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Oct, 2021"
},
{
"code": null,
"e": 328,
"s": 28,
"text": "Sometimes, while working with records we can have problem in which we can have pair of lists, we need to pair similar like elements to single key value dictionary. This is ver... |
How to create proxy server on Heroku in Node.js ? | 11 May, 2022
The following approach covers how to create a proxy server on Heroku using NodeJS. Heroku is a cloud application platform that is used as PaaS (Platform as a service) to build, operate and run applications on their cloud.
Prerequisites: To create a proxy server, you will need the following to be installed ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n11 May, 2022"
},
{
"code": null,
"e": 274,
"s": 52,
"text": "The following approach covers how to create a proxy server on Heroku using NodeJS. Heroku is a cloud application platform that is used as PaaS (Platform as a service) to buil... |
How to Use for Each Loop in Excel VBA? | 29 Jul, 2021
A For Each loop is used to execute a statement or a set of statements for each element in an array or collection.
Syntax:
For Each element In group
[ statements ]
[ Exit For ]
[ statements ]
Next [ element ]
The For...Each...Next statement syntax has the following three parts:
There are 4 basic steps to wr... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Jul, 2021"
},
{
"code": null,
"e": 142,
"s": 28,
"text": "A For Each loop is used to execute a statement or a set of statements for each element in an array or collection."
},
{
"code": null,
"e": 150,
"s": 142,
"... |
StringIO Module in Python | 15 Sep, 2021
The StringIO module is an in-memory file-like object. This object can be used as input or output to the most function that would expect a standard file object. When the StringIO object is created it is initialized by passing a string to the constructor. If no string is passed the StringIO will start empty.... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Sep, 2021"
},
{
"code": null,
"e": 398,
"s": 28,
"text": "The StringIO module is an in-memory file-like object. This object can be used as input or output to the most function that would expect a standard file object. When the String... |
Kahan Summation Algorithm | 23 Dec, 2021
Prerequisites: Rounding off errors, Introduction to the floating-point representationKahan summation algorithm, also known as compensated summation and summation with the carry algorithm, is used to minimize the loss of significance in the total result obtained by adding a sequence of finite-precision floa... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Dec, 2021"
},
{
"code": null,
"e": 453,
"s": 28,
"text": "Prerequisites: Rounding off errors, Introduction to the floating-point representationKahan summation algorithm, also known as compensated summation and summation with the carr... |
Understanding “static” in “public static void main” in Java | 28 Oct, 2020
Following points explain what is “static” in the main() method:
main() method: The main() method, in Java, is the entry point for the JVM(Java Virtual Machine) into the java program. JVM launches the java program by invoking the main() method.
Static is a keyword. The role of adding static before any e... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n28 Oct, 2020"
},
{
"code": null,
"e": 118,
"s": 52,
"text": "Following points explain what is “static” in the main() method: "
},
{
"code": null,
"e": 300,
"s": 118,
"text": "main() method: The main() method, in Ja... |
Swift – Convert String to Int Swift | 07 Jan, 2022
Swift provides a number of ways to convert a string value into an integer value. Though, we can convert a numeric string only into an integer value. In this article, we will see the two most common methods used to convert a string to an integer value. A string is a collection of characters. Swift provides ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jan, 2022"
},
{
"code": null,
"e": 537,
"s": 52,
"text": "Swift provides a number of ways to convert a string value into an integer value. Though, we can convert a numeric string only into an integer value. In this article, we will ... |
How to check an element with ng-if is visible on DOM ? | 23 Sep, 2021
ng-if directive: The ng-if directive in AngularJS is used to remove or recreate a portion of the HTML element based on an expression. If the expression inside it is false then the element is removed and if it is true then the element is added to the DOM.
Syntax:
<element ng-if="expression"> Contents... </e... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n23 Sep, 2021"
},
{
"code": null,
"e": 283,
"s": 28,
"text": "ng-if directive: The ng-if directive in AngularJS is used to remove or recreate a portion of the HTML element based on an expression. If the expression inside it is false then... |
Manacher’s Algorithm – Linear Time Longest Palindromic Substring – Part 3 | 24 Jun, 2022
In Manacher’s Algorithm Part 1 and Part 2, we gone through some of the basics, understood LPS length array and how to calculate it efficiently based on four cases. Here we will implement the same.We have seen that there are no new character comparison needed in case 1 and case 2. In case 3 and case 4, nece... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n24 Jun, 2022"
},
{
"code": null,
"e": 416,
"s": 54,
"text": "In Manacher’s Algorithm Part 1 and Part 2, we gone through some of the basics, understood LPS length array and how to calculate it efficiently based on four cases. Here we wi... |
Counting number of unique values in a Python list | 29 Aug, 2020
Let us see how to count the number of unique values in a Python list.Examples :
Input : 10 20 10 30 40 40
Output : 2
Explanation : Only 2 elements, 20 and 30 are unique in the list.
Input : 'geeks' 'for' 'geeks'
Output : 1
Approach 1 : Traversing the list and counting the frequrency of each element using... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 108,
"s": 28,
"text": "Let us see how to count the number of unique values in a Python list.Examples :"
},
{
"code": null,
"e": 253,
"s": 108,
"text": "Input : 10 20 10 30 40 40\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.