Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 40 of 81

Execute a script when the seeking attribute is set to false indicating that seeking has ended in HTML?

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 193 Views

The onseeked attribute executes a script when the user skips or moves to a new position in the audio or video.ExampleYou can try to run the following code to implement onseeked attribute −           Play                                    Your browser does not support the video element.                      function myFunction() {          document.getElementById("test").innerHTML = "Current position: " +          document.getElementById("myid").currentTime;          }          

Read More

Execute a script when a user is pressing a key in HTML?

Chandu yadav
Chandu yadav
Updated on 03-Mar-2020 394 Views

Use the onkeydown attribute. The onkeydown attribute triggers when the user is pressing a key.ExampleYou can try to run the following code to execute a script on pressing a key −           Press a key inside the textbox.                      function display() {             alert("You pressed a key!");          }          

Read More

How do we display the thickness of the border of an element in HTML?

Chandu yadav
Chandu yadav
Updated on 02-Mar-2020 195 Views

Use the border attribute in HTML to display the thickness of the border.Note − This attribute is not supported in HTML5.ExampleYou can try to run the following code to learn how to implement border attribute in HTML −           Cricketers                Name                       Sachin Tendulkar                                 Virat Kohli                     Use CSS instead, since the border attribute deprecated in HTML5.                    table, th, td {             border: 1px solid black;          }                     Cricketers                Indian Cricketers          Name                       Sachin Tendulkar                                 Virat Kohli                    

Read More

How do we create preformatted text in HTML?

Chandu yadav
Chandu yadav
Updated on 02-Mar-2020 213 Views

Use the tag to create preformatted text. Note − The tag deprecated.ExampleYou can try to run the following code to learn how to create preformatted text in HTML −           HTML xmp Tag               HTML tags include       for bold text, for italic text.    

Read More

What is "Argument-Dependent Lookup" ("Koenig Lookup") in C++?

Chandu yadav
Chandu yadav
Updated on 12-Feb-2020 434 Views

Argument-dependent lookup(ADL) is a protocol for looking up unqualified function names in function-call expressions.These function call expressions include implicit function calls to overloaded operators.The function names are looked up in the namespaces of their arguments in addition to the scopes and namespaces considered by the usual unqualified name lookup. Argument-dependent lookup makes it possible to use operators defined in a different namespace. Examplenamespace MyNamespace{    class A {};    void f( A &a, int i) {} } int main() {    MyNamespace::A a;    f( a, 0 );    //calls MyNamespace::f }The lookup of a function call to f was dependent ...

Read More

How do I declare a two-dimensional array in C++ using new?

Chandu yadav
Chandu yadav
Updated on 11-Feb-2020 2K+ Views

A dynamic 2D array is basically an array of pointers to arrays. So you first need to initialize the array of pointers to pointers and then initialize each 1d array in a loop.example#include using namespace std; int main() {    int rows = 3, cols = 4;    int** arr = new int*[rows];    for(int i = 0; i < rows; ++i)    arr[i] = new int[cols];    return 0; } This will create an 2D array of size 3x4. Be vary of clearing the memory in such cases as you'll need to delete the memory in the ...

Read More

How do you set, clear, and toggle a bit in C/C++?

Chandu yadav
Chandu yadav
Updated on 11-Feb-2020 9K+ Views

You can set clear and toggle bits using bitwise operators in C, C++, Python, and all other programming languages that support these operations. You also need to use the bitshift operator to get the bit to the right place.Setting a bitTo set a bit, we'll need to use the bitwise OR operator −Example#include using namespace std; int main() {    int i = 0, n;        // Enter bit to be set:    cin >> n;    i |= (1 > n;    i ^= (1

Read More

Why is not sizeof for a struct equal to the sum of sizeof of each member in C/C++?

Chandu yadav
Chandu yadav
Updated on 11-Feb-2020 304 Views

The difference between sizeof for a struct and the sum of sizeof of each member of that struct is due to byte padding and alignment. Every data type in C/C++ has a alignment requirement. A processor will have processing word length of its architecture. On a 32 bit machine, the processing word size will be 4 bytes or 32 bits. For example, If you have the struct −Example#include using namespace std; struct X {    char b[3];    int c; }; int main() {    char b[3];    int c;    int total = sizeof(b) + sizeof(c);    cout

Read More

How can we combine functions in MySQL?

Chandu yadav
Chandu yadav
Updated on 10-Feb-2020 630 Views

Combining of functions in MySQL is quite possible by providing a function as the argument of other function. It is also called nesting of functions. To understand it, consider some examples belowmysql> Select UPPER(CONCAT('www.', 'tutorialspoint', '.com'))As Tutorials; +------------------------+ | Tutorials              | +------------------------+ | WWW.TUTORIALSPOINT.COM | +------------------------+ 1 row in set (0.00 sec) mysql> Select LOWER(CONCAT('WWW.', 'TUTORIALSPOINT', '.COM'))As Tutorials; +------------------------+ | Tutorials              | +------------------------+ | www.tutorialspoint.com | +------------------------+ 1 row in set (0.00 sec)The above queries combine UPPER() and LOWER() function with CONCAT() function.Similarly, we can combine more ...

Read More

How can we split an IP Address into four respective octets by using MySQL SUBSTRING_INDEX() function?

Chandu yadav
Chandu yadav
Updated on 10-Feb-2020 1K+ Views

Suppose we have a table named ‘ipaddress’ which contains the IP addresses as its values in column ‘IP’ as follows −mysql> Select * from ipaddress; +-----------------+ | ip              | +-----------------+ | 192.128.0.5     | | 255.255.255.255 | | 192.0.255.255   | | 192.0.1.5       | +-----------------+ 4 rows in set (0.10 sec)Now with the help of SUBSTRING_INDEX() function in the following query, we can divide the IP address in four octets −mysql> Select IP, SUBSTRING_INDEX(ip, '.', 1)AS '1st Part',     -> SUBSTRING_INDEX(SUBSTRING_INDEX(ip, '.', 2), '.', -1)AS '2nd Part',     ...

Read More
Showing 391–400 of 810 articles
« Prev 1 38 39 40 41 42 81 Next »
Advertisements