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 use a not:first-child selector in CSS?
The CSS :not(:first-child) selector combines the :not and :first-child pseudo-classes to select all elements except the first child of their parent. This is useful when you want to style all child elements except the first one. Syntax element:not(:first-child) { /* CSS styles */ } Method 1: Selecting Specific Child Elements You can target specific elements within a parent container, excluding the first one − div p:not(:first-child) { color: green; ...
Read MoreHow to translate an image or icon by hovering over it?
In web development, interactivity is key to providing a memorable user experience. One common technique used to add interactivity is hovering over images or icons to reveal more information or change the appearance. Translating an image or icon by hovering over it is a great way to add some movement and interest to your website. In this article, we will learn how to translate an image or icon on hover. To perform this task, we will learn different approaches using only HTML and CSS. Syntax selector { transform: translateX(value) | translateY(value) | ...
Read MoreAppend Odd element twice in Python
Sometimes we need to process a list where odd numbers appear twice while even numbers remain unchanged. This is useful in data processing scenarios where odd values need special emphasis or duplication. Using List Comprehension The most concise approach uses list comprehension with conditional repetition ? numbers = [2, 11, 5, 24, 5] # Repeat odd numbers twice, keep even numbers once result = [value for num in numbers for value in ([num] if num % 2 == 0 else [num, num])] print("Original list:", numbers) print("After processing:", result) Original list: [2, ...
Read MoreAppend at front and remove from rear in Python
When working with Python lists, we often need to add elements to the front and remove elements from the rear. Python provides several efficient methods to accomplish this task, both from the standard library and through built-in operators. Using + Operator with List Slicing The simplest approach combines list concatenation with slicing to add an element at the front while removing the last element ? days = ['Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] print("Original list:", days) # Add 'Mon' at front and remove last element result = ['Mon'] + days[:-1] print("After append front and remove ...
Read MoreHow to transform child elements preserve the 3D transformations?
When working with 3D transformations in CSS, preserving the 3D context for child elements requires specific techniques. The transform-style property controls whether child elements are rendered in 3D space or flattened to a 2D plane. Syntax selector { transform-style: preserve-3d | flat; } Method 1: Using Transform-style Property The transform-style: preserve-3d property allows child elements to maintain their 3D positioning when the parent has 3D transforms applied − .container { perspective: 800px; ...
Read MoreAdding a Chartsheet in an excel sheet using Python XlsxWriter module
The XlsxWriter module in Python is a powerful external library that allows you to create Excel files with data, formatting, and charts. Unlike Python's built-in libraries, XlsxWriter specializes in generating Excel files with advanced features like charts, images, and complex formatting. What is a Chartsheet? A chartsheet is a separate worksheet in Excel that contains only a chart, without any data cells. This is different from inserting a chart into a regular worksheet − the entire sheet becomes the chart. Creating a Pie Chart in a Chartsheet Let's create a pie chart that displays data about ...
Read MoreHow to test CSS property of an element using Protractor?
Testing CSS properties is crucial in ensuring the quality of a web application. CSS properties determine how elements are displayed on a webpage, such as font size, color, and layout. Protractor is a popular end-to-end testing framework that uses WebDriver to automate interactions between a web application and a browser, widely used to test Angular applications. In this article, we will learn how to test the CSS properties of an element with the help of Protractor using different methods. Prerequisites Installation Requirements: Install Protractor: npm install -g protractor Update binaries: webdriver-manager update Start server: webdriver-manager ...
Read MoreAdd the element in a Python list with help of indexing
A Python list is a collection data type that is ordered and changeable. It allows duplicate members and is the most frequently used collection data type in Python programs. We can add elements to a list at specific positions using indexing and the insert() method. Before adding elements, let's first understand how to access list elements using indexing. Accessing List Elements Using Index Every element in a list is associated with an index, which keeps the elements ordered. We can access elements by their index positions using slicing or direct indexing ? vowels_list = ['a', ...
Read MoreHow to style scrollbar thumb for the webkit browsers and what are components of scrollbar?
Scrollbars are essential UI components that allow users to navigate through content that extends beyond the visible area. Webkit-based browsers (Chrome, Safari, Edge) provide special CSS pseudo-elements to style scrollbar components, including the draggable thumb handle. Syntax ::-webkit-scrollbar { width: value; } ::-webkit-scrollbar-thumb { background: color; border-radius: value; } ::-webkit-scrollbar-track { background: color; } Scrollbar Components Up Arrow ...
Read MoreAdd similar value multiple times in a Python list
There are occasions when we need to add the same value multiple times to a Python list. This is useful for initializing lists, creating test data, or padding sequences. Python provides several built-in methods to achieve this efficiently. Using the * Operator This is the most straightforward method. The * operator creates a new list by repeating elements a specified number of times. Example Creating a list with repeated strings ? given_value = 'Hello! ' repeated_list = [given_value] * 5 print(repeated_list) The output of the above code is ? ['Hello! ...
Read More