Node.js dns.resolve4() Method

Mayank Agarwal
Updated on 24-Nov-2021 05:32:49

238 Views

The dns.resolve4() method uses the DNS protocol to resolve a IPv4 address for the hostname. The arguments passed to the callback function can contain an array of multiple addresses.Syntaxdns.resolve4(hostname, [options], callback)Parametershostname - This parameter takes input for the hostname to be resolved.options - It can have the following optionsttl - It defines the Time-To-Live (TTL) for each record. Callback receives an array of addresses like this{ address: '1.2.3.4', ttl:60 }callback - It will catch errors, if any.Example 1Create a file with the name "resolve4.js" and copy the following code snippet. After creating the file, use the command "node resolve4.js" to ... Read More

Normalize Observations Using Scipy Cluster VQ Module

Gaurav Kumar
Updated on 23-Nov-2021 13:23:51

174 Views

Before implementing k-means algorithms, it is always beneficial to rescale each feature dimension of the observation set. The function scipy.cluster.vq.whiten(obs, check_finite = True)is used for this purpose. To give it unit variance, it divides each feature dimension of the observation by its standard deviation (SD).ParametersBelow are given the parameters of the function scipy.cluster.vq.whiten(obs, check_finite = True) −obs− ndarrayIt is an array, to be rescaled, where each row is an observation, and the columns are the features seen during each observation. The example is given below −obs = [[ 1., 1., 1.], [ 2., 2., 2.], ... Read More

Call Documentation for NumPy and SciPy

Gaurav Kumar
Updated on 23-Nov-2021 13:15:28

273 Views

If you are unsure of how to use a particular function or variable in NumPy and SciPy, you can call for the documentation with the help of ‘?’. In Jupyter notebook and IPython shell we can call up the documentation as follows −ExampleIf you want to know NumPy sin () function, you can use the below code −import numpy as np np.sin?OutputWe will get the details about sin() function something like as follows −We can also view the source with the help of double question mark (??) as follows −import numpy as np np.sin??Similarly, if you want to see the ... Read More

Scipy Package for Implementing Clustering

Gaurav Kumar
Updated on 23-Nov-2021 12:49:59

219 Views

Clustering is one among the most useful unsupervised ML methods. It is used to find the relationship patterns and similarity among the input data samples. After finding these patterns, unsupervised algorithm clusters the data samples having similarities into groups as illustrated in the diagram below −Anomaly detection, image segmentation, medical imaging, social network analysis, and market segmentation are some common applications for clustering. K-means and Hierarchical are the two most common forms of clustering.To implement clustering, SciPy provides us a clustering package (scipy.cluster) which further has two modules as given below −scipy.cluster.vq module − This SciPy module provides functions for k-means ... Read More

Import NumPy Functions for Scipy

Gaurav Kumar
Updated on 23-Nov-2021 12:39:42

338 Views

When SciPy is imported, you do not need to explicitly import the NumPy functions because by default all the NumPy functions are available through SciPy namespace. But as SciPy is built upon the NumPy arrays, we must need to know the basics of NumPy.As most parts of linear algebra deals with vectors and matrices only, let us understand the basic functionalities of NumPy vectors and matrices.Creating NumPy vectors by converting Python array-like objectsLet us understand this with the help of following example−Exampleimport numpy as np list_objects = [10, 20, 30, 40, 50, 60, 70, 80, 90] array_new = np.array(list_objects) print ... Read More

Internet Control Message Protocol (ICMP)

Urmila Samariya
Updated on 23-Nov-2021 12:03:47

14K+ Views

Internet Control Message Protocol (ICMP) works in the network layer of the OSI model and the internet layer of the TCP/IP model. It is used to send control messages to network devices and hosts. Routers and other network devices monitor the operation of the network. When an error occurs, these devices send a message using ICMP. Messages that can be sent include "destination unreachable", "time exceeded", and "echo requests".ICMP is a network layer protocol.ICMP messages are not passed directly to the data link layer. The message is first encapsulated inside the IP datagram before going to the lower layer.Types of ... Read More

Types of Firewalls in Computer Networks

Urmila Samariya
Updated on 23-Nov-2021 12:01:36

9K+ Views

A firewall is a network security device; it is a protective layer for the server that monitors and filters all the incoming and outgoing network traffic. It uses a set of rules to determine whether to allow or block a specific network traffic. Firewalls can prevent unauthorized use before reaching the servers. Firewalls can be hardware or software-based.Firewall PoliciesTo protect private networks and individual machines, a firewall can be employed to filter incoming or outgoing traffic based on a predefined set of rules known as firewall policies.Packet flowing through a firewall can have one of the following three outcomes −Accepted ... Read More

Circuit Switching in Computer Networks

Urmila Samariya
Updated on 23-Nov-2021 11:59:07

9K+ Views

Circuit Switching is a connection-oriented service that uses a dedicated path from the sender to the receiver. Before sending any data from the source to the destination, it needs to set up an end-to-end path.Circuit switching has the minimum chance of data loss due to the dedicated circuit path, but a lot of bandwidth is wasted as a path cannot be used by other senders during a congestion.Three Phases of Circuit SwitchingFollowing are the three phases of circuit switching −Circuit Establishment − A dedicated circuit is established between the two end-devices or from the source to the destination using the ... Read More

Internet Protocol Version 6 (IPv6) Header

Urmila Samariya
Updated on 23-Nov-2021 11:57:52

1K+ Views

Internet protocol version 6 (IPv6) headers is the next generation of the internet protocol designed to replace the current version, or Internet Protocol Version 4 (IPv4). IPv6 fixes many problems in IPv4, such as the limited number of available IPv4 addresses.IPv6 uses 128-bit addresses; an address space is large enough to last for the predictable future. IPv6 added many improvements to IPv4 in areas such as routing and network auto-configuration.IPv6 is a progressive step from IPv4, some IPv4 functions that do not work were removed from IPv6.IPv6 is an Internet Protocol for packet-switched internetworking; it provides end-to-end datagram transmission across ... Read More

Layers of OSI Model in Computer Networks

Urmila Samariya
Updated on 23-Nov-2021 11:52:07

21K+ Views

The OSI (Open Systems Interconnection) model is developed by the International Standard Organization. It is a layered framework for the design of network systems that allows communication between all types of computer systems. Its primary purpose is to provide a set of structural guidelines for exchanging information between computers, workstations, and networks.The Seven Layers of OSI ModelLayers No.Layers NameFunctionLayer 1Physical LayerTransmission method used to propagate bits through a networkLayer 2Data Link LayerFrame formatting for transmitting data across a physical communication line.Layer 3Network LayerNetwork addressing and packet transmission on the network.Layer 4Transport LayerData tracking as it moves through a network.Layer 5Session ... Read More

Advertisements