Chandu yadav has Published 1091 Articles

C++ Program to Use rand and srand Functions

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 09:06:34

636 Views

Random numbers can be generated in C++ using the rand() function. The srand() function seeds the random number generator that is used by rand().A program that uses rand() and srand() is given as follows −Example Live Demo#include #include #include using namespace std; int main() {    srand(1); ... Read More

C++ Program to Implement Queue using Linked List

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 09:00:06

29K+ Views

A queue is an abstract data structure that contains a collection of elements. Queue implements the FIFO mechanism i.e the element that is inserted first is also deleted first. In other words, the least recently added element is removed first in a queue.A program that implements the queue using linked ... Read More

How to specify the size of the gap between rows in CSS Grid

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:57:03

314 Views

Use the grid-row-gap property to set the size of the gap between rows in CSSExampleLive Demo                    .container {             display: grid;             grid-auto-rows: 50px;             grid-column-gap: 30px;             grid-row-gap: 50px;             background-color: #95A5A6;             padding: 10px;          }          .container>div {             background-color: #F0F3F4;             text-align: center;             padding:10px 0;             font-size: 20px;          }          .ele3 {             grid-column-end: span 2;          }                              1          2          3          4          5          6          

How to add 5 hours to current time in MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:32:37

2K+ Views

To add 5 hours in current time, we will use now() function from MySQL. The syntax is as follows −SELECT date_add(now(), interval some integer value hour);Now, I am applying the above query to add 5 hours to current time. The query is as follows −mysql> SELECT date_add(now(), interval 5 hour); ... Read More

Can a number be used to name a MySQL table column?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:24:12

1K+ Views

Yes, we can include a number for column name in MySQL. We need to use the symbol backtick, which is as follows( ` `)To understand, we will make a table with the help of CREATE command. Let us create a table −mysql> CREATE table NumberColumnDemo -> ( -> `123` varchar(100) ... Read More

How to save time in milliseconds in MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 08:09:10

3K+ Views

To save time in milliseconds, we can use now(3) function because “milli 3” can be used for te same purpose. Firstly, I will create a table with the help of CREATE command −mysql> CREATE table MilliSecondDemo -> ( -> MyTimeInMillSec datetime(3) -> ); Query OK, 0 rows affected (0.70 sec)Inserting ... Read More

HTML5 video full preload in JavaScript

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 07:58:43

816 Views

Use the oncanplaythrough event to completely preload video. You can try to run the following code.Example                                        Your browser does not support the video element.                      function display() {             alert("Can be played without pausing for buffering.");         }

HTML5 Video Tag in Chrome - Why is currentTime ignored when video downloaded from my webserver?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 07:52:33

587 Views

To be able to playback video from a specific time using the HTML5 video tag, try these fixes.Your web server should be capable of serving the document using byte ranges. The Google Chrome web browser want this to work. If this is not worked out, then the seeking will be ... Read More

How do I get the current AUTO_INCREMENT value for a table in MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 07:50:02

7K+ Views

To know the current auto_increment value, we can use the last_insert_id() function. Firstly, we will create a table with the help of INSERT command.Creating a table −mysql> CREATE table AutoIncrement -> ( -> IdAuto int auto_increment, -> primary key(IdAuto) -> ); Query OK, 0 rows affected (0.59 sec)After creating a ... Read More

SELECT DISTINCT vs GROUP BY in MySQL?

Chandu yadav

Chandu yadav

Updated on 25-Jun-2020 07:47:28

5K+ Views

SELECT DISTINCT can be used to give distinct values. Use it to remove duplicate records and it can be used with aggregate function as well. For example: MAX, AVG etc. This can be applied on a single column.Now, I am creating a table to use SELECT DISTINCT for a column. ... Read More

Advertisements