Nishtha Thakur has Published 495 Articles

Inspect live objects in Python

Nishtha Thakur

Nishtha Thakur

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

759 Views

Functions in this module provide usefule information about live objects such as modules, classes, methods, functions, code objects etc. These functions perform type checking, retrieve source code, inspect classes and functions, and examine the interpreter stack.getmembers()− This function returns all the members of an object in a list of name, ... Read More

DoubleStream builder() method in Java

Nishtha Thakur

Nishtha Thakur

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

125 Views

The builder() method of the DoubleStream class returns a builder for a DoubleStream.The syntax is as follows −static DoubleStream.Builder builder()To use the DoubleStream class in Java, import the following package −import java.util.stream.DoubleStream;The following is an example to implement DoubleStream builder() method in Java −Example Live Demoimport java.util.stream.Stream; import java.util.stream.DoubleStream; public ... Read More

How to get current country code from Network provider in android?

Nishtha Thakur

Nishtha Thakur

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

3K+ Views

This example demonstrates about How to get the current country code from Network provider 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

Iterate through LabelValue Tuple in Java

Nishtha Thakur

Nishtha Thakur

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

205 Views

To iterate through the LabelValue tuple value, use a simple for loop just like what we do in other collections. Let us first see what we need to work with JavaTuples. To work with LabelValue class in JavaTuples, you need to import the following package −import org.javatuples.LabelValue;Note − Download JavaTuples ... Read More

How to append data from hashmap to arraylist for listview in Android?

Nishtha Thakur

Nishtha Thakur

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

773 Views

This example demonstrates how to append data from hashmap to ArrayList for listview in AndroidStep 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

How to lock Screen Orientation programmatically in iOS?

Nishtha Thakur

Nishtha Thakur

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

2K+ Views

You might come across a scenario where you need to show the UI in a specific orientation may be Landscape or Portrait.We will be seeing how to lock orientation programmatically using Swift in iOS.Open Xcode → New Project → ViewController.swift write the below code.// Set the shouldAutorotate to False override ... Read More

do…while loop vs. while loop in C/C++

Nishtha Thakur

Nishtha Thakur

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

7K+ Views

Here we will see what are the basic differences of do-while loop and the while loop in C or C++.A while loop in C programming repeatedly executes a target statement as long as a given condition is true. The syntax is like below.while(condition) {    statement(s); }Here, statement(s) may be ... Read More

How to get current postal code from Network provider in android?

Nishtha Thakur

Nishtha Thakur

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

661 Views

This example demonstrates about How to get the current postal code from Network provider 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

Foreach in C++ vs Java

Nishtha Thakur

Nishtha Thakur

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

213 Views

In C++ and Java, there is another kind of loop, called the foreach loop. This is basically a modification of for loop. This loop is used to access the data from some container. This can access the elements of some array quickly without performing initialization. This loop is used to ... Read More

MongoDB Query to select records having a given key?

Nishtha Thakur

Nishtha Thakur

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

208 Views

To select records having a given key, you can use $exists operator. The syntax is as follows −db.yourCollectionName.find( { yourFieldName: { $exists : true } } ).pretty();To understand the above syntax, let us create a collection with the document. The query to create a collection with a document is as ... Read More

Advertisements