Ankith Reddy has Published 996 Articles

How do we specify that the audio/video will start playing as soon as it is ready in HTML?

Ankith Reddy

Ankith Reddy

Updated on 02-Mar-2020 12:44:10

333 Views

Use the autoplay attribute to set that the audio or video will start playing automatically as the page loads.ExampleYou can try to run the following code to implement autoplay attribute in HTML −                                        Your browser does not support the video element.          

Why should C++ programmers minimize use of 'new'?

Ankith Reddy

Ankith Reddy

Updated on 02-Mar-2020 08:07:45

132 Views

new is used for dynamic memory allocation. The memory allocated in this case goes on the heap. There are several costs associated with this type of memory allocation along with the programmer having to do manual memory cleaning and management. This type of allocation must be used when − You don't ... Read More

What should be the order in which libraries are linked in GCC?

Ankith Reddy

Ankith Reddy

Updated on 02-Mar-2020 07:52:22

1K+ Views

The linker searches from left to right. While doing so it encounters unresolved symbols which it keeps track of. If a library resolves the unresolved symbol, it takes the object files of that library to resolve the symbol.Dependencies of static libraries from each other work in the same way. Libraries ... Read More

How MySQL virtual GENERATED COLUMNS can work with mathematical expressions?

Ankith Reddy

Ankith Reddy

Updated on 21-Feb-2020 11:39:55

165 Views

It can be illustrated with the help of an example in which we are creating a virtual generated column in the table named ‘triangle’. As we know that virtual generated column can be generated with or without using the keyword ‘virtual’.Examplemysql> Create table triangle(SideA DOUBLE, SideB DOUBLE, SideC DOUBLE AS ... Read More

How MySQL can perform case-sensitive string comparison?

Ankith Reddy

Ankith Reddy

Updated on 17-Feb-2020 06:01:43

667 Views

As we know that MySQL is not case-sensitive while comparing characters but it can be changed i.e. MySQL can perform case-sensitive string comparison if we will use BINARY keyword before the expression. Actually, BINARY keyword instructs MySQL to compare the characters in the string using their underlying ASCII values rather ... Read More

Sorting a vector of custom objects using C++ STL

Ankith Reddy

Ankith Reddy

Updated on 12-Feb-2020 06:19:23

13K+ Views

You can sort a vector of custom objects using the C++ STL function std::sort. The sort function has an overloaded form that takes as arguments first, last, comparator. The first and last are iterators to first and last elements of the container. The comparator is a predicate function that can ... Read More

How can I use SPACE() function with MySQL WHERE clause?

Ankith Reddy

Ankith Reddy

Updated on 10-Feb-2020 06:24:38

295 Views

In this case, SPACE() function would add white spaces depending upon the condition given in WHERE clause. The following example from student table will demonstrate it.Examplemysql> Select Id, Name, Space(5) from student WHERE Name='Harshit'; +------+---------+----------+ | Id   | Name    | Space(5) | +------+---------+----------+ | 15   | Harshit ... Read More

What MySQL returns if the argument of QUOTE() function is NULL?

Ankith Reddy

Ankith Reddy

Updated on 07-Feb-2020 07:15:41

139 Views

MySQL returns NULL if the argument of QUOTE() function is NULL.Examplemysql> Select QUOTE(NULL); +-------------+ | QUOTE(NULL) | +-------------+ | NULL         +-------------+ 1 row in set (0.00 sec) mysql> Select Name, QUOTE(NULL) from student where id = 1; +--------+-------------+ | Name   | QUOTE(NULL) | +--------+-------------+ | Gaurav | NULL        | +--------+-------------+ 1 row in set (0.08 sec)

In MySQL, how can we check whether a string of a specified pattern is not present within another string?

Ankith Reddy

Ankith Reddy

Updated on 07-Feb-2020 06:45:36

147 Views

We can check whether a string of specified pattern is not present within another string by using NOT LIKE operator along with wildcard characters.SyntaxNOT LIKE specific_patternSpecific_pattern is the pattern of string we do not want to find out within another string.ExampleSuppose we have a table named ‘student’ having names of ... Read More

How can we use LPAD() or RPAD() functions with the values in the column of a MySQL table?

Ankith Reddy

Ankith Reddy

Updated on 06-Feb-2020 06:53:27

735 Views

For using LPAD() or RPAD() functions with the column values we need to specify the column name as the first argument of these functions. Following the example from ‘Student’ table will make it clearer −Examplemysql> Select Name, LPAD(Name, 10, '*') from student; +---------+-------------------+ | Name    | LPAD(Name, 10, ... Read More

Advertisements