- Trending Categories
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
Anvi Jain has Published 629 Articles
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
1K+ Views
Here, we have set panels with BorderLayout, GridLayout and FlowLayout. Within the panels, we have created components such as Button, ComboBox, etc. The following is an example to combine layouts in Java −Examplepackage my; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JPanel; ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
6K+ Views
Here we will see how to get the modulus of two floating or double type data in C. The modulus is basically finding the remainder. For this, we can use the remainder() function in C. The remainder() function is used to compute the floating point remainder of numerator/denominator.So the remainder(x, ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
379 Views
This is a C++ Program to print the diamond shape.AlgorithmBegin Take the no of rows n means the dimension of the diamond shape as input. Declare the variables i, j and initialize space=1. Initialize space = n-1. Run for loop till n. Run ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
1K+ Views
To check if value exists for a field in a MongoDB document, you can use find() along with $exists operator. Let us first create a collection with documents −> db.checkIfValueDemo.insertOne({"PlayerName":"John Smith", "PlayerScores":[5000, 98595858, 554343]}); { "acknowledged" : true, "insertedId" : ObjectId("5cc6f507af8e7a4ca6b2ad98") } > db.checkIfValueDemo.insertOne({"PlayerName":"John Doe", "PlayerScores":[]}); { ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
580 Views
To set the alignment of the label content along the X axis, use the setHorizontalAlignment() method. Let us first set a label component. We have set the label background color as well so that we can check the alignment of the label’s content properly −JLabel label = new JLabel("Team "); ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
478 Views
In a Directed Acyclic Graph, we can sort vertices in linear order using topological sort.Topological sort is only work on Directed Acyclic Graph. In a Directed Acyclic Graph (DAG), there can be more than one topological sort.In the following C++ program, we shall perform topological sort to check existence of ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
803 Views
You can use regular expression along with $not operator to ignore a specific character and display rest of them. Let us first create a collection with documents −> db.regexDemo.insertOne({"CustomerId":"Customer#1234", "CustomerName":"Chris"}); { "acknowledged" : true, "insertedId" : ObjectId("5cc7428f8f9e6ff3eb0ce436") } > db.regexDemo.insertOne({"CustomerId":"Customer5678", "CustomerName":"Robert"}); { "acknowledged" : true, "insertedId" ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
466 Views
You can use $literal operator along with aggregate framework. Let us first create a collection with documents −> db.fieldWithStaticValue.insertOne({"Name":"Larry", "Age":24}); { "acknowledged" : true, "insertedId" : ObjectId("5cd6554c7924bb85b3f48948") } > db.fieldWithStaticValue.insertOne({"Name":"Chris", "Age":23}); { "acknowledged" : true, "insertedId" : ObjectId("5cd655567924bb85b3f48949") } > db.fieldWithStaticValue.insertOne({"Name":"David", "Age":26}); { "acknowledged" : ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
312 Views
To get the node at a specified index in a JTree, use the getChildAt() method. Here, we are finding the node at index 3 i.e. 4th node −node.getChildAt(3)The following is an example to get the node at a specified index in a JTree −Examplepackage my; import javax.swing.JFrame; import javax.swing.JTree; import ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
153 Views
This is a C++ Program to show the Duality Transformation of Line and Point. So it can have two cases −Case-1: A point (a, b) is transformed to the line (y = ax − b).Case-2: A line D(y = cx + d) is transformed to the point D’(c, −d).Functions and ... Read More