To make a responsive design of the application, we also require to make an image responsive. If images are not responsive, overflow occurs in the app, and it looks worst. So, we also require to increase or decrease the images' dimensions proportional to the parent element's dimensions. Here, we will learn various ways to resize images proportionally with CSS. Syntax Users can follow the syntax below to resize the image proportionally using the ‘width’ CSS property. img { width: 100%; height: auto; } In the above syntax, we have set 100% width ... Read More
Sometimes, the task is change the page themes and to use different CSS files on the same page content. In such tasks the need is to fetch a CSS and load it dynamically while selecting a theme. In this case the CSS file has to be accessed, loaded and even selected through a javascript program. Using HTML and javascript code this process of loading the CSS file is demonstrated in this article. This is shown by using two different examples. In the first example, a CSS file is selected on the windows load event. In the second example, two buttons ... Read More
Sometimes, the task is to find the user’s current position and then to show the location coordinates on the webpage or show the location on a map. Using HTML and javascript code this process of getting the current location of the user in an HTML page is demonstrated in this article. This is shown by using two different examples. In the first example, the current location of the user can be fetched and then the location coordinates are displayed on the HTML page. In the second example, an open-source Leaflet map library is used to fetch and then display the ... Read More
Sometimes, the task is to click a link in one container and to display the content in another container. In HTML, iframes are used to easily show the content in specified area on the page. In this article, using two different examples, links are used to load an iframe using another iframe links. In example 1, the links in the upper Iframe are used to display two different pictures in the bottom iframe. In example 2, using the links in the upper iframe the video content is displayed both in the bottom iframe as well in the upper iframe. ... Read More
Sometimes, the task is to fetch a page from a subfolder and then to come back to the page in the parent folder. Using HTML code this process of providing a link to back out of a folder using a tags and href tags is demonstrated in this article. This is shown by using two different examples. In the first example, a text link with a relative path is used for coming back to the page of parent folder. In the second example, tag with the SVG link is used to back out of a folder. In this second ... Read More
Hotkeys are a convenient way to automate repetitive tasks in Python programs. Hotkeys allow users to perform an action quickly and easily, without having to navigate through menus or use a mouse. In this tutorial, we will discuss how to create a hotkey in Python using the keyboard library. This keyboard library provides a simple and easy-to-use API for registering hotkeys and responding to keyboard events. By creating hotkeys in your Python programs, you can enhance the user experience and improve productivity by allowing users to perform tasks quickly and efficiently. We will cover the approach and two code ... Read More
Candlestick charts are a popular way to visualize stock market data. They show the opening, closing, high, and low prices of a stock or security for a given time period. A candlestick chart consists of a series of vertical bars or "candlesticks", where each candlestick represents one time period. The top and bottom of each candlestick represent the highest and lowest prices traded during that period, while the body of the candlestick represents the opening and closing prices. In this tutorial, we will explore codes where we will use Matplotlib, a popular data visualization library in Python, to create a ... Read More
Counting the number of rows in a MySQL table is a common operation when working with databases. In Python, you can use the MySQL Connector module to establish a connection to a MySQL database and execute SQL queries to fetch data from tables. There are different ways to count the number of rows in a MySQL table using Python, and the method you choose will depend on the specific requirements of your project. This article will guide you on how to obtain the count of rows in a particular MySQL table that resides in a database. To begin with, we ... Read More
Pandas and PySpark are two popular data processing tools in Python. While Pandas is well-suited for working with small to medium-sized datasets on a single machine, PySpark is designed for distributed processing of large datasets across multiple machines. Converting a pandas DataFrame to a PySpark DataFrame can be necessary when you need to scale up your data processing to handle larger datasets. In this guide, we'll explore the process of converting a pandas DataFrame to a PySpark DataFrame using the PySpark library in Python. We'll cover the steps involved in installing and setting up PySpark, converting a pandas DataFrame to ... Read More
Pandas is a popular Python library for data manipulation and analysis. A common task in working with Pandas is to convert a DataFrame into a JSON (JavaScript Object Notation) format, which is a lightweight data interchange format widely used in web applications. The conversion from pandas DataFrame to JSON can be useful for data sharing, data storage, and data transfer between different programming languages. In this tutorial, we will discuss how to convert a pandas DataFrame to JSON using built-in Pandas functions, explore different options and parameters for the conversion, and provide examples of how to handle specific scenarios. Converting ... Read More