Ankith Reddy has Published 996 Articles

How can I find non-ASCII characters in MySQL?

Ankith Reddy

Ankith Reddy

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

2K+ Views

Non ASCII characters are characters such as the pound symbol(£), trademark symbol, plusminus symbol etc. To find the non-ASCII characters from the table, the following steps are required −First a table is created with the help of the create command which is given as follows −mysql> CREATE table NonASciiDemo -> ... Read More

MySQL error 1452 - Cannot add or a child row: a foreign key constraint fails

Ankith Reddy

Ankith Reddy

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

8K+ Views

To understand error 1452, first we need to create a table and relate that to another table with the help of a foreign key constraint.Creating the first table −mysql> CREATE table ForeignTable -> ( -> id int, -> name varchar(200), -> Fk_pk int -> ); Query OK, 0 rows affected ... Read More

Applying a CSS style to an ID element when the beginning of its name stays identical and the end varies in HTML

Ankith Reddy

Ankith Reddy

Updated on 24-Jun-2020 14:05:19

73 Views

Posts can be selected using div with ‘id=post’. This will select all div elements with an id which contains a value in quotes.We can use either −div[id*='post-'] { ... } or div[id^='post-'] { ... }.div[id*='post-'] { ... } will select all div elements with id which is having all values ... Read More

How do I see all foreign keys to a table column?

Ankith Reddy

Ankith Reddy

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

2K+ Views

To see all the foreign keys to a table or column, the referenced_column_name command is used.First, two tables are created and then related with the help of the foreign key constraint.Creating the first table −mysql> CREATE table ForeignTable -> ( -> id int, -> name varchar(200), -> Fk_pk int -> ... Read More

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

652 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

123 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

64 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

strncat() in C++

Ankith Reddy

Ankith Reddy

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

555 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