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 on Trending Technologies
Technical articles with clear explanations and examples
How to disable resizable property of textarea using CSS?
The CSS resize property controls whether an element can be resized by the user. By default, textareas are resizable, allowing users to drag their corners to change dimensions. Setting resize: none disables this functionality completely. Syntax textarea { resize: none; } Possible Values ValueDescription noneDisables resizing completely bothAllows resizing in both directions (default) horizontalAllows resizing only horizontally verticalAllows resizing only vertically Example: Disabling Textarea Resize The following example creates two textareas − one resizable (default) and one non−resizable − ...
Read MorePrint first n distinct permutations of string using itertools in Python
When working with permutations of strings that contain duplicate characters, we often need to find only the distinct permutations. Python's itertools.permutations() generates all possible arrangements, including duplicates, so we need additional logic to filter unique results. Syntax from itertools import permutations def get_distinct_permutations(string, n): # Sort characters to group duplicates together sorted_chars = sorted(list(string)) # Generate all permutations all_perms = permutations(sorted_chars) # Use set to store ...
Read MoreHow to disable text selection highlighting using CSS?
To disable text selection highlighting using CSS, you can prevent users from selecting and copying content. The CSS user-select property controls whether the user can select text within an element. Syntax selector { user-select: value; } Possible Values ValueDescription noneText cannot be selected by the user autoDefault behavior, text can be selected textText can be selected by the user allAll content of the element will be selected atomically Example: Disabling Text Selection The following example shows how to disable text selection on specific content using the ...
Read MorePrime or not in Python
Prime numbers play a central role in many applications like cryptography. So it is a necessity to check for prime numbers using Python programs in various applications. A prime number is a number which doesn't have any factors other than one and itself. Below we'll see programs that can find out if a given number is prime or not. Basic Approach We take the following approach to decide whether a number is prime or not ? Check if the number is positive or not. As only positive numbers can be prime numbers. We divide the number ...
Read MoreSorting Function in SASS
In this article, we will learn about the sorting function in Sass, but before moving forward, let's have a basic idea about Sass; so sass is a powerful and popular preprocessor language for CSS that allows developers to write more efficient and maintainable stylesheets. One of the best advantages of Sass is the ability to use functions to streamline the development process. However, one function that Sass does not provide out of the box is a sorting function. Sorting is a common task in all programming languages and can be useful in many different contexts when working with stylesheets. ...
Read MoreMaximum length of consecutive 1's in a binary string in Python using Map function
When working with binary strings, you may need to find the maximum length of consecutive 1's. Python provides several approaches using built-in functions like split() with map() and regular expressions. Using Split and Map The split() function divides a string by a delimiter. When we split by '0', we get segments of consecutive 1's. The map() function applies len() to each segment, and max() finds the longest one ? Example data = '11110000111110000011111010101010101011111111' def max_consecutive_ones(binary_string): return max(map(len, binary_string.split('0'))) result = max_consecutive_ones(data) print("Maximum Number of consecutive one's:", result) ...
Read MoreNeumorphismUI Form
NeumorphismUI is a design trend that combines skeuomorphism with modern aesthetics, creating elements that appear to extrude from the background. When applied to forms, it creates a tactile, interactive feeling that enhances user experience and makes interfaces more engaging. Syntax The key to neumorphism is using dual box-shadows to create the illusion of depth − .neumorphic-element { box-shadow: -5px -5px 10px #ffffff, 5px 5px 10px #b7b7b7; /* OR for inset effect */ box-shadow: inset -5px -5px 10px #ffffff, inset 5px 5px 10px #b7b7b7; } ...
Read MoreUsage of Asterisks in Python
Python programming language uses both * and ** in different contexts. In this article, we will explore how these operators are used and their practical applications. As an Infix Operator When * is used as an infix operator, it performs mathematical multiplication on numbers. Let's see examples with integers, floats, and complex numbers ? # Integers x = 20 y = 10 z = x * y print(z) # Floats x1 = 2.5 y1 = 5.1 z1 = x1 * y1 print(z1) # Complex Numbers x2 = 4 + 5j y2 = 5 + ...
Read MoreStatistical Thinking in Python
Statistical thinking is fundamental for machine learning and AI. Since Python is the language of choice for these technologies, we will explore how to write Python programs that incorporate statistical analysis. In this article, we will create graphs and charts using various Python modules to analyze data quickly and derive insights through visualization. Data Preparation We'll use a dataset containing information about various seeds. This dataset is available on Kaggle and has eight columns that we'll use to create different types of charts for comparing seed features. The program below loads the dataset and displays sample rows. ...
Read MoreLast-child and last-of-type selector in SASS
SASS provides advanced selectors that extend CSS functionality, including :last-child and :last-of-type pseudo-selectors. These selectors help target specific elements based on their position within parent containers. Last-child Selector in SASS The :last-child selector targets the last child element within a parent container, regardless of the element type. It applies styles to the final element and all its nested children. Syntax .parent-element :last-child { /* CSS properties */ } Example 1: Basic Last-child Selection This example demonstrates selecting the last child element within a container − ...
Read More