Chandu yadav

Chandu yadav

810 Articles Published

Articles by Chandu yadav

Page 34 of 81

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

Chandu yadav
Chandu yadav
Updated on 25-Jun-2020 753 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

Flexbox and vertical scroll in a full-height app using newer Flexbox API with HTML

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 652 Views

The flex property is a shorthand for the flex-grow, flex-shrink, and flex-basis properties. The flex property sets the flexible length on flexible items.For example −#container article {    -webkit-flex: 1 1 auto;    overflow-y: auto;    height: 0px; /*here the height is set to 0px*/ }If you want a min-height, the use height: 100px; that it is exactly the same as − min-height: 100px;#container article {    -webkit-flex: 1 1 auto;    overflow-y: auto;    height: 100px; /*here the height is set to 100px*/ }

Read More

Find records from one MySQL table which don't exist in another?

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 830 Views

To find the records from one MySQL table which don’t exist in another table we can use the subquery for the table which does not have the records. This can be better understood using the given steps −First a table is created using the create command. The table name is ‘PresentHistory’ and it has two columns. This is given as follows −mysql> CREATE table PresentHistory -> ( -> HisID int, -> HisName varchar(100) -> ); Query OK, 0 rows affected (0.54 sec)After creating the table, some records are inserted that will be present in the second table as well. This ...

Read More

EventSource vs. wrapped WebSocket with HTML5 Server-Side Event

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 171 Views

The event source is just a web socket that -That cannot send data Uses text or event stream format It fires events that are server definedIt is useful in applications that only need server push.Web sockets are good for applications that need fast communications in both directions.Another major difference is the different security models they used.Server Send events are useful for −Live Feeds Live Scores Stock Market Update

Read More

How can I stop running a MySQL query?

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 1K+ Views

Before stopping a running query of MySQL, first we need to see how many processes are running with the help of show command.The query for that is given as follows −mysql> show processlist;After executing the above query, we will get the output with some id’s. This is given as follows −+----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+-----------------+-----------------+----------+---------+-------+------------------------+------------------+ | 4 | event_scheduler | localhost | NULL | Daemon | 71034 | Waiting on empty queue | NULL | | 8 | Manish | localhost:53496 | business | Query | ...

Read More

How to check if a MySQL database exists?

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 6K+ Views

The schema_name command is used to check if a MySQL database exists or not. The syntax of this command is as follows −select schema_name from information_schema.schemata where schema_name = 'database name';Now, the above command is used to check whether the database exists or not. The query for that is as follows −Case 1 − The database exists.mysql> select schema_name from information_schema.schemata where schema_name = 'business'; The output obtained is as follows −+-------------+ | SCHEMA_NAME | +-------------+ | business | +-------------+ 1 row in set (0.00 sec)Case 2 − The database does not exist.mysql> select schema_name from information_schema.schemata ...

Read More

How can I add video to site background in HTML 5?

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 471 Views

Add a button to play or pause the video. Then we have styled the video to a hundred percentage height and width so that it covers the entire background.The following is the code snippet to set video as a site background in HTML5.        Your browser does not support HTML5 video. The following is to pause the video −function display() {    if (video.paused) {       video.play();       btn.innerHTML = "Pause the video!";    } else {       video.pause();       btn.innerHTML = "Play";    } }

Read More

How to stream large .mp4 files in HTML5?

Chandu yadav
Chandu yadav
Updated on 24-Jun-2020 1K+ Views

Video files on the web sometimes need to be encoded in a special way in order for them to be played while downloading. In order for flash-based videos to work, data should be moved from the end to the start of the stream. A program called mp4 FastStart can do this for you.Programs like HandBrake have a "web" option that also does this when encoding. You need to ensure that your web server is not applying to gzip or deflate compression on top of the compression in the mp4 file.Compression allows your webserver to provide smaller file sizes, which load ...

Read More
Showing 331–340 of 810 articles
« Prev 1 32 33 34 35 36 81 Next »
Advertisements