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 Yaswanth Varma
Page 21 of 31
Fixed Positioning with CSS
The CSS position: fixed property positions an element relative to the browser window (viewport). Unlike other positioning methods, fixed elements remain in the same position even when the page is scrolled, making them ideal for navigation bars, headers, or footers that should always be visible. Syntax selector { position: fixed; top: value; /* optional */ right: value; /* optional */ bottom: value; /* optional */ left: value; /* optional */ } ...
Read MoreHow do I center tag using CSS?
Centering a in CSS is one of the most common layout tasks in web development. There are several approaches − Flexbox, Grid, and margin-based centering. Let's look at each method with examples. Syntax /* Flexbox Method */ .container { display: flex; justify-content: center; align-items: center; } /* Grid Method */ .container { display: grid; place-items: center; } /* Margin Method */ .element { margin: 0 auto; ...
Read MoreHow would you convert string to bytes in Python 3?
In Python, strings and bytes are two different types of data, where the strings are the sequences of unicode characters used for text representation, while bytes are sequences of bytes used for binary data. Converting strings to bytes is used when we want to work with the raw binary data or perform low-level operations. This can be done by using the built-in encode() method or the bytes() constructor. Using Python encode() Method The Python encode() method is used to convert the string into bytes object using the specified encoding format. Syntax Following is the syntax ...
Read MoreSafari on iPad (iOS6) does not scale HTML5 video to fill 100% of page width
This article will teach you how Safari on iPad iOS6 does not scale HTML5 video to fill 100% of page width. On a responsive HTML5 page, a video can be shown at full width (100%) by applying CSS styling. The video's native resolution is 480x270. On all desktop browsers, the video is resized to span the entire width of the page while preserving the aspect ratio. On the iPad (iOS 6.0.1), Mobile Safari and Chrome, however, display a black rectangle same width as the page. The black rectangle's center contains a small video that is shown at its original ...
Read MorePython program to print all distinct elements of a given integer array.
The distinct elements are the values that appears only once or uniquely in the array. When working with the array we will come across the repeated or duplicate values. In this article, we are going to print all the distinct elements of a given array. Identifying and printing these distinct elements is a common task to avoid the unexpected results. This can be achieved by using the Python built-in tools like sets and dictionaries. Using Python set() Function In this approach we are using Python set() function, which removes all the duplicate value from the list because a ...
Read MorePython program to Display Hostname and IP address?
In this article, we are going to learn how to display the hostname and IP address. Generally, the devices that connect to a network are identified by two things: Hostname: It is the name assigned to the device on a network. It helps users to identify devices in a human-readable format (e.g, mypc, desktop-pc, etc.) IP Address: It is the numerical address assigned to each device on a network, used to locate and communicate with that device. Python provides the built-in socket module for achieving this task, which provides access to various ...
Read MorePython program to print the initials of a name with last name in full?
In this article, we are going to learn about how to print the initials of a name with last name in full. For example, If we consider the applications like resumes or media references, it represents the person name using initials followed by the last name like instead of writing "Sai Vamsi Srinivas", we might write "S.V.Srinivas". This kind of formatting improves the readability and ensures the important part of the name(last name) is fully visible. Using Python split() and join() Methods The Python split() method is used to split all the words in the string by ...
Read MorePython program to split the even and odd elements into two different lists.
In this article, we are going to learn about splitting the even and odd elements into two different lists. This involves looping each element in a list and checking whether it is divisible by 2. Even numbers are those that gives the remainder '0' when divided by 2, while the odd numbers leaves a remainder '1'. Using Python append() Method The Python append() method is used to add the new object to a list. It accepts an object as a argument and inserts it at the end of the existing list. Syntax Following is the syntax of Python ...
Read MoreSequenceMatcher in Python for Longest Common Substring.
The SequenceMatcher class is the part of the Python difflib module. It is used to compare sequence (such as lists or strings) and finds the similarities between them. The task is to find the Longest Common Substring, i.e, the longest sequence of the characters that appears contiguously in both strings. which is different from the Longest Common Subsequence, where the characters may appear in the same order but not repeatedly. Using find_longest_match() Method The find_longest_match() method is used to find the longest matching sequence of elements between two sequences. It is the part of the Python difflib module. ...
Read MorePython program to find Maximum and minimum element’s position in a list?
In Python, Lists are one of the data types. It is sequence of comma separated items, enclosed in the square brackets []. They are widely used to store collection of item. In this article, we are going to learn about finding the maximum and minimum element's position in a list. This can be achieved by using the Python built-in functions like max(), min() and index(). Using Python max() Function The Python max() function is used to return the maximum element in the list. If the list contains the numbers, comparison is done numerically, but if the list contains strings, ...
Read More