Nishtha Thakur has Published 564 Articles

How to add a value in Octet Tuple in Java

Nishtha Thakur

Nishtha Thakur

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

60 Views

To add value in Octet Tuple, you need to use the addAtX() method. Here, X is the index wherein you need to add the value i.e. to add value at index 0, use the addAt0() and value as a parameter.Let us first see what we need to work with JavaTuples. ... Read More

How to find Second most repeated string in a sequence in android?

Nishtha Thakur

Nishtha Thakur

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

147 Views

This example demonstrate about How to find Second most repeated string in a sequence in android.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

Include all existing fields and add new fields to document in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

337 Views

You can achieve this with the help of $addFields operator. 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.addFieldDemo.insertOne({"EmployeeId":101, "EmployeeName":"Larry", "EmployeeDetails":{    "EmployeeSalary":65000, "EmployeeCity":"New York", "Message":"Hi"}}); {    "acknowledged" : true,    "insertedId" ... Read More

Variable Length Argument in C

Nishtha Thakur

Nishtha Thakur

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

1K+ Views

Sometimes, you may come across a situation, when you want to have a function, which can take variable number of arguments, i.e., parameters, instead of predefined number of parameters. The C/C++ programming language provides a solution for this situation and you are allowed to define a function which can accept ... Read More

Iterate through Octet Tuple in Java

Nishtha Thakur

Nishtha Thakur

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

80 Views

You can easily iterate through Octet Tuple using a for the loop. 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. If you ... Read More

Operations on struct variables in C

Nishtha Thakur

Nishtha Thakur

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

1K+ Views

Here we will see what type of operations can be performed on struct variables. Here basically one operation can be performed for struct. The operation is assignment operation. Some other operations like equality check or other are not available for stack.Example#include typedef struct { //define a structure for complex ... Read More

How to Sort a stack in android?

Nishtha Thakur

Nishtha Thakur

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

86 Views

This example demonstrate about How to Sort a stack in android.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.     In the above ... Read More

The contains() method of the Java Ennead Tuple

Nishtha Thakur

Nishtha Thakur

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

56 Views

The contains() method of the Ennead Tuple in Java is used to search for a value in the Tuple. To find the existence of a value, you need to just set it as a parameter of the method. It returns a boolean value i.e. TRUE is returned for the existence ... Read More

How to efficiently perform “distinct” with multiple keys in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

306 Views

You can perform distinct with multiple keys with the help of an aggregate framework.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.distinctWithMultipleKeysDemo.insertOne({"StudentName":"Mike", "StudentAge":22, "StudentMathMarks":56}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c7f74488d10a061296a3c53") ... Read More

What is the difference between C++0x and C++11?

Nishtha Thakur

Nishtha Thakur

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

317 Views

C++ and C Standards are usually named after the year they are published in. For example, in C++, the original Standard was published in 1998, so it is called C++98, and its first correction, published in 2003 is called C++03.For the next revision, it was supposed that the next Standard ... Read More

Advertisements