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 Make the CSS margin-top Style Work?
Sometimes, the margin-top in CSS doesn't work as expected. You might not see the space you want above an element, or it might not behave correctly. This can happen because of things like collapsing margins, the element's type, or how it's positioned. Our task is to show you how to make the margin-top style work using different approaches, so you can control spacing in your designs. Syntax selector { margin-top: value; } Approaches to Managing Margin-Top We'll look at different ways to manage the margin-top property and control space ...
Read MoreFind indices with None values in given list in Python
Many times when dealing with data analysis we may come across None values present in a list. These values cannot be used directly in mathematical operations and string operations. So we need to find their position and either convert them or use them effectively. Using range() with List Comprehension Combining the range() and len() functions we can compare the value of each element with None and capture their index positions using list comprehension ? Example days = ['Sun', 'Mon', None, 'Wed', None, None] # Given list print("Given list :", days) # Using range ...
Read MoreFind groups of strictly increasing numbers in a list in Python
Finding groups of strictly increasing numbers means identifying sequences where each number is exactly 1 greater than the previous number. This is useful for pattern recognition and data analysis tasks in Python. Using Direct Comparison This approach compares each element with the previous one to check if they form a consecutive sequence ? numbers = [11, 12, 6, 7, 8, 12, 13, 14] groups = [[numbers[0]]] for i in range(1, len(numbers)): if numbers[i - 1] + 1 == numbers[i]: groups[-1].append(numbers[i]) ...
Read MoreHow to Remove the CSS :hover Behavior from an Element?
Removing the :hover effect means stopping an element from changing its appearance when a user hovers over it. You might need to do this if the hover effect is unnecessary, distracting, or doesn't fit with the design of your page. Methods to Remove CSS :hover Behavior There are several effective ways to disable the :hover effect from elements while maintaining clean, consistent styling. Method 1: Using pointer-events: none The pointer-events: none property disables all mouse interactions, including hover effects. This completely prevents the element from responding to pointer events − ...
Read MoreFind fibonacci series upto n using lambda in Python
A Fibonacci series is a widely known mathematical sequence that explains many natural phenomena. It starts with 0 and 1, then each subsequent term is the sum of the two preceding terms. In this article, we will see how to generate a given number of Fibonacci terms using lambda functions in Python. Method 1: Using map() with Lambda We use the map() function to apply a lambda function that adds the sum of the last two terms to our list. The any() function is used to execute the map operation ? Example def fibonacci(count): ...
Read MoreImplementing CSS Shapes for Creative Text Wrapping
CSS Shapes allow text to flow around custom shapes, breaking free from traditional rectangular boundaries. This powerful feature enables designers to create magazine-style layouts and visually appealing designs with dynamic text wrapping around circles, polygons, and irregular images. Syntax selector { shape-outside: circle() | ellipse() | polygon() | url(); float: left | right; clip-path: circle() | ellipse() | polygon(); shape-margin: value; } Core CSS Properties shape-outside Property The shape-outside property defines the area around which text should ...
Read MoreFind elements within range in numpy in Python
Sometimes while processing data using the numpy library, we may need to filter out certain numbers in a specific range. This can be achieved by using some in-built methods available in numpy. Using logical_and() with where() In this approach we take a numpy array then apply the logical_and() function to it. The where() clause in numpy is also used to apply the and condition. The result is an array showing the position of the elements satisfying the required range conditions ? import numpy as np A = np.array([5, 9, 11, 4, 31, 27, 8]) ...
Read MoreFind depth of a dictionary in Python
A Python dictionary can be nested, meaning there are dictionaries within dictionaries. In this article, we will see how to calculate the level of nesting in a dictionary when there are nested dictionaries. Using String Conversion In this approach, we convert the entire dictionary into a string and count the number of opening braces { to determine the nesting level ? Example dictA = {1: 'Sun', 2: {3: {4: 'Mon'}}} dictStr = str(dictA) cnt = 0 for i in dictStr: if i == "{": ...
Read MoreHow to Make the CSS vertical-align Property Work on the div Element?
This article will let you understand the vertical-align property in CSS. Here, we discuss the limitations of the vertical-align property and a few methods to overcome this, and hence, you will learn the solution to make the vertical-align property work on a div tag. Syntax vertical-align: value; Why does vertical-align don't work on div elements? Remember, the vertical-align property only works on inline, inline-block, and table-cell elements. You cannot use it to align block-level elements vertically. Tables work differently than divs because all the rows in a table are the same height. If ...
Read MoreFind common elements in three sorted arrays by dictionary intersection in Python
When working with Python data manipulation, you may need to find elements that are common among multiple arrays. This can be efficiently achieved by converting arrays into dictionaries using the Counter class from the collections module. The approach involves using Counter to count occurrences of each element, then finding the intersection using the & operator. This method preserves the minimum count of common elements across all arrays. Using Counter and Dictionary Intersection Here's how to find common elements using dictionary intersection ? from collections import Counter arrayA = ['Sun', 12, 14, 11, 34] arrayB ...
Read More