title stringlengths 3 221 | text stringlengths 17 477k | parsed listlengths 0 3.17k |
|---|---|---|
Java - ByteArrayInputStream | The ByteArrayInputStream class allows a buffer in the memory to be used as an InputStream. The input source is a byte array.
ByteArrayInputStream class provides the following constructors.
ByteArrayInputStream(byte [] a)
This constructor accepts a byte array as a parameter.
ByteArrayInputStream(byte [] a, int off, int ... | [
{
"code": null,
"e": 2502,
"s": 2377,
"text": "The ByteArrayInputStream class allows a buffer in the memory to be used as an InputStream. The input source is a byte array."
},
{
"code": null,
"e": 2566,
"s": 2502,
"text": "ByteArrayInputStream class provides the following constru... |
What’s New In Python 3.9 Dictionaries? | by Anupam Chugh | Towards Data Science | Python 3.9 is currently in beta and with a release scheduled in October 2020, there’s a lot to look forward to. For Python developers eagerly waiting for the update, there are a few interesting additions, be it new string methods, topological ordering, or type hinting.
But the one that stands out for me is the new unio... | [
{
"code": null,
"e": 442,
"s": 172,
"text": "Python 3.9 is currently in beta and with a release scheduled in October 2020, there’s a lot to look forward to. For Python developers eagerly waiting for the update, there are a few interesting additions, be it new string methods, topological ordering, or... |
How can we apply different borders to JButton in Java? | A JButton is a subclass of AbstractButton class and it can be used for adding platform-independent buttons in a Java Swing application. A JButon can generate an ActionListener interface when the user clicking on a button, it can also generate MouseListener when a user can do some actions from the mouse and KeyListener ... | [
{
"code": null,
"e": 1433,
"s": 1062,
"text": "A JButton is a subclass of AbstractButton class and it can be used for adding platform-independent buttons in a Java Swing application. A JButon can generate an ActionListener interface when the user clicking on a button, it can also generate MouseListe... |
BabylonJS - VectorPosition and Rotation | Run the demo links given below in your browser. In the demos given below, we have drawn the x,y and z-axis. There are numbers plotted on the x,y and z-axis in the positive and negative direction. Run the same in browser, change the values in case you need and draw your shapes, meshes, position them and see how they ren... | [
{
"code": null,
"e": 2648,
"s": 2183,
"text": "Run the demo links given below in your browser. In the demos given below, we have drawn the x,y and z-axis. There are numbers plotted on the x,y and z-axis in the positive and negative direction. Run the same in browser, change the values in case you ne... |
Sort the words in lexicographical order in Java | The words are sorted in lexicographical order or dictionary order. This means that the words are alphabetically ordered based on their component alphabets. An example of this is given as follows.
The original order of the words is
Tom
Anne
Sally
John
The lexicographical order of the words is
Anne
John
Sally
Tom
A progr... | [
{
"code": null,
"e": 1258,
"s": 1062,
"text": "The words are sorted in lexicographical order or dictionary order. This means that the words are alphabetically ordered based on their component alphabets. An example of this is given as follows."
},
{
"code": null,
"e": 1375,
"s": 1258,... |
Bootstrap 4 - Carousel | Carousel is a flexible, responsive way to add a slider to your site. To create a carousel,
Add the .carousel and .slide classes to the container along with an id.
Add the .carousel and .slide classes to the container along with an id.
Specify the slides in a <div> with class .carousel-inner and each slide defined with ... | [
{
"code": null,
"e": 1907,
"s": 1816,
"text": "Carousel is a flexible, responsive way to add a slider to your site. To create a carousel,"
},
{
"code": null,
"e": 1979,
"s": 1907,
"text": "Add the .carousel and .slide classes to the container along with an id."
},
{
"code... |
Difference between HashTable and HashMap in Java | Following are the notable differences between HashTable and HashMap classes in Java.
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
public class Tester {
public static void main(String args[]) {
Map<String, String> map = new HashMap<String, String>();
map.put("1", "One");
... | [
{
"code": null,
"e": 1147,
"s": 1062,
"text": "Following are the notable differences between HashTable and HashMap classes in Java."
},
{
"code": null,
"e": 1809,
"s": 1147,
"text": "import java.util.HashMap;\nimport java.util.Hashtable;\nimport java.util.Map;\n\npublic class Tes... |
Where and how to use to static variables in android studio? | This example demonstrates about how and where do I use static variable in android studio.
Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project
Step 2 − Add the following code to res/layout/activity_main.xml.
<?xml version="1.0" encoding="utf-8"?... | [
{
"code": null,
"e": 1152,
"s": 1062,
"text": "This example demonstrates about how and where do I use static variable in android studio."
},
{
"code": null,
"e": 1280,
"s": 1152,
"text": "Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all requi... |
Creating Colormaps in Matplotlib | by Rizky Maulana N | Towards Data Science | Almost all the programmers who work with Python programming language know Matplotlib. It is one of the most used libraries. It is a multi-platform library that can play with many operating systems and was built in 2002 by John Hunter.
Nowadays, people start to develop new packages with more simple and more modern style... | [
{
"code": null,
"e": 407,
"s": 172,
"text": "Almost all the programmers who work with Python programming language know Matplotlib. It is one of the most used libraries. It is a multi-platform library that can play with many operating systems and was built in 2002 by John Hunter."
},
{
"code"... |
Overview of Data modeling in Apache Cassandra - GeeksforGeeks | 09 Oct, 2019
In this article we will learn about these three data model in Cassandra: Conceptual, Logical, and Physical.
Learning Objective:
To Build database using quick design techniques in Cassandra.
To Improve existing model using a query driven methodology in Cassandra.
To Optimize Existing model via analysis and ... | [
{
"code": null,
"e": 23727,
"s": 23699,
"text": "\n09 Oct, 2019"
},
{
"code": null,
"e": 23835,
"s": 23727,
"text": "In this article we will learn about these three data model in Cassandra: Conceptual, Logical, and Physical."
},
{
"code": null,
"e": 23855,
"s": 23... |
JavaScript String - length Property | This property returns the number of characters in a string.
Use the following syntax to find the length of a string −
string.length
Returns the number of characters in the string.
Try the following example.
<html>
<head>
<title>JavaScript String length Property</title>
</head>
<body>
<scrip... | [
{
"code": null,
"e": 2526,
"s": 2466,
"text": "This property returns the number of characters in a string."
},
{
"code": null,
"e": 2584,
"s": 2526,
"text": "Use the following syntax to find the length of a string −"
},
{
"code": null,
"e": 2599,
"s": 2584,
"t... |
CakePHP - Redirect Routing | Redirect routing is useful when we want to inform client applications that this URL has been moved. The URL can be redirected using the following function.
static Cake\Routing\Router::redirect($route, $url, $options =[])
There are three arguments to the above function −
A string describing the template of the route.
A... | [
{
"code": null,
"e": 2398,
"s": 2242,
"text": "Redirect routing is useful when we want to inform client applications that this URL has been moved. The URL can be redirected using the following function."
},
{
"code": null,
"e": 2464,
"s": 2398,
"text": "static Cake\\Routing\\Rout... |
clear() method in PyQt5 - GeeksforGeeks | 26 Mar, 2020
While using PyQt5, there occur a need of removing or clearing labels in order to do so clear() method is used. This method belongs to the QLabel class, and can be used on only label widgets.
Syntax : label.clear()Argument : It takes no argument.Action Performed : It clears(remove) the label from main windo... | [
{
"code": null,
"e": 26399,
"s": 26371,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 26590,
"s": 26399,
"text": "While using PyQt5, there occur a need of removing or clearing labels in order to do so clear() method is used. This method belongs to the QLabel class, and can be ... |
Hive - Built-in Functions | This chapter explains the built-in functions available in Hive. The functions look quite similar to SQL functions, except for their usage.
Hive supports the following built-in functions:
The following queries demonstrate some built-in functions:
hive> SELECT round(2.6) from temp;
On successful execution of query, you g... | [
{
"code": null,
"e": 2089,
"s": 1950,
"text": "This chapter explains the built-in functions available in Hive. The functions look quite similar to SQL functions, except for their usage."
},
{
"code": null,
"e": 2137,
"s": 2089,
"text": "Hive supports the following built-in functi... |
random.choices() method in Python - GeeksforGeeks | 27 Jan, 2022
The choices() method returns multiple random elements from the list with replacement. You can weigh the possibility of each result with the weights parameter or the cum_weights parameter. The elements can be a string, a range, a list, a tuple or any other kind of sequence.
Syntax : random.choices(sequence,... | [
{
"code": null,
"e": 23926,
"s": 23898,
"text": "\n27 Jan, 2022"
},
{
"code": null,
"e": 24200,
"s": 23926,
"text": "The choices() method returns multiple random elements from the list with replacement. You can weigh the possibility of each result with the weights parameter or th... |
Longest Consecutive 1's | Practice | GeeksforGeeks | Given a number N. Find the length of the longest consecutive 1s in its binary representation.
Example 1:
Input: N = 14
Output: 3
Explanation:
Binary representation of 14 is
1110, in which 111 is the longest
consecutive set bits of length is 3.
Example 2:
Input: N = 222
Output: 4
Explanation:
Binary representation o... | [
{
"code": null,
"e": 332,
"s": 238,
"text": "Given a number N. Find the length of the longest consecutive 1s in its binary representation."
},
{
"code": null,
"e": 343,
"s": 332,
"text": "Example 1:"
},
{
"code": null,
"e": 485,
"s": 343,
"text": "Input: N = 1... |
Rexx - Best Programming Practices | Every programmer wants their program to be the best when it comes to quality and efficiency. The following are some of the best programming practices or hints when writing Rexx programs which can help one achieve these goals.
Use the address command before you issue any command to the operating system or command prompt... | [
{
"code": null,
"e": 2565,
"s": 2339,
"text": "Every programmer wants their program to be the best when it comes to quality and efficiency. The following are some of the best programming practices or hints when writing Rexx programs which can help one achieve these goals."
},
{
"code": null,... |
Python unittest - assertIsNotNone() function - GeeksforGeeks | 29 Aug, 2020
assertIsNotNone() in Python is a unittest library function that is used in unit testing to check that input value is not None. This function will take two parameters as input and return a boolean value depending upon assert condition. If input value is not equal to None assertIsNotNone() will return true e... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n29 Aug, 2020"
},
{
"code": null,
"e": 24226,
"s": 23901,
"text": "assertIsNotNone() in Python is a unittest library function that is used in unit testing to check that input value is not None. This function will take two paramete... |
How to create a table in a database using JDBC API? | A. You can create a table in a database using the CREATE TABLE query.
CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype,
PRIMARY KEY( one or more columns )
);
To create a table in a database using JDBC API you need to:
Register the driver: Register the driver class us... | [
{
"code": null,
"e": 1132,
"s": 1062,
"text": "A. You can create a table in a database using the CREATE TABLE query."
},
{
"code": null,
"e": 1273,
"s": 1132,
"text": "CREATE TABLE table_name(\ncolumn1 datatype,\ncolumn2 datatype,\ncolumn3 datatype,\n.....\ncolumnN datatype,\nPRI... |
Select and sum with grouping in MySQL? | To sum, use the aggregate function SUM(). With that, group using MySQL GROUP BY. Let us first create a table −
mysql> create table DemoTable
-> (
-> ProductName varchar(20),
-> ProductQuantity int,
-> ProductPrice int
-> );
Query OK, 0 rows affected (0.63 sec)
Insert some records in the table using inser... | [
{
"code": null,
"e": 1173,
"s": 1062,
"text": "To sum, use the aggregate function SUM(). With that, group using MySQL GROUP BY. Let us first create a table −"
},
{
"code": null,
"e": 1338,
"s": 1173,
"text": "mysql> create table DemoTable\n -> (\n -> ProductName varchar(20),\... |
Can we declare a static variable within a method in java? | A static filed/variable belongs to the class and it will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference). There is only one copy of the static field available throughout the class i.e. the value of the static field will be same in all o... | [
{
"code": null,
"e": 1446,
"s": 1062,
"text": "A static filed/variable belongs to the class and it will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference). There is only one copy of the static field available throughout... |
Binary Indexed Tree : Range Update and Range Queries - GeeksforGeeks | 16 Jun, 2021
Given an array arr[0..n-1]. The following operations need to be performed.
update(l, r, val) : Add ‘val’ to all the elements in the array from [l, r].getRangeSum(l, r) : Find sum of all elements in array from [l, r].
update(l, r, val) : Add ‘val’ to all the elements in the array from [l, r].
getRangeSum(l... | [
{
"code": null,
"e": 24273,
"s": 24245,
"text": "\n16 Jun, 2021"
},
{
"code": null,
"e": 24349,
"s": 24273,
"text": "Given an array arr[0..n-1]. The following operations need to be performed. "
},
{
"code": null,
"e": 24491,
"s": 24349,
"text": "update(l, r, v... |
CSS | column-span Property - GeeksforGeeks | 06 Sep, 2021
The column-span property of CSS sets the number of columns an element can span across. Its value can be none | all | initial | inherit Syntax:
column-span: none|all|initial|inherit;
Default Value: None
Property Values:
all: It allows to span in all the columns equally.Syntax:
column-span: all;
Examp... | [
{
"code": null,
"e": 23237,
"s": 23209,
"text": "\n06 Sep, 2021"
},
{
"code": null,
"e": 23382,
"s": 23237,
"text": "The column-span property of CSS sets the number of columns an element can span across. Its value can be none | all | initial | inherit Syntax: "
},
{
"cod... |
Check if a large number is divisible by 11 or not in java | A number is divisible by 11 if the difference between the sum of its alternative digits is divisible by 11.
i.e. if (sum of odd digits) – ( sum of even digits) is 0 or divisible by 11 then the given number is divisible by 11.
import java.util.Scanner;
public class DivisibleBy11 {
public static void main(String args... | [
{
"code": null,
"e": 1170,
"s": 1062,
"text": "A number is divisible by 11 if the difference between the sum of its alternative digits is divisible by 11."
},
{
"code": null,
"e": 1288,
"s": 1170,
"text": "i.e. if (sum of odd digits) – ( sum of even digits) is 0 or divisible by 1... |
PHP program to calculate the sum of square of first n natural numbers | To calculate the sum of square of first n natural numbers in PHP, the code is as follows −
Live Demo
<?php
function sum_of_squares($limit)
{
$ini_sum = 0;
for ($i = 1; $i <= $limit; $i++)
$ini_sum += ($limit * $limit);
return $ini_sum;
}
$limit = 5;
print_r("The sum of square of first 5 natural numbers ... | [
{
"code": null,
"e": 1153,
"s": 1062,
"text": "To calculate the sum of square of first n natural numbers in PHP, the code is as follows −"
},
{
"code": null,
"e": 1164,
"s": 1153,
"text": " Live Demo"
},
{
"code": null,
"e": 1422,
"s": 1164,
"text": "<?php\nfu... |
Annotate data points while plotting from Pandas DataFrame | To annotate data points while plotting from pandas data frame, we can take the following steps −
Create df using DataFrame with x, y and index keys.
Create df using DataFrame with x, y and index keys.
Create a figure and a set of subplots using subplots() method.
Create a figure and a set of subplots using subplots() m... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "To annotate data points while plotting from pandas data frame, we can take the following steps −"
},
{
"code": null,
"e": 1211,
"s": 1159,
"text": "Create df using DataFrame with x, y and index keys."
},
{
"code": null,
"... |
7 Applications of Auto-Encoders every Data Scientist should know | by Satyam Kumar | Towards Data Science | Auto-Encoders are a popular type of unsupervised artificial neural network that takes un-labeled data and learns efficient codings about the structure of the data that can be used for another context. Auto-Encoders approximates the function that maps the data from full input space to lower dimension coordinates and fur... | [
{
"code": null,
"e": 566,
"s": 172,
"text": "Auto-Encoders are a popular type of unsupervised artificial neural network that takes un-labeled data and learns efficient codings about the structure of the data that can be used for another context. Auto-Encoders approximates the function that maps the ... |
Get distinct values from a column in MongoDB? | To get distinct values from a column, use distinct() in MongoDB. Let us first create a collection with documents −
> db.demo128.insertOne({"Name":"Chris"});
{
"acknowledged" : true,
"insertedId" : ObjectId("5e30583d68e7f832db1a7f5d")
}
> db.demo128.insertOne({"Name":"David"});
{
"acknowledged" : true,
"inse... | [
{
"code": null,
"e": 1177,
"s": 1062,
"text": "To get distinct values from a column, use distinct() in MongoDB. Let us first create a collection with documents −"
},
{
"code": null,
"e": 1810,
"s": 1177,
"text": "> db.demo128.insertOne({\"Name\":\"Chris\"});\n{\n \"acknowledged... |
Sum of array using pointer arithmetic in C | In this program, we need to find sum of array elements using pointer arithmetic.
Here we use * which denotes the value stored at the memory address and this address will remain stored in the variable. Thus “int *ptr” means, ptr is a variable which contains an address and content of the address is an integer quantity.
*... | [
{
"code": null,
"e": 1143,
"s": 1062,
"text": "In this program, we need to find sum of array elements using pointer arithmetic."
},
{
"code": null,
"e": 1381,
"s": 1143,
"text": "Here we use * which denotes the value stored at the memory address and this address will remain store... |
Principal Component Analysis for Dimensionality Reduction | by Lorraine Li | Towards Data Science | In the modern age of technology, increasing amounts of data are produced and collected. In machine learning, however, too much data can be a bad thing. At a certain point, more features or dimensions can decrease a model’s accuracy since there is more data that needs to be generalized — this is known as the curse of di... | [
{
"code": null,
"e": 381,
"s": 47,
"text": "In the modern age of technology, increasing amounts of data are produced and collected. In machine learning, however, too much data can be a bad thing. At a certain point, more features or dimensions can decrease a model’s accuracy since there is more data... |
JavaScript | array.values() - GeeksforGeeks | 18 Nov, 2021
The array.values() function is an inbuilt function in JavaScript which is used to returns a new array Iterator object that contains the values for each index in the array i.e, it prints all the elements of the array. Syntax:
arr.values()
Return values: It returns a new array iterator object i.e, elements... | [
{
"code": null,
"e": 24540,
"s": 24512,
"text": "\n18 Nov, 2021"
},
{
"code": null,
"e": 24767,
"s": 24540,
"text": "The array.values() function is an inbuilt function in JavaScript which is used to returns a new array Iterator object that contains the values for each index in th... |
Array of maps in C++ with Examples - GeeksforGeeks | 27 Dec, 2021
What is an array?
An array in any programming language is a data structure that is used to store elements or data items of similar data types at contiguous memory locations and elements can be accessed randomly using indices of an array. Arrays are efficient when we want to store a large number of elements... | [
{
"code": null,
"e": 24042,
"s": 24014,
"text": "\n27 Dec, 2021"
},
{
"code": null,
"e": 24060,
"s": 24042,
"text": "What is an array?"
},
{
"code": null,
"e": 24382,
"s": 24060,
"text": "An array in any programming language is a data structure that is used to... |
Create and Import modules in Python - GeeksforGeeks | 29 Dec, 2019
In Python, a module is a self-contained Python file that contains Python statements and definitions, like a file named GFG.py, can be considered as a module named GFG which can be imported with the help of import statement. However, one might get confused about the difference between modules and packages. ... | [
{
"code": null,
"e": 25863,
"s": 25835,
"text": "\n29 Dec, 2019"
},
{
"code": null,
"e": 26272,
"s": 25863,
"text": "In Python, a module is a self-contained Python file that contains Python statements and definitions, like a file named GFG.py, can be considered as a module named ... |
SQL Query for Finding Maximum Values in Rows | 07 Apr, 2021
SQL stands for Structured Query Language and is used to create, maintain and retrieve the data from relational databases. Relational Database Management Systems (RDBMS) like MySQL, MS Access, Oracle, and SQL Server use SQL as their standard database language. Here we are going to see the SQL query for Find... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Apr, 2021"
},
{
"code": null,
"e": 427,
"s": 28,
"text": "SQL stands for Structured Query Language and is used to create, maintain and retrieve the data from relational databases. Relational Database Management Systems (RDBMS) like M... |
Interpreter Design Pattern | 22 Feb, 2018
Interpreter design pattern is one of the behavioral design pattern. Interpreter pattern is used to defines a grammatical representation for a language and provides an interpreter to deal with this grammar.
This pattern involves implementing an expression interface which tells to interpret a particular cont... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 Feb, 2018"
},
{
"code": null,
"e": 258,
"s": 52,
"text": "Interpreter design pattern is one of the behavioral design pattern. Interpreter pattern is used to defines a grammatical representation for a language and provides an interpr... |
Lodash _.pickBy() Method - GeeksforGeeks | 09 Sep, 2020
Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.
The _.pickBy() method is used to return a copy of the object that composed of the object properties predicate returns truthy for.
Syntax:
_.pickBy( object, predicate )... | [
{
"code": null,
"e": 26545,
"s": 26517,
"text": "\n09 Sep, 2020"
},
{
"code": null,
"e": 26685,
"s": 26545,
"text": "Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc."
},
{
"code": n... |
Number of intersections between two ranges - GeeksforGeeks | 10 Sep, 2021
Given N ranges of type1 ranges and M ranges of type2.The task is to find the total number of intersections between all possible type1 and type2 range pairs. All start and end points of type1 and type2 ranges are given.Examples:
Input : N = 2, M = 2 type1[ ] = { { 1, 3 }, { 5, 9 } } type2[ ] = { { 2, 8 }, ... | [
{
"code": null,
"e": 26561,
"s": 26533,
"text": "\n10 Sep, 2021"
},
{
"code": null,
"e": 26790,
"s": 26561,
"text": "Given N ranges of type1 ranges and M ranges of type2.The task is to find the total number of intersections between all possible type1 and type2 range pairs. All st... |
Python | Program to count duplicates in a list of tuples - GeeksforGeeks | 11 Dec, 2018
Given a list of tuples, write a Python program to check if an element of the list has duplicates. If duplicate exist, print the number of occurrence of each duplicate tuple, otherwise print “No Duplicates”.
Examples:
Input : [(‘a’, ‘e’), (‘b’, ‘x’), (‘b’, ‘x’), (‘a’, ‘e’), (‘b’, ‘x’)]Output :(‘a’, ‘e’) – 2... | [
{
"code": null,
"e": 26305,
"s": 26277,
"text": "\n11 Dec, 2018"
},
{
"code": null,
"e": 26512,
"s": 26305,
"text": "Given a list of tuples, write a Python program to check if an element of the list has duplicates. If duplicate exist, print the number of occurrence of each duplic... |
Print all the duplicates in the input string - GeeksforGeeks | 23 Nov, 2021
Write an efficient program to print all the duplicates and their counts in the input string
Method 1: Using hashingAlgorithm: Let input string be “geeksforgeeks” 1: Construct character count array from the input string.count[‘e’] = 4 count[‘g’] = 2 count[‘k’] = 2 ......2: Print all the indexes from the co... | [
{
"code": null,
"e": 26495,
"s": 26467,
"text": "\n23 Nov, 2021"
},
{
"code": null,
"e": 26588,
"s": 26495,
"text": "Write an efficient program to print all the duplicates and their counts in the input string "
},
{
"code": null,
"e": 26861,
"s": 26588,
"text"... |
Program to print a pattern of numbers - GeeksforGeeks | 28 Jun, 2021
The idea of pattern based programs is to understand the concept of nesting of for loops and how and where to place the alphabets / numbers / stars to make the desired pattern.Write to program to print the pattern of numbers in the following manner using for loop
1
232
34543
4567654
567898765
In... | [
{
"code": null,
"e": 24428,
"s": 24400,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24693,
"s": 24428,
"text": "The idea of pattern based programs is to understand the concept of nesting of for loops and how and where to place the alphabets / numbers / stars to make the desi... |
GATE | GATE-CS-2014-(Set-2) | Question 65 - GeeksforGeeks | 28 Jun, 2021
An IP machine Q has a path to another IP machine H via three IP routers R1, R2, and R3.
Q—R1—R2—R3—H
H acts as an HTTP server, and Q connects to H via HTTP and downloads a file. Session layer encryption is used, with DES as the shared key encryption protocol. Consider the following four pieces of informat... | [
{
"code": null,
"e": 24668,
"s": 24640,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 24756,
"s": 24668,
"text": "An IP machine Q has a path to another IP machine H via three IP routers R1, R2, and R3."
},
{
"code": null,
"e": 24770,
"s": 24756,
"text": "Q—... |
Adding millisecond to date in SAP HANA | Try using ADD_SECONDS function as below:
SELECT ADD_SECONDS (TO_TIMESTAMP('2017-07-15 02:17:15'), 0.1) FROM TEST
This will add seconds as fraction value as requested. Below is syntax and example:
ADD_SECONDS
Syntax
ADD_SECONDS (t, n)
Description
Computes the time t plus n seconds.
Example:
SELECT ADD_SECONDS (TO_TIMES... | [
{
"code": null,
"e": 1103,
"s": 1062,
"text": "Try using ADD_SECONDS function as below:"
},
{
"code": null,
"e": 1175,
"s": 1103,
"text": "SELECT ADD_SECONDS (TO_TIMESTAMP('2017-07-15 02:17:15'), 0.1) FROM TEST"
},
{
"code": null,
"e": 1258,
"s": 1175,
"text":... |
Apex - Objects | An instance of class is called Object. In terms of Salesforce, object can be of class or you can create an object of sObject as well.
You can create an object of class as you might have done in Java or other object-oriented programming language.
Following is an example Class called MyClass −
// Sample Class Example
pub... | [
{
"code": null,
"e": 2186,
"s": 2052,
"text": "An instance of class is called Object. In terms of Salesforce, object can be of class or you can create an object of sObject as well."
},
{
"code": null,
"e": 2298,
"s": 2186,
"text": "You can create an object of class as you might h... |
Constructor Chaining In Java programming | Constructor chaining refers to calling a constructor from other constructor. It is of two types.
Within same Class − Use this() keyword to refer to current class constructor. Make sure that this() is the first statement of the constructor and there should be at least one constructor without using this() statement.
With... | [
{
"code": null,
"e": 1159,
"s": 1062,
"text": "Constructor chaining refers to calling a constructor from other constructor. It is of two types."
},
{
"code": null,
"e": 1378,
"s": 1159,
"text": "Within same Class − Use this() keyword to refer to current class constructor. Make su... |
Python - Functions | A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing.
As you already know, Python gives you many built-in functions like print(), etc. but you can also create your own functions. The... | [
{
"code": null,
"e": 2436,
"s": 2244,
"text": "A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing."
},
{
"code": null,
"e": 2612,
"s": 2436,
... |
How to search for files using the wildcard character (*) in PowerShell? | You can also search for files with a specific name or using the wildcard (*) character.
Below command will search for the files (including hidden files) starting with “Bac”.
Get-ChildItem D:\Temp -Recurse -Force -Include Bac*
PS C:\WINDOWS\system32> Get-ChildItem D:\Temp -Recurse -Force -Include Bac*
Directory: D:\... | [
{
"code": null,
"e": 1150,
"s": 1062,
"text": "You can also search for files with a specific name or using the wildcard (*) character."
},
{
"code": null,
"e": 1236,
"s": 1150,
"text": "Below command will search for the files (including hidden files) starting with “Bac”."
},
... |
Python PIL | ImageDraw.Draw.multiline_textsize() - GeeksforGeeks | 17 Sep, 2019
PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image objects. You can use this module to create new images, annotate or retouch existing images, and to generate graphics on the fly for web use.
Ima... | [
{
"code": null,
"e": 23901,
"s": 23873,
"text": "\n17 Sep, 2019"
},
{
"code": null,
"e": 24205,
"s": 23901,
"text": "PIL is the Python Imaging Library which provides the python interpreter with image editing capabilities. The ImageDraw module provide simple 2D graphics for Image ... |
Count all possible walks from a source to a destination with exactly k edges - GeeksforGeeks | 26 Jan, 2022
Given a directed graph and two vertices ‘u’ and ‘v’ in it, count all possible walks from ‘u’ to ‘v’ with exactly k edges on the walk. The graph is given adjacency matrix representation where the value of graph[i][j] as 1 indicates that there is an edge from vertex i to vertex j and a value 0 indicates no e... | [
{
"code": null,
"e": 24741,
"s": 24713,
"text": "\n26 Jan, 2022"
},
{
"code": null,
"e": 25065,
"s": 24741,
"text": "Given a directed graph and two vertices ‘u’ and ‘v’ in it, count all possible walks from ‘u’ to ‘v’ with exactly k edges on the walk. The graph is given adjacency ... |
Tryit Editor v3.7 | Tryit: two classes | [] |
Statistical Machine Learning: Gradient Boosting & AdaBoost from Scratch | by Andrew Rothman | Towards Data Science | Boosting is a family of ensemble Machine Learning techniques for both discrete and continuous random variable targets. Boosting models take the form of Non-Parametric Additive models and are most typically specified with additive components being “weak learners”. From an empirical risk decomposition perspective, where ... | [
{
"code": null,
"e": 675,
"s": 172,
"text": "Boosting is a family of ensemble Machine Learning techniques for both discrete and continuous random variable targets. Boosting models take the form of Non-Parametric Additive models and are most typically specified with additive components being “weak le... |
How to Extract Key from Python Dictionary using Value | by Abhijith Chandradas | Towards Data Science | It is straight-forward to extract value if we have key, like unlocking a lock with a key. However, the vice versa is not as simple, like “unkeying the key with a lock”, maybe!
Sometimes extracting keys become important especially when the key and value has a one-to-one relationship. That is, when either of them is uniq... | [
{
"code": null,
"e": 347,
"s": 171,
"text": "It is straight-forward to extract value if we have key, like unlocking a lock with a key. However, the vice versa is not as simple, like “unkeying the key with a lock”, maybe!"
},
{
"code": null,
"e": 524,
"s": 347,
"text": "Sometimes ... |
Python Tkinter - Message - GeeksforGeeks | 26 Mar, 2020
Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with Tkinter is the fastest and easiest way to create GUI applications. C... | [
{
"code": null,
"e": 41554,
"s": 41526,
"text": "\n26 Mar, 2020"
},
{
"code": null,
"e": 41906,
"s": 41554,
"text": "Python offers multiple options for developing a GUI (Graphical User Interface). Out of all the GUI methods, Tkinter is the most commonly used method. It is a stand... |
How to remove empty rows from R dataframe? - GeeksforGeeks | 26 Mar, 2021
A dataframe can contain empty rows and here with empty rows we don’t mean NA, NaN or 0, it literally means empty with absolutely no data. Such rows are obviously wasting space and making data frame unnecessarily large. This article will discuss how can this be done.
To remove rows with empty cells we have ... | [
{
"code": null,
"e": 25242,
"s": 25214,
"text": "\n26 Mar, 2021"
},
{
"code": null,
"e": 25509,
"s": 25242,
"text": "A dataframe can contain empty rows and here with empty rows we don’t mean NA, NaN or 0, it literally means empty with absolutely no data. Such rows are obviously w... |
Linear Regression in Python. The math behind Linear Regression and... | by Indhumathy Chelliah | Towards Data Science | Linear Regression is a machine learning algorithm based on supervised learning. Linear Regression is a predictive model that is used for finding the linear relationship between a dependent variable and one or more independent variables. Here,dependent variable/target variable(Y) should be continuous variable.
Let’s lea... | [
{
"code": null,
"e": 483,
"s": 172,
"text": "Linear Regression is a machine learning algorithm based on supervised learning. Linear Regression is a predictive model that is used for finding the linear relationship between a dependent variable and one or more independent variables. Here,dependent var... |
Making a cone with VPython - GeeksforGeeks | 08 Jun, 2020
VPython makes it easy to create navigable 3D displays and animations, even for those with limited programming experience. Because it is based on Python, it also has much to offer for experienced programmers and researchers. VPython allows users to create objects such as spheres and cones in 3D space and di... | [
{
"code": null,
"e": 24292,
"s": 24264,
"text": "\n08 Jun, 2020"
},
{
"code": null,
"e": 24895,
"s": 24292,
"text": "VPython makes it easy to create navigable 3D displays and animations, even for those with limited programming experience. Because it is based on Python, it also ha... |
BigInteger remainder() Method in Java - GeeksforGeeks | 04 Dec, 2018
The java.math.BigInteger.remainder(BigInteger big) method returns a BigInteger whose value is equal to (this BigInteger % big(BigInteger passed as parameter)).The remainder operation finds the remainder after division of this BigInteger by another BigInteger passed as parameter.
Syntax:
public BigInteger r... | [
{
"code": null,
"e": 23948,
"s": 23920,
"text": "\n04 Dec, 2018"
},
{
"code": null,
"e": 24228,
"s": 23948,
"text": "The java.math.BigInteger.remainder(BigInteger big) method returns a BigInteger whose value is equal to (this BigInteger % big(BigInteger passed as parameter)).The ... |
Print colored message with different fonts and sizes in C | 29 Oct, 2018
In C/C++ we can use graphics.h header file for creation of programs which uses graphical functions like creating different objects, setting the color of text, printing messages in different fonts and size, changing the background of our output console and much more.Here we will create a program which will ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Oct, 2018"
},
{
"code": null,
"e": 471,
"s": 52,
"text": "In C/C++ we can use graphics.h header file for creation of programs which uses graphical functions like creating different objects, setting the color of text, printing messag... |
Count of sub-strings that are divisible by K | 07 Jul, 2022
Given an integer K and a numeric string str (all the characters are from the range [‘0’, ‘9’]). The task is to count the number of sub-strings of str that are divisible by K.
Examples:
Input: str = “33445”, K = 11 Output: 3 Sub-strings that are divisible by 11 are “33”, “44” and “3344”
Input: str = “33445... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n07 Jul, 2022"
},
{
"code": null,
"e": 227,
"s": 52,
"text": "Given an integer K and a numeric string str (all the characters are from the range [‘0’, ‘9’]). The task is to count the number of sub-strings of str that are divisible by K.... |
JavaScript | Rest parameter | 28 Sep, 2021
Rest parameter is an improved way to handle function parameter, allowing us to more easily handle various input as parameters in a function. The rest parameter syntax allows us to represent an indefinite number of arguments as an array. With the help of a rest parameter a function can be called with any nu... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n28 Sep, 2021"
},
{
"code": null,
"e": 637,
"s": 53,
"text": "Rest parameter is an improved way to handle function parameter, allowing us to more easily handle various input as parameters in a function. The rest parameter syntax allows ... |
How to make a glass/blur effect overlay using HTML and CSS ? | 13 Jun, 2022
To give a background blur effect on an overlay, the CSS’s backdrop-filter: blur() property is used with ::before pseudo-element. The “backdrop-filter: blur()” property gives the blur effect on the box or any element where it is desired and “before” is used to add the blurred background without applying any... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n13 Jun, 2022"
},
{
"code": null,
"e": 350,
"s": 28,
"text": "To give a background blur effect on an overlay, the CSS’s backdrop-filter: blur() property is used with ::before pseudo-element. The “backdrop-filter: blur()” property gives t... |
Python – Central Limit Theorem | 29 May, 2021
The definition:
The sample mean will approximately be normally distributed for large sample sizes, regardless of the distribution from which we are sampling.
Suppose we are sampling from a population with a finite mean and a finite standard-deviation(sigma). Then Mean and standard deviation of the sam... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 May, 2021"
},
{
"code": null,
"e": 69,
"s": 52,
"text": "The definition: "
},
{
"code": null,
"e": 213,
"s": 69,
"text": "The sample mean will approximately be normally distributed for large sample sizes, regardl... |
Sorted() function in Python | 29 Dec, 2021
Python sorted() function returns a sorted list from the iterable object.
Sorted() sorts any sequence (list, tuple) and always returns a list with the elements in a sorted manner, without modifying the original sequence.
Syntax: sorted(iterable, key, reverse)
Parameters: sorted takes three parameters from w... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n29 Dec, 2021"
},
{
"code": null,
"e": 125,
"s": 52,
"text": "Python sorted() function returns a sorted list from the iterable object."
},
{
"code": null,
"e": 272,
"s": 125,
"text": "Sorted() sorts any sequence (lis... |
Minimize the maximum difference between the heights | 05 Jul, 2022
Given heights of n towers and a value k. We need to either increase or decrease the height of every tower by k (only once) where k > 0. The task is to minimize the difference between the heights of the longest and the shortest tower after modifications and output this difference.
Examples:
Input : arr[] ... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n05 Jul, 2022"
},
{
"code": null,
"e": 333,
"s": 52,
"text": "Given heights of n towers and a value k. We need to either increase or decrease the height of every tower by k (only once) where k > 0. The task is to minimize the difference... |
Lexicographically smallest string with given string as prefix | 07 Oct, 2021
Given an array arr[] consisting of N strings and a string S if size M, the task is to find the lexicographically smallest string consisting of the string S as the prefix. If there doesn’t exist any string starting with prefix S then print “-1”.
Examples:
Input: arr[] = {“apple”, “appe”, “apl”, “aapl”, “app... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n07 Oct, 2021"
},
{
"code": null,
"e": 273,
"s": 28,
"text": "Given an array arr[] consisting of N strings and a string S if size M, the task is to find the lexicographically smallest string consisting of the string S as the prefix. If t... |
Servlet With JDBC | 20 Dec, 2021
Servlets are the Java programs that run on the Java-enabled web server or application server. They are used to handle the request obtained from the webserver, process the request, produce the response, then send a response back to the webserver. Properties of Servlets are as follows:
Servlets work on the ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n20 Dec, 2021"
},
{
"code": null,
"e": 314,
"s": 28,
"text": "Servlets are the Java programs that run on the Java-enabled web server or application server. They are used to handle the request obtained from the webserver, process the requ... |
Django ModelForm – Create form from Models | 16 May, 2022
Django ModelForm is a class that is used to directly convert a model into a Django form. If you’re building a database-driven app, chances are you’ll have forms that map closely to Django models. For example, a User Registration model and form would have the same quality and quantity of model fields and fo... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n16 May, 2022"
},
{
"code": null,
"e": 716,
"s": 53,
"text": "Django ModelForm is a class that is used to directly convert a model into a Django form. If you’re building a database-driven app, chances are you’ll have forms that map clos... |
Batch Script - DATE and TIME | The date and time in DOS Scripting have the following two basic commands for retrieving the date and time of the system.
This command gets the system date.
DATE
@echo off
echo %DATE%
The current date will be displayed in the command prompt. For example,
Mon 12/28/2015
This command sets or displays the time.
TIME
@e... | [
{
"code": null,
"e": 2290,
"s": 2169,
"text": "The date and time in DOS Scripting have the following two basic commands for retrieving the date and time of the system."
},
{
"code": null,
"e": 2325,
"s": 2290,
"text": "This command gets the system date."
},
{
"code": null... |
Circular rotation of an array using deque in C++ - GeeksforGeeks | 23 Sep, 2019
Given an array arr[] of integers and another integer D, the task is to perform D circular rotations on the array and print the modified array.
Examples:
Input: Arr[] = {1, 2, 3, 4, 5, 6}, D = 2Output: 5 6 1 2 3 4
Input: Arr[] = {1, 2, 3}, D = 2Output: 2 3 1
Approach:Using Deque in C++, a rotation can be pe... | [
{
"code": null,
"e": 26175,
"s": 26147,
"text": "\n23 Sep, 2019"
},
{
"code": null,
"e": 26318,
"s": 26175,
"text": "Given an array arr[] of integers and another integer D, the task is to perform D circular rotations on the array and print the modified array."
},
{
"code"... |
Depth of an N-Ary tree - GeeksforGeeks | 28 Jun, 2021
Given an N-Ary tree, find depth of the tree. An N-Ary tree is a tree in which nodes can have at most N children.Examples: Example 1:
Example 2:
N-Ary tree can be traversed just like a normal tree. We just have to consider all childs of a given node and recursively call that function on every node.
... | [
{
"code": null,
"e": 26287,
"s": 26259,
"text": "\n28 Jun, 2021"
},
{
"code": null,
"e": 26422,
"s": 26287,
"text": "Given an N-Ary tree, find depth of the tree. An N-Ary tree is a tree in which nodes can have at most N children.Examples: Example 1: "
},
{
"code": null,
... |
How to bind an array to an IN() condition in PHP ? - GeeksforGeeks | 20 May, 2020
Given a database containing some data and the task is to bind a PHP array to it by using MySQL IN() operator. Here we will look at a program that does the needful by taking a PHP array within the query and interpreting it.
SQL IN() Operator: The SQL IN() operator allows you to pass multiple arguments in th... | [
{
"code": null,
"e": 26327,
"s": 26299,
"text": "\n20 May, 2020"
},
{
"code": null,
"e": 26550,
"s": 26327,
"text": "Given a database containing some data and the task is to bind a PHP array to it by using MySQL IN() operator. Here we will look at a program that does the needful ... |
Difference between tellg and tellp in C++ - GeeksforGeeks | 23 Mar, 2021
In this article, we will discuss the functionality of basic_istream<>::tellg and basic_ostream<>::tellp and the difference between them.
tellg(): The function is defined in the istream class, and used with input streams. It returns the position of the current character in the input stream.
Syntax:
pos_type... | [
{
"code": null,
"e": 24163,
"s": 24135,
"text": "\n23 Mar, 2021"
},
{
"code": null,
"e": 24300,
"s": 24163,
"text": "In this article, we will discuss the functionality of basic_istream<>::tellg and basic_ostream<>::tellp and the difference between them."
},
{
"code": null... |
Spring - Bean Definition Inheritance | A bean definition can contain a lot of configuration information, including constructor arguments, property values, and container-specific information such as initialization method, static factory method name, and so on.
A child bean definition inherits configuration data from a parent definition. The child definition ... | [
{
"code": null,
"e": 2513,
"s": 2292,
"text": "A bean definition can contain a lot of configuration information, including constructor arguments, property values, and container-specific information such as initialization method, static factory method name, and so on."
},
{
"code": null,
... |
Cassandra - CQL Collections | CQL provides the facility of using Collection data types. Using these Collection types, you can store multiple values in a single variable. This chapter explains how to use Collections in Cassandra.
List is used in the cases where
the order of the elements is to be maintained, and
a value is to be stored multiple times... | [
{
"code": null,
"e": 2486,
"s": 2287,
"text": "CQL provides the facility of using Collection data types. Using these Collection types, you can store multiple values in a single variable. This chapter explains how to use Collections in Cassandra."
},
{
"code": null,
"e": 2518,
"s": 24... |
Deep Learning-Prepare Image for Dataset | by Karthick Nagarajan | Towards Data Science | Whenever we begin a machine learning project, the first thing that we need is a dataset. Dataset will be the pillar of your training model. You can build the dataset either automatically or manually. Here I am going to share about the manual process.
Dataset is the collection of specific data for your ML project needs.... | [
{
"code": null,
"e": 423,
"s": 172,
"text": "Whenever we begin a machine learning project, the first thing that we need is a dataset. Dataset will be the pillar of your training model. You can build the dataset either automatically or manually. Here I am going to share about the manual process."
}... |
instance initializer block in Java | Instance initializer block works are used to initialize the properties of an object. It is invoked before the constructor is invoked. It is invoked every time an object is created. See the example below −
Live Demo
public class Tester {
{
System.out.println("Inside instance initializer block");
}
Tester(... | [
{
"code": null,
"e": 1267,
"s": 1062,
"text": "Instance initializer block works are used to initialize the properties of an object. It is invoked before the constructor is invoked. It is invoked every time an object is created. See the example below −"
},
{
"code": null,
"e": 1277,
"... |
How to insert HTML content into an iFrame using jQuery? | 27 Sep, 2019
Here is the task to insert HTML content into an iFrame using jQuery. To do so, we can use the jQuery contents() method.
The .contents() method: It returns all the direct children, including text and comment nodes for the selected element.
Syntax:
$(selector).contents()
Find the iframe in the body section.
... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n27 Sep, 2019"
},
{
"code": null,
"e": 148,
"s": 28,
"text": "Here is the task to insert HTML content into an iFrame using jQuery. To do so, we can use the jQuery contents() method."
},
{
"code": null,
"e": 267,
"s": 148,... |
Longest Palindromic Substring | Set 2 | 30 Jun, 2022
Given a string, find the longest substring which is a palindrome.
Examples:
Input: Given string :"forgeeksskeegfor",
Output: "geeksskeeg".
Input: Given string :"Geeks",
Output: "ee".
Common mistake : Wrong Approach:
Some people will be tempted to come up with a O(n) time complexity quick solution,... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Jun, 2022"
},
{
"code": null,
"e": 121,
"s": 54,
"text": "Given a string, find the longest substring which is a palindrome. "
},
{
"code": null,
"e": 132,
"s": 121,
"text": "Examples: "
},
{
"code": null,... |
Optional ifPresentOrElse() method in Java with examples | 30 Jul, 2019
The ifPresentOrElse(Consumer, Runnable) method of java.util.Optional class helps us to perform the specified Consumer action the value of this Optional object. If a value is not present in this Optional, then this method performs the given empty-based Runnable emptyAction, passed as the second parameter
Sy... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n30 Jul, 2019"
},
{
"code": null,
"e": 359,
"s": 54,
"text": "The ifPresentOrElse(Consumer, Runnable) method of java.util.Optional class helps us to perform the specified Consumer action the value of this Optional object. If a value is ... |
scriptreplay command in Linux with Examples | 17 Apr, 2019
scriptreplay command is used to replay a typescript/terminal_activity stored in the log file that was recorded by the script command. With the help of timing information, the log files are played and the outputs are generated in the terminal with the same speed the original script was recorded. The replay ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n17 Apr, 2019"
},
{
"code": null,
"e": 642,
"s": 28,
"text": "scriptreplay command is used to replay a typescript/terminal_activity stored in the log file that was recorded by the script command. With the help of timing information, the ... |
How to replace an HTML element with another one using JavaScript ? | 18 Nov, 2020
Document Object Model (DOM) is a platform and language-neutral interface which is used by programs and scripts to dynamically access the content, style and structure. Please refer to DOM (Document Object Model) to know the details. We can implement this by using DOM’s createElement(), createTextNode(), app... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n18 Nov, 2020"
},
{
"code": null,
"e": 421,
"s": 54,
"text": "Document Object Model (DOM) is a platform and language-neutral interface which is used by programs and scripts to dynamically access the content, style and structure. Please ... |
Python Program to convert a list into matrix with size of each row increasing by a number | 24 Jan, 2021
Given a list and a number N, the task here is to write a python program to convert it to matrix where each row has N elements more than previous row elements from list.
Input : test_list = [4, 6, 8, 1, 2, 9, 0, 10, 12, 3, 9, 1], N = 3
Output : [[4, 6, 8], [4, 6, 8, 1, 2, 9], [4, 6, 8, 1, 2, 9, 0, 10, 12], ... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Jan, 2021"
},
{
"code": null,
"e": 197,
"s": 28,
"text": "Given a list and a number N, the task here is to write a python program to convert it to matrix where each row has N elements more than previous row elements from list."
},
... |
How to sum two integers without using arithmetic operators in C/C++? | 27 Jun, 2020
Given two integers a and b, how can we evaluate the sum a + b without using operators such as +, -, ++, –, ...?
An interesting way would be:
// May not work with C++ compilers and// may produce warnings in C. // Returns sum of 'a' and 'b'int sum(int a, int b) { char *p = a; return (int)&p[b];}
Despi... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n27 Jun, 2020"
},
{
"code": null,
"e": 166,
"s": 54,
"text": "Given two integers a and b, how can we evaluate the sum a + b without using operators such as +, -, ++, –, ...?"
},
{
"code": null,
"e": 195,
"s": 166,
"t... |
Serializable Interface in Java | 24 Nov, 2020
The Serializable interface is present in java.io package. It is a marker interface. A Marker Interface does not have any methods and fields. Thus classes implementing it do not have to implement any methods. Classes implement it if they want their instances to be Serialized or Deserialized. Serialization i... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n24 Nov, 2020"
},
{
"code": null,
"e": 739,
"s": 28,
"text": "The Serializable interface is present in java.io package. It is a marker interface. A Marker Interface does not have any methods and fields. Thus classes implementing it do no... |
How to pass multiple arguments to function ? | 01 Feb, 2022
A Routine is a named group of instructions performing some tasks. A routine can always be invoked as well as called multiple times as required in a given program.
When the routine stops, the execution immediately returns to the stage from which the routine was called. Such routines may be predefined in th... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n01 Feb, 2022"
},
{
"code": null,
"e": 218,
"s": 54,
"text": "A Routine is a named group of instructions performing some tasks. A routine can always be invoked as well as called multiple times as required in a given program. "
},
{
... |
SQL queries on clustered and non-clustered Indexes | 22 May, 2022
Prerequisite – Indexing in Databases Indexing is a procedure that returns your requested data faster from the defined table. Without indexing, the SQL server has to scan the whole table for your data. By indexing, SQL server will do the exact same thing you do when searching for content in a book by checki... | [
{
"code": null,
"e": 52,
"s": 24,
"text": "\n22 May, 2022"
},
{
"code": null,
"e": 520,
"s": 52,
"text": "Prerequisite – Indexing in Databases Indexing is a procedure that returns your requested data faster from the defined table. Without indexing, the SQL server has to scan the ... |
Create matrix of zeros in R | 29 Oct, 2021
R programming language offers us a variety of ways to create a matrix and fill it in such a way that all the element values are equivalent to 0. Let’s see those ways –
The in-built matrix() method in R can be used to create a matrix with a given set of values, that is, n x m dimensions, and initialize it w... | [
{
"code": null,
"e": 28,
"s": 0,
"text": "\n29 Oct, 2021"
},
{
"code": null,
"e": 196,
"s": 28,
"text": "R programming language offers us a variety of ways to create a matrix and fill it in such a way that all the element values are equivalent to 0. Let’s see those ways –"
},
... |
HTML | <frame> noresize Attribute | 30 Sep, 2019
The HTML <frame> noresize attribute is used to specify that the frame element can not be resize by the user. This type of attribute is used to looks at the size of the frame element.
Syntax:
<frame noresize="noresize">
Attribute Values:
noresize: It defines the frame element that can not be resize by the u... | [
{
"code": null,
"e": 53,
"s": 25,
"text": "\n30 Sep, 2019"
},
{
"code": null,
"e": 236,
"s": 53,
"text": "The HTML <frame> noresize attribute is used to specify that the frame element can not be resize by the user. This type of attribute is used to looks at the size of the frame ... |
Java Program to print all permutations of a given string | 10 Dec, 2021
A permutation also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself. A string of length n has n! permutation.
Source: Mathword(http://mathworld.wolfram.com/Permutation.html)
Below are the permutations of strin... | [
{
"code": null,
"e": 54,
"s": 26,
"text": "\n10 Dec, 2021"
},
{
"code": null,
"e": 262,
"s": 54,
"text": "A permutation also called an “arrangement number” or “order,” is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself. A string... |
How to change the column names in R within aggregate function? | The column names in an R data frame are an important part of the data because by reading the column names any viewer is likely to understand the theoretical background behind it. If that name is not appropriate then we might want to change it. While using the aggregate function to calculate mean or any other statistica... | [
{
"code": null,
"e": 1482,
"s": 1062,
"text": "The column names in an R data frame are an important part of the data because by reading the column names any viewer is likely to understand the theoretical background behind it. If that name is not appropriate then we might want to change it. While usi... |
JavaScript Array find() Method - GeeksforGeeks | 16 Nov, 2021
The arr.find() method in Javascript is used to get the value of the first element in the array that satisfies the provided condition. It checks all the elements of the array and whichever first element satisfies the condition is going to print. This function will not work function having the empty array el... | [
{
"code": null,
"e": 24207,
"s": 24179,
"text": "\n16 Nov, 2021"
},
{
"code": null,
"e": 24563,
"s": 24207,
"text": "The arr.find() method in Javascript is used to get the value of the first element in the array that satisfies the provided condition. It checks all the elements of... |
Feature Selection Using Random forest | by Akash Dubey | Towards Data Science | Random forests are one the most popular machine learning algorithms. They are so successful because they provide in general a good predictive performance, low overfitting, and easy interpretability. This interpretability is given by the fact that it is straightforward to derive the importance of each variable on the tr... | [
{
"code": null,
"e": 599,
"s": 172,
"text": "Random forests are one the most popular machine learning algorithms. They are so successful because they provide in general a good predictive performance, low overfitting, and easy interpretability. This interpretability is given by the fact that it is st... |
Application Layer - GeeksforGeeks | 09 Oct, 2019
The Layer 1 (Physical Layer) PDU is the bit or, more generally, symbol
The Layer 2 (Data Link Layer) PDU is the frame.
The Layer 3 (Network Layer) PDU is the packet.
The Layer 4 (Transport Layer) PDU is the segment
for TCP or the datagram for UDP.
The Layer 5 (Application Layer) PDU is ... | [
{
"code": null,
"e": 36666,
"s": 36638,
"text": "\n09 Oct, 2019"
},
{
"code": null,
"e": 36995,
"s": 36666,
"text": " The Layer 1 (Physical Layer) PDU is the bit or, more generally, symbol \n The Layer 2 (Data Link Layer) PDU is the frame.\n The Layer 3 (Network Layer) PDU is the... |
The @Override Annotation in Java - GeeksforGeeks | 06 Dec, 2021
The @Override annotation is a standard Java annotation that was first introduced in Java 1.5. The @Override annotation denotes that the child class method overrides the base class method.
For two reasons, the @Override annotation is useful.
If the annotated method does not actually override anything, the c... | [
{
"code": null,
"e": 25347,
"s": 25319,
"text": "\n06 Dec, 2021"
},
{
"code": null,
"e": 25535,
"s": 25347,
"text": "The @Override annotation is a standard Java annotation that was first introduced in Java 1.5. The @Override annotation denotes that the child class method override... |
How to share intent from intentservice in android? | Before getting into example, we should know what Intent service is in android. Intent Service is going to do back ground operation asynchronously. When user call startService() from activity , it doesn’t create instance for each request. It going to stop service after done some action in service class or else we need t... | [
{
"code": null,
"e": 1415,
"s": 1062,
"text": "Before getting into example, we should know what Intent service is in android. Intent Service is going to do back ground operation asynchronously. When user call startService() from activity , it doesn’t create instance for each request. It going to sto... |
DateTime.ToFileTimeUtc() Method in C# - GeeksforGeeks | 10 Feb, 2019
This method is used to convert the value of the current DateTime object to a Windows file time.
Syntax: public long ToFileTimeUtc ();
Return Value: This method returns the value of the current DateTime object expressed as a Windows file time.
Exception: This method will give ArgumentOutOfRangeException if ... | [
{
"code": null,
"e": 24302,
"s": 24274,
"text": "\n10 Feb, 2019"
},
{
"code": null,
"e": 24398,
"s": 24302,
"text": "This method is used to convert the value of the current DateTime object to a Windows file time."
},
{
"code": null,
"e": 24436,
"s": 24398,
"te... |
How to detect if JavaScript is disabled in a browser? | To detect if JavaScript is disabled in a web browser, use the <noscript> tag. The HTML <noscript> tag is used to handle the browsers, which do recognize <script> tag but do not support scripting. This tag is used to display an alternate text message.
Here’s an example,
<!DOCTYPE html>
<html>
<head>
<title>HTML... | [
{
"code": null,
"e": 1313,
"s": 1062,
"text": "To detect if JavaScript is disabled in a web browser, use the <noscript> tag. The HTML <noscript> tag is used to handle the browsers, which do recognize <script> tag but do not support scripting. This tag is used to display an alternate text message."
... |
How to pass data into table from a form using React Components - GeeksforGeeks | 21 Sep, 2021
ReactJS is a front-end library used to build UI components. In this article, we will learn to pass data into a table from a form using React Components. This will be done using two React components named Table and form. We will enter data into a form, which will be displayed in the table on ‘submit’.
Creat... | [
{
"code": null,
"e": 26247,
"s": 26219,
"text": "\n21 Sep, 2021"
},
{
"code": null,
"e": 26549,
"s": 26247,
"text": "ReactJS is a front-end library used to build UI components. In this article, we will learn to pass data into a table from a form using React Components. This will ... |
How to re-index an array in PHP? - GeeksforGeeks | 22 May, 2019
The re-index of an array can be done by using some inbuilt function together. These functions are:
array_combine() Function: The array_combine() function is an inbuilt function in PHP which is used to combine two arrays and create a new array by using one array for keys and another array for values. That i... | [
{
"code": null,
"e": 26327,
"s": 26299,
"text": "\n22 May, 2019"
},
{
"code": null,
"e": 26426,
"s": 26327,
"text": "The re-index of an array can be done by using some inbuilt function together. These functions are:"
},
{
"code": null,
"e": 26763,
"s": 26426,
... |
Python 3 - Number fabs() Method | The fabs() method returns the absolute value of x. Although similar to the abs() function, there are differences between the two functions. They are −
abs() is a built in function whereas fabs() is defined in math module.
abs() is a built in function whereas fabs() is defined in math module.
fabs() function works only ... | [
{
"code": null,
"e": 2491,
"s": 2340,
"text": "The fabs() method returns the absolute value of x. Although similar to the abs() function, there are differences between the two functions. They are −"
},
{
"code": null,
"e": 2562,
"s": 2491,
"text": "abs() is a built in function wh... |
Add new column with default value in PySpark dataframe - GeeksforGeeks | 29 Jun, 2021
In this article, we are going to see how to add a new column with a default value in PySpark Dataframe.
The three ways to add a column to PandPySpark as DataFrame with Default Value.
Using pyspark.sql.DataFrame.withColumn(colName, col)
Using pyspark.sql.DataFrame.select(*cols)
Using pyspark.sql.SparkSessio... | [
{
"code": null,
"e": 24390,
"s": 24362,
"text": "\n29 Jun, 2021"
},
{
"code": null,
"e": 24494,
"s": 24390,
"text": "In this article, we are going to see how to add a new column with a default value in PySpark Dataframe."
},
{
"code": null,
"e": 24573,
"s": 24494,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.