Swarali Sree

Swarali Sree

48 Articles Published

Articles by Swarali Sree

48 articles

How to draw a quadratic curve on HTML5 Canvas?

Swarali Sree
Swarali Sree
Updated on 16-Dec-2021 1K+ Views

The HTML5 tag is used to draw graphics, animations, etc. using scripting. It is a new tag introduced in HTML5. The canvas element has a DOM method called getContext, which obtains rendering context and its drawing functions. This function takes one parameter, the type of context 2d.To draw a Quadratic curve with HTML5 canvas, use the quadraticCurveTo() method. This method adds the given point to the current path, connected to the previous one by a quadratic Bezier curve with the given control point.You can try to run the following code to learn how to draw a quadratic curve on ...

Read More

Should I use <img>, <object>, or <embed> for SVG files?

Swarali Sree
Swarali Sree
Updated on 26-Jun-2020 507 Views

To add SVG files, you can use , or element in HTML. Choose any one of them according to your requirement. Here’s how you can add SVG, elementUse the tag for images without interaction.The disadvantage is you cannot manipulate images with JavaScript. elementThe element is used to define an embedded object within an HTML document. Use it to embed multimedia like audio, video, flash, etc in the web page.    Your browser does not support SVG elementThe tag wasn’t part of the HTML 4 specification and is new in HTML5. It validates in an HTML5 page.

Read More

How to use .svg files in a webpage?

Swarali Sree
Swarali Sree
Updated on 26-Jun-2020 750 Views

The svg files are Scalable Vector Graphics. You can add it to a web page using the , , or tag.The .svg file is to be referenced in the src attribute of the tag. Let’s see how to add it using the tag.You can try to run the following code to learn how to use .svg files in a web page. We have a smiley.svg file −           HTML SVG               Design          

Read More

How to set the width of the outline around an element with JavaScript?

Swarali Sree
Swarali Sree
Updated on 23-Jun-2020 182 Views

To set the outline width, use the outlineWidth property. You can try to run the following code to set the width of the outline around an element with JavaScript −ExampleLive Demo                    #box {             width: 450px;             background-color: orange;             border: 3px solid red;             margin-left: 20px;          }                     Click below to add Outline Width. ...

Read More

How to set the margins of an element with JavaScript?

Swarali Sree
Swarali Sree
Updated on 23-Jun-2020 314 Views

Use the margin property in JavaScript, to set the margins. You can try to run the following code to set the margins of an element with JavaScript −ExampleLive Demo           Set all four margins       This is demo text.                function display() {             document.getElementById("myID").style.margin = "30px 20px 40px 40px";          }          

Read More

Which event occurs in JavaScript when a dragged element is dropped?

Swarali Sree
Swarali Sree
Updated on 23-Jun-2020 191 Views

The ondrop event triggers when a dragged element is dropped on the target. You can try to run the following code to learn how to implement ondrop event in JavaScript −ExampleLive Demo                    .drag {             float: left;             width: 100px;             height: 35px;             border: 2px dashed #876587;             margin: 15px;             padding: 10px;          } ...

Read More

Why do we need to change the delimiter for creating a trigger?

Swarali Sree
Swarali Sree
Updated on 22-Jun-2020 633 Views

As we know that in MySQL we use the delimiter semicolon (;) to end each statement. The semicolon is the by default delimiter in MySQL. We need to change the delimiter, while creating a trigger, to tell MySQL that this is not the end of our trigger statement because we can use multiple statements in the trigger. We can change the delimiter temporarily by DELIMITER // statement to change the delimiter from Semicolon (;) to two back-slash (//). After this MySQL would know that the triggering statement only ends when it encounters a two back-slash (//). Following is an example ...

Read More

How can we nest a subquery within another subquery?

Swarali Sree
Swarali Sree
Updated on 22-Jun-2020 228 Views

If a subquery is nested inside another subquery then it is called a nested subquery. To make it understand we are creating the nested subquery from the following tables data −mysql> Select * from Cars; +------+--------------+---------+ | ID   | Name         | Price   | +------+--------------+---------+ |    1 | Nexa         | 750000  | |    2 | Maruti Swift | 450000  | |    3 | BMW          | 4450000 | |    4 | VOLVO        | 2250000 | |    5 | Alto   ...

Read More

How can group functions be used in ORDER BY clause?

Swarali Sree
Swarali Sree
Updated on 22-Jun-2020 204 Views

We can sort the result set groups by using group functions in the ORDER BY clause. By default, the sort order is ascending but we can reverse it by using DESC keyword.Examplemysql> Select designation, YEAR(Doj), count(*) from employees GROUP BY designation, YEAR(DoJ) ORDER BY Count(*) DESC; +-------------+-----------+----------+ | designation | YEAR(Doj) | count(*) | +-------------+-----------+----------+ | Prof        |      2009 |        2 | | Asst.Prof   |      2015 |        1 | | Asst.Prof   |      2016 |        1 | | Prof     ...

Read More

How can I use MySQL INTERVAL() function with a column of a table?

Swarali Sree
Swarali Sree
Updated on 22-Jun-2020 490 Views

We can use INTERVAL() function with a column of a table by providing the first argument as the name of the column. In this case, al the values in that column would be compared with the values given as the other arguments of INTERVAL() function and on that basis of comparison, the result set is provided. To understand it, the data from the employee table is used which is as follows −mysql> Select* from employee568; +----+--------+--------+ | ID | Name   | Salary | +----+--------+--------+ | 1  | Gaurav | 50000  | | 2  | Rahul  | 20000  | | ...

Read More
Showing 1–10 of 48 articles
« Prev 1 2 3 4 5 Next »
Advertisements