Smita Kapse has Published 558 Articles

How to use sqlite_source_id () in Android sqlite?

Smita Kapse

Smita Kapse

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

87 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

How to use time() with local time in Android sqlite?

Smita Kapse

Smita Kapse

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

256 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

How to print to console an object in a MongoDB script?

Smita Kapse

Smita Kapse

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

3K+ Views

You can use printjson() method to print to console an object in a MongoDB script. The syntax is as follows −printjson({yourFieldName”:yourValue”, ........N});You can use JSON.stringify() along with print() function. The syntax is as follows minus;print ( JSON.stringify( { {yourFieldName”:yourValue”, ........N} } ));Let us implement the above syntax to print object ... Read More

Generate and parse Mac OS X .plist files using Python (plistlib)

Smita Kapse

Smita Kapse

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

2K+ Views

Files with '.plist' the extension is used by Mac OS X applications to store application properties. The plislib module provides an interface to read/write operations of these property list files.The plist file format serializes basic object types, like dictionaries, lists, numbers, and strings. Usually, the top level object is a ... Read More

IntStream sum() method in Java

Smita Kapse

Smita Kapse

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

154 Views

The sum() method of the IntStream class is used in Java to return the sum of elements in this stream.The syntax is as follows −int sum()To work with the IntStream class in Java, import the following package −import java.util.stream.IntStream;Create IntStream and add some elements −IntStream intStream = IntStream.of(50, 100, 150, ... Read More

How to convert ObjectId to string in MongoDB

Smita Kapse

Smita Kapse

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

3K+ Views

To convert ObjectId to string, use the $toString in MongoDB. 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.objectidToStringDemo.insertOne({"UserName":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c92b80036de59bd9de0639d") } > db.objectidToStringDemo.insertOne({"UserName":"Chris"}); { ... Read More

Python Context Variables

Smita Kapse

Smita Kapse

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

1K+ Views

Context variable can have different values depending on its context. Unlike Thread-Local Storage where each execution thread may have a different value for a variable, a context variable may be several contexts in one execution thread. This is useful in keeping track of variables in concurrent asynchronous tasks.The ContextVar class ... Read More

DoubleStream mapToObj() method in Java

Smita Kapse

Smita Kapse

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

130 Views

The mapToObj() method of the DoubleStream class returns an object-valued Stream consisting of the results of applying the given function to the elements of this stream.The syntax is as follows − Stream mapToObj(DoubleFunction

The equals() method of AbstractSequentialList in Java

Smita Kapse

Smita Kapse

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

69 Views

The equals() method is inherited from the AbstractList class in Java. It is used to check the object for equality with this list. It returns TRUE if the object is equal to this list, else FALSE is returned.The syntax is as follows −public boolean equals(Object o)Here, o is the object ... Read More

MongoDB query by sub-field?

Smita Kapse

Smita Kapse

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

1K+ Views

You can use dot(.) notation to query by subfield. Let us create a collection with a document. The query to create a collection with a document is as follows −> db.queryBySubFieldDemo.insertOne(    ... {       ... "StudentPersonalDetails" : {"StudentName" : "John", "StudentHobby" :"Photography"},       ... "StudentScores" ... Read More

Advertisements