Smita Kapse has Published 558 Articles

How to use changes () in Android sqlite?

Smita Kapse

Smita Kapse

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

286 Views

Before getting into an 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

Find all duplicate documents in a MongoDB collection by a key field?

Smita Kapse

Smita Kapse

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

293 Views

Use the aggregate framework to find all duplicate documents in a MongoDB collection by a key field.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.findDuplicateByKeyDemo.insertOne({"StudentId":1, "StudentName":"John"}); {    "acknowledged" : true,    "insertedId" ... Read More

How to remove all common character from string array elements in android?

Smita Kapse

Smita Kapse

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

213 Views

This example demonstrate about How to remove all common character from string array elements 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

Search for a value in Java Octet Tuple

Smita Kapse

Smita Kapse

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

63 Views

To search for a value in Java Octet Tuple, you need to use the contains() method. The method returns a Boolean value stating whether the element set as a parameter exists in the values set in Octet Tuple or not. Let us first see what we need to work with ... Read More

mbtowc function in C

Smita Kapse

Smita Kapse

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

53 Views

The C library function int mbtowc(whcar_t *pwc, const char *str, size_t n) converts a multibyte sequence to a wide character.Following is the declaration for mbtowc() function.int mbtowc(whcar_t *pwc, const char *str, size_t n)The parameters are −pwc − This is the pointer to an object of type wchar_t.str − This is ... Read More

Restrict keyword in C

Smita Kapse

Smita Kapse

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

1K+ Views

Here we will see what is the restrict keyword in C. The restrict keyword first introduced in C99 version. Let us see what is actually this restrict keyword.The restrict keyword is used for pointer declarations as a type quantifier of the pointer.This keyword does not add new functionalities. Using this ... Read More

How to Reverse a linked list in android?

Smita Kapse

Smita Kapse

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

147 Views

This example demonstrate about How to reverse a linked list 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 ... Read More

Avoid duplicate entries in MongoDB?

Smita Kapse

Smita Kapse

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

976 Views

To avoid duplicate entries in MongoDB, you can use createIndex(). The syntax is as follows −db.yourCollectionName.createIndex({"yourFieldName":1}, {unique:true});Let us implement the above syntax. The query to avoid duplicate entries in MongoDB is a follows −> db.avoidDuplicateEntriesDemo.createIndex({"UserName":1}, {unique:true}); {    "createdCollectionAutomatically" : true,    "numIndexesBefore" : 1,    "numIndexesAfter" : 2,   ... Read More

The setAtX() method of the Octet Tuple in Java

Smita Kapse

Smita Kapse

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

76 Views

The setAtX() method is used to set Octet value in Java. Here, X is the index wherein you need to set the value i.e. to set value at index 1, use the setAt1() and value as a parameter.Let us first see what we need to work with JavaTuples. To work ... Read More

How do I make case-insensitive queries on MongoDB?

Smita Kapse

Smita Kapse

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

174 Views

Use regexp to make case-insensitive queries on MongoDB. 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.caseInsensitiveDemo.insertOne({"UserName":"David"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c7f6fec8d10a061296a3c45") } > db.caseInsensitiveDemo.insertOne({"UserName":"DAVID"}); {    "acknowledged" : ... Read More

Advertisements