Nishtha Thakur has Published 498 Articles

Set find() function in C++ STL

Nishtha Thakur

Nishtha Thakur

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

601 Views

Set find() function in C++ STL returns an iterator to the element which is searched in the set container. The iterator points to the position just after the last element in the set, if the element is not found.AlgorithmBegin    Define function printS() to print elements of set container.   ... Read More

Encode and decode binhex4 files using Python (binhex)

Nishtha Thakur

Nishtha Thakur

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

610 Views

The binhex module encodes and decodes files in binhex4 format. This format is used in the representation of Macintosh files in ASCII. Only the data fork is handled.The binhex module defines the following functions −binhex.binhex(input, output): Convert a binary file with filename input to binhex file output. The output parameter can ... Read More

Create Octet Tuple from a List collection in Java

Nishtha Thakur

Nishtha Thakur

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

129 Views

Create Octel Tuple from List collection as well using the fromCollection() method in Java. Let us first see what we need to work with JavaTuples. To work with Octet class in JavaTuples, you need to import the following package −import org.javatuples.Octet;Note − Download JavaTuples Jar library to run JavaTuples program. ... Read More

Prettyprint in MongoDB shell as default?

Nishtha Thakur

Nishtha Thakur

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

245 Views

You can call pretty() function on cursor object to prettyprint in MongoDB shell. The syntax is as follows −db.yourCollectionName.find().pretty();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.prettyDemo.insertOne({"ClientName":"Larry", "ClientAge":27, "ClientFavoriteCountry":["US", "UK"]}); {    "acknowledged" : ... Read More

Match between fields in MongoDB aggregation framework?

Nishtha Thakur

Nishtha Thakur

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

267 Views

      You can use $cmp operator for this. 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.matchBetweenFieldsDemo.insertOne({"FirstValue":40, "SecondValue":70}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c92c9625259fcd19549980d") } > db.matchBetweenFieldsDemo.insertOne({"FirstValue":20, "SecondValue":5}); ... Read More

Set vs Map in C++ STL

Nishtha Thakur

Nishtha Thakur

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

2K+ Views

Set is an abstract data type in which each element has to be unique because the value of the element identifies it. The value of the element cannot be modified once it is added to the set, but it is possible to remove and add the modified value of that ... Read More

The isEmpty() method of Java AbstractCollection class

Nishtha Thakur

Nishtha Thakur

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

300 Views

The isEmpty() method of the AbstractCollection class checks whether the collection is empty or not i.e. whether it has zero elements. It returns if the Collectionn has no elements.The syntax is as follows −public boolean isEmpty()To work with AbstractCollection class in Java, import the following package −import java.util.AbstractCollection;The following is ... Read More

How to use LIKE Cause in Android sqlite?

Nishtha Thakur

Nishtha Thakur

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

275 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to ... Read More

unordered_multimap rehash() function in C++ STL

Nishtha Thakur

Nishtha Thakur

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

107 Views

The unordered_multimap rehash(N) function in C++ STL sets the number of buckets in the container to n or more. A rehash is forced if n is greater than the current number of buckets in the container. The new bucket count can either be equal to or greater than n. The ... Read More

How to find a document by the non-existence of a field in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

104 Views

To find a document by the non-existence of a field in MongoDB, the syntax is as follows −db.yourCollectionName.find({ "yourFieldName" : { "$exists" : false } }).pretty();To understand the above syntax, let us create a collection with the document. The query to create a collection with a document is as follows ... Read More

Advertisements