George John has Published 1167 Articles

DoubleStream mapToLong() method in Java

George John

George John

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

90 Views

The mapToLong() method of the DoubleStream class returns a LongStream consisting of the results of applying the given function to the elements of this stream.The syntax is as followsLongStream mapToLong(DoubleToLongFunction mapper)Here, the parameter mapper is a stateless function to apply to each element. The DoubleToLongFunction here is a function that ... Read More

How to update a column of varchar type in MySQL to increase its length?

George John

George John

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

512 Views

Let us first create a table. Here, we have two columns with varchar type −mysql> create table DemoTable (    UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    UserFirstName varchar(10),    UserLastName varchar(20) ,    UserAge int ); Query OK, 0 rows affected (0.96 sec)Let us check the description of ... Read More

How to send an error code using JSP to browser?

George John

George John

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

280 Views

Following example shows how a 407 error code is sent to the client browser. After this, the browser would show you "Need authentication!!!" message.           Setting HTTP Status Code     ... Read More

8086 program to convert an 8 bit BCD number into hexadecimal number

George John

George John

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

7K+ Views

In this program we will see how to find the equivalent hexadecimal number from a BCD number.Problem StatementWrite 8086 Assembly language program to find the equivalent hexadecimal number from a BCD number. The number is stored at memory offset 500 and store the result at memory offset 600.DiscussionTo convert BCD ... Read More

Program to print numbers from 1 to 100 without using loop

George John

George John

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

545 Views

Here we will see how to write a C program that can print numbers from 1 to 100 without using any kind of loops.This problem can be solved using the recursion. We will create a function that will be called recursively. As we know that a recursive function has basically ... Read More

DoubleStream findAny() method in Java

George John

George John

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

80 Views

The findAny() method of the DoubleStream class returns an OptionalDouble describing some element of the stream, or an empty OptionalDouble if the stream is empty.The syntax is as followsOptionalDouble findAny()Here, OptionalDouble is a container object which may or may not contain a double value To use the DoubleStream class in ... Read More

Is it possible to delete everything after a 'space' in a MySQL field?

George John

George John

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

1K+ Views

In order to delete everything after a space, you need to use SUBSTRING_INDEX().The syntax is as followsselect substring_index(yourColumnName, ' ', 1) as anyAliasName from yourTableName;To understand the above syntax, let us create a table. The query to create a table is as followsmysql> create table deleteAfterSpaceDemo    -> (   ... Read More

How to create MySQL user with limited privileges?

George John

George John

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

393 Views

To create MySQL user with limited privileges, following is the syntax −CREATE USER 'yourUserName'@'yourHostName' IDENTIFIED BY 'yourPassword';Following is the syntax to set limited privileges for user −GRANT SELECT, INSERT, UPDATE, etc. REFERENCES ON yourDatabaseName.* TO 'yourUserName'@'yourHostName';Let us implement the above syntaxes in order to create a MySQL user with limited ... Read More

8086 program to sort an integer array in ascending order

George John

George John

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

11K+ Views

In this program we will see how to sort array elements in ascending order.Problem StatementWrite 8086 Assembly language program to sort the elements in a given array, which is starts from memory offset 501. The size of the series is stored at memory offset 500.DiscussionHere we are sorting the number ... Read More

C program to print characters without using format specifiers

George John

George John

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

565 Views

In this article we will see how we can print some characters without using any kind of format specifiers. The format specifiers in C are %d, %f, %c etc.These are used to print characters and numbers in C using the printf() function.Here we will see another way to print characters ... Read More

Advertisements