We will call a function by referencing its name and adding parentheses after it. If the function we are calling returns another function (it does in our case), we will need to assign it to a variable or call it immediately. In the future, we will need to make sure that we understand the behavior of the returned function and how it can be utilized in our code. This is call Function Currying. Function Currying Function currying is a technique in functional programming where a function is transformed into a sequence of functions, each taking a single ... Read More
We use the inline CSS style, to set the cell width and height. The HTML style element contains width and height attributes. To set cell width and height we should place these attributes with specified values with pixels inside the tag. Syntax Following is the syntax to set cell width and height in HTML. content Example Following is the example program to set cell width and height in HTML. DOCTYPE html> table, tr, th, td { border:1px solid ... Read More
Page redirection is a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection. Website designers rely on redirection when there is a need to change the layout of a particular website or the location of a specific page. To redirect from an HTML page, we use the META Tag. Along with this, we also use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value in the content is the number of seconds; you want ... Read More
To search the array of object in MongoDB, you can use $elemMatch operator. This operator allows us to search for more than one component from an array object.To understand the above concept, let us create a collection with the document. The query to create a collection with a document is as follows −> db.searchArrayDemo.insertOne({"EmployeeFirstName":"Adam", "EmployeeLastName":"Smith", "EmployeeDateOfBirth":new ISODate("1992-01-31 13:45:10"), ... "EmployeeSkills":["Spring and Hibernate Framework", "Machine Learning"], ... "EmployeeDetails":[ ... { ... "EmployeePerformanceArea":"Java", ... "Year":2001 ... }, ... { ... ... Read More
To create table border in HTML, the border attribute was used. But the introduction of HTML5, deprecated the border tag. Create table border using the CSS property border. Set table border as well as border for and .ExampleYou can try to run the following code to create a border in the table in HTML. We’re using tag here: table, th, td { border: 1px solid black; } Employee Details Name Amit Sachin Age 27 34 Output
In this tutorial, we will learn how to hide HTML element with JavaScript. Hiding an HTML element can be performed in different ways in JavaScript. In this tutorial, we will see the three most popular ways of doing it − Using the hidden property Using the style.display property Using the style.visibility property Generally, we use the hidden attribute to hide a particular element. We can toggle between hiding and showing the element by setting the hidden attribute value to true or false, respectively. In the other two ways, we use the style object of the element. We ... Read More
To create line segments between two points in matplotlib, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.To make two points, create two lists.Extract x and y values from point1 and point2.Plot x and y values using plot() method.Place text for both the points.To display the figure, use show() method.Exampleimport matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True point1 = [1, 2] point2 = [3, 4] x_values = [point1[0], point2[0]] y_values = [point1[1], point2[1]] plt.plot(x_values, y_values, 'bo', linestyle="--") plt.text(point1[0]-0.015, point1[1]+0.25, "Point1") plt.text(point2[0]-0.050, point2[1]-0.25, "Point2") plt.show()OutputRead More
A deadlock happens in operating system when two or more processes need some resource to complete their execution that is held by the other process.In the above diagram, the process 1 has resource 1 and needs to acquire resource 2. Similarly process 2 has resource 2 and needs to acquire resource 1. Process 1 and process 2 are in deadlock as each of them needs the other’s resource to complete their execution but neither of them is willing to relinquish their resources.Coffman ConditionsA deadlock occurs if the four Coffman conditions hold true. But these conditions are not mutually exclusive.The Coffman ... Read More
Beautiful webpages are a very strong means of catching user attention. In this article, we are going to see how we can add an image as the background image of a web. Approach There are two approaches to setting an image as the webpage's background image, which we will learn in this article. They are − Using background attribute Using CSS Method 1: Using background attribute We can use the background attribute in the body tag to set an image as the background of the webpage. We will need to specify the URL or the location of the image ... Read More
Wireless LANs (WLANs) are wireless computer networks that use high-frequency radio waves instead of cables for connecting the devices within a limited area forming LAN (Local Area Network). Users connected by wireless LANs can move around within this limited area such as home, school, campus, office building, railway platform, etc.Most WLANs are based upon the standard IEEE 802.11 standard or WiFi.Components of WLANsThe components of WLAN architecture as laid down in IEEE 802.11 are −Stations (STA) − Stations comprises of all devices and equipment that are connected to the wireless LAN. Each station has a wireless network interface controller. A ... Read More