Nishtha Thakur has Published 568 Articles

How to use split () in Android textview?

Nishtha Thakur

Nishtha Thakur

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

1K+ Views

This example demonstrate about How to use split () in Android textview.Step 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

How to remove data from treeset in Android?

Nishtha Thakur

Nishtha Thakur

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

70 Views

This example demonstrates How to remove data from tree set 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.         ... Read More

How to return only unique values (no duplicates) in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

835 Views

You can use distinct() to return only unique values. The syntax is as follows −db.yourCollectionName.distinct("yourFieldName");To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.returnOnlyUniqueValuesDemo.insertOne({"CusomerName":"Larry", "CustomerAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c8ed7262f684a30fbdfd580") ... Read More

Compare *ptr++, *++ptr and ++*ptr in C++

Nishtha Thakur

Nishtha Thakur

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

2K+ Views

In this section, we will see what are the differences between *ptr++, *++ptr and ++*ptr in C++.Here we will see the precedence of postfix++ and prefix++ in C or C++. The precedence of prefix ++ or -- has higher priority than dereference operator ‘*’ and postfix ++ or -- has ... Read More

How to use toLowerCase () in Android textview?

Nishtha Thakur

Nishtha Thakur

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

1K+ Views

This example demonstrate about How to use toLowerCase () in Android textview.Step 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

Check that Field Exists with MongoDB?

Nishtha Thakur

Nishtha Thakur

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

166 Views

You can use the $exists and $ne operator for this. To understand the concept further, let us create a collection with document. The query to create a collection with document is as follows −> db.checkFieldExistDemo.insertOne({"EmployeeId":1, "EmployeeName":"John", "isMarried":true, "EmployeeSalary":4648585}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c76f7b31e9c5dd6f1f78281") } > db.checkFieldExistDemo.insertOne({"StudentId":2, ... Read More

How to sum the value of a key across all documents in a MongoDB collection?

Nishtha Thakur

Nishtha Thakur

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

4K+ Views

To get sum the value of a key across all documents in a MongoDB collection, you can use aggregate().To understand the above concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.sumOfValueDemo.insertOne({"Name":"Larry", "Amount":14.50}); {    "acknowledged" : ... Read More

C++ Program to Check if a Given Graph must Contain Hamiltonian Cycle or Not

Nishtha Thakur

Nishtha Thakur

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

225 Views

A Hamiltonian cycle is a Hamiltonian Path such that there is an edge (in graph) from the last vertex to the first vertex of the Hamiltonian Path. It is in an undirected graph is a path that visits each vertex of the graph exactly once.Functions and purposesBegin    1. function ... Read More

How do I display the indexes of a collection in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

264 Views

In order to display the indexes of a collection, you can use getIndexes(). The syntax is as follows −db.yourCollectionName.getIndexes();To understand the concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.indexDemo.insertOne({"StudentName":"Larry", "StudentAge":21}); {    "acknowledged" : true, ... Read More

C++ Preprocessors

Nishtha Thakur

Nishtha Thakur

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

99 Views

The preprocessors are the directives, which give instructions to the compiler to preprocess the information before actual compilation starts.pAll preprocessor directives begin with #, and only white-space characters may appear before a preprocessor directive on a line. Preprocessor directives are not C++ statements, so they do not end in a ... Read More

Advertisements