C++ set for user define data type

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

466 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 data, but here we will see how we can also use set for userdefined datatypes.To use user-defined datatypes into stack, we have to override < operator, that can compare two values of that type. If this is not present, it cannot compare two objects, so the set cannot store data ... Read More

Which British General was responsible for the Jallianwala Bagh massacre?

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

86 Views

The Jallianwala Bagh massacre, also known as the Amritsar massacre, was one of the horrible incidents in Indian history during the reign of Britishers. On 13 April 1919, the troops of the British Indian Army under the command of Colonel Reginald Dyer fired rifles into the crown of Indians, gathered in Jallianwala Bagh, Amritsar, Punjab.

Mode 2—bi-directional I/O

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

509 Views

In mode 0 or mode 1, a port works as an input port or an output port. It is dependent if an input device or an output device gets connected to the port. Moreover, this, mode 2 is often called as bi-directional handshake Input Output. It is beneficial for us when the microprocessor receives information, and sometimes sends information to the Input Output device which is connected to 8255. An example to be cited as for the communication process with a floppy disk controller card. Since mode 2 is bi-directional handshake Input Output, it needs more number of handshake lines ... Read More

How to get last row in Android sqlite?

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

436 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 access this database, you don't need to establish any kind of connections for it like JDBC, ODBC etc.This example demonstrate about How to get last row in Android sqliteStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to ... Read More

How to add webview focus in android?

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

736 Views

This example demonstrate about How to add webview focus 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 above code, we have taken web view to show google.com.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.os.Build; import android.os.Bundle; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.webkit.WebView; import android.widget.EditText; public class MainActivity extends AppCompatActivity { @RequiresApi(api = Build.VERSION_CODES.P) @Override ... Read More

How to Navigate through a ResultSet using a JDBC program?

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

106 Views

The next() method of the ResultSet interface moves the pointer/Cursor of the current ResultSet object to the next row from the current position. This method returns a boolean value. If there are no rows next to its current position this method returns false, else it returns true.Therefore, using this method in the while loop you can iterate the contents of the ResultSet object.while(rs.next()){ }Getting the column values of each recordThe ResultSet interface (also) provides getter methods (getXXX()) to retrieve values in each column of a row, each getter methods has two variants:getXXX(int columnIndex): Accepts an integer value representing the index ... Read More

How to find current Bluetooth supports Le2MPy in android?

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

38 Views

This example demonstrate about How to find current Bluetooth supports Le2MPy 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 above code, we have taken text view to show Bluetooth status about Le2MPy.Step 3 − Add the following code to src/MainActivity.javapackage com.example.myapplication; import android.bluetooth.BluetoothManager; import android.content.Context; import android.net.ConnectivityManager; import android.net.Network; import android.os.Build; import android.os.Bundle; import android.os.health.SystemHealthManager; import android.provider.Telephony; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.telephony.SmsManager; import android.view.View; import ... Read More

LocalDate isBefore() method in Java

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

447 Views

It can be checked if a particular LocalDate is before the other LocalDate in a timeline using the isBefore() method in the LocalDate class in Java. This method requires a single parameter i.e. the LocalDate object that is to be compared. It returns true if the LocalDate object is before the other LocalDate object and false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.time.*; public class Main {    public static void main(String[] args) {       LocalDate ld1 = LocalDate.parse("2019-02-12");       LocalDate ld2 = LocalDate.parse("2019-02-14");       System.out.println("The LocalDate ld1 is: ... Read More

DoubleStream iterator() method in Java

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

55 Views

The iterator() method of the DoubleStream class in Java returns an iterator for the elements of this stream.The syntax is as followsPrimitiveIterator.OfDouble iterator()Here, PrimitiveIterator.OfDouble is an Iterator specialized for double values.To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;The following is an example to implement DoubleStream iterator() method in JavaExample Live Demoimport java.util.*; import java.util.stream.DoubleStream; public class Demo {    public static void main(String[] args) {       DoubleStream doubleStream = DoubleStream.of(50.6, 69.8, 81.8, 95.6, 106.9);       PrimitiveIterator.OfDouble res = doubleStream.iterator();       while (res.hasNext()) {          System.out.println(res.nextDouble());       }    } }Output50.6 69.8 81.8 95.6 106.9

How to select from MySQL table A that does not exist in table B?

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

1K+ Views

You can use IN operator to select from one table that does not exist in another. To understand the above syntax, let us create a table.The first table name is A and second table name is B. The query to create a table is as followsmysql> create table A    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.56 sec)Now you can insert some records in the table using insert command.The query is as followsmysql> insert into A values(10); Query OK, 1 row affected (0.23 sec) mysql> insert into A values(20); Query OK, 1 ... Read More

Advertisements