George John has Published 1081 Articles

How to send an error code using JSP to browser?

George John

George John

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

426 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

8K+ 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

760 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

105 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

2K+ 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

559 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

15K+ 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

785 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

How to query a key having space in its name with MongoDB?

George John

George John

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

2K+ Views

To query a key having space in its name, you can use dot(.) notation.Step 1: First, you need to create a set in which a key has space in its name. Following is the query:> myValues["Details"] = {} { } > myValues["Details"]["Student Name"]="John"; John > myValues["Details"]["StudentAge"]=26; 26Step 2: Now you ... Read More

LongStream filter() method in Java

George John

George John

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

165 Views

The filter() method in the LongStream class in Java returns a stream consisting of the elements of this stream that match the given predicate.The syntax is as followsLongStream filter(LongPredicate predicate)Here, the parameter predicate is a stateless predicate to apply to each element to determine if it should be included. The ... Read More

Advertisements