Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Abhinanda Shri
43 articles
How to handle very large numbers in Python?
Python handles arbitrarily large integers automatically without any special syntax or imports. Unlike languages with fixed integer sizes, Python's integer type can grow as large as your system's memory allows. Python's Arbitrary Precision Integers In Python 3, all integers are arbitrary precision by default. Python 2 had separate int and long types, but Python 3 unified them into a single int type that automatically handles very large numbers. Basic Large Number Operations You can perform standard arithmetic operations on numbers of any size − # Working with very large integers a = 182841384165841685416854134135 b ...
Read MoreHow to use a novalidate attribute in HTML?
The novalidate attribute in HTML is a Boolean attribute that disables the browser's built-in form validation when a form is submitted. When applied to a element, it allows users to submit forms even if the input fields contain invalid data according to their validation constraints. By default, HTML5 provides automatic client-side validation for various input types such as email, number, url, and attributes like required, pattern, min, and max. The novalidate attribute overrides this behavior. Syntax Following is the syntax for using the novalidate attribute − ...
Read MoreHow to get the value associated with the http-equiv or name attribute in HTML?
The content attribute in HTML is used to specify the value associated with the http-equiv or name attribute in meta tags. This attribute provides essential metadata information to browsers and search engines about your web page. Syntax Following is the syntax for using the content attribute with the name attribute − Following is the syntax for using the content attribute with the http-equiv attribute − Using Content with Name Attribute The name attribute specifies the type of metadata, while the content attribute provides the actual value. This ...
Read MoreSet the language of the track text data in HTML
The srclang attribute in HTML5 is used to specify the language of the track text data. This attribute is essential when working with elements to provide subtitles, captions, descriptions, or other text tracks for multimedia content. The srclang attribute helps browsers and assistive technologies understand what language the track content is written in. Syntax Following is the syntax for the srclang attribute − The language-code should be a valid BCP 47 language tag, such as "en" for English, "es" for Spanish, or "fr" for French. Parameters The srclang attribute accepts ...
Read MoreHow to specify the URL of the page the link goes to in HTML?
The href attribute in HTML is used to specify the URL of the page that a link should navigate to. The href attribute is primarily used with the (anchor) tag to create hyperlinks that allow users to navigate between web pages or different sections within the same page. Syntax Following is the syntax for using the href attribute with anchor tags − Link Text The URL can be an absolute URL, relative URL, or an anchor link to a section within the same page. Types of URLs in href Attribute The ...
Read MoreHow to set the script to be executed asynchronously in HTML?
The async attribute in HTML allows external JavaScript files to execute asynchronously, meaning the script runs as soon as it finishes downloading without blocking the HTML parsing. This improves page loading performance by preventing scripts from delaying the rendering of other page content. Syntax Following is the syntax for using the async attribute − The async attribute is a boolean attribute that only works with external scripts (scripts with a src attribute). It cannot be used with inline scripts. How Async Scripts Work When a browser encounters a tag with ...
Read MoreIn JavaScript inheritance how to differentiate Object.create vs new?
In JavaScript inheritance, Object.create() and new serve different purposes when setting up prototype chains. Understanding their differences is crucial for proper inheritance implementation. Object.create() - Prototype Only Inheritance When using Object.create(), you inherit only the prototype methods without executing the parent constructor: function BaseClass(name) { this.name = name; console.log("BaseClass constructor called"); } BaseClass.prototype.greet = function() { return "Hello from " + this.name; }; function ChildClass(name) { this.name = name; } // Using Object.create - inherits prototype only ...
Read MoreHow to use JavaScript Object.defineProperty?
The Object.defineProperty() method allows you to define a new property or modify an existing property on an object with precise control over its behavior. Syntax Object.defineProperty(obj, prop, descriptor) Parameters obj – The object on which to define the property prop – The name of the property to be defined or modified descriptor – An object that describes the property's attributes Property Descriptor Attributes The descriptor object can contain the following attributes: value – The value of ...
Read MoreIs their JavaScript scroll event for iPhone/iPad?
Yes, iOS Safari captures scroll events on iPhone and iPad. However, iOS handles scrolling differently than desktop browsers, using momentum scrolling and gesture-based interactions. Basic Scroll Event Detection You can use the standard scroll event listener on iOS devices: Scroll this content on mobile... Content line 2 Content line 3 Content line 4 Content line 5 Scroll position: 0 const scrollable = document.getElementById('scrollable'); const output = ...
Read MoreWhat is the usage of onsearch event in JavaScript?
The onsearch event triggers when a user interacts with a search input field by pressing ENTER or clicking the "x" (clear) button. This event only works with elements and provides a convenient way to handle search operations. Syntax // Or using addEventListener element.addEventListener("search", myFunction); Example Here's how to implement the onsearch event to capture user search input: OnSearch Event Example Write what you want to search below and press "ENTER" or click the "x" to clear: ...
Read More