Govinda Sai

Govinda Sai

45 Articles Published

Articles by Govinda Sai

45 articles

How to get signal names from numbers in Python?

Govinda Sai
Govinda Sai
Updated on 24-Mar-2026 617 Views

Python's signal module allows you to work with system signals, but getting signal names from their numeric values requires some introspection. You can create a mapping dictionary by examining the signal module's attributes and filtering for signal constants. Creating a Signal Number to Name Mapping The signal module contains all signal constants as attributes. We can iterate through these attributes to build a mapping ? import signal # Get all signal module attributes and create mapping sig_items = reversed(sorted(signal.__dict__.items())) signal_map = dict((k, v) for v, k in sig_items if v.startswith('SIG') and not v.startswith('SIG_')) print("Signal ...

Read More

What is Practical Use of Reversed Set Operators in Python?

Govinda Sai
Govinda Sai
Updated on 24-Mar-2026 201 Views

Reversed set operators in Python are special methods that handle operations when the left operand cannot perform the operation or when the right operand is a subclass. These methods provide fallback mechanisms and enable proper inheritance behavior for custom set-like classes. Understanding Reversed Operations When Python evaluates a & b, it first tries a.__and__(b). If this returns NotImplemented or the method doesn't exist, Python tries the reversed operation b.__rand__(a). class CustomSet: def __init__(self, items): self.items = set(items) ...

Read More

Execute a script when a reset button in a form is clicked in HTML?

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 288 Views

The onreset attribute in HTML is an event handler that executes a JavaScript function when a form's reset button is clicked. This attribute is applied to the element and triggers before the form fields are actually reset to their default values. Syntax Following is the syntax for using the onreset attribute − The onreset attribute calls the specified JavaScript function when the user clicks the reset button or programmatically resets the form. Basic Example Following example demonstrates how to execute a ...

Read More

Execute a script when the element loses focus in HTML?

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 345 Views

The onblur attribute in HTML is used to execute a JavaScript function when an element loses focus. This event is triggered when a user clicks outside the element, tabs to another element, or navigates away from the current input field. Syntax Following is the syntax for the onblur attribute − The function() can be a JavaScript function name or inline JavaScript code that executes when the element loses focus. Text Input with onblur The most common use case is with form input fields where you want to validate or format data ...

Read More

Websockets Apache Server compatibility in HTML5

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 298 Views

WebSocket technology enables real-time, bidirectional communication between web browsers and servers. While Apache HTTP Server is widely used for web applications, it presents specific challenges when implementing WebSocket connections due to its traditional request-response architecture. Apache Server was originally designed for stateless HTTP requests, where each request is processed independently and connections are short-lived. WebSockets, however, require persistent connections that remain open for extended periods to enable real-time data exchange. Apache WebSocket Implementation Options Several approaches exist for implementing WebSockets with Apache Server − Using mod_websocket Module The mod_websocket module extends Apache to handle WebSocket ...

Read More

How to add an inline layer in HTML?

Govinda Sai
Govinda Sai
Updated on 16-Mar-2026 453 Views

The tag was a non-standard HTML element introduced by Netscape Navigator to create inline layers that occupy space within the normal text flow. Unlike the tag which positioned content above the text flow, created layers that pushed subsequent content after the space they occupied. Important: The tag is obsolete and deprecated. It was never part of the HTML standard and was only supported by Netscape Navigator 4.x. Modern browsers do not support this tag, and it should not be used in contemporary web development. Syntax The basic syntax for the tag was ...

Read More

How to create SVG graphics using JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 716 Views

SVG (Scalable Vector Graphics) can be dynamically created and manipulated using JavaScript. This allows you to generate interactive graphics, charts, and animations programmatically. Creating SVG Elements with JavaScript To create SVG elements in JavaScript, use document.createElementNS() with the SVG namespace. Here's how to create a basic SVG container and add shapes: SVG with JavaScript // SVG namespace ...

Read More

How to set line breaking rules for non-CJK scripts in JavaScript?

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 341 Views

The word-break CSS property controls how words break when text overflows its container. For non-CJK (Chinese, Japanese, Korean) scripts like English, you can set different line breaking behaviors using JavaScript. Syntax element.style.wordBreak = "value"; word-break Property Values Value Description Use Case normal Default breaking rules Standard text flow break-all Break anywhere, even mid-word Prevent overflow in narrow containers keep-all Don't break CJK text Preserve CJK word integrity Example: Interactive Word Breaking ...

Read More

How to display rupee symbol in HTML

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 2K+ Views

The Indian rupee symbol (₹) can be displayed in HTML using several methods. Here are the most reliable approaches to ensure proper display across different browsers. Using HTML Entity Code The most straightforward method is using the HTML entity code for the rupee symbol: Rupee Symbol Example Price: ₹500 Amount: ₹1000 Price: ₹500 Amount: ₹1000 Using Font Awesome Icons Font Awesome provides a reliable cross-browser solution with the rupee icon: ...

Read More

Backward compatibility with HTML5

Govinda Sai
Govinda Sai
Updated on 15-Mar-2026 1K+ Views

HTML5 is designed to be backward compatible with existing web browsers. New features build on existing features and allow you to provide fallback content for older browsers. Modern browsers like Safari, Chrome, Firefox, and Opera support many HTML5 features. Even older versions of Internet Explorer have partial support, while mobile browsers on iPhones, iPads, and Android phones provide excellent HTML5 compatibility. Feature Detection with JavaScript Instead of browser detection, use feature detection to check if specific HTML5 features are supported: // Check for Canvas support if (document.createElement('canvas').getContext) { console.log('Canvas is ...

Read More
Showing 1–10 of 45 articles
« Prev 1 2 3 4 5 Next »
Advertisements