George John has Published 1167 Articles

Convert MySQL null to 0?

George John

George John

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

17K+ Views

Use IFNULL or COALESCE() function in order to convert MySQL NULL to 0.The syntax is as followsSELECT IFNULL(yourColumnName, 0) AS anyAliasName FROM yourTableName; The second syntax is as follows: SELECT COALESCE(yourColumnName, 0) AS anyAliasName FROM yourTableName;Let us first create a table. The query to create a table is as followsmysql> ... Read More

DoubleStream peek() method in Java

George John

George John

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

124 Views

The syntax is as followsDoubleStream peek(DoubleConsumer action)Here, DoubleConsumer is an operation that accepts a single double-valued argument and returns no result.To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;The following is an example to implement DoubleStream peek() method in JavaExample Live Demoimport java.util.*; import java.util.stream.DoubleStream; public class Demo ... Read More

How to add elements to AbstractSequentialList class at a specific position in Java?

George John

George John

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

77 Views

The AbstractSequentialList class has the add() method to add an element to the specific position.The syntax is as followsadd(int index, E ele)Here, index is where the element is to be inserted. The ele is the element to be inserted.To work with the AbstractSequentialList class in Java, you need to import ... Read More

How to use action down event in android?

George John

George John

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

282 Views

 This example demonstrate about How use action down event 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 ... Read More

DoubleStream sequential() method in Java

George John

George John

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

47 Views

The sequential() method of the DoubleStream class returns an equivalent stream that is sequential.The syntax is as followsDoubleStream sequential()To use the DoubleStream class in Java, import the following packageimport java.util.stream.DoubleStream;Create a DoubleStream and add some elementsDoubleStream doubleStream1 = DoubleStream.of(45.8, 67.9, 78.5, 90.6, 97.4);Now create an equivalent stream that is sequentialDoubleStream ... Read More

Program for adding 2 numbers input from keyboard in 8085 Microprocessor

George John

George John

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

521 Views

We write an 8085 assembly language program of two input using two 2-digit hexadecimal numbers from the keyboard and then we add and the output results in the address field.FILE NAME ADD2NUM.ASM ORG C000H CURAD: EQU FFF7H UPDAD: EQU 06BCH CLEAR: EQU 044AH GTHEX: EQU 052FH MVI A, 0EH SIM ... Read More

Updating a MySQL column that contains dot (.) in its name?

George John

George John

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

867 Views

If the MySQL column contains dot (.) in its name, then you need to use backticks around the column name. To understand the above concept, let us create a table. The query to create a table is as followsmysql> create table UpdateDemo    -> (    -> UserId int NOT ... Read More

IntStream distinct() method in Java

George John

George John

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

115 Views

The distinct() method in the IntStream class in Java returns a stream consisting of the distinct elements of this stream.The syntax is as followsIntStream distinct()Let’s say we have the following elements in the stream. Some of them are repeatedIntStream intStream = IntStream.of(10, 20, 30, 20, 10, 50, 80, 90, 100, ... Read More

Display interface using serial transfer in 8085 Microprocessor

George John

George John

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

229 Views

In this module we have explained the complete interface of four numbers segmented into seven parts having the Light Emitting Diode which uses a serial data transfer scheme. The portion which is displayed of the interface has 4 LEDS comprises of 7-segments LEDs as we can see from the physical ... Read More

How to check current wifi supports 5 GHz band support in android?

George John

George John

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

226 Views

This example demonstrate about How to check current wifi supports 5 GHz band support 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

Advertisements