Sai Nath has Published 36 Answers

What is the usage of oninput event in JavaScript?

Sai Nath

Sai Nath

Updated on 23-Jun-2020 09:06:13

When a value is added in an input box, then the oninput event occurs. You can try to run the following code to learn how to implement oninput event in JavaScript −Example<!DOCTYPE html> <html>    <body>       <p>Write below:</p>       <input type = "text" id = "newInput" ... Read More

How to improve the performance of JavaScript?

Sai Nath

Sai Nath

Updated on 23-Jun-2020 08:48:47

To improve the performance, try the following techniques −Create and use VariablesIn JavaScript, only create variables, which you will use and save values. Use the following and avoid unnecessary lines of code and variable declaration −document.write(num.copyWithin(2, 0));Avoid the usage of withThe with keywords do not have a good impact on ... Read More

Match any string containing a sequence of N p's

Sai Nath

Sai Nath

Updated on 23-Jun-2020 08:33:12

To match any string containing a sequence of N p’s with JavaScript RegExp, use the p{N} Quantifier.ExampleYou can try to run the following code to match any string containing a sequence of N p’s −<html>    <head>       <title>JavaScript Regular Expression</title>    </head>    <body>     ... Read More

How to return the "time" portion of the Date as a human-readable string.

Sai Nath

Sai Nath

Updated on 23-Jun-2020 08:00:07

To return the “time” portion of the Date as a human-readable string, use the toTimeString() method in JavaScript. This method returns the time portion of a Date object in the human-readable form.ExampleYou need to run the following code to return only the time portion of a Date −<html>    <head> ... Read More

Find non-word character in a string with JavaScript RegExp.

Sai Nath

Sai Nath

Updated on 23-Jun-2020 07:42:54

To find a non-word character (a-z, A-Z, 0-9, _) in a string with JavaScript Regular Expression, use the following −\WExampleYou can try to run the following code to find a non-word character in a string −<html>    <head>       <title>JavaScript Regular Expression</title>    </head>    <body>   ... Read More

How can we ENABLE AND DISABLE a particular MySQL event?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 12:38:29

With the help of ALTER EVENT statement along with the ENABLE and DISABLE keyword, we can ENABLE and DISABLE the event. To illustrate it we are having the following example −Examplemysql> ALTER EVENT hello DISABLE; Query OK, 0 rows affected (0.00 sec)The above query will DISABLE the event named ‘Hello’ ... Read More

What is MySQL trigger and triggering events related to it?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 11:42:04

Basically, MySQL trigger is a set of statements stored in the database catalog. This database object is always associated with a table that is defined to be activated when a particular kind of event occurs for that table. In other sense, we can say that MySQL trigger is a special ... Read More

How can we convert subqueries to LEFT JOIN?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 10:55:57

To make it understand we are using the data from the following tables −mysql> Select * from customers; +-------------+----------+ | Customer_Id | Name     | +-------------+----------+ | 1           | Rahul    | | 2           | Yashpal  | | 3 ... Read More

What is the use of MySQL NULLIF() control flow function?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 06:58:05

MySQL NULLIF() control flow function will return NULL if both the arguments are the same, otherwise, it returns the first argument.SyntaxNULLIF(expression1, expression2)Here if expression1 = expression2, NULL will be returned by NULLIF() otherwise expression1 will be returned. Following example will exhibit this −mysql> Select NULLIF('Ram', 'Ram'); +---------------------+ | NULLIF('Ram', 'Ram') ... Read More

What is the method with the help of which the hexadecimal value can be treated as a number?

Sai Nath

Sai Nath

Updated on 22-Jun-2020 05:26:48

For treating the hexadecimal value as a number, we can use the CAST(… AS UNSIGNED) function. Following example will demonstrate it −mysql> Select 0x54, CAST(0x54 AS UNSIGNED); +------+------------------------+ | 0x54 | CAST(0x54 AS UNSIGNED) | +------+------------------------+ | T    |                     ... Read More

Advertisements