Articles on Trending Technologies

Technical articles with clear explanations and examples

HTML DOM Label htmlFor Property

AmitDiwan
AmitDiwan
Updated on 30-Jul-2019 237 Views

The HTML DOM Label htmlFor property returns/sets the value of for attribute.SyntaxFollowing is the syntax −Returning value of for attribute −labelObject.htmlForExampleLet us see an example for Label htmlForproperty − Live Demo Label htmlFor    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px;       margin:5px;    }    input[type="button"] {       border-radius: 10px;    } Label-htmlFor Current Editor: Label for attribute set as editor two ...

Read More

C++ program to Solve Tower of Hanoi Problem using Binary Value

Smita Kapse
Smita Kapse
Updated on 30-Jul-2019 410 Views

This C++ program displays the solution to the Tower of Hanoi problem using binary value.There is one binary digit for each disk.The most significant bit represents the largest disk. A value of 0 indicates that the largest disk is on the initial peg, while a 1 indicates that it’s on the final peg.The bitstring is read from left to right, and each bit can be used to determine the location of the corresponding disk.The corresponding disk is stacked on top the previous disk on the same peg if a bit has the same value as the previous one.If it is ...

Read More

The ResultSet updateRow() method with example

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 2K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).The ResultSet object has a cursor/pointer which points to the current row. Initially this cursor is positioned before first row.The updateRow() method of the ResultSet interface updates the contents of the current row to the database. For example if we have updated the values of a particular record using the updateXXX() ...

Read More

Multiple Access with Collision Avoidance (MACA)

Chandu yadav
Chandu yadav
Updated on 30-Jul-2019 5K+ Views

Multiple Access with Collision Avoidance (MACA) is a medium access control (MAC) layer protocol used in wireless networks, with a view to solve the hidden terminal problem. It also provides solution to the exposed terminal problem. The MAC layer protocol IEEE 802.11 RTS/CTS has been adopted from MACA.Working PrincipleThe MACA protocol works with the condition that the stations are synchronized and frame sizes and data speed are the same. It involves transmission of two frames called RTS and CTS prior to data transmission. RTS stands for Request to Send and CTS stands for Clear to Send.Let us consider that a ...

Read More

How to center a Window in Java?

Anvi Jain
Anvi Jain
Updated on 30-Jul-2019 1K+ Views

To center a Window in Java, use the getCenterPoint() method. Set the width and height and use the below formulae to set bounds −Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); int width = 500; int height = 200; frame.setBounds(center.x - width / 2, center.y - height / 2, width, height);The following is an example to center a window −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; public class SwingDemo {    public static void main(String[] args) throws Exception {       JFrame.setDefaultLookAndFeelDecorated(true);       JFrame frame = new JFrame("Register!");     ...

Read More

Fetch records containing a specific character twice in MySQL

Rama Giri
Rama Giri
Updated on 30-Jul-2019 351 Views

Let us first create a table −mysql> create table DemoTable    -> (    -> Words text    -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Ever'); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values('Forever'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('Good'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable values('Never'); Query OK, 1 row affected (0.12 sec)Display all records from the table using select statement −mysql> select *from DemoTable;Output+---------+ | Words ...

Read More

HTML DOM HTML Object

Sharon Christine
Sharon Christine
Updated on 30-Jul-2019 384 Views

The HTML Object represents the element of an HTML document.Let us see how to access HTML object −SyntaxFollowing is the syntax −document.getElementsByTagName(“HTML”)Let us see an example of HTML object −Example Live Demo    body{       text-align:center;    }    .btn{       background-color:lightblue;       border:none;       height:2rem;       border-radius:50px;       width:60%;    margin:1rem auto;    }    .show{       font-size:1rem;       font-weight:bold;       color:orange;       border:2px solid green;       padding:10px;       display:none;    } ...

Read More

Java ResultSet wasNull() method with example

Arushi
Arushi
Updated on 30-Jul-2019 9K+ Views

When we execute certain SQL queries (SELECT query in general) they return tabular data.The java.sql.ResultSet interface represents such tabular data returned by the SQL statements.i.e. the ResultSet object holds the tabular data returned by the methods that execute the statements which quires the database (executeQuery() method of the Statement interface in general).The ResultSet object has a cursor/pointer which points to the current row. Initially this cursor is positioned before first row.The wasNull() method of the ResultSet interface determines whether the last column read had a Null value. i.e. whenever you read the contents of a column of the ResultSet using the ...

Read More

How do I check whether a field contains null value in MongoDB?

Nishtha Thakur
Nishtha Thakur
Updated on 30-Jul-2019 380 Views

You can use $type operator to check whether a filed contains null value. Let us first create a collection with documents. We have also inserted a null in a field −> db.nullDemo.insertOne({"FirstName":"Chris"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc68a1eac184d684e3fa270") } > db.nullDemo.insertOne({"FirstName":null}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc68a25ac184d684e3fa271") } > db.nullDemo.insertOne({"FirstName":"Robert"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc68a2cac184d684e3fa272") }Following is the query to display all documents from a collection with the help of find() method −> db.nullDemo.find().pretty();This will produce the following output. One of the field is null −{ "_id" : ObjectId("5cc68a1eac184d684e3fa270"), "FirstName" ...

Read More

Request To Send (RTS)

George John
George John
Updated on 30-Jul-2019 3K+ Views

Request to Send (RTS) is a control frame employed in the medium access control (MAC) layer protocol IEEE 802.11 RTS/CTS. The protocol uses the concept of Multiple Access with Collision Avoidance (MACA) in wireless networks. The RTS/CTS (Request to Send / Clear to Send) mechanism aims to reduce frame collisions introduced by the hidden terminal problem. RTS frame is sent by the transmitter prior to transmission of the actual data frame.Working Principle of MACA implementing RTSThe MACA protocol works with the condition that the communicating stations are synchronized and frame sizes and data speed are the same.Let us consider that ...

Read More
Showing 55901–55910 of 61,248 articles
Advertisements