The HTML DOM download property is used to set or return the value of the download attribute of a link.Following is the syntax to set the download property −anchorObject.download = fileAbove, file represents the file name you can set for the file to be downloaded. The actual extension will get suffixed.Following is the syntax to return the download property: anchorObject.downloadLet us now see an example to implement the DOM Anchor download property −Example Live Demo ReactJS Display the value function display() { var val = document.getElementById("myid").download; document.getElementById("demo").innerHTML = val; ... Read More
Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentScore varchar(100) -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(StudentScore) values('90'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable(StudentScore) values('100'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable(StudentScore) values('56'); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable(StudentScore) values('98'); Query OK, 1 row affected (0.13 sec)Display all records from the table ... Read More
The HTML DOM Input Date stepdown() method defines the amount of days the date field should decrease.SyntaxFollowing is the syntax −Calling stepDown method with a number, which by default is equal to 1inputDateObject.stepDown(number)ExampleLet us see an example of Input Date stepDown method − Live Demo Input Date stepDown() Calendar: Decrease by 2 Decrease by 3 var divDisplay = document.getElementById("divDisplay"); var inputDate = document.getElementById("dateSelect"); function changeStep(num){ if(num===2) inputDate.stepDown(2); else inputDate.stepDown(3); divDisplay.textContent = 'Current date decreased by: '+num; } OutputThis will produce the following output −Clicking ‘Decrease by 2’ button −Clicking ‘Decrease by 3’ button −
The HTML DOM ins cite property returns the URL of a document that reasons why text was inserted.SyntaxFollowing is the syntax −Returning string valueinsObject.citeExampleLet us see an example for ins cite property − Live Demo ins cite form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } ins-cite Fact: Water cannot persist on moon's surface.Water ice found on moon ... Read More
You need to use GROUP BY for this. Let us first create a table −mysql> create table DemoTable ( StudentFirstName varchar(20) ); Query OK, 0 rows affected (0.74 sec)Insert records in the table using insert command −mysql> insert into DemoTable values('John'); Query OK, 1 row affected (1.34 sec) mysql> insert into DemoTable values('Carol'); Query OK, 1 row affected (0.28 sec) mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('John'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('Bob'); Query OK, 1 row affected (0.25 sec) mysql> ... Read More
The getMaxConnections() method of the DatabaseMetaData interface is used to find out the maximum number of connections that the underlying database allows at a time.This method returns an integer value, representing the maximum number of connections allowed at a time. If this value is 0 it indicates that there is no limit or, limit is unknown.To get the DatabaseMetaData object −Make sure your database is up and running.Register the driver using the registerDriver() method of the DriverManager class. Pass an object of the driver class corresponding to the underlying database.Get the connection object using the getConnection() method of the DriverManager class. ... Read More
To count presence of a NOT NULL value, use aggregate function COUNT(yourColumnName). Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, NumberOfQuestion int, NumberOfSolution int ); Query OK, 0 rows affected (0.20 sec)Insert some records in the table using insert command. Here, some of the values are NULL −mysql> insert into DemoTable(NumberOfQuestion, NumberOfSolution) values(20, 10); Query OK, 1 row affected (0.06 sec) mysql> insert into DemoTable(NumberOfQuestion, NumberOfSolution) values(20, 2); Query OK, 1 row affected (0.04 sec) mysql> insert into DemoTable(NumberOfQuestion, NumberOfSolution) values(20, NULL); Query ... Read More
With two dimensional array, set the columns of a table. Additionally, we have set the rows using a one-dimensional array as shown below −DefaultTableModel tableModel = new DefaultTableModel(new Object[][] { { "Mobile Phones", "100" }, { "RAM", "200" }, { "Caps", "50" }, { "Tablet", "80" }, { "LED", "400" }, { "Trousers", "350" }, { "T-Shirt", "500" }, { "Hoodie", "650" }, { "Jeans", "900" } }, new Object[] { "Items", "Quantity" } );Now set the table model to the table −JTable table = new JTable(tableModel);The following is an example to create a table from ... Read More
In this program we will see how to find AP series using 8086.Problem StatementWrite 8086 Assembly language program to find AP series. The limit of the series is stored at 500, First term is stored at 501, and the common difference is stored at 502.DiscussionAP generation is simple task. We are taking the limit as counter value, the first term is loaded into AL first, then the BL is holding the common difference d. Now the result is storing memory offset 600 onwards. The AL is placing as it is, then repeatedly add BL with AL and store it into ... Read More
There are a couple of ways to find whether a key exist in javascript object or not.Let's say we have an 'employee' object as shown below. var employee = { name: "Ranjan", age: 25 }Now we need to check whether 'name' property exist in employee object or not.1) 'In' operatorWe can use 'in' operator on object to check its properties. The 'in' operator also looks about inherited property if it does not find any actual properties of the object.In the following example when 'toString' is checked whether present or not, the 'in' operator ... Read More