Request to Send (RTS) in Networking

George John
Updated on 30-Jul-2019 22:30:26

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

Set ColumnWeights and RowWeights in GridBagLayout

Smita Kapse
Updated on 30-Jul-2019 22:30:26

248 Views

Create a panel and set the layout −JPanel panel = new JPanel(); GridBagLayout layout = new GridBagLayout(); panel.setLayout(layout);Now, set the constrainst and with that the columnWeights and rowWeights −GridBagConstraints gbc = new GridBagConstraints(); JLabel label = new JLabel("Rank: "); JTextArea text = new JTextArea(); text.setText("Add rank here..."); layout.columnWeights = new double[]{0.0f, 0.0f, 2.0f}; layout.rowWeights = new double[]{0.0f, 1.0f};Now, set the constraints for the label and add it to the panel −gbc.gridx = 0; gbc.gridy = 0; layout.setConstraints(label, gbc); panel.add(label);The following is an example to set columnWeights and rowWeights in a GridBagLayout −Examplepackage my; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.JFrame; import ... Read More

HTML ins Cite Attribute

Ankith Reddy
Updated on 30-Jul-2019 22:30:26

220 Views

The cite attribute of the element is used to set a URL that specified the reason to insert the text. Following is the syntax −Above, we have set url, which is the address to the document explaining the reason to insert the text. Let us now see an example to implement the cite attribute of the element −Example Live Demo Demo Heading Text is inserted. OutputIn the above example, we have inserted a text using the element −    Text is inserted. Above, we have set the reason of insertion using the cite attribute −cite="new.htm

HTML DOM Iframe Object

Sharon Christine
Updated on 30-Jul-2019 22:30:26

244 Views

The HTML DOM iframe Object represents the element of an HTML document.Let us now create iframe object −SyntaxFollowing is the syntax −document.createElement(“IFRAME”);PropertiesFollowing are the properties of iframe Object −PropertyExplanationcontentDocumentIt returns the document object generated by an iframe HTML element.contentWindowIt returns the window object generated by an iframe HTML element.heightIt returns and modify the value of height attribute of an iframe HTML element.nameIt returns and modify the value of the name attribute of an iframe HTML element.sandboxIt returns and alter the value of sandbox attribute of an iframe HTML element.seamlessIt returns and modify whether the iframe should look seamless like ... Read More

HTML DOM Input datetime-local Type Property

AmitDiwan
Updated on 30-Jul-2019 22:30:26

143 Views

The HTML DOM Input DatetimeLocal type property returns/sets type of Input DatetimeLocal.SyntaxFollowing is the syntax −Returning string valueinputDatetimeLocalObject.typeSetting type to string valueinputDatetimeLocalObject.type = stringValueString ValuesHere, “stringValue” can be the following −stringValueDetailsdateIt defines that input type is datedatetime-localIt defines that input type is datetime-localcheckboxIt defines that input type is checkboxtextIt defines that input type is textExampleLet us see an example of Input DatetimeLocal type property − Live Demo Input DatetimeLocal type    form {       width:70%;       margin: 0 auto;       text-align: center;    }    * {       padding: 2px; ... Read More

C++ Program to Solve a Matching Problem for a Given Specific Case

Smita Kapse
Updated on 30-Jul-2019 22:30:26

502 Views

This is a C++ Program to solve a matching problem for a Given Specific Case. Here, N men and N women are given, each person has ranked all members of the opposite gender in order of preference, marry the men and women together such that there are no two people of opposite gender who would both rather have each other than their current partners. All the marriages are “stable”, if there are no such people exists.AlgorithmsBegin    function WomenPrefersMenOverMen1():    A) Check if women prefer men over her current engagement men1    B) If men1 comes before men in list ... Read More

Java ResultSetMetaData getColumnCount Method with Example

Rishi Raj
Updated on 30-Jul-2019 22:30:26

2K+ Views

The getColumnCount() method of the ResultSetMetaData (interface) retrieves the number of the columns of the current ResultSet object.This method returns an integer value representing the number of columns.To get the ResultSetMetaData object, you need to:Register the Driver: Select the required database register the Driver class of the particular database using the registerDriver() method of the DriverManager class or, the forName() method of the class named Class.DriverManager.registerDriver(new com.mysql.jdbc.Driver());Get connection: Create a connection object by passing the URL of the database, username and password of a user in the database (in string format) as parameters to the getConnection() method of the DriverManager class.Connection mysqlCon = ... Read More

Select Two Fields and Return a Sorted Array with Distinct Values in MongoDB

Anvi Jain
Updated on 30-Jul-2019 22:30:26

431 Views

To select two fields and return a sorted array with distinct values, use aggregate framework along with $setUnion operator. Let us first create a collection with documents −> db.sortedArrayWithDistinctDemo.insertOne( ...    { value1: 4, value2: 5} ... ); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc690b99cb58ca2b005e666") } > db.sortedArrayWithDistinctDemo.insertOne( ...    {value1: 5, value2: 6} ... ); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc690b99cb58ca2b005e667") } > db.sortedArrayWithDistinctDemo.insertOne( ...    {value1: 7, value2: 4} ... ); {    "acknowledged" : true,    "insertedId" : ObjectId("5cc690b99cb58ca2b005e668") }Following is the query to display all documents from a collection with the ... Read More

Distribute Extra Horizontal and Vertical Space in GridBagLayout with Java

Nishtha Thakur
Updated on 30-Jul-2019 22:30:26

825 Views

To distribute the extra horizontal and vertical space, use the fields weightx and weighty. The following is an example to distribute extra horizontal and vertical space −Examplepackage my; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTextArea; import javax.swing.WindowConstants; public class SwingDemo {    public static void main(String[] args) {       JFrame frame = new JFrame("Demo Frame");       JPanel panel = new JPanel();       GridBagLayout layout = new GridBagLayout();       panel.setLayout(layout);       GridBagConstraints gbc = new GridBagConstraints();       JLabel label = new JLabel("Rank: ");   ... Read More

Naming Conventions for Packages in Java

Venkata Sai
Updated on 30-Jul-2019 22:30:26

1K+ Views

While choosing a package name you need to keep the following points in mind.The name of the package should be in small letters.It is suggested to start the name of the package with the top level domain level followed by sub domains, ex: com.example.tutorialspoint.ExampleYou can declare a package as −package com.mypackage.tutorialspoint; Public class Sample{ Public static void main(String args[]){ System.out.println("Welcome to Tutorialspoint"); } }Executing a packageYou need to compile the file with packages using –d option as −C:\Sample>javac -d . PackageExample.javaAfter compiling, you can see the class files ... Read More

Advertisements