Network switching is the process of forwarding data frames or packets from one port to another leading to data transmission from source to destination. Data link layer is the second layer of the Open System Interconnections (OSI) model whose function is to divide the stream of bits from physical layer into data frames and transmit the frames according to switching requirements. Switching in data link layer is done by network devices called bridges.BridgesA data link layer bridge connects multiple LANs (local area networks) together to form a larger LAN. This process of aggregating networks is called network bridging. A bridge ... Read More
Method reference is a simplified form of the lambda expression. It can specify a class name or instance name followed by the method name. The "::" symbol can separate a method name from the name of an object or class.An instance method reference refers to an instance method of any class. In the below example, we can implement an instance methods reference using the class name.Syntax::Exampleimport java.util.*;; import java.util.function.*; public class ClassNameRefInstanceMethodTest { public static void main(String args[]) { List empList = Arrays.asList( new Employee("Raja", 15000), new Employee("Adithya", 12000), new Employee("Jai", 9000), ... Read More
To generate a strong password with the PowerShell, we can use 8 or more characters password. In the below example, we are going to use the 8 character password, you can change the number of characters as per your convenience.This script you can bind into windows forms and provide it to the IT helpdesk to set the password for new users.In this example, we will use the Random integers between 33 and 126 and convert it to the Character, considering them they are the ASCII values for characters.You can find more about ASCII values in the table provided in the ... Read More
To copy the items with the different credentials you need to use the credential parameter in the Copy-Item cmdlet.For example,Copy-Item C:\temp\* -Destination \Remoteshare\c$\temp -Credential (Get- Credential)Or$creds = (Get-Credential) Copy-Item C:\temp\* -Destination \Remoteshare\c$\temp -Credential $creds
Now it is easy to ZIP or extract (unzip) the files or folders using PowerShell. PowerShell has added features of the Archive module (Microsoft.PowerShell.Archive) from PowerShell 5.1 version.If you have PowerShell older version (version 4.0 or less) then you can download and install the module from the website or through the command line. However, only download and installing or manually copying the Archive module to the Module folder won’t work because it needs some dependent DLL files which are provided by .Net framework 4.5 so you need to consider upgrading .Net framework as well if it is below the 4.5 ... Read More
A Callable interface defined in java.util.concurrent package. An object of Callable returns a computed result done by a thread in contrast to a Runnable interface that can only run the thread. The Callable object returns Future object that provides methods to monitor the progress of a task executed by a thread. An object of the Future used to check the status of a Callable interface and retrieves the result from Callable once the thread has done.In the below example, we can write a Callable interface as a Lambda Expression.Exampleimport java.util.concurrent.*; public class LambdaCallableTest { public static void main(String args[]) throws InterruptedException { ExecutorService executor = Executors.newSingleThreadExecutor(); ... Read More
An interface having only one abstract method is known as a functional interface and also named as Single Abstract Method Interfaces (SAM Interfaces). One abstract method means that either a default method or an abstract method whose implementation is available by default is allowed. The instances of SAM interfaces are java.lang.Runnable, java.awt.event.ActionListener, java.util.Comparator and java.util.concurrent.Callable. The SAM interfaces can be implemented using lambda expressions or method references.Syntax@FunctionalInterface public interface Changeable { public void change(T o); }Example@FunctionalInterface interface MyInterface { String reverse(String n); } public class LambdaReverseTest { public static void main( String[] args ) { MyInterface myInterface = (str) -> { // ... Read More
The easiest way to write text and obtain it as an output is done by using writeLines function and cat function, and the output of these functions are connected with the help fileConn and sink.Example> fileConn writeLines(c("TutorialsPoint", "SIMPLY EASY LEARNING"), fileConn) > close(fileConn)We can do the same and view these files in R as follows −> fileConn writeLines(c(paste("TutorialsPoint", "E-learning"), "2006", "Video Courses", "Tutorials", "Books"), fileConn) > close(fileConn) > file.show("example.txt")Using sink function> sink("example3.txt") > cat("TutorialsPoint", "E-learning") > cat("") > cat("2006") > cat("") > cat("Video Courses") > cat("") > cat("Tutorials") > cat("") > cat("Books") > sink()Using only cat function> cat("TutorialsPoint E-learning", ... Read More
Tilde operator is used to define the relationship between dependent variable and independent variables in a statistical model formula. The variable on the left-hand side of tilde operator is the dependent variable and the variable(s) on the right-hand side of tilde operator is/are called the independent variable(s). So, tilde operator helps to define that dependent variable depends on the independent variable(s) that are on the right-hand side of tilde operator.Example> Regression_Model Regression_Data Regression_Model_New < - lm(y~ . , data = Regression_Data)This will have the same output as the previous model, but we cannot use tilde with dot if ... Read More
There is no function in base R to simulate discrete uniform random variable like we have for other random variables such as Normal, Poisson, Exponential etc. but we can simulate it using rdunif function of purrr package.The rdunif function has the following syntax −> rdunif(n, b , a)Here, n = Number of random values to returnb = Maximum value of the distribution, it needs to be an integer because the distribution is discretea = Minimum value of the distribution, it needs to be an integer because the distribution is discreteExampleLet’s say you want to simulate 10 ages between 21 to ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP