Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 33 of 81

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

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 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) -> ); Query OK, 0 rows affected (0.51 sec)Above, I have created a column name as a number with the help of backtick symbol.Now, we can check the same by inserting records with the help of INSERT command. Let us insert a record, which is as follows −mysql> INSERT into ...

Read More

How to save time in milliseconds in MySQL?

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 4K+ 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 record into the table −mysql> INSERT into MilliSecondDemo values(now(3)); Query OK, 1 row affected (0.98 sec)Let us now view the table records −mysql> SELECT * from MilliSecondDemo; The following is the output+-------------------------+ | MyTimeInMillSec | +-------------------------+ | 2018-10-08 15:19:50.202 | +-------------------------+ 1 row in set (0.00 sec)

Read More

HTML5 video full preload in JavaScript

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 895 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.");         }

Read More

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

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 625 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 disabled and even if you set the currentTime, it will not work.Test your web server, if it allows this −curl --dump-header - -r0-0 http://theurl

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 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 table, we will insert the records with the help of INSERT command. Inserting records −mysql> INSERT into AutoIncrement values(); Query OK, 1 row affected (0.48 sec) mysql> INSERT into AutoIncrement values(); Query OK, 1 row affected (0.17 sec) mysql> INSERT into AutoIncrement values(); Query OK, 1 row affected ...

Read More

SELECT DISTINCT vs GROUP BY in MySQL?

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 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. Creating a table with the help of CREATE command −mysql> CREATE TABLE DistinctDemo -> ( -> id int, -> name varchar(100) -> ); Query OK, 0 rows affected (0.64 sec)Inserting records −mysql> INSERT into DistinctDemo values(1, 'John'); Query OK, 1 row affected (0.17 sec) mysql> INSERT into DistinctDemo values(2, ...

Read More

How to choose between `window.URL.createObjectURL()` and `window.webkitURL.createObjectURL()` based on browser?

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 752 Views

To choose, you need to define a wrapper function −function display ( file ) {    if ( window.webkitURL ) {       return window.webkitURL.createObjectURL( file );    } else if ( window.URL && window.URL.createObjectURL ) {       return window.URL.display( file );    } else {    return null;    } }After that set it for cross-browser −var url = display( file );

Read More

Align HTML5 SVG to the center of the screen

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 3K+ Views

SVG stands for Scalable Vector Graphics and it is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer.ExampleLet us see an example of SVG −                    #svgelem {             position: relative;             left: 50%;             -webkit-transform: translateX(-20%);             -ms-transform: translateX(-20%);             transform: translateX(-20%);          }             SVG                     HTML5 SVG Circle                           To center it, add the CSS like the following −# svgelem {    margin-left:auto;    margin-right:auto;    display:block; }

Read More

CSS Grid Columns

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 231 Views

The vertical line in the following is called Grid Columns.

Read More

HTML5 <input type=“file” accept=“image/*” capture=“camera”> display as image rather than “choose file” button

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 448 Views

Use the JavaScript FileReader to allow users to choose an image.Let us see an example −         Here is the JS −function readURL(input) {    if (input.files && input.files[0]) {       var r = new FileReader();       r.onload = function (ev) {          $('#myid).attr('src', ev.target.result);       }       reader.readAsDataURL(input.files[0]);    } }   

Read More
Showing 321–330 of 810 articles
« Prev 1 31 32 33 34 35 81 Next »
Advertisements