In this article, we are going to learn how to read data from *.CSV file using JavaScript. To convert or parse CSV data into an array, we need JavaScript’s FileReader class, which contains a method called readAsText() that will read a CSV file content and parse the results as string text. If we have the string, we can create a custom function to turn the string into an array. To read a CSV file, first we need to accept the file. Now let’s see how to accept the csv file from browser using HTML elements. Example Following is the example ... Read More
In this tutorial, we learn to use JavaScript to redirect a webpage after 5 seconds. To redirect a webpage after 5 seconds, use the setInterval() method to set the time interval. Add the webpage in window.location.href object. As we know, whenever we need to call a function or some block of code after a specific delay of time we use the setTimeout() and the setInterval() methods of JavaScript. Lts look at the use of these methods to redirect a web page by 5 seconds. To redirect a page we will use the document.location.href or window.location.href object of JavaScript as shown ... Read More
In this article, we will learn how to limit an HTML input box so that it only accepts numeric inputs. We use the to limit an HTML input box so that it only accepts numeric inputs. By using this, we will get a numeric input field. Syntax Following is the syntax to limit an HTML input box so that it only accepts numeric input. Example Following is the example program to limit an HTML input box so that it only accepts numeric input - DOCTYPE html> ... Read More
To convert columns of an R data frame from integer to numeric we can use lapply() function. For example, if we have a data frame df that contains all integer columns then we can use the code lapply(df,as.numeric) to convert all of the columns data type into numeric data type.Example1Consider the below data frame − Live Demoset.seed(871) x1
Frequency-Division Multiplexing (FDM) is an analog method which is used when the channel's bandwidth is higher than the consolidated bandwidths of the signals which are to be broadcasted.In FDM, different frequencies are combined into a single composite signal and are transmitted on the channel. At the receiver end, the reverse phase is applied to get the individual frequencies back for working. The entire bandwidth of the channel is divided into logical channels, and each sending device is given with the possession of a logical channel.There is a gap between the frequencies of adjoining channels to avoid one channel's frequency with ... Read More
In this section we will see what is a graph data structure, and the traversal algorithms of it.The graph is one non-linear data structure. That is consists of some nodes and their connected edges. The edges may be director or undirected. This graph can be represented as G(V, E). The following graph can be represented as G({A, B, C, D, E}, {(A, B), (B, D), (D, E), (B, C), (C, A)})The graph has two types of traversal algorithms. These are called the Breadth First Search and Depth First Search.Breadth First Search (BFS)The Breadth First Search (BFS) traversal is an algorithm, ... Read More
The Data Link layer is located between physical and network layers. It provides services to the Network layer and it receives services from the physical layer. The scope of the data link layer is node-to-node.The following are the design issues in the Data Link Layer −The services that are provided to the Network layer.FramingError controlFlow controlServices to the Network LayerIn OSI each layer uses the services of the bottom layer and provides services to the above layer. The main function of this layer is to provide a well defined service interface over the network layer.Types of ServicesThe services are of ... Read More
Another important function of the Lua’s string library is the string.sub() function. The string.sub() function is used to extract a piece of the string.The string.sub() function takes three arguments in general, the first argument being the name of the string from which we want to extract a piece, the second argument is the i-th index or say, the starting index of the string piece that we want, and the third and the last argument is the j-th index of the last index of the string piece we want.It should be noted that both the starting index and the ending index, ... Read More
Multiprogramming OS is an ability of an operating system that executes more than one program using a single processor machine.More than one task or program or jobs are present inside the main memory at one point of time.Buffering and spooling can overlap I/O and CPU tasks to improve the system performance but it has some limitations that a single user cannot always keep CPU or I/O busy all the time.To increase resource utilization, multiprogramming approaches.Operating SystemJob1Job2---Job NEmpty spaceThe OS could pick and start the execution of one of the jobs in memory, whenever the jobs does not need CPU that ... Read More
nPr is known as n permutation r, where n represents the total numbers and r represents the arrangement of the elements. A permutation is known as the arrangement of elements in a specified order. Elements can arrange either in a sequence or in a linear order, for example, we have a set of elements [2, 4], so the permutation is: [4, 2], [2, 4]. In permutation the order of elements matters whereas in combination the order of the elements does not matters. We can calculate the value of nPr with the help of the following formula: Formula nPr = ... Read More