A rectangle is a quadrilateral that has opposite side equal and parallel. The adjacent side are at 90o. And a triangle is a closed figure with three sides.The largest triangle inscribed within a rectangle. Has its base equal to the length of the rectangle and height of the triangle is equal to the breadth of the rectangle.Area = (½)*l*bArea of largest triangle inscribed in a rectangle = (½)*l*bProgram to calculate the area of the largest triangle inscribed in a rectangle −Example Code#include int main(void) { int l = 10, b = 9; float area ; area ... Read More
To understand we need to first have a fair idea of what JSON actually is, JSON stands for Java Script Object Notation. Now let's have a look at what a sample JSON input looks like −{ "name": "Tutorials Point", "topic": "Selenium", "Address": "India" }JSON today is one of the most widely used and accepted method for communication of heterogeneous system. JSON is used a lot in web services in REST and has been a strong competition to XML.Let’s understand how Web driver uses it when testing the web applications −WebDriver uses JSON as a medium to communicate ... Read More
Let us first create a table −mysql> create table DemoTable ( Number float ); Query OK, 0 rows affected (0.47 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(1000); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values(1); Query OK, 1 row affected (0.27 sec) mysql> insert into DemoTable values(10); Query OK, 1 row affected (0.30 sec) mysql> insert into DemoTable values(100); Query OK, 1 row affected (0.24 sec) mysql> insert into DemoTable values(390); Query OK, 1 row affected (0.09 sec)Display all records from the table using select statement −mysql> ... Read More
The getMaxColumnNameLength() method of the DatabaseMetaData interface is used to find out the maximum number of characters that the underlying database allows in the name of a column.This method returns an integer value, representing the maximum number of characters allowed in a column name. 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() ... Read More
You can use CONCAT() function for this. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value1 varchar(10), Value2 varchar(10) ); Query OK, 0 rows affected (0.21 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Value1, Value2) values('10', '345'); Query OK, 1 row affected (0.07 sec) mysql> insert into DemoTable(Value1, Value2) values('14', '789'); Query OK, 1 row affected (0.06 sec) mysql> insert into DemoTable(Value1, Value2) values('18', '234'); Query OK, 1 row affected (0.13 sec)Display all records from the table using ... Read More
Bitcoin is the first and foremost cryptocurrency ever created. It is the digital currency which is created, used and maintained electronically. The transactions of a digital coin are written in Blocks and maintained in the Block Chain, which is a distributed, transparent and digital ledger.During the process of mining the Bitcoins, the miners (computer nodes with high power graphic processors) of the network solve the hash algorithms, difficult math problems and mine a block to earn bitcoins as reward. This is how Bitcoins come into market.What is Proof of WorkThe original idea of Proof of Work belong to Cynthia Dwork ... Read More
Let’s say we have set the tooltips for all the components using the following method in Java, for example −setToolTipText("Enter Age");Here, we have already enabled tooltips for all the components using the setToolTipText(). But, after enabling all of them, we disabled the tooltips using the following −ToolTipManager.sharedInstance().setEnabled(false);The following is an example to disable Tooltip for a component with an already enabled tooltip −Examplepackage my; import java.awt.GraphicsEnvironment; import java.awt.GridLayout; import java.awt.Point; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPasswordField; import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.ToolTipManager; public class SwingDemo { public static void main(String[] args) throws Exception { JFrame.setDefaultLookAndFeelDecorated(true); ... Read More
Now let us see a program of Intel 8085 Microprocessor. In this program we will see how to simulate the hexadecimal counter.Problem StatementWrite 8085 Assembly language program to simulate hexadecimal counter.DiscussionHexadecimal counters in 8085 is similar to the binary counter. There are two different parts. The main counting part and the delay part. We have to define a delay subroutine to generate delay between each number while counting. We are considering that we have some external display which are connected through IO port, that will display the result in hexadecimal form.InputHere we are not providing any input.Flow Diagram ProgramAddressHEX CodesLabelsMnemonicsCommentsF00006, FF MVI ... Read More
Power function is used to calculate the power of the given number.The pow function find the value of a raised to the power b i.e. ab.Syntaxdouble pow(double a , double b)It accepts a double integers as input and output a double integer as output. It pow() function is defined in math.h package.If you pass an integer to the power function, the function converts it into double data type. But there's an issue with this, sometimes this conversion might store this as a lower double. For example, if we pass 3 and is converted as 2.99 then the square is 8.99940001 ... Read More
Organizationally unique identifier (OUI) refers to a 24-bit number assigned to a manufacturer or a vendor of a network device or station. They are globally unique identifiers assigned by the Institute of Electrical and Electronics Engineers (IEEE) Registration Authority.OUI are typically used for uniquely identifying a particular device connected to the computer network through derived identifiers like the Medium Access Control (MAC) addresses. MAC addresses are of 6 octets ( 48-bits ). Among these, the first three octets of the addresses constitutes the OUI.A 3-octet OUI is generally represented in hexadecimal notation separated by dashes (for example, 1F – 9E ... Read More