Smita Kapse has Published 558 Articles

Program to display hostname and IP address C

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

339 Views

In this section we will see how to see the Host name and IP address of the local system in an easier way. We will write a C program to find the host name and IP.Some of the following functions are used. These functions have a different task. Let us ... Read More

Remove and update the existing record in MongoDB?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

108 Views

You can use only $pull operator that removes and updates the existing record in MongoDB. Let us first create a collection with documents −> db.removeDemo.insertOne( ...    { ...       "UserName" : "Larry", ...       "UserDetails" : [ ...          { ...   ... Read More

How to get the number of siblings of this node in a JTree?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

110 Views

To get the count of siblings of this node, use the getSiblingCount() method. Let’s say you have a node with 4 child nodes. Find the sibling of any of this node’s child node. Here, “eight” is the child node −eight.getSiblingCount());Note − Remember, a node is it’s own sibling.The following is ... Read More

Find the count of users who logged in between specific dates with MongoDB

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

254 Views

Let’s say you have saved the Login date of users. Now, you want the users who logged in between specific dates i.e. login date. For this, use $gte and $lt operator along with count(). Let us first create a collection with documents −> db.findDataByDateDemo.insertOne({"UserName":"John", "UserLoginDate":new ISODate("2019-01-31")}); {    "acknowledged" : ... Read More

How to use use an array of pointers (Jagged) in C/C++?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

513 Views

Let us consider the following example, which uses an array of 3 integers −In CExample Live Demo#include const int MAX = 3; int main () {    int var[] = {10, 100, 200};    int i;    for (i = 0; i < MAX; i++) {       printf("Value ... Read More

How to display multiple notifications in android?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

824 Views

This example demonstrate about How to display multiple notifications in androidStep 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

How to increment a field in MongoDB?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

293 Views

To increment a field in MongoDB, you can use $inc operator. Let us first create a collection with documents −> db.incrementDemo.insertOne({"PlayerScore":100}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc81cdd8f9e6ff3eb0ce44e") } > db.incrementDemo.insertOne({"PlayerScore":290}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc81ce28f9e6ff3eb0ce44f") } > db.incrementDemo.insertOne({"PlayerScore":560}); {    "acknowledged" : true, ... Read More

How to add components with a relative Y position in Java?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

114 Views

To add components with a relative Y position, use the GridBagConstraints.RELATIVE constant. Set this to gridy field −GridBagConstraints constraints = new GridBagConstraints(); constraints.gridy = GridBagConstraints.RELATIVE;The following is an example to add components with a relative Y position in Java −Examplepackage my; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.JButton; import javax.swing.JFrame; import ... Read More

What should be used to implement MySQL LIKE statement in MongoDB?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

67 Views

To get MySQL LIKE statement, use the REGEX in MongoDB. Let us first create a collection with documents −> db.likeInMongoDBDemo.insertOne({"Name" : "Sam"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd6922857806ebf1256f123") } > db.likeInMongoDBDemo.insertOne({"Name" : "John" }); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd6923157806ebf1256f124") } > db.likeInMongoDBDemo.insertOne({"Name" : ... Read More

How to make notification intent resume rather than making a new intent?

Smita Kapse

Smita Kapse

Updated on 30-Jul-2019 22:30:26

400 Views

This example demonstrate about How to make notification intent resume rather than making a new intentStep 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

Advertisements