- 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
926 Views
This example demonstrate about How to Show android notification every five minutesStep 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. Step 3 ... Read More
Smita Kapse
1K+ Views
To rename a user, you need to use update() and $set to set the new username. Following is the syntax −db.system.users.update({"user":"yourOldUserName"}, {$set:{"user":"yourNewUserName"}});Firstly, display all the users from the MongoDB database −> use admin; switched to db admin > db.getUsers();This will produce the following output −[ { ... Read More
Smita Kapse
53 Views
Use $addToSet to create a new field in MongoDB. Let us first create a collection with documents −> db.createFieldDemo.insertOne({"StudentFirstName":"John", "StudentAge":21}); { "acknowledged" : true, "insertedId" : ObjectId("5cd99e28b50a6c6dd317ad95") } > db.createFieldDemo.insertOne({"StudentFirstName":"Larry", "StudentAge":23}); { "acknowledged" : true, "insertedId" : ObjectId("5cd99e2fb50a6c6dd317ad96") } > db.createFieldDemo.insertOne({"StudentFirstName":"Chris", "StudentAge":22}); { "acknowledged" : ... Read More
Smita Kapse
194 Views
To automatically resize a JTree, use the setVisibleRowCount() method in Java. At first, create a node in the tree −DefaultMutableTreeNode node = new DefaultMutableTreeNode("Project");Now, add nodes to the node created above −DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("App"); DefaultMutableTreeNode node2 = new DefaultMutableTreeNode("Website"); DefaultMutableTreeNode node3 = new DefaultMutableTreeNode("WebApp"); node.add(node1); node.add(node2); node.add(node3);Now, create ... Read More
Smita Kapse
110 Views
Here we will see some incompatibilities between C and C++. Some C codes that can be compiled using C compiler, but does not compile in C++ compiler. And also returns error.We can define function using a syntax, that optionally specify the argument types after the argument list.Example#include void my_function(x, y)int ... Read More
Smita Kapse
82 Views
Let us first create a table with rows and columns −String data[][] = { {"Australia", "5", "1"}, {"US", "10", "2"}, {"Canada", "9", "3"}, {"India", "7", "4"}, {"Poland", "2", "5"}, {"SriLanka", "5", "6"} }; String col [] = {"Team", "Selected Players", "Rank"}; DefaultTableModel tableModel = new ... Read More
Smita Kapse
92 Views
To get particular field as a result in MongoDB, you can use findOne(). Following is the syntax −db.yourCollectionName.findOne({"yourFieldName1":yourValue}, {yourFieldName2:1});Let us first create a collection with documents −> db.particularFieldDemo.insertOne({"EmployeeName":"John Smith", "EmployeeAge":26, "EmployeeTechnology":"MongoDB"}); { "acknowledged" : true, "insertedId" : ObjectId("5cd9b4abb50a6c6dd317ada2") } > db.particularFieldDemo.insertOne({"EmployeeName":"Chris Brown", "EmployeeAge":28, "EmployeeTechnology":"Java"}); { "acknowledged" : ... Read More
Smita Kapse
92 Views
Contigous selection means sharing borders like selecting siblings of a node in a JTree. To allow contiguous selection of nodes, set the selection mode to CONTIGUOUS_TREE_SELECTION −tree.getSelectionModel().setSelectionMode(TreeSelectionModel.CONTIGUOUS_TREE_SELECTION);The following is an example to allow contigous selection of nodes in a JTree −Examplepackage my; import javax.swing.JFrame; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreeSelectionModel; public class SwingDemo { public static void main(String[] args) throws Exception { ... Read More
Smita Kapse
3K+ Views
In C we have used Files. To handle files, we use the pointer of type FILE. So the FILE is a datatype. This is called the Opaque datatype. So its implementation is hidden. The definition of the FILE is system specific. This is the definition of FILE in Ubuntu System ... Read More
Smita Kapse
428 Views
Use delete operator to unset variable in MongoDB shell. Following is the syntax −delete yourVariableName;Let us now implement the above syntax in order to unset variable in MongoDB shell. First, print the variable name −> customerDetail;This will produce the following output −2019-05-08T22:29:17.361+0530 E QUERY [js] ReferenceError: customerDetail is not defined ... Read More