title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Operating Systems | Set 10 | 13 Apr, 2018
Following questions have been asked in GATE 2008 CS exam.
1) The data blocks of a very large file in the Unix file system are allocated using(A) contiguous allocation(B) linked allocation(C) indexed allocation(D) an extension of indexed allocation
Answer (D)The Unix file system uses an extension of indexed... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n13 Apr, 2018"
},
{
"code": null,
"e": 112,
"s": 54,
"text": "Following questions have been asked in GATE 2008 CS exam."
},
{
"code": null,
"e": 302,
"s": 112,
"text": "1) The data blocks of a very large file in the ... |
PageView Widget in Flutter | 29 Nov, 2020
The PageView widget allows the user to transition between different screens in their flutter application. All you need to set it up are a PageViewController and a PageView.
Syntax:
PageView({Key key,
Axis scrollDirection,
bool reverse,
PageController controller,
ScrollPhysics physics,
bool pageSnappin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n29 Nov, 2020"
},
{
"code": null,
"e": 227,
"s": 54,
"text": "The PageView widget allows the user to transition between different screens in their flutter application. All you need to set it up are a PageViewController and a PageView."
... |
Swift Programming Language | 20 Oct, 2021
Swift is a general-purpose, multi-paradigm, object-oriented, functional, imperative and block-structured language. Swift is the result of the latest research on programming languages and is built using a modern approach to safety, software design patterns by Apple Inc. for iOS applications, macOS applicati... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n20 Oct, 2021"
},
{
"code": null,
"e": 741,
"s": 53,
"text": "Swift is a general-purpose, multi-paradigm, object-oriented, functional, imperative and block-structured language. Swift is the result of the latest research on programming l... |
p5.js | rotate() function | 22 Apr, 2019
The rotate() function in p5.js is used to rotate a shape or the object using p5.js to a specified axis over a specified angle.
Syntax:
rotate(angle, [axis])
Parameters: The function accepts single parameter as mentioned above and described below:
angle: The angle of rotation which specified in radians or ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Apr, 2019"
},
{
"code": null,
"e": 155,
"s": 28,
"text": "The rotate() function in p5.js is used to rotate a shape or the object using p5.js to a specified axis over a specified angle."
},
{
"code": null,
"e": 163,
"s... |
Map put() Method in Java with Examples | 02 Jan, 2019
This method is used to associate the specified value with the specified key in this map.
Syntax:
V put(K key,
V value)
Parameters: This method has two arguments, key and value where key is the left argument and value is the corresponding value of the key in the map.
Returns: This method returns returns... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n02 Jan, 2019"
},
{
"code": null,
"e": 142,
"s": 53,
"text": "This method is used to associate the specified value with the specified key in this map."
},
{
"code": null,
"e": 150,
"s": 142,
"text": "Syntax:"
},
... |
GATE | GATE-CS-2017 (Set 2) | Question 60 | 28 Jun, 2021
In a B+ tree, if the search-key value is 8 bytes long, the block size is 512 bytes and the block pointer is 2 bytes, then the maximum order of the B+ tree is ____.
Note: This question appeared as Numerical Answer Type.(A) 51(B) 52(C) 53(D) 54Answer: (B)Explanation:
Order of a B+ tree node is maximum number... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 192,
"s": 28,
"text": "In a B+ tree, if the search-key value is 8 bytes long, the block size is 512 bytes and the block pointer is 2 bytes, then the maximum order of the B+ tree is ____."
},
{
... |
Explain BCNF with an example in DBMS | BCNF (Boyce Codd Normal Form) is the advanced version of 3NF. A table is in BCNF if every functional dependency X->Y, X is the super key of the table. For BCNF, the table should be in 3NF, and for every FD. LHS is super key.
Consider a relation R with attributes (student, subject, teacher).
F: { (student, Teacher) -> s... | [
{
"code": null,
"e": 1412,
"s": 1187,
"text": "BCNF (Boyce Codd Normal Form) is the advanced version of 3NF. A table is in BCNF if every functional dependency X->Y, X is the super key of the table. For BCNF, the table should be in 3NF, and for every FD. LHS is super key."
},
{
"code": null,
... |
JSON - Quick Guide | JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc.
JSON stands for JavaScript Object Notation.
JSON stands for JavaScript Object Notation.
The format ... | [
{
"code": null,
"e": 2135,
"s": 1914,
"text": "JSON or JavaScript Object Notation is a lightweight text-based open standard designed for human-readable data interchange. Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc."
},
{
"code": null,
... |
HTTP Cookies in Node.js | 19 Feb, 2019
Cookies are small data that are stored on a client side and sent to the client along with server requests. Cookies have various functionality, they can be used for maintaining sessions and adding user-specific features in your web app. For this, we will use cookie-parser module of npm which provides middle... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n19 Feb, 2019"
},
{
"code": null,
"e": 496,
"s": 53,
"text": "Cookies are small data that are stored on a client side and sent to the client along with server requests. Cookies have various functionality, they can be used for maintainin... |
Composite Key in SQL | 26 Apr, 2021
To know what a composite key is we need to have the knowledge of what a primary key is, a primary key is a column that has a unique and not null value in an SQL table.
Now a composite key is also a primary key, but the difference is that it is made by the combination of more than one column to identify th... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 197,
"s": 28,
"text": "To know what a composite key is we need to have the knowledge of what a primary key is, a primary key is a column that has a unique and not null value in an SQL table. "
},
... |
Create a Search Bar using HTML and CSS | 18 May, 2022
To create a search bar in the navigation bar is easy, just like creating another option in the navbar that will search the database. You need to be careful about the timing of placing the search bar. Make sure separately placed in the navbar. To create a navbar containing a search bar you will need HTML an... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 May, 2022"
},
{
"code": null,
"e": 635,
"s": 52,
"text": "To create a search bar in the navigation bar is easy, just like creating another option in the navbar that will search the database. You need to be careful about the timing o... |
std::lcm in C++17 | 24 Jul, 2017
Competitive programming often involves computation of Least Common Multiple (LCM) of two numbers. One way of doing that is using boost::math::lcm(), which we discussed in the post – Inbuilt function for calculating LCM in C++ .But, recently, C++ in its latest version C++17 has also included another in-buil... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n24 Jul, 2017"
},
{
"code": null,
"e": 456,
"s": 52,
"text": "Competitive programming often involves computation of Least Common Multiple (LCM) of two numbers. One way of doing that is using boost::math::lcm(), which we discussed in the... |
JavaScript ReferenceError – Invalid assignment left-hand side | 24 Jul, 2020
Basic Example of ReferenceError – Invalid assignment left-hand side, run the code and check the console
Example:
Javascript
<script> if (Math.PI = 10 || Math.PI = 5) { document.write("Inside Loop"); }</script>
Output:
ReferenceError: Invalid left-hand side in assignment
This JavaScript except... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jul, 2020"
},
{
"code": null,
"e": 132,
"s": 28,
"text": "Basic Example of ReferenceError – Invalid assignment left-hand side, run the code and check the console"
},
{
"code": null,
"e": 141,
"s": 132,
"text": "Ex... |
SDL library in C/C++ with examples | 15 Feb, 2022
SDL is Simple DirectMedia Layer.It is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.It can be used to make animations and video games.
It basically provides a set of APIs to interact with variou... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Feb, 2022"
},
{
"code": null,
"e": 300,
"s": 52,
"text": "SDL is Simple DirectMedia Layer.It is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via... |
Java | Converting an Image into Grayscale using cvtColor() | 04 Nov, 2019
To convert a color image to Grayscale image using OpenCV, we read the image into BufferedImage and convert it into Mat Object.
Syntax:
File input = new File("digital_image_processing.jpg");
BufferedImage image = ImageIO.read(input);
To transform the image from RGB to Grayscale format by using method cvtCo... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n04 Nov, 2019"
},
{
"code": null,
"e": 181,
"s": 54,
"text": "To convert a color image to Grayscale image using OpenCV, we read the image into BufferedImage and convert it into Mat Object."
},
{
"code": null,
"e": 288,
"... |
How to Convert Wide Dataframe to Tidy Dataframe with Pandas stack()? | 26 Nov, 2020
We might sometimes need a tidy/long-form of data for data analysis. So, in python’s library Pandas there are a few ways to reshape a dataframe which is in wide form into a dataframe in long/tidy form. Here, we will discuss converting data from a wide form into a long-form using the pandas function stack().... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n26 Nov, 2020"
},
{
"code": null,
"e": 648,
"s": 28,
"text": "We might sometimes need a tidy/long-form of data for data analysis. So, in python’s library Pandas there are a few ways to reshape a dataframe which is in wide form into a dat... |
Python – Decrement Dictionary value by K | 17 Dec, 2019
Sometimes, while working with dictionaries, we can have a use-case in which we require to decrement a particular key’s value by K in dictionary. It may seem a quite straight forward problem, but catch comes when the existence of a key is not known, hence becomes a 2 step process at times. Let’s discuss cer... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Dec, 2019"
},
{
"code": null,
"e": 382,
"s": 28,
"text": "Sometimes, while working with dictionaries, we can have a use-case in which we require to decrement a particular key’s value by K in dictionary. It may seem a quite straight f... |
vector::push_back() and vector::pop_back() in C++ STL | 06 Jul, 2022
Vectors are same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by the container.
push_back() function is used to push elements into a vector from the back. The new value is inserted into the vector at... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 240,
"s": 52,
"text": "Vectors are same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled automatically by t... |
How to Sort Hashtable in Java? | 04 Jan, 2021
Given a Hashtable, the task is to sort this Hashtable. Hashtable is a data structure that stores data in key-value format. The stored data is neither in sorted order nor preserves the insertion order.
Example
Java
import java.io.*;import java.util.*; public class SortHashtable { public static void mai... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n04 Jan, 2021"
},
{
"code": null,
"e": 230,
"s": 28,
"text": "Given a Hashtable, the task is to sort this Hashtable. Hashtable is a data structure that stores data in key-value format. The stored data is neither in sorted order nor prese... |
Python | Pandas Series.select() | 07 Feb, 2019
Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based indexing and provides a host of methods for performing operations involving the index.
Pandas Series.select() function return data corres... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Feb, 2019"
},
{
"code": null,
"e": 285,
"s": 28,
"text": "Pandas series is a One-dimensional ndarray with axis labels. The labels need not be unique but must be a hashable type. The object supports both integer- and label-based index... |
Counting the number of groups Java regular expression | You can treat multiple characters as a single unit by capturing them as groups. You just need to place these characters inside a set of parentheses.
You can count the number of groups in the current match using the groupCount() method of the Matcher class. This method calculates the number of capturing groups in the cu... | [
{
"code": null,
"e": 1211,
"s": 1062,
"text": "You can treat multiple characters as a single unit by capturing them as groups. You just need to place these characters inside a set of parentheses."
},
{
"code": null,
"e": 1410,
"s": 1211,
"text": "You can count the number of group... |
Sets in C# | Sets in C# is a HashSet. HashSet in C# eliminates duplicate strings or elements in an array. In C#, it is an optimized set collection
To declare HashSet −
var h = new HashSet<string>(arr1);
Above, we have set the already declared array arr1 in the HashSet.
Now set it on the array to remove the duplicate words −
string[... | [
{
"code": null,
"e": 1196,
"s": 1062,
"text": "Sets in C# is a HashSet. HashSet in C# eliminates duplicate strings or elements in an array. In C#, it is an optimized set collection"
},
{
"code": null,
"e": 1217,
"s": 1196,
"text": "To declare HashSet −"
},
{
"code": null,... |
Default Arguments in C++ | In this tutorial, we will be discussing a program to understand default arguments in C++.
Default arguments are those which are provided to the called function in case the caller statement does provide any value for them.
Live Demo
#include<iostream>
using namespace std;
//function defined with default arguments
int s... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "In this tutorial, we will be discussing a program to understand default arguments in C++."
},
{
"code": null,
"e": 1284,
"s": 1152,
"text": "Default arguments are those which are provided to the called function in case the caller sta... |
Count Number of Cars in Less Than 10 Lines of Code Using Python | by Sabina Pokhrel | Towards Data Science | When travelling in a car as a kid, did you ever play a game where you counted the number of cars that passed by?
That used to be my favourite game as a kid.
In this post, I will teach you how to build your own car counter program in just 10 lines of code using Python.
You will need to install the following python libra... | [
{
"code": null,
"e": 285,
"s": 172,
"text": "When travelling in a car as a kid, did you ever play a game where you counted the number of cars that passed by?"
},
{
"code": null,
"e": 329,
"s": 285,
"text": "That used to be my favourite game as a kid."
},
{
"code": null,
... |
Modular multiplicative inverse in java | The java.math.BigInteger.modInverse(BigInteger m) returns a BigInteger whose value is (this-1 mod m). Using this method you can calculate Modular multiplicative inverse for a given number.
Live Demo
import java.math.*;
public class BigIntegerDemo {
public static void main(String[] args) {
// create 3 BigIntege... | [
{
"code": null,
"e": 1251,
"s": 1062,
"text": "The java.math.BigInteger.modInverse(BigInteger m) returns a BigInteger whose value is (this-1 mod m). Using this method you can calculate Modular multiplicative inverse for a given number."
},
{
"code": null,
"e": 1261,
"s": 1251,
"t... |
Spring MVC Tiles Example | Spring With Tiles Example Online Tutorialspoint | PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
JAVAEXCEPTIONSCOLLECTIONSSWINGJDBC
EXCEPTIONS
COLLECTIONS
SWING
JDBC
JAVA 8
SPRING
SPRING BOOT
HIBERNATE
PYTHON
PHP
JQUERY
PROGRAMMINGJava ExamplesC Examples
Java Examples
C Examples
C Tutorials
aws
In this tutorials, I am going to show you how... | [
{
"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,
... |
for_each loop in C++ - GeeksforGeeks | 12 Jul, 2021
Apart from the generic looping techniques, such as “for, while and do-while”, C++ in its language also allows us to use another functionality which solves the same purpose termed “for-each” loops. This loop accepts a function which executes over each of the container elements. This loop is defined in the h... | [
{
"code": null,
"e": 24238,
"s": 24210,
"text": "\n12 Jul, 2021"
},
{
"code": null,
"e": 24658,
"s": 24238,
"text": "Apart from the generic looping techniques, such as “for, while and do-while”, C++ in its language also allows us to use another functionality which solves the same... |
Data analysis and visualization in Python | Towards Data Science | Many a time, I have seen beginners in data science skip exploratory data analysis (EDA) and jump straight into building a hypothesis function or model. In my opinion, this should not be the case. We should first perform an EDA as it will connect us with the dataset at an emotional level and yes, of course, will help in... | [
{
"code": null,
"e": 528,
"s": 172,
"text": "Many a time, I have seen beginners in data science skip exploratory data analysis (EDA) and jump straight into building a hypothesis function or model. In my opinion, this should not be the case. We should first perform an EDA as it will connect us with t... |
Keras custom data generators example with MNIST Dataset | by Pedro F. Rodenas | Towards Data Science | Often, in real world problems the dataset used to train our models take up much more memory than we have in RAM. The problem is that we cannot load the entire dataset into memory and use the standard keras fit method in order to train our model.
One approach to tackle this problem involves loading into memory only one ... | [
{
"code": null,
"e": 418,
"s": 172,
"text": "Often, in real world problems the dataset used to train our models take up much more memory than we have in RAM. The problem is that we cannot load the entire dataset into memory and use the standard keras fit method in order to train our model."
},
{... |
How to get userAgent information in Selenium Web driver? | We can get the user Agent information with Selenium webdriver. This is done with the help of the JavaScript Executor. Selenium executes JavaScript commands with the help of the execute_script method.
To obtain the user Agent information, we have to pass the return navigator.userAgent parameter to the execute_script met... | [
{
"code": null,
"e": 1262,
"s": 1062,
"text": "We can get the user Agent information with Selenium webdriver. This is done with the help of the JavaScript Executor. Selenium executes JavaScript commands with the help of the execute_script method."
},
{
"code": null,
"e": 1455,
"s": 1... |
AI Teaches itself to play a game. Simple game using Pygame and applied... | by Sanjay.M | Towards Data Science | This post is all about teaching AI how to play a simple game which I built using pygame library. The game is, the ball should keep on rolling through the gap between the pipes, if the ball hits any of the pipe then we lose. As and when a ball successfully passes through the gap between the pipes, the score will be incr... | [
{
"code": null,
"e": 503,
"s": 171,
"text": "This post is all about teaching AI how to play a simple game which I built using pygame library. The game is, the ball should keep on rolling through the gap between the pipes, if the ball hits any of the pipe then we lose. As and when a ball successfully... |
Plotting Graphs using Two Dimensional List in R Programming - GeeksforGeeks | 01 Jun, 2020
List is a type of an object in R programming. Lists can contain heterogeneous elements like strings, numeric, matrices, or even lists. A list is a generic vector containing other objects. Two-dimensional list can be created in R programming by creating more lists in a list or simply, we can say nested list... | [
{
"code": null,
"e": 24513,
"s": 24485,
"text": "\n01 Jun, 2020"
},
{
"code": null,
"e": 24981,
"s": 24513,
"text": "List is a type of an object in R programming. Lists can contain heterogeneous elements like strings, numeric, matrices, or even lists. A list is a generic vector c... |
PostgreSQL - PHP Interface | The PostgreSQL extension is enabled by default in the latest releases of PHP 5.3.x. It is possible to disable it by using --without-pgsql at compile time. Still you can use yum command to install PHP -PostgreSQL interface −
yum install php-pgsql
Before you start using the PHP PostgreSQL interface, find the pg_hba.conf ... | [
{
"code": null,
"e": 3049,
"s": 2825,
"text": "The PostgreSQL extension is enabled by default in the latest releases of PHP 5.3.x. It is possible to disable it by using --without-pgsql at compile time. Still you can use yum command to install PHP -PostgreSQL interface −"
},
{
"code": null,
... |
Visualising high-dimensional datasets using PCA and t-SNE in Python | by Luuk Derksen | Towards Data Science | Update: April 29, 2019. Updated some of the code to not use ggplot but instead use seaborn and matplotlib. I also added an example for a 3d-plot. I also changed the syntax to work with Python3.
The first step around any data related challenge is to start by exploring the data itself. This could be by looking at, for ex... | [
{
"code": null,
"e": 366,
"s": 172,
"text": "Update: April 29, 2019. Updated some of the code to not use ggplot but instead use seaborn and matplotlib. I also added an example for a 3d-plot. I also changed the syntax to work with Python3."
},
{
"code": null,
"e": 594,
"s": 366,
"... |
Convert a Vector to an array in Java | A Vector can be converted into an Array using the java.util.Vector.toArray() method. This method requires no parameters and it returns an Array that contains all the elements of the Vector in the correct order.
A program that demonstrates this is given as follows −
Live Demo
import java.util.Vector;
public class Demo ... | [
{
"code": null,
"e": 1273,
"s": 1062,
"text": "A Vector can be converted into an Array using the java.util.Vector.toArray() method. This method requires no parameters and it returns an Array that contains all the elements of the Vector in the correct order."
},
{
"code": null,
"e": 1328,... |
Make Binary Tree From Linked List | Practice | GeeksforGeeks | Given a Linked List Representation of Complete Binary Tree. The task is to construct the Binary tree.
Note : The complete binary tree is represented as a linked list in a way where if root node is stored at position i, its left, and right children are stored at position 2*i+1, 2*i+2 respectively.
Example 1:
Input:
... | [
{
"code": null,
"e": 538,
"s": 238,
"text": "Given a Linked List Representation of Complete Binary Tree. The task is to construct the Binary tree.\nNote : The complete binary tree is represented as a linked list in a way where if root node is stored at position i, its left, and right children are st... |
Generation of large CSV data using Python Faker library. | by Krishna Parekh | Towards Data Science | To the learners out there, who need large amount of fake data to experiment different algorithm. Mammoth data is generated online each second in various domains but for learning and experimenting purpose, the original data can’t be used due to security and many other constraints. So here I am talking about huge amount ... | [
{
"code": null,
"e": 557,
"s": 171,
"text": "To the learners out there, who need large amount of fake data to experiment different algorithm. Mammoth data is generated online each second in various domains but for learning and experimenting purpose, the original data can’t be used due to security an... |
PyTorch [Tabular] —Multiclass Classification | by Akshaj Verma | Towards Data Science | We will use the wine dataset available on Kaggle. This dataset has 12 columns where the first 11 are the features and the last column is the target column. The data set has 1599 rows.
We’re using tqdm to enable progress bars for training and testing loops.
import numpy as npimport pandas as pdimport seaborn as snsfrom ... | [
{
"code": null,
"e": 356,
"s": 172,
"text": "We will use the wine dataset available on Kaggle. This dataset has 12 columns where the first 11 are the features and the last column is the target column. The data set has 1599 rows."
},
{
"code": null,
"e": 429,
"s": 356,
"text": "We... |
std::string::append vs std::string::push_back() vs Operator += in C++ | 14 Jul, 2022
To append characters, you can use operator +=, append(), and push_back(). All of them helps to append character but with a little difference in implementation and application.
Operator += : appends single-argument values. Time complexity : O(n)
append() : lets you specify the appended value by using multip... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n14 Jul, 2022"
},
{
"code": null,
"e": 228,
"s": 52,
"text": "To append characters, you can use operator +=, append(), and push_back(). All of them helps to append character but with a little difference in implementation and application... |
How to get Geolocation in Python? | 29 Dec, 2021
In this article, we will discuss on how to get Geolocation when you enter any location name and its gives all the useful information such as postal code, city, state, country etc. with the latitudes and the longitudes (the specific coordinates) and vice-versa in which we provide the coordinates to get the ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 374,
"s": 52,
"text": "In this article, we will discuss on how to get Geolocation when you enter any location name and its gives all the useful information such as postal code, city, state, country... |
Menu-Driven program using Switch-case in C | 16 Jul, 2019
Prerequisite : Switch Case in C
Problem Statement:Write a menu-driven program using Switch case to calculate the following:1. Area of circle2. Area of square3. Area of sphere
Also use functions input() and output() to input and display respective values.
// C program to illustrate// Menu-Driven program// u... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n16 Jul, 2019"
},
{
"code": null,
"e": 84,
"s": 52,
"text": "Prerequisite : Switch Case in C"
},
{
"code": null,
"e": 227,
"s": 84,
"text": "Problem Statement:Write a menu-driven program using Switch case to calculat... |
How to convert blob to base64 encoding using JavaScript ? | 02 Jun, 2020
Blob is a fundamental data type in JavaScript. Blob stands for Binary Large Object and it is a representation of bytes of data. Web browsers support the Blob data type for holding data. Blob is the underlying data structure for the File object and the FileReader API. Blob has a specific size and file type ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n02 Jun, 2020"
},
{
"code": null,
"e": 652,
"s": 28,
"text": "Blob is a fundamental data type in JavaScript. Blob stands for Binary Large Object and it is a representation of bytes of data. Web browsers support the Blob data type for hol... |
map find() function in C++ STL | 06 Jul, 2022
The map::find() is a built-in function in C++ STL which returns an iterator or a constant iterator that refers to the position where the key is present in the map. If the key is not present in the map container, it returns an iterator or a constant iterator which refers to map.end()
. Syntax:
iterator=map... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Jul, 2022"
},
{
"code": null,
"e": 336,
"s": 52,
"text": "The map::find() is a built-in function in C++ STL which returns an iterator or a constant iterator that refers to the position where the key is present in the map. If the key... |
Python: Update Nested Dictionary | 14 May, 2020
A Dictionary in Python works similar to the Dictionary in the real world. Keys of a Dictionary must be unique and of immutable data types such as Strings, Integers, and tuples, but the key-values can be repeated and be of any type.
Refer to the below article to get the idea about dictionaries:
Python Dicti... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n14 May, 2020"
},
{
"code": null,
"e": 260,
"s": 28,
"text": "A Dictionary in Python works similar to the Dictionary in the real world. Keys of a Dictionary must be unique and of immutable data types such as Strings, Integers, and tuples... |
Python Program To Find Longest Common Prefix Using Sorting | 10 Jan, 2022
Problem Statement: Given a set of strings, find the longest common prefix.Examples:
Input: {"geeksforgeeks", "geeks", "geek", "geezer"}
Output: "gee"
Input: {"apple", "ape", "april"}
Output: "ap"
The longest common prefix for an array of strings is the common prefix between 2 most dissimilar strings. ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n10 Jan, 2022"
},
{
"code": null,
"e": 114,
"s": 28,
"text": "Problem Statement: Given a set of strings, find the longest common prefix.Examples: "
},
{
"code": null,
"e": 227,
"s": 114,
"text": "Input: {\"geeksforge... |
How to send JSON response using Node.js ? | 15 Jun, 2022
NodeJS is the runtime environment, which can execute the javascript code on any platform. It is widely used to create and run web application servers because of its salient features. During production, several times we need to send the resources or some type of information as a response, and javascript obj... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Jun, 2022"
},
{
"code": null,
"e": 724,
"s": 28,
"text": "NodeJS is the runtime environment, which can execute the javascript code on any platform. It is widely used to create and run web application servers because of its salient fe... |
Python | Clustering, Connectivity and other Graph properties using Networkx | 09 Dec, 2021
Triadic Closure for a Graph is the tendency for nodes who has a common neighbour to have an edge between them. In case more edges are added in the Graph, these are the edges that tend to get formed. For example in the following Graph :
The edges that are most likely to be formed next are (B, F), (C, D), (... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n09 Dec, 2021"
},
{
"code": null,
"e": 265,
"s": 28,
"text": "Triadic Closure for a Graph is the tendency for nodes who has a common neighbour to have an edge between them. In case more edges are added in the Graph, these are the edges t... |
PHP | Data Types | 07 Jun, 2022
Data Types define the type of data a variable can store. PHP allows eight different types of data types. All of them are discussed below. There are pre-defined, user-defined, and special data types.
The predefined data types are:
Boolean
Integer
Double
String
The user-defined (compound) data types are:
Arr... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n07 Jun, 2022"
},
{
"code": null,
"e": 252,
"s": 53,
"text": "Data Types define the type of data a variable can store. PHP allows eight different types of data types. All of them are discussed below. There are pre-defined, user-defined,... |
FactSet Interview Experience | 02 Sep, 2020
First round: It was on Hackerrank. We were given 2 coding questions which were random for all. The questions that I got are as follows:
Purchasing Supplies: This question was similar to the chocolate wrapper problem. You can refer it here. Triplets: Given an array of n distinct integers, d=[d[0],d[1], ..... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n02 Sep, 2020"
},
{
"code": null,
"e": 191,
"s": 54,
"text": "First round: It was on Hackerrank. We were given 2 coding questions which were random for all. The questions that I got are as follows: "
},
{
"code": null,
"e": ... |
Visualizing Geospatial Data using Folium in Python | 30 Jun, 2021
One of the most important tasks for someone working on datasets with countries, cities, etc. is to understand the relationships between their data’s physical location and their geographical context. And one such way to visualize the data is using Folium.
Folium is a powerful data visualization library in ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Jun, 2021"
},
{
"code": null,
"e": 284,
"s": 28,
"text": "One of the most important tasks for someone working on datasets with countries, cities, etc. is to understand the relationships between their data’s physical location and thei... |
Java String contentEquals() Method | ❮ String Methods
Find out if a string contains a sequence of characters:
String myStr = "Hello";
System.out.println(myStr.contentEquals("Hello")); // true
System.out.println(myStr.contentEquals("e")); // false
System.out.println(myStr.contentEquals("Hi")); // false
Try it Yourself »
The contentEquals() met... | [
{
"code": null,
"e": 19,
"s": 0,
"text": "\n❮ String Methods\n"
},
{
"code": null,
"e": 75,
"s": 19,
"text": "Find out if a string contains a sequence of characters:"
},
{
"code": null,
"e": 278,
"s": 75,
"text": "String myStr = \"Hello\";\nSystem.out.println(... |
Demand Forecasting using FB-Prophet | by Ritvik Dhupkar | Towards Data Science | Forecasting future demand is a fundamental business problem and any solution that is successful in tackling this will find valuable commercial applications in diverse business segments. In the retail context, Demand Forecasting methods are implemented to make decisions regarding buying, provisioning, replenishment, and... | [
{
"code": null,
"e": 890,
"s": 172,
"text": "Forecasting future demand is a fundamental business problem and any solution that is successful in tackling this will find valuable commercial applications in diverse business segments. In the retail context, Demand Forecasting methods are implemented to ... |
Maximum difference between node and its ancestor | Practice | GeeksforGeeks | Given a Binary Tree, you need to find the maximum value which you can get by subtracting the value of node B from the value of node A, where A and B are two nodes of the binary tree and A is an ancestor of B.
Example 1:
Input:
5
/ \
2 1
Output: 4
Explanation:The maximum difference we can
get is 4, which i... | [
{
"code": null,
"e": 448,
"s": 238,
"text": "Given a Binary Tree, you need to find the maximum value which you can get by subtracting the value of node B from the value of node A, where A and B are two nodes of the binary tree and A is an ancestor of B. "
},
{
"code": null,
"e": 459,
... |
PHP if...else...elseif Statements | Conditional statements are used to perform different actions based on different conditions.
Very often when you write code, you want to perform different actions for
different conditions. You can use conditional statements in your code to do this.
In PHP we have the following conditional statements:
if statement - exe... | [
{
"code": null,
"e": 92,
"s": 0,
"text": "Conditional statements are used to perform different actions based on different conditions."
},
{
"code": null,
"e": 249,
"s": 92,
"text": "Very often when you write code, you want to perform different actions for \ndifferent conditions. ... |
MySQL - SHOW DATABASES Statement | After establishing connection with MySQL, to manipulate data in it you need to connect to a database. You can connect to an existing database or, create your own. You can create any database using the MySQL CREATE DATABASE statement.
The SHOW DATABASES Statement of MySQL lists out all the existing databases.
Following ... | [
{
"code": null,
"e": 2567,
"s": 2333,
"text": "After establishing connection with MySQL, to manipulate data in it you need to connect to a database. You can connect to an existing database or, create your own. You can create any database using the MySQL CREATE DATABASE statement."
},
{
"code... |
Python Program to Check if Two Strings are Anagram - GeeksforGeeks | 17 Feb, 2022
Question:
Given two strings s1 and s2, check if both the strings are anagrams of each other.Examples:
Input : s1 = "listen"
s2 = "silent"
Output : The strings are anagrams.
Input : s1 = "dad"
s2 = "bad"
Output : The strings aren't anagrams.
Python provides a inbuilt function sorted() whi... | [
{
"code": null,
"e": 24312,
"s": 24284,
"text": "\n17 Feb, 2022"
},
{
"code": null,
"e": 24322,
"s": 24312,
"text": "Question:"
},
{
"code": null,
"e": 24415,
"s": 24322,
"text": "Given two strings s1 and s2, check if both the strings are anagrams of each othe... |
Determinant of a Matrix - GeeksforGeeks | 07 Apr, 2022
What is Determinant of a Matrix? Determinant of a Matrix is a special number that is defined only for square matrices (matrices which have same number of rows and columns). Determinant is used at many places in calculus and other matrix related algebra, it actually represents the matrix in term of a real n... | [
{
"code": null,
"e": 24852,
"s": 24824,
"text": "\n07 Apr, 2022"
},
{
"code": null,
"e": 25257,
"s": 24852,
"text": "What is Determinant of a Matrix? Determinant of a Matrix is a special number that is defined only for square matrices (matrices which have same number of rows and ... |
Print 1 To N Without Loop | Practice | GeeksforGeeks | Print numbers from 1 to N without the help of loops.
Example 1:
Input:
N = 10
Output: 1 2 3 4 5 6 7 8 9 10
Example 2:
Input:
N = 5
Output: 1 2 3 4 5
Your Task:
This is a function problem. You only need to complete the function printNos() that takes N as parameter and prints number from 1 to N recursively. Don't pri... | [
{
"code": null,
"e": 343,
"s": 290,
"text": "Print numbers from 1 to N without the help of loops."
},
{
"code": null,
"e": 354,
"s": 343,
"text": "Example 1:"
},
{
"code": null,
"e": 398,
"s": 354,
"text": "Input:\nN = 10\nOutput: 1 2 3 4 5 6 7 8 9 10\n"
},
... |
10 Smooth Python Tricks For Python Gods | by Emmett Boudreau | Towards Data Science | Although on the surface Python might appear to be a language of simplicity that anyone can learn, and it is, many might be surprised to know just how much mastery one can obtain in the language. Python is one of those things that is rather easy learn, but can be difficult to master. In Python, there are often multiple ... | [
{
"code": null,
"e": 662,
"s": 171,
"text": "Although on the surface Python might appear to be a language of simplicity that anyone can learn, and it is, many might be surprised to know just how much mastery one can obtain in the language. Python is one of those things that is rather easy learn, but... |
YACC program which accept strings that starts and ends with 0 or 1 | 06 May, 2019
Problem: Write a YACC program which accept strings that starts and ends with Zero or One
Explanation:YACC (Yet another Compiler-Compiler) is the standard parser generator for the Unix operating system. An open source program, yacc generates code for the parser in the C programming language. The acronym is ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n06 May, 2019"
},
{
"code": null,
"e": 117,
"s": 28,
"text": "Problem: Write a YACC program which accept strings that starts and ends with Zero or One"
},
{
"code": null,
"e": 407,
"s": 117,
"text": "Explanation:YACC ... |
Implementing Rich getting Richer phenomenon using Barabasi Albert Model in Python | 01 Oct, 2020
Prerequisite- Introduction to Social Networks, Barabasi Albert Graph
In social networks, there is a phenomenon called Rich getting Richer also known as Preferential Attachment. In Preferential Attachment, a person who is already rich gets more and more and a person who is having less gets less. This is cal... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n01 Oct, 2020"
},
{
"code": null,
"e": 97,
"s": 28,
"text": "Prerequisite- Introduction to Social Networks, Barabasi Albert Graph"
},
{
"code": null,
"e": 401,
"s": 97,
"text": "In social networks, there is a phenomen... |
D3.js | color.opacity | 12 Jul, 2019
The color.opacity in D3.js is used to fade the color. The opacity value is in the range of [0, 1].
Syntax:
color.opacity
Parameters: This function does not accept any parameters.
Return Value: This function returns the opacity value of the specified color.
Below program illustrate the color.opacity functio... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n12 Jul, 2019"
},
{
"code": null,
"e": 127,
"s": 28,
"text": "The color.opacity in D3.js is used to fade the color. The opacity value is in the range of [0, 1]."
},
{
"code": null,
"e": 135,
"s": 127,
"text": "Syntax:... |
What is the valid range of a Class A network address? | 05 Jul, 2022
Let us know what an IP address is first, if you already know, skip this section.
IP (Internet Protocol): It is one of the fundamental protocols inorder to have communications on the Internet. IP describes how the information is addressed, routed by networking devices. An IP address is a number identifying... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 110,
"s": 28,
"text": "Let us know what an IP address is first, if you already know, skip this section. "
},
{
"code": null,
"e": 428,
"s": 110,
"text": "IP (Internet Protocol): ... |
UltraSPARC Architecture | 22 Mar, 2022
UltraSPARC Architecture belongs to the SPARC (Scalable Processor Architecture) family of processors. This architecture is suitable for wide range of microcomputers and supercomputers. UltraSPARC is example of RISC (Reduced Instruction Set Computer). UltraSPARC architecture:
Memory: Memory consists of 8 bit... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Mar, 2022"
},
{
"code": null,
"e": 303,
"s": 28,
"text": "UltraSPARC Architecture belongs to the SPARC (Scalable Processor Architecture) family of processors. This architecture is suitable for wide range of microcomputers and superco... |
Dekker’s algorithm in Process Synchronization | 05 Jan, 2022
Prerequisite – Process Synchronization, Inter Process Communication To obtain such a mutual exclusion, bounded waiting, and progress there have been several algorithms implemented, one of which is Dekker’s Algorithm. To understand the algorithm let’s understand the solution to the critical section problem ... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n05 Jan, 2022"
},
{
"code": null,
"e": 410,
"s": 54,
"text": "Prerequisite – Process Synchronization, Inter Process Communication To obtain such a mutual exclusion, bounded waiting, and progress there have been several algorithms implem... |
Python | Ways to find nth occurrence of substring in a string | 10 Jul, 2022
Given a string and a substring, write a Python program to find the nth occurrence of the string. Let’s discuss a few methods to solve the given task. Method #1: Using re
Python3
# Python code to demonstrate# to find nth occurrence of substring import re # Initialising valuesini_str = "abababababab"substr ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n10 Jul, 2022"
},
{
"code": null,
"e": 223,
"s": 52,
"text": "Given a string and a substring, write a Python program to find the nth occurrence of the string. Let’s discuss a few methods to solve the given task. Method #1: Using re "
... |
How to convert a date format in MySQL? | To convert a date format, use STR_TO_DATE() −
mysql> create table DemoTable2010
(
DueDate varchar(20)
);
Query OK, 0 rows affected (0.68 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable2010 values('12/10/2019 12:34:00');
Query OK, 1 row affected (0.13 sec)
mysql> insert into ... | [
{
"code": null,
"e": 1233,
"s": 1187,
"text": "To convert a date format, use STR_TO_DATE() −"
},
{
"code": null,
"e": 1332,
"s": 1233,
"text": "mysql> create table DemoTable2010\n(\n DueDate varchar(20)\n);\nQuery OK, 0 rows affected (0.68 sec)"
},
{
"code": null,
"... |
yes command in Linux with Examples | 08 Nov, 2019
yes command in linux is used to print a continuous output stream of given STRING. If STRING is not mentioned then it prints ‘y’;
Syntax:
yes [STRING]
Note: To stop printing please press Ctrl + C.
Question: Where it is used ?
Ans: Lets say that we want to delete all the .txt file present in the current dire... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Nov, 2019"
},
{
"code": null,
"e": 157,
"s": 28,
"text": "yes command in linux is used to print a continuous output stream of given STRING. If STRING is not mentioned then it prints ‘y’;"
},
{
"code": null,
"e": 165,
... |
Angular PrimeNG ProgressSpinner Component | 08 Sep, 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 ProgressSpinner component in Angular PrimeNG. We will also lea... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Sep, 2021"
},
{
"code": null,
"e": 426,
"s": 28,
"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 responsive websi... |
How are variables scoped in C – Static or Dynamic? | 12 Sep, 2018
In C, variables are always statically (or lexically) scoped i.e., binding of a variable can be determined by program text and is independent of the run-time function call stack.
For example, output for the below program is 0, i.e., the value returned by f() is not dependent on who is calling it. f() always... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n12 Sep, 2018"
},
{
"code": null,
"e": 230,
"s": 52,
"text": "In C, variables are always statically (or lexically) scoped i.e., binding of a variable can be determined by program text and is independent of the run-time function call sta... |
HTML | Window innerHeight Property | 25 Nov, 2021
The Window innerHeight property is used for returning the height of a window’s content area. It is a read-only property and returns a number which represents the height of the browser window’s content area in pixels.Syntax:
window.innerHeight
Return Value: It returns a number that represents browser wind... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n25 Nov, 2021"
},
{
"code": null,
"e": 254,
"s": 28,
"text": "The Window innerHeight property is used for returning the height of a window’s content area. It is a read-only property and returns a number which represents the height of the... |
Goldman Sachs Interview Experience | Off-Campus (September-2020) | 26 Apr, 2021
I was contacted by a recruiter through Linkedin. At that time I had just started in an XYZ firm as a software engineer. I had forwarded my resume, after 2 months I got a call from HR to have an online round.
Coding Round: 2 coding questions on HackerRank to be solved in 2 hours. Both the questions are very... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n26 Apr, 2021"
},
{
"code": null,
"e": 260,
"s": 52,
"text": "I was contacted by a recruiter through Linkedin. At that time I had just started in an XYZ firm as a software engineer. I had forwarded my resume, after 2 months I got a call... |
MapStruct - Using defaultExpression | Using Mapstruct we can pass a computed value using defaultExpression in case source property is null using defaultExpression attribute of @Mapping annotation.
@Mapping(target = "target-property", source="source-property" defaultExpression = "default-value-method")
Here
default-value-method − target-property will be se... | [
{
"code": null,
"e": 2419,
"s": 2260,
"text": "Using Mapstruct we can pass a computed value using defaultExpression in case source property is null using defaultExpression attribute of @Mapping annotation."
},
{
"code": null,
"e": 2526,
"s": 2419,
"text": "@Mapping(target = \"tar... |
MongoDB. max length of field name? | MongoDB supports the BSON format data, so there is no max length of field name. Let us first create a collection with documents −
>db.maxLengthDemo.insertOne({"maxLengthhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
hhh... | [
{
"code": null,
"e": 1192,
"s": 1062,
"text": "MongoDB supports the BSON format data, so there is no max length of field name. Let us first create a collection with documents −"
},
{
"code": null,
"e": 2388,
"s": 1192,
"text": ">db.maxLengthDemo.insertOne({\"maxLengthhhhhhhhhhhhh... |
GATE | GATE CS 1999 | Question 43 - GeeksforGeeks | 09 Oct, 2017
RAID configurations of disks are used to provide
(A) Fault-tolerance(B) High speed(C) High data density(D) None of the aboveAnswer: (A)Explanation:Quiz of this QuestionPlease comment below if you find anything wrong in the above post
GATE CS 1999
GATE-GATE CS 1999
GATE
Writing code in comment?
Please use i... | [
{
"code": null,
"e": 24075,
"s": 24047,
"text": "\n09 Oct, 2017"
},
{
"code": null,
"e": 24124,
"s": 24075,
"text": "RAID configurations of disks are used to provide"
},
{
"code": null,
"e": 24309,
"s": 24124,
"text": "(A) Fault-tolerance(B) High speed(C) High... |
Using K-means Clustering to Create Support and Resistance: | by Victor Sim | Towards Data Science | Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking professional advice. See our Reader Terms for details.
Support and resistan... | [
{
"code": null,
"e": 471,
"s": 171,
"text": "Note from Towards Data Science’s editors: While we allow independent authors to publish articles in accordance with our rules and guidelines, we do not endorse each author’s contribution. You should not rely on an author’s works without seeking profession... |
CSS Tutorial | CSS is the language we use to style an HTML document.
CSS describes how HTML elements should be displayed.
This tutorial will teach you CSS from basic to advanced.
This CSS tutorial contains hundreds of CSS examples.
With our online editor, you can edit the CSS, and click on a button to view the result.
Click on the "T... | [
{
"code": null,
"e": 54,
"s": 0,
"text": "CSS is the language we use to style an HTML document."
},
{
"code": null,
"e": 107,
"s": 54,
"text": "CSS describes how HTML elements should be displayed."
},
{
"code": null,
"e": 164,
"s": 107,
"text": "This tutorial ... |
Data Cleaning with R and the Tidyverse: Detecting Missing Values | by John Sullivan | Towards Data Science | Data cleaning is one of the most important aspects of data science.
As a data scientist, you can expect to spend up to 80% of your time cleaning data.
In a previous post I walked through a number of data cleaning tasks using Python and the Pandas library.
That post got so much attention, I wanted to follow it up with a... | [
{
"code": null,
"e": 240,
"s": 172,
"text": "Data cleaning is one of the most important aspects of data science."
},
{
"code": null,
"e": 323,
"s": 240,
"text": "As a data scientist, you can expect to spend up to 80% of your time cleaning data."
},
{
"code": null,
"e"... |
How to compare two arrays in JavaScript and make a new one of true and false? JavaScript | We have 2 arrays in JavaScript and we want to compare one with the other to see if the
elements of master array exists in keys array, and then make one new array of the same length
that of the master array but containing only true and false (being true for the values that exists in
keys array and false the ones that do... | [
{
"code": null,
"e": 1388,
"s": 1062,
"text": "We have 2 arrays in JavaScript and we want to compare one with the other to see if the\nelements of master array exists in keys array, and then make one new array of the same length\nthat of the master array but containing only true and false (being tru... |
C++ Array of Pointers | Before we understand the concept of array of pointers, let us consider the following example, which makes use of an array of 3 integers −
#include <iostream>
using namespace std;
const int MAX = 3;
int main () {
int var[MAX] = {10, 100, 200};
for (int i = 0; i < MAX; i++) {
cout << "Value of var[... | [
{
"code": null,
"e": 2456,
"s": 2318,
"text": "Before we understand the concept of array of pointers, let us consider the following example, which makes use of an array of 3 integers −"
},
{
"code": null,
"e": 2710,
"s": 2456,
"text": "#include <iostream>\n \nusing namespace std;... |
C++ Stdexcept Library - logic_error | It is a logic error exception and this class defines the type of objects thrown as exceptions to report errors in the internal logical of the program, such as violation of logical preconditions or class invariants.
Following is the declaration for std::logic_error.
class logic_error;
class logic_error;
none
none
constr... | [
{
"code": null,
"e": 2818,
"s": 2603,
"text": "It is a logic error exception and this class defines the type of objects thrown as exceptions to report errors in the internal logical of the program, such as violation of logical preconditions or class invariants."
},
{
"code": null,
"e": 2... |
Java - The WeakHashMap Class | WeakHashMap is an implementation of the Map interface that stores only weak references to its keys. Storing only weak references allows a key-value pair to be garbage-collected when its key is no longer referenced outside of the WeakHashMap.
This class provides the easiest way to harness the power of weak references. I... | [
{
"code": null,
"e": 2619,
"s": 2377,
"text": "WeakHashMap is an implementation of the Map interface that stores only weak references to its keys. Storing only weak references allows a key-value pair to be garbage-collected when its key is no longer referenced outside of the WeakHashMap."
},
{
... |
How to use a line break in array values in JavaScript? | To add a line break in array values for every occurrence of ~, first split the array. After splitting, add a line break i.e. <br> for each occurrence of ~.
For example,
This is demo text 1!~This is demo text 2!~~This is demo text 3!
This will add line breaks like the following for ~ occurrence:
This is demo text 1!
Thi... | [
{
"code": null,
"e": 1218,
"s": 1062,
"text": "To add a line break in array values for every occurrence of ~, first split the array. After splitting, add a line break i.e. <br> for each occurrence of ~."
},
{
"code": null,
"e": 1231,
"s": 1218,
"text": "For example,"
},
{
... |
C# | Type.GetMembers() Method - GeeksforGeeks | 10 Dec, 2019
Type.GetMembers() Method is used to get the members (properties, methods, fields, events, and so on) of the current Type. There are 2 methods in the overload list of this method as follows:
GetMembers() Method
GetMembers(BindingFlags) Method
This method is used to return all the public members of the curre... | [
{
"code": null,
"e": 24302,
"s": 24274,
"text": "\n10 Dec, 2019"
},
{
"code": null,
"e": 24492,
"s": 24302,
"text": "Type.GetMembers() Method is used to get the members (properties, methods, fields, events, and so on) of the current Type. There are 2 methods in the overload list ... |
Installing TensorFlow GPU in Ubuntu 20.04 | by Abien Fred Agarap | Towards Data Science | Also published at https://afagarap.works/2020/07/26/installing-tf-gpu-ubuntu2004.html
When Ubuntu publishes a long-term support (LTS) release, I usually wait for a while before upgrading, mainly because I’m waiting for CUDA and cuDNN support for the new release. This time, it only took me three months to migrate from U... | [
{
"code": null,
"e": 258,
"s": 172,
"text": "Also published at https://afagarap.works/2020/07/26/installing-tf-gpu-ubuntu2004.html"
},
{
"code": null,
"e": 741,
"s": 258,
"text": "When Ubuntu publishes a long-term support (LTS) release, I usually wait for a while before upgrading... |
DAX Text - UPPER function | Converts a text string to all uppercase letters.
UPPER (<text>)
text
The text that you want to convert to uppercase, or a reference to a column that contains text.
Same text string in upper case.
The characters other than alphabets will not be changed.
= UPPER("ab") returns AB.
= UPPER("12ab") returns 12AB.
53... | [
{
"code": null,
"e": 2050,
"s": 2001,
"text": "Converts a text string to all uppercase letters."
},
{
"code": null,
"e": 2067,
"s": 2050,
"text": "UPPER (<text>) \n"
},
{
"code": null,
"e": 2072,
"s": 2067,
"text": "text"
},
{
"code": null,
"e": 21... |
How to define two column layout using flexbox ? | 27 Sep, 2021
In this article, we will learn how to create a two-column layout using flexbox. To create the two-column layout, we use display and flex-direction properties.
Approach: To create a two-column layout, first we create a <div> element with property display: flex, it makes that a div flexbox and then add flex... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Sep, 2021"
},
{
"code": null,
"e": 188,
"s": 28,
"text": "In this article, we will learn how to create a two-column layout using flexbox. To create the two-column layout, we use display and flex-direction properties. "
},
{
"... |
Showing and Hiding widgets in Tkinter? | Let us suppose that we have to create an application such that we can show as well as hide the widgets whenever we need.
The widgets can be hidden through pack_forget() method.
The widgets can be hidden through pack_forget() method.
To show the hidden widgets, we can use the pack() method.
To show the hidden widgets, w... | [
{
"code": null,
"e": 1308,
"s": 1187,
"text": "Let us suppose that we have to create an application such that we can show as well as hide the widgets whenever we need."
},
{
"code": null,
"e": 1364,
"s": 1308,
"text": "The widgets can be hidden through pack_forget() method."
},... |
JQuery | map() Method | 30 Apr, 2020
This map() Method in jQuery is used to translate all items in an array or object to new array of items.
Syntax:
jQuery.map( array/object, callback )
Parameters: This method accept two parameters which is mentioned above and described below:
array/object: This parameter holds the Array or object to translat... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n30 Apr, 2020"
},
{
"code": null,
"e": 132,
"s": 28,
"text": "This map() Method in jQuery is used to translate all items in an array or object to new array of items."
},
{
"code": null,
"e": 140,
"s": 132,
"text": "Sy... |
Difference between relative , absolute and fixed position in CSS | 23 Jul, 2021
Relative Position: Setting the top, right, bottom, and left properties of an element with position: relative; property will cause it to adjust from its normal position. The other objects or elements will not fill the gap.
Syntax:
position: relative;
Absolute Position: An element with position: absolute; wi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n23 Jul, 2021"
},
{
"code": null,
"e": 276,
"s": 54,
"text": "Relative Position: Setting the top, right, bottom, and left properties of an element with position: relative; property will cause it to adjust from its normal position. The o... |
Singular Value Decomposition | 18 Jul, 2021
Prerequisites: Matrix Diagonalization, Eigenvector Computation and Low-Rank Approximations
Before getting in depth into the SVD, let us first briefly understand what Matrix Diagonalization technique is and when it fails to perform efficiently.
Matrix Diagonalization
Matrix diagonalization is the process o... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n18 Jul, 2021"
},
{
"code": null,
"e": 143,
"s": 52,
"text": "Prerequisites: Matrix Diagonalization, Eigenvector Computation and Low-Rank Approximations"
},
{
"code": null,
"e": 297,
"s": 143,
"text": "Before getting... |
Python | Detect corner of an image using OpenCV | 15 Oct, 2018
OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be used to perform multiple operations on videos.
Let’s see how to detect the corner in the image.
cv2.goodFeaturesToTrack() method finds N stronge... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n15 Oct, 2018"
},
{
"code": null,
"e": 238,
"s": 28,
"text": "OpenCV (Open Source Computer Vision) is a computer vision library that contains various functions to perform operations on Images or videos. OpenCV library can be used to perf... |
HTML | Navigator userAgent Property | 19 Aug, 2021
The Navigator userAgent property is used for returning the user-agent header’s value sent to the server by the browser. It returns a string representing values such as the name, version, and platform of the browser.Syntax:
navigator.userAgent
Return Value: A String, representing the user agent string for... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n19 Aug, 2021"
},
{
"code": null,
"e": 253,
"s": 28,
"text": "The Navigator userAgent property is used for returning the user-agent header’s value sent to the server by the browser. It returns a string representing values such as the nam... |
Minimum steps to minimize n as per given condition | 15 Feb, 2022
Given a number n, count minimum steps to minimize it to 1 according to the following criteria:
If n is divisible by 2 then we may reduce n to n/2.
If n is divisible by 3 then you may reduce n to n/3.
Decrement n by 1.
Examples:
Input : n = 10
Output : 3
Input : 6
Output : 2
Greedy Approach (Doesn’t work... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n15 Feb, 2022"
},
{
"code": null,
"e": 148,
"s": 52,
"text": "Given a number n, count minimum steps to minimize it to 1 according to the following criteria: "
},
{
"code": null,
"e": 200,
"s": 148,
"text": "If n is d... |
Sort a 2D vector diagonally | 16 Jun, 2022
Given a 2D vector of NxM integers. The task is to sort the elements of the vectors diagonally from top-left to bottom-right in decreasing order.Examples:
Input: arr[][] = { { 10, 2, 3 }, { 4, 5, 6 }, {7, 8, 9 } } Output: 10 6 3 8 9 2 7 4 5Input: arr[][] = { { 10, 2, 43 }, { 40, 5, 16 }, { 71, 8, 29 }, {1,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n16 Jun, 2022"
},
{
"code": null,
"e": 209,
"s": 54,
"text": "Given a 2D vector of NxM integers. The task is to sort the elements of the vectors diagonally from top-left to bottom-right in decreasing order.Examples: "
},
{
"code... |
Java Program to Compute the Sum of Diagonals of a Matrix | 08 Apr, 2022
For a given 2D square matrix of size N*N, the task is to find the sum of elements in the Principle and Secondary diagonals. For example, analyze the following 4 × 4 input matrix.
a00 a01 a02 a03a10 a11 a12 a13a20 a21 a22 a23a30 a31 a32 a33
Example:
Input 1 : 6 7 3 4 8 9 2 1 1 2 ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n08 Apr, 2022"
},
{
"code": null,
"e": 207,
"s": 28,
"text": "For a given 2D square matrix of size N*N, the task is to find the sum of elements in the Principle and Secondary diagonals. For example, analyze the following 4 × 4 input matr... |
std::partial_sort in C++ | 06 Aug, 2017
std::sort is used for sorting the elements present within a container. One of the variants of this is std::partial_sort, which is used for sorting not the entire range, but only a sub-part of it.
It rearranges the elements in the range [first, last), in such a way that the elements before middle are sorted... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n06 Aug, 2017"
},
{
"code": null,
"e": 248,
"s": 52,
"text": "std::sort is used for sorting the elements present within a container. One of the variants of this is std::partial_sort, which is used for sorting not the entire range, but o... |
SQLAlchemy ORM conversion to Pandas DataFrame | 22 Jun, 2022
In this article, we will see how to convert an SQLAlchemy ORM to Pandas DataFrame using Python.
We need to have the sqlalchemy as well as the pandas library installed in the python environment –
$ pip install sqlalchemy
$ pip install pandas
For our example, we will make use of the MySQL database where we h... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n22 Jun, 2022"
},
{
"code": null,
"e": 124,
"s": 28,
"text": "In this article, we will see how to convert an SQLAlchemy ORM to Pandas DataFrame using Python."
},
{
"code": null,
"e": 223,
"s": 124,
"text": "We need to... |
Java.util.TimeZone Class | Set 1 | 03 Dec, 2021
TimeZone class is used to represents a time zone offset, and also figures out daylight savings.What is a Time Zone and Time Offset?“Time Zone” is used to describe the current time for different areas of the world. It refers to one of the specific regions out of the 24 total regions in the world that are di... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n03 Dec, 2021"
},
{
"code": null,
"e": 436,
"s": 28,
"text": "TimeZone class is used to represents a time zone offset, and also figures out daylight savings.What is a Time Zone and Time Offset?“Time Zone” is used to describe the current ... |
Command line arguments in Java | Sometimes you will want to pass some information on a program when you run it. This is accomplished by passing command-line arguments to main( ).
A command-line argument is an information that directly follows the program's name on the command line when it is executed. To access the command-line arguments inside a Java... | [
{
"code": null,
"e": 1333,
"s": 1187,
"text": "Sometimes you will want to pass some information on a program when you run it. This is accomplished by passing command-line arguments to main( )."
},
{
"code": null,
"e": 1597,
"s": 1333,
"text": "A command-line argument is an inform... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.