In JavaScript, the clearTimeout() and clearInterval() methods are used to clear timers. When we set a timer using setTimeout() or setInterval() methods, the browser allocates memory to track it. Therefore, we use these methods to release that memory and avoid unnecessary function calls. It is best practice to clear timers when they are no longer needed. In this article, we will learn how the clearTimeout() and clearInterval() methods help to clear timers. JavaScript clearTimeout() method The clearTimeout() method in JavaScript clears the timeout that has been previously set by the setTimeout() function. It accepts a single integer value as a ... Read More
To add an icon logo to the title bar of a website in HTML. The icon of the title bar is often referred to as a favicon (short for "favorites icon"). It appears in the browser tab, bookmarks, and history. What is a Favicon? A favicon is a small, 16x16 or 32x32 pixel image associated with a website or web page. It is used to display a visual representation of your company, brand or website. It helps users to quickly identify your site or company name among multiple open tabs. Steps to Add an Icon Logo in ... Read More
The form fields can be disabled with the help of CSS, and JavaScript. In this article, we will learn to disable the form input fields with the help of CSS. Sometimes we need to disable form fields for various reasons, such as preventing user input before certain conditions, or for other purposes. The disabled form field means the user can not interact with the input field. Approaches to Disable Form Fields There are two approaches to disabling the form input field, we will explain each approach in detail with code examples. Disable Form Fields ... Read More
To use PHP in HTML, you must enclose the PHP code with PHP start tag . In this article from the example we will learn to use and become comfortable with PHP in HTML. PHP (Hypertext Preprocessor) is a popular server-side scripting language used for web development. It allows you to embed dynamic content into your HTML. Approach to use PHP in HTML To effectively use PHP in HTML, you need to enclose PHP code within tags. Remember, PHP files must have a .php extension since PHP code is processed on the server before the page is ... Read More
Binary search is a fast searching algorithm with run-time complexity of Ο(log n). This search algorithm works on the principle of divide and conquer. For this algorithm to work properly, the data collection should be in the sorted form. The binary search looks for a particular item by comparing the middle most item of the collection. If a match occurs, then the index of the item is returned. If the middle item is greater than the item, then the item is searched in the sub-array to the left of the middle item. Otherwise, the item is searched for in the sub-array to the ... Read More
Introduction to Near Field Communication (NFC) Near Field Communication (NFC) may be a short-range remote communication technology that permits two electronic gadgets to set up communication when they are set in the near vicinity, ordinarily inside some centimeters. NFC is an expansion of Radio Recurrence Distinguishing Proof (RFID) innovation and works at a recurrence of 13.56 MHz. NFC innovation empowers contactless communication and information trade between gadgets, making it helpful and proficient for different applications. Working of NFC The essential rule behind NFC is using electromagnetic areas for information exchange. It utilizes inductive coupling, where the NFC-enabled gadgets create attractive ... Read More
Interrupt is an issue that is not caused by the CPU but is done by a component. Interrupts may occur suddenly and CPU has to take immediate action to resolve the issue. Interrupts are of many types and in this article, we will discuss the difference between Maskable and Non-Maskable Interrupts. What is Maskable Interrupt? Maskable interrupt is a kind of interrupt which can be ignored or disabled by instructions given by the CPU. The ignoring or disabling of this interrupt allows the system to give priority to certain tasks. The sources of interrupts are also disabled so that critical ... Read More
A keyboard is an input device which is used in computers and typewriters to type different types of alphabets, numerals, and symbols. In the case of computers, the characters typed through the keyboard are visible on the screen. Previously, keyboards were used only for typing but now games can also be played. Keyboards are of many types and in this article, we will discuss the difference between mechanical and membrane keyboards. What is a Membrane Keyboard? A membrane keyboard consists of three layers of membrane. The location of each key is different on the three-layered membrane. The membrane is sensitive ... Read More
As a developer, you probably love coding but dread the inevitable merge conflicts that come with Git. These conflicts can disrupt your flow and waste precious time. Fortunately, there's a way to automate the resolution process, ensuring you can keep working smoothly. In this article, I'll show you how to set up automatic conflict resolution in Git, favoring either your changes or those from another branch. My First Encounter with Merge Conflicts I remember my first major merge conflict like it was yesterday. I had just finished a big feature and was excited to merge my branch. Instead of celebrating, ... Read More
The GregorianCalendar class in Java allows us to manipulate dates and times easily. In this example, we will create a GregorianCalendar object and use it to display the current date and the date of the previous month. Problem Statement Write a Java program and create a GregorianCalendar object, display the current date, and then modify this date to show the date of the previous month. Output Current date: Mon Nov 19 18:07:03 UTC 2018 Input Modified date (Previous Month): Fri Oct 19 18:07:03 UTC 2018 Steps to display previous month from GregorianCalendar Below are the steps to display previous ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP