Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
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?
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 MoreExecute a script when a user is pressing a key in HTML?
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 MoreHow do we display the thickness of the border of an element in HTML?
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 MoreHow do we create preformatted text in HTML?
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 MoreWhat is "Argument-Dependent Lookup" ("Koenig Lookup") in C++?
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 MoreHow do I declare a two-dimensional array in C++ using new?
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 MoreHow do you set, clear, and toggle a bit in C/C++?
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 MoreWhy is not sizeof for a struct equal to the sum of sizeof of each member in C/C++?
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 MoreHow can we combine functions in MySQL?
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 MoreHow can we split an IP Address into four respective octets by using MySQL SUBSTRING_INDEX() function?
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