Anvi Jain has Published 629 Articles

The contains() method of the Java LabelValue Tuple

Anvi Jain

Anvi Jain

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

50 Views

Use the contains() method of the LabelValue class in Java to search for a value. The return value of the method is TRUE if the value exists in the tuple, else the FALSE value is returned.Let us first see what we need to work with JavaTuples. To work with LabelValue ... Read More

How to check if Location Services are enabled in iOS App?

Anvi Jain

Anvi Jain

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

1K+ Views

Location services as the name suggests gather the user information via GPS, Wifi and cell towers. Every iOS device has on board GPS, WiFi, cell tower location data and Bluetooth to determine the location of the iPhone or iPad. The user can enable or disable location services from the Settings ... Read More

Command to show the database currently being used in MongoDB?

Anvi Jain

Anvi Jain

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

444 Views

The command to show the database currently used in MongoDB is the following −db;Let us first check how many databases are present. The query is as follows −> show dbs;The following is the output displaying all the databases −admin 0.000GB config 0.000GB local 0.000GB sample 0.000GB sampleDemo 0.000GB studentSearch 0.000GB ... Read More

How to get current location provider information in android?

Anvi Jain

Anvi Jain

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

424 Views

This example demonstrate about How to get current location provider information 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 ... Read More

Compile 32-bit program on 64-bit gcc in C and C++

Anvi Jain

Anvi Jain

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

1K+ Views

Nowadays the compiler comes with default 64-bit version. Sometimes we need to compile and execute a code into some 32bit system. In that time, we have to use thisS feature.At first, we Shave to check the current target version of the gcc compiler. To check this, we have to type ... Read More

How to get duplicate records from Android sqlite?

Anvi Jain

Anvi Jain

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

497 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

Type difference of character literals in C vs C++

Anvi Jain

Anvi Jain

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

102 Views

In C++ the size of the character constants is char. In C the type of character constant is integer (int). So in C the sizeof(‘a’) is 4 for 32bit architecture, and CHAR_BIT is 8. But the sizeof(char) is one byte for both C and C++.Example#include main() {    printf("%d", sizeof('a')); ... Read More

Difftime() C library function

Anvi Jain

Anvi Jain

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

112 Views

Here we will see what is the difftime() function in C. The difftime() is used to get the differences between two time values.difftime() takes two time argument, the first one is the lower bound, and the second one is the upper bound. And it returns the differences between these two ... Read More

C++ Program to Implement String Matching Using Vectors

Anvi Jain

Anvi Jain

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

486 Views

This is another string matching method. In this approach, we are searching for a substring using vectors.In C++ we can create vectors easily using the standard library. We are taking the main string and the string that will be searched as a vector, then searching it into the main string. ... Read More

C++ set for user define data type

Anvi Jain

Anvi Jain

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

662 Views

Here we will see how we can make a set for user defined datatypes. The Set is present in C++ STL. This is a special type of data structure, it can store data in sorted order, and does not support duplicate entry. We can use set for any type of ... Read More

Advertisements