- 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
Smita Kapse has Published 558 Articles
Smita Kapse
912 Views
This is a C++ program to convert time from 12 hour to 24 hour format.AlgorithmBegin In main(), If median = pm Check if entered hours is less than 12 Then add 12 to hours and print the time in 24 hours ... Read More
Smita Kapse
9K+ Views
First open the CMD and then reach the BIN directory of MongoDB. The screenshot to open CMD prompt is as follows.Above we have reached the RUN dialog by pressing START and then typing RUN and ENTER.Now, type CMD and press OK button to get the command line. The screenshot is ... Read More
Smita Kapse
175 Views
The exception handling feature is present almost any object oriented languages nowadays. In C++ and Java also we can get this kind of feature. There are some similarities between exception handling in C++ and exception handling in Java, like in both languages we have to use the try-catch block. Though ... Read More
Smita Kapse
427 Views
Insert styled text in a JTextPane component using the SimpleAttributeSet and StyleConstants classes. With that, we will also use StyledDocument.The following is an example to insert styled text in a JTextPane component −package my; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Font; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTextPane; import javax.swing.text.BadLocationException; ... Read More
Smita Kapse
5K+ Views
Let us create a label with image icon −JLabel label = new JLabel("SUBJECT "); label.setIcon(new ImageIcon("E:ew.png"));Now, create another component −JTextArea text = new JTextArea(); text.setText("Add subject here...");Align the components with GridBagLayout −panel.setLayout(new GridBagLayout());The following is an example to center a label with an image icon −Examplepackage my; import java.awt.GridBagLayout; import ... Read More
Smita Kapse
86 Views
It is a program to check possibility of construction of a graph in a given degree sequence.InputIt takes the no of edges and vertexes.OutputIt shows the random values of a created graph.AlgorithmsBegin Declare a function RandomGraphs(). Declare NoEdge and NoVertex of the integer datatype and pass ... Read More
Smita Kapse
315 Views
To sum every field in a sub document, use aggregate framework. Let us first create a collection with documents −> db.sumEveryFieldDemo.insertOne( ... { ... "_id":101, ... "PlayerDetails": [ ... {"PlayerName":"John", "PlayerScore":1000}, ... {"PlayerName":"Carol", "PlayerScore":2000}, ... {"PlayerName":"Sam", "PlayerScore":3000} ... ... Read More
Smita Kapse
251 Views
To sort by sub-document match, you can use aggregate framework. Let us first create a collection with documents −> db.sortBySubDocumentsDemo.insertOne( { "StudentName": "Chris", "StudentDetails": [ { "Age":21, ... Read More
Smita Kapse
204 Views
Here we will see some C++ examples and try to get what type of output will generate. Then we can understand the purpose and functions of scope resolution operator and the ‘this’ pointer in C++.If some code has some members say ‘x’, and we want to use another function that ... Read More
Smita Kapse
395 Views
To set the alignment of the label content along the Y axis, use the setVerticalAlignment() 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("Product Name ... Read More