- 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
230 Views
You can use $inc operator to increment. Let us first create a collection with documents −> db.addInUpdateFunctionDemo.insertOne({"PlayerName":"Chris", "PlayerScore":78}); { "acknowledged" : true, "insertedId" : ObjectId("5cd2b3f4345990cee87fd893") } > db.addInUpdateFunctionDemo.insertOne({"PlayerName":"Robert", "PlayerScore":88}); { "acknowledged" : true, "insertedId" : ObjectId("5cd2b3fc345990cee87fd894") } > db.addInUpdateFunctionDemo.insertOne({"PlayerName":"David", "PlayerScore":99}); { "acknowledged" : true, ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
93 Views
Let’s say we have a menu and within that we need to set the JCheckBoxMenuItem. Here’s the Menu −JMenu editMenu = new JMenu("Edit"); editMenu.setMnemonic(KeyEvent.VK_E); menuBar.add(editMenu);Now, set the JCheckBoxMenuItem and add it to the editMenu created above −JCheckBoxMenuItem checkMenuItem = new JCheckBoxMenuItem("SelectAll"); checkMenuItem.setMnemonic(KeyEvent.VK_B); editMenu.add(checkMenuItem);The following is an example to set JCheckBoxMenuItem ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
14K+ Views
Here we will see how to initialize the const type member variable using constructor?To initialize the const value using constructor, we have to use the initialize list. This initializer list is used to initialize the data member of a class. The list of members, that will be initialized, will be ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
678 Views
This is the program to find closest pair of points in an array.AlgorithmsFor Distance between Closest pointBegin Declare function Closest_dist_Spoint(poi stp[], int s, double dist, poi &pnt1, poi &pnt2) to the double datatype. Declare Minimum to the double datatype. Initialize Minimum = dist. for ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
250 Views
Major Tick marks is the number passed in representing the distance between each major tick mark. For example, a slider with range from 0 to 75 and major tick spacing 25, would give major ticks next to the following values: 0, 25, 50, 75.To set major tick marks, use the setMajorTickSpacing() ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
349 Views
You can use Date() along with $gte operator to find objects created last week. Here the curdate is as follows in my system −> new Date(); ISODate("2019-05-14T08:32:42.773Z")Let us first create a collection with documents −> db.findObectInLastWeekDemo.insertOne({"ShippingDate":new ISODate("2019-05-01")}); { "acknowledged" : true, "insertedId" : ObjectId("5cda7dc4bf3115999ed511e0") } > db.findObectInLastWeekDemo.insertOne({"ShippingDate":new ISODate("2019-05-02")}); ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
608 Views
To append a row, you can use the addRow() method. Ley us first create a table wherein we need to append a row −DefaultTableModel tableModel = new DefaultTableModel(); JTable table = new JTable(tableModel);Add some columns to the table −tableModel.addColumn("Language/ Technology"); tableModel.addColumn("Difficulty Level");Add some rows −tableModel.insertRow(0, new Object[] { "CSS", "Easy" ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
675 Views
Prufer code uniquely identifies a tree which is given by user as a graph representation with labels from 1 to p. This tree consist p(value is given by user) labels of node. It has sequence of p – 2 values.AlgorithmBegin Declare i, j, ver, edg, minimum, p to the ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
455 Views
This example demonstrate about How to get android notifications when the app was closedStep 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. ... Read More
![Anvi Jain](https://www.tutorialspoint.com/assets/profiles/13591/profile/60_98631-1512716973.jpg)
Anvi Jain
1K+ Views
Use $set to replace value in an array. Let us first create a collection with documents −> db.replaceValueInArrayDemo.insertOne({"StudentScores":[45, 56, 78]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd7f0421a844af18acdffb7") } > db.replaceValueInArrayDemo.insertOne({"StudentScores":[33, 90, 67]}); { "acknowledged" : true, "insertedId" : ObjectId("5cd7f0521a844af18acdffb8") }Following is the query to display all ... Read More