The Pattern class of the java.util.regex package is a compiled representation of a regular expression.The splitAsStream() method of this class accepts a CharSequence object, representing the input string as a parameter and, at each match, it splits the given string into a new substring and returns the result as a stream holding all the substrings.Exampleimport java.util.regex.Pattern; import java.util.stream.Stream; public class SplitAsStreamMethodExample { public static void main( String args[] ) { //Regular expression to find digits String regex = "(\s)(\d)(\s)"; String input = " 1 Name:Radha, age:25 2 Name:Ramu, age:32" + ... Read More
The Pattern class of the java.util.regex package is a compiled representation of a regular expression.The split() method of this class accepts a CharSequence object, representing the input string as a parameter and, at each match, it splits the given string into a new token and returns the string array holding all the tokens.Exampleimport java.util.regex.Pattern; public class SplitMethodExample { public static void main( String args[] ) { //Regular expression to find digits String regex = "(\s)(\d)(\s)"; String input = " 1 Name:Radha, age:25 2 Name:Ramu, age:32 3 Name:Rajev, age:45"; ... Read More
The java.util.regex package of java provides various classes to find particular patterns in character sequences. The pattern class of this package is a compiled representation of a regular expression.The pattern() method of the Pattern class fetches and returns the regular expression in the string format, using which the current pattern was compiled.Example 1import java.util.regex.Pattern; public class PatternExample { public static void main(String[] args) { String date = "12/09/2019"; String regex = "^(1[0-2]|0[1-9])/(3[01]|[12][0-9]|0[1-9])/[0-9]{4}$"; //Creating a pattern object Pattern pattern = Pattern.compile(regex); if(pattern.matcher(date).matches()) { ... Read More
The java.util.regex package of java provides various classes to find particular patterns in character sequences. The pattern class of this package is a compiled representation of a regular expression.The matches() method of the Pattern class accepts −A string value representing the regular expression.An object of the CharSequence class representing the input string.On invocation, this method matches the input string against the regular expression. This method returns a boolean value which is true in-case of a match else, false.Exampleimport java.util.Scanner; import java.util.regex.Pattern; public class MatchesExample { public static void main(String[] args) { //Getting the date ... Read More
The java.util.regex package of java provides various classes to find particular patterns in character sequences.The pattern class of this package is a compiled representation of a regular expression. The quote() method of this class accepts a string value and returns a pattern string that would match the given string i.e. to the given string additional metacharacters and escape sequences are added. Anyway, the meaning of the given string is not affected.Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class QuoteExample { public static void main( String args[] ) { //Reading string value Scanner ... Read More
Facebook’s power as a marketing platform to draw online customers can be inferred from the following statistics −The social media giant has 2.32 billion users across the globe.As of today, 60 million businesses are existing on this social media platform.39% of customers follow a company’s Facebook page to view their offers and discounts.That is the reason many B2C businesses focus dedicatedly on Facebook marketing to strengthen and expand their businesses.It is no wonder that creating a Facebook page for a business is very important for its existence because this is an excellent way to take business closer to the heart ... Read More
Short Interframe Spacing (SIFS), is the time interval required by a wireless device in between receiving a frame and responding to the frame. It is used in Distributed coordination function (DCF) scheme, which is a mandatory technique used to prevent collisions in IEEE 802.11-based WLAN standard (Wi-Fi).The duration of SIFS is equal to the sum of delays in radio frequency (RF), Physical Layer Convergence Procedure (PLCP) and processing delay of MAC (medium access control) layer.In IEEE 802.11 networks, SIFS is the interframe spacing maintained before and after the transmission of an acknowledgment frame and Clear To Send (CTS) frame.TechniqueThe role ... Read More
Distributed coordination function (DCF) is a mandatory technique used to prevent collisions in IEEE 802.11-based WLAN standard (Wi-Fi). It is a medium access control (MAC) sublayer technique used in areas where carrier-sense multiple access with collision avoidance (CSMA/CA) is used.Using DCF technique, a station needs to sense the status of the wireless channel before it can place its request to transmit a frame. The time interval that a station should wait before it sends its request frame is known as DCF Interframe Spacing (DIFS).TechniqueWhen a station has a frame to transmit, it waits for a random backoff time.At the end ... Read More
In IEEE 802.11 wireless LANs, automatic power save delivery (APSD) is a mechanism that aims to reduce power consumption by the devices connected in the network. It was originally introduced to IEEE 802.11e in 2005.TechniqueAPSD is generally deployed in infrastructure BSS (basic service set). In infrastructure BSS, there is are access points (APs) which are basically wireless routers forming the base stations for access. All the wireless devices i.e. clients communicate with each other through the APs. When a client has frames to send it sends the frames to the corresponding AP along with the destination address. The AP then ... Read More
In computer networks, beacon frames management frames used in IEEE 802.11 based wireless local area networks (WLANs). A beacon frame contains network information needed by a station before it can transmit a frame. They are used for announcing the presence of devices in a WLAN as well as synchronisation of the devices and services.Beacon frames are used as a part of BSS (basic service set). In infrastructure BSS, there is are access points (APs) that are wireless routers forming the base stations for access. All the devices communicate with each other through APs. The APs transmit beacon frames periodically so ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP