Ankith Reddy has Published 996 Articles

Work with white-space inside an element with CSS

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:21:25

136 Views

Use the white-space property to work with white-space inside an elementExampleLive Demo                    p.demo1 {             white-space: normal;          }          p.demo2 {             white-space: pre;          }                     Control white-space                This is demo text.          This is demo text.                      This is demo text.          This is demo text.          

What is ROW_NUMBER() in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:13:35

3K+ Views

Row_NUMBER() included from MySQL version 8.0. It is a type of window function. This can be used to assign a sequence number for rows. To understand, create a table with the help of CREATE pcommand −Creating a tablemysql> CREATE table rowNumberDemo -> ( -> FirstName varchar(100) -> ); Query OK, ... Read More

How can we use nested transactions allowed in MySQL?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:11:48

471 Views

We can allow multiple transactions with the help of START command and SAVEPOINT. Let us create a table with the help of CREATE command.Creating a tablemysql> CREATE table transactionDemo -> ( -> id int auto_increment, -> primary key(id) -> ); Query OK, 0 rows affected (0.76 sec)After that, I will ... Read More

How to convert an MySQL database characterset and collation to UTF-8?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:10:50

358 Views

Firstly, we will check which MySQL version is currently being used with the help of version() function −The query is as follows −mysql> SELECT version();The following is the output+-----------+ | version() | +-----------+ | 8.0.12 | +-----------+ 1 row in set (0.00 sec)As you can see in ... Read More

How to measure actual MySQL query time?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:08:48

4K+ Views

To measure actual MySQL query time, we can use the concept of profiling that must be set to 1 before executing the query.The order must be like this.Set profiling to 1 Then execute query Then show profilesNow, I am applying the above order to get the actual MySQL query time ... Read More

How to stop dragend's default behavior in drag and drop?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:04:08

212 Views

To stop dragend’s default behavior, you need to detect if the mouse is over the drop target where you want to drop.This is what you should do only if you are hovering over my list − listContainer.insertBefore(source, myNode);Use jQuery −if ($(mylist).parent().find(":hover")) {    listContainer.insertBefore(source, myNode); }Read More

How to display all the tables in MySQL with a storage engine?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 08:03:59

157 Views

We can display all the tables with the help of the WHERE clause. The syntax for that is as follows −SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE engine = 'InnoDB';Now, the above syntax is applied to the given query −mysql> SELECT * from INFORMATION_SCHEMA.TABLES WHERE engine = 'InnoDB';The following is the output ... Read More

Detection on clicking bezier path shape with HTML5

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:54:28

230 Views

To detect Bezier path shape on click, try the following code −Examplevar l = boxes.length; for (var i = l-1; i >= 0; i--) {    drawshape(gctx, boxes[i], 'black', 'black');    var imgData = gctx.getImageData(mx, my, 1, 1);    var index = (mx + my * imgData.width) * 4;   ... Read More

How do I set the timezone of MySQL?

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:50:31

702 Views

To know the current time, we can use the now() function with SELECT statement. The query is as follows −mysql> SELECT now();After executing the above query, we will get the current time. The following is the output −+---------------------+ | now() ... Read More

HTML5 File API readAsBinaryString reads files as much larger and different than files on disk

Ankith Reddy

Ankith Reddy

Updated on 25-Jun-2020 07:49:37

143 Views

This may happen if you are reading your file as a binary string and forming the multipart/ form-data request manually.You need to try and use xhr.send(File) and work around xhr progress event, which is fired when all list items had been already created.ExampleThe following is our upload function −function display(url, ... Read More

Advertisements