When we want to add a pause in MySQL triggers or stored procedures, we use the SLEEP() function. This function stops the execution of a query or procedure for a set amount of time. It is useful in different scenarios such as checking how an app acts when operations slow down or stimulating network slowness. SLEEP() Function MySQL has this SLEEP() function that will suspend the operation for a specified time duration. For example, if you want to pause for 5 seconds, you would write - SLEEP(5); This causes the database to wait for 5 ... Read More
HTML Tag To set a smaller font size in an HTML document, use the tag. This tag decreases the font size by one level, from medium to small or extra-large to large. There are two ways to use the tag in HTML. The tag also supports the global attributes and event attributes in HTML. This tag is not deprecated, but it is possible to achieve better results or nearly the same effect with CSS. The tag supports both Event Attributes and Global Attributes in HTML. Although not deprecated, similar or better results can be achieved ... Read More
Linked List Representation Linked lists use dynamic memory allocation, allowing them to grow and shrink as needed. They are defined as a collection of nodes, each containing two parts: data and a link. A linked list is a linear data structure where each element is known as a node, is connected to the next one using pointers. Unlike arrays, elements of a linked list are stored in random memory locations. The representation of data, links, and linked lists is shown below − Representation of node - Representation of Linked List - Insertion Insertion operations in a linked list ... Read More
To hide a div in JavaScript on button click we will be discussing three different approaches with example codes. We will hide the div upon clicking the button and similarly display the hidden div upon clicking the button. In this article we are having a div element. Our task is to hide the div on clicking the button using JavaScript. Approaches to Hide div on Button Click Here is a list of approaches to hide a div in JavaScript on button click which we will be discussing in this article with stepwise explanation and complete example codes. ... Read More
Problem Description In this problem, we are given a number, and we need to convert it to its equivalent Roman number representation using C#. Example 1 Input: number = 58 Output: Roman numeral = LVIII Explanation: 58 in Roman numerals is written as L (50) + V (5) + III (3). Example 2 Input: number = 1994 Output: Roman numeral = MCMXCIV Explanation: 1994 in Roman numerals is written as M (1000) + CM (900) + XC (90) + IV ... Read More
A capsule is a three-dimensional geometric shape that consists of a cylindrical body with hemispherical ends on both sides. The volume of a capsule can be calculated by adding the volume of the cylindrical part and the volume of the two hemispherical ends present on both sides of the cylindrical part. In this tutorial, we are going to discuss how to find the volume of a given capsule in C++ using different approaches. Formula for Volume of Capsule The formula for the volume of a capsule is as follows: Volume of Capsule = Volume of cylinder + Volume of both ... Read More
In JavaScript, there are built-in methods for getting the current date and time in seconds. We are going to perform this in two ways − Using the Date.now() method Using a new date getTime() method Let’s dive into the article for getting better understanding on getting current date time in seconds. Using Date.now() method The Date.now() static method returns the milliseconds that ... Read More
In this article, we will learn how to find the average of all positive numbers in an array using JavaScript, along with examples to demonstrate the implementation. We are given an array of integers, which may contain both negative and positive numbers. Our task is to calculate the average of all the positive numbers in the array. Problem Description The goal is to compute the average of all positive numbers in a given array. This involves summing up the positive numbers and dividing the sum by the count of positive numbers. Input 1 arr = [2, -5, 6, -3, 8]; ... Read More
In this article we are going to learn how to find the action attribute and method of a form with suitable examples in JavaScript. In HTML, there is elements which has few attributes: input, label, text area, select, name, target. The action and method attributes of the form are used to return those values. The action attribute also specifies where to send the form data when form is submitted. To get a better idea of this concept, let’s look into JavaScript examples where we achieved the given task using action attribute and also with method attribute. Using action ... Read More
JavaScript program for number of pairs with maximum sum is a common coding problem that involves finding the number of pairs in an array that have the maximum sum. This problem can be solved using various approaches which we will be discussing with code examples and their stepwise explanation. In this article we are having an array of integers. Our task is to write a JavaScript program for number of pairs with maximum sum. Example 1 Input: array = [1, 2, 3, 4, 5] Pair sum of (1, 2) = 3, Pair sum of (1, 3) = ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP