- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Let us first create a collection with documents −> db.arrayElementsNotGreaterThanDemo.insertOne({"Scores":[89, 43, 32, 45]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd9e9f9b50a6c6dd317adb3") } > db.arrayElementsNotGreaterThanDemo.insertOne({"Scores":[32, 33, 34, 40]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd9ea13b50a6c6dd317adb4") } > db.arrayElementsNotGreaterThanDemo.insertOne({"Scores":[45, 56, 66, 69]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd9ea25b50a6c6dd317adb5") } > db.arrayElementsNotGreaterThanDemo.insertOne({"Scores":[46, 66, 77, 88]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd9ea3cb50a6c6dd317adb6") }Following is the query to display all documents from a collection with the help of find() method −> db.arrayElementsNotGreaterThanDemo.find().pretty();This will produce the following output −{ "_id" : ObjectId("5cd9e9f9b50a6c6dd317adb3"), "Scores" : [ ... Read More
Void pointer is a pointer which is not associate with any data types. It points to some data location in storage means points to the address of variables. It is also called general purpose pointer.It is not safe to delete a void pointer in C/C++ because delete needs to call the destructor of whatever object it's destroying, and it is impossible to do that if it doesn't know the type.Here is a simple example of void pointer −Example Live Demo#include int main() { int a = 7; float b = 7.6; void *p; p = &a; printf("Integer variable is = %d", *( (int*) p) ); p = &b; printf("Float variable ... Read More
The HTML DOM input number Object represent the
The HTML DOM S Object represent the element of an HTML document.Let us create an s object −SyntaxFollowing is the syntax −document.createElement(“S”);ExampleLet us see an example of s object − Live Demo body{ text-align:center; background-color:#fff; color:#0197F6; } h1{ color:#23CE6B; } .drop-down{ width:35%; border:2px solid #fff; font-weight:bold; padding:8px; } .btn{ background-color:#fff; border:1.5px dashed #0197F6; height:2rem; ... Read More
Let’s say the following is our List with string elements:List leagues = Arrays.asList("BBL", "IPL", "MLB", "FPL", "NBA", "NFL");Now, create a stream and filter elements that end with a specific letter:Stream stream = leagues.stream().filter(leagueName -> leagueName.endsWith("L"));Now, use Objects::nonnull for non-null values:List list = stream.filter(Objects::nonNull).collect(Collectors.toList());The following is an example to filter non-null value in Java:Exampleimport java.util.Arrays; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; public class Demo { public static void main(String[] args) { List leagues = Arrays.asList("BBL", "IPL", "MLB", "FPL", "NBA", "NFL"); Stream stream = leagues.stream().filter(leagueName -> leagueName.endsWith("L")); List list = ... Read More
Here we shall discuss a C++ program to find the Longest Subsequence Common to All Sequences in a Set of Sequences.AlgorithmsBegin Take the array of strings as input. function matchedPrefixtill(): find the matched prefix between string s1 and s2 : n1 = store length of string s1. n2 = store length of string s2. for i = 0, j = 0 to i
Html taga) The tag is used to define a client-side script.b) The tag contains scripting statements or an external script file.JavaScript code must be keep in script tag.Let's see the use of the tag. For suppose declare the variable outside the script tag. Live DemoExample var a = 1; var b = 2; var c = a + b; document.getElementById("tag").innerHTML = c; Outputvar a = 1For suppose, let the variable be declared inside the script tag. Live DemoExample var a = 1; var b = 2; var c = a + b; document.getElementById("tag").innerHTML = c; Output3
Position buttons vertically one after another using the Box class. Use the createVerticalBox() method that displays components from top to bottom −JButton button1 = new JButton("One"); JButton button2 = new JButton("Two"); JButton button3 = new JButton("Three"); Box box = Box.createVerticalBox(); box.add(button1); box.add(button2); box.add(button3);The following is an example to position buttons vertically one after another −Examplepackage my; import javax.swing.Box; import javax.swing.JButton; import javax.swing.JFrame; public class SwingDemo { public static void main(String[] args) { JButton button1 = new JButton("One"); JButton button2 = new JButton("Two"); JButton button3 = new JButton("Three"); ... Read More
To concatenate two tables, UNION ALL in MySQL. Let us create a table −mysql> create table DemoTable1 ( Id int, FirstName varchar(20) ); Query OK, 0 rows affected (1.52 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values(10, 'John'); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable1 values(20, 'Carol'); Query OK, 1 row affected (0.28 sec)Display all records from the table using select statement −mysql> select *from DemoTable1;Output+------+-----------+ | Id | FirstName | +------+-----------+ | 10 | John | ... Read More
PointersPointers are used to store the address of variable.SyntaxType *pointer;InitializationType *pointer; Pointer = variable name;Functionspointers are used to store address of variable.pointers can have a null value assigned.pointer can be referenced by pass by reference.a pointer has its own memory address and size on the stack.Example Live Demo#include using namespace std; int main() { // A normal integer variable int a = 7; // A pointer variable that holds address of a. int *p = &a; // Value stored is value of variable "a" cout
To Continue Learning Please Login
Login with Google