Nishtha Thakur has Published 564 Articles

Rint(), rintf(), rintl() in C++

Nishtha Thakur

Nishtha Thakur

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

94 Views

Here we will see three functions. These functions are Rint(), rintf() and the rintl(). These functions are used to convert floating point values into rounded format.The rint() FunctionThis function is used for rounding floating point value to integer. The syntax is like below. If the result is outside of return ... Read More

How to start an Android activity when use clicks on Notification?

Nishtha Thakur

Nishtha Thakur

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

157 Views

This example demonstrate about How to start an Android activity when use clicks on NotificationStep 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

Decrement only a single value in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

635 Views

Let us first create a collection with documents −>db.decrementingOperationDemo.insertOne({"ProductName":"Product-1", "ProductPrice":756}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd7a8ae6d78f205348bc63c") } >db.decrementingOperationDemo.insertOne({"ProductName":"Product-2", "ProductPrice":890}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd7a8b86d78f205348bc63d") } >db.decrementingOperationDemo.insertOne({"ProductName":"Product-3", "ProductPrice":994}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd7a8c66d78f205348bc63e") } >db.decrementingOperationDemo.insertOne({"ProductName":"Product-4", "ProductPrice":1000}); {    "acknowledged" : ... Read More

Generalized Lambda Expressions in C++14

Nishtha Thakur

Nishtha Thakur

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

187 Views

In C++11, the lambda was introduced. Lambdas are basically a part of code, that can be nested inside other function call statements. By combining lambda expressions with the auto keyword, they can be used later.In C++14, these lambda expressions are improved. Here we can get the generalized lambda. For example, ... Read More

Escaping quotes while inserting records in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

854 Views

The double quotes have unicode which has the value \u0022. Let us first create a collection with documents −> db.escapingQuotesDemo.insert({ "StudentFullName": "John \u0022 Smith" }); WriteResult({ "nInserted" : 1 }) > db.escapingQuotesDemo.insert({ "StudentFullName": "David \u0022 Miller" }); WriteResult({ "nInserted" : 1 }) > db.escapingQuotesDemo.insert({ "StudentFullName": "John \u0022 Doe" }); WriteResult({ ... Read More

regex_error in C++

Nishtha Thakur

Nishtha Thakur

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

166 Views

The regex library has different methods and features related to regular expressions. Here we will see some regex_errors. These are also present at regex library. During executing some regular expressions, we get some errors. That errors are mentioned here.FlagsErrorserror_collateIn the Regex, the names having invalid collation.error_ctypeIn the Regex, there is ... Read More

How to write your own header file in C?

Nishtha Thakur

Nishtha Thakur

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

14K+ Views

Here we will see how to create own header file using C. To make a header file, we have to create one file with a name, and extension should be (*.h). In that function there will be no main() function. In that file, we can put some variables, some functions ... Read More

Query MongoDB collection starting with _?

Nishtha Thakur

Nishtha Thakur

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

133 Views

For MongoDB collection beginning with_, following is the syntax −db.createCollection(‘_yourCollectionName’);Insert query using below syntax −db.getCollection('_yourCollectionName').insertOne({"yourFieldName1":"yourValue1", "yourFieldName2":yourValue2, ............N});Let us first create a collection with documents −> db.createCollection('_testUnderscoreCollectionDemo'); { "ok" : 1 } >db.getCollection('_testUnderscoreCollectionDemo').insertOne({"StudentFirstName":"John", "StudentAge":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ccfb4a6140b992277dae0e4") } >db.getCollection('_testUnderscoreCollectionDemo').insertOne({"StudentFirstName":"Carol", "StudentAge":21}); {    "acknowledged" ... Read More

How to apply adjustments to the next column of a JTable only, when the width of a column is changed in Java Swing?

Nishtha Thakur

Nishtha Thakur

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

125 Views

To apply adjustments to the next column only, use the setAutoResizeMode and set the mode. The mode here would be AUTO_RESIZE_NEXT_COLUMN. This will allow you to adjust only the next column even if any of the column header is dragged to resize.Let us first see an example to create a ... Read More

Stringstream in C++

Nishtha Thakur

Nishtha Thakur

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

9K+ Views

Here we will see the string stream in C++. The string stream associates a string object with a string. Using this we can read from string as if it were a stream like cin.The Stringstream has different methods. These are like below −clear(): Used to clear the streamstr(): To get ... Read More

Advertisements