Using HTML forms, you can easily take user input. The tag is used to get user input, by adding the form elements. Different types of form elements include text input, radio button input, submit button, etc. The tag, helps you to take user input using the type attribute. To clear all the input in an HTML form, use the tag with the type attribute as reset. Example 1 The following example demonstrates how to clear all the input in HTML forms. In this example, we are going to use the document.getElementId() to clear the text in ... Read More
Using the following methods, we can clear the memory occupied by Matplotlib plots.plt.figure() - Create a new figure or activate an existing figure.plt.figure().close() - Close a figure window.close() by itself closes the current figureclose(h), where h is a Figure instance, closes that figureclose(num) closes the figure number, numclose(name), where name is a string, closes figure with that labelclose('all') closes all the figure windowsplt.figure().clear() - It is the same as clf.plt.cla() - Clear the current axes.plt.clf() - Clear the current figure.Examplefrom matplotlib import pyplot as plt fig = plt.figure() plt.figure().clear() plt.close() plt.cla() plt.clf()OutputWhen we execute the code, it will clear all the plots from ... Read More
What is an IP Address? An IP address (Internet Protocol address) is a numerical identifier, such as 192.0.2.1, that is associated with a computer network that communicates using the Internet Protocol. An IP address is used for two purposes: identifying a host or network interface, and addressing a specific location. An IP address has two primary functions: it identifies the host, or more particularly its network interface; and it indicates the host's position in the network, allowing a path to be established to that host. IP addresses can be either Public or Private. Read through this article to ... Read More
In this section we will see how DAC (Digital to Analog Converter) using Intel 8051 Microcontroller. We will also see the sinewave generation using DAC.The Digital to Analog converter (DAC) is a device, that is widely used for converting digital pulses to analog signals. There are two methods of converting digital signals to analog signals. These two methods are binary weighted method and R/2R ladder method. In this article we will use the MC1408 (DAC0808) Digital to Analog Converter. This chip uses R/2R ladder method. This method can achieve a much higher degree of precision. DACs are judged by its ... Read More
The internal data memory of 8051 is divided into two groups. These are a set of eight registers and a scratch pad memory. These eight registers are R0 toR7. The address range 00H to 07H is used to access the registers, and the rest are scratch pad memory. 8051 Provides four register bank, but only one register bank can be used at any point in time. To select the register bank, two bits of PSW (Program Status Word) are used.So the following addressing can be used to select register banks.Address RangeRegister Bank00H to 07HRegister Bank 008H to 0FHRegister Bank 110H to ... Read More
To count the total number of tables, use the concept of count(*) with table_schema. First, to check how many tables are present in our database "business", we need to use the 'show' command. mysql> show tables; The following is the output that displays all the tables in the database "business". +--------------------------+ | Tables_in_business | +--------------------------+ | addcheckconstraintdemo | | addcolumntable | | addconstraintdemo | | addnotnulldemo ... Read More
You can select a single field in MongoDB using the following syntax:db.yourCollectionName.find({"yourFieldName":yourValue}, {"yourSingleFieldName":1, _id:0});In the above syntax "yourSingleFieldName":1, _id:0 means get all data from one field without _id.To understand the above syntax, let us create a collection with document. The query to create a collection with document is as follows:> db.singleFieldDemo.insertOne({"StudentName":"David", "StudentAge":28}); { "acknowledged" : true, "insertedId" : ObjectId("5c6eba356fd07954a489067c") } > db.singleFieldDemo.insertOne({"StudentName":"Bob", "StudentAge":18}); { "acknowledged" : true, "insertedId" : ObjectId("5c6eba406fd07954a489067d") } > db.singleFieldDemo.insertOne({"StudentName":"Chris", "StudentAge":24}); { "acknowledged" : true, "insertedId" : ObjectId("5c6eba4c6fd07954a489067e") } > db.singleFieldDemo.insertOne({"StudentName":"Robert", "StudentAge":26}); { "acknowledged" : true, "insertedId" : ObjectId("5c6eba586fd07954a489067f") ... Read More
Most computer systems are single processor systems i.e., they only have one processor. However, multiprocessor or parallel systems are increasing in importance nowadays. These systems have multiple processors working in parallel that share the computer clock, memory, bus, peripheral devices etc. An image demonstrating the multiprocessor architecture is − Types of MultiprocessorsThere are mainly two types of multiprocessors i.e. symmetric and asymmetric multiprocessors. Details about them are as follows −Symmetric MultiprocessorsIn these types of systems, each processor contains a similar copy of the operating system and they all communicate with each other. All the processors are in a peer to ... Read More
Following are the different ways to handle exception messages in Java.Using printStackTrace() method − It print the name of the exception, description and complete stack trace including the line where exception occurred.catch(Exception e) { e.printStackTrace(); }Using toString() method − It prints the name and description of the exception.catch(Exception e) { System.out.println(e.toString()); }Using getMessage() method − Mostly used. It prints the description of the exception.catch(Exception e) { System.out.println(e.getMessage()); }Exampleimport java.io.Serializable; public class Tester implements Serializable, Cloneable { public static void main(String args[]) { try { int a = 0; ... Read More
In this tutorial, we will learn to check whether a value is a number in JavaScript. In JavaScript, it is necessary to check the variable's data type while performing some operation. Otherwise, it can create some unknown bugs in your application. For example, when users use the addition operator with the string, it concatenates the two strings, and in the same way, if users use the addition operator with a number, it adds two numbers. Now, think that the user wants to add two numbers but is concatenating the two strings. Here, we have three different methods to check whether ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP