Ankith Reddy has Published 1070 Articles

What is “where 1=1” statement in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 13:58:15

2K+ Views

In MySQL “Where 1=1” results in all the rows of a table as this statement is always true. An example to better unerstand this statement is given as follows −First, a table is created with the help of the create command. This is given as follows −mysql> CREATE table WhereConditon ... Read More

How to find the size of localStorage in HTML?

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 13:38:28

455 Views

localStorage is used to persist information across multiple sessions. It has a maximum size of 5MB.ExampleYou can try to run the following code snippet to check the size allocated −var sum = 0; // loop for size for(var i in localStorage) {    var amount = (localStorage[i].length * 2) ... Read More

How to apply antialiasing in HTML5 canvas drawImage()?

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 13:37:21

2K+ Views

For antialiasing, you need to set resampling quality.ctx.imageSmoothingQuality = "low|medium|high"Use an off-screen canvas to reduce the image to half −var c = document.createElement('canvas'), ocx = c.getContext('2d'); c.width = img.width * 0.5; c.height = img.height * 0.5; ocxx.drawImage(img, 0, 0, c.width, c.height);// drawing images reducing to half again and repeating ... Read More

Shorthand property for setting all the column-rule-* properties

Ankith Reddy

Ankith Reddy

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

62 Views

The shorthand property for column rule is column-rule property. You can try to run the following code to implement the column-rule propertyExampleLive Demo                    .demo {             column-count: 4;             ... Read More

cal_to_jd() function in PHP

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 12:52:18

32 Views

The cal_to_jd() function converts a date to Julian day count. It returns a Julian day number.Syntaxcal_to_jd(calendar, month, day, year)Parameterscalendar − The calendar to convert from. Possible values −CAL_GREGORIANCAL_JULIANCAL_JEWISHCAL_FRENCHmonth  − Set the month as a number.day  − Set the day as a number.year  − Set the year as a number.ReturnThe cal_to_jd() ... Read More

Nested Classes in C++

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 11:40:43

23K+ Views

A nested class is a class that is declared in another class. The nested class is also a member variable of the enclosing class and has the same access rights as the other members. However, the member functions of the enclosing class have no special access to the members of ... Read More

Default Constructors in C++

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 11:35:35

15K+ 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 ... Read More

C++ Program to Implement Sparse Matrix

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 11:30:57

7K+ Views

A sparse matrix is a matrix in which majority of the elements are 0. An example for this is given as follows.The matrix given below contains 5 zeroes. Since the number of zeroes is more than half the elements of the matrix, it is a sparse matrix.5 0 0 3 ... Read More

atanh() function in C++ STL

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 10:55:29

87 Views

The atanh() function returns the arc hyperbolic tangent or the inverse hyperbolic tangent of an angle given in radians. It is an inbuilt function in C++ STL.The syntax of the atanh() function is given as follows.atanh(var)As can be seen from the syntax, the function atanh() accepts a parameter var of ... Read More

strncat() in C++

Ankith Reddy

Ankith Reddy

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

422 Views

The function strncat() in C++ is used for concatenation. It appends the specified number of characters from the source string at the end of the destination string and returns a pointer to the destination string. The syntax of strncat() is given as follows.char * strncat ( char * dest, const ... Read More

Advertisements