Arjun Thakur has Published 1025 Articles

Mouse event not being triggered on HTML5 canvas? How to solve it?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 14:09:51

507 Views

To trigger mouse event we can add −-webkit-transform: translate3d(0, 0, 0)In addition to this canvas can also be styled.Another way is to add a listener in the event mousemove, canvas.addEventListener("mousemove", this.checkMouseLocation.bind(this, this.inputs), false);By adding this listener, we can easily trigger a mouse move event in HTML5.Read More

How to get the max of two values MySQL?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 14:07:00

1K+ Views

To get the maximum of two values in MySQL, we can use the predefined function “greatest”. The syntax of greatest() function is as follows −SELECT greatest(value1, value2);Applying the above query, To get the maximum value from two values. The query is as follows −Case 1We are giving both the values ... Read More

Solve unknown gap between elements in Flexbox with HTML5.

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 14:06:10

241 Views

Unknown gaps between elements in flexbox are due to margin collapsing of the header to the bar division. To resolve this −Either Margin is reset to 0 for header or Border is added to the bar.Padding can be done to bar by adding property padding: 10px to bar. Try the following ... Read More

How to change auto increment number in the beginning in MySQL?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 14:01:33

838 Views

The auto_increment is a default property that automatically increments the newly added record by 1. The auto_increment can be changed from the beginning as well. The procedure for that is given below −First, a table is created.mysql> CREATE table DemoAuto -> ( -> id int auto_increment, -> name varchar(100), -> ... Read More

MySQL Error - #1046 - No database selected

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 13:56:06

22K+ Views

The error-#1046 can occur when we are creating a table, but forget to select the database. Let us say we have started MySQL as shown below −After giving the correct password, the above window will open. Now create a table without choosing any database. This will show an error −mysql> ... Read More

How to draw grid using HTML5 and canvas or SVG?

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 13:43:08

648 Views

In the below given example, we have first defined the width and height of the grid. Then we are defining the size of canvas and drawn gird into a canvas.//we are setting the grid width and height var grid_w = 200; var grid_h = 200; //we are setting padding ... Read More

JDMonthName() function in PHP

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 12:51:38

47 Views

The JDMonthName() method returns a month name.Syntaxjdmonthname(julian_day, mode)Parametersjulian_day − A julian day numbermode  − Specifies which calendar to convert the Julian Day Count to, and what type of month names is to be returned−0 - Gregorian abbreviated form (Jan, Feb, Mar, etc.)1 - Gregorian (January, February, March, etc.)2 - Julian ... Read More

atan2() function in C++ STL

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 11:42:59

358 Views

The atan2() function returns the tangent inverse of the coordinate in terms of y and x. Here y and x are the values of the y and x coordinates respectively. It is an inbuilt function in C++ STL.The syntax of the atan2() function is given as follows.atan2(dataType var1, dataType var2)As ... Read More

Constructors in C++

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 11:39:55

10K+ Views

Constructors are functions of a class that are executed when new objects of the class are created. The constructors have the same name as the class and no return type, not even void. They are primarily useful for providing initial values for variables of the class.The two main types of ... Read More

strcat() vs strncat() in C++

Arjun Thakur

Arjun Thakur

Updated on 24-Jun-2020 10:49:31

721 Views

Both strcat() and strncat() are predefined string functions in C++. Details about these are given as follows.strcat()This function is used for concatenation. It appends a copy of the source string at the end of the destination string and returns a pointer to the destination string. The syntax of strcat() is ... Read More

Advertisements