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
Find the longest prefix in a string that has the highest frequency across the string.
In this article, we'll discuss the problem of finding the longest prefix in a string that has the highest frequency (appears most often) across the string. We'll break it down step-by-step and show how to efficiently solve this problem. Given a string, we need to find the longest prefix (the starting sequence) that appears most often in the string. A prefix is simply a substring that begins at the start of the string and includes one or more characters. Let's understand with an example. For the string 'abcabc', the prefixes are: a ...
Read MoreHow to resolve a name conflict in C++
In C++, a name conflict occurs when two or more identifiers, such as variables, functions, or classes, share the same name within the same scope. This creates ambiguity because the compiler may struggle to distinguish between them, leading to compilation errors. In this article, we will discuss name conflicts in C++ and also ways to resolve them, ensuring your code remains clear and error-free. Name Conflict Error in C++ Name conflicts typically occur when the same name is used for different variables, functions, or classes in conflicting or overlapping scopes, or when they are declared globally or within the ...
Read MoreHow to pass an array into a lambda function in C++
In this article, we will learn how to pass an array into a lambda function in C++. A lambda function is a small, anonymous function that doesn't have a name and can access variables from the surrounding code. Passing an array to a lambda function is a bit different from passing a single value because you need to define how the array will be handled inside the lambda. Let's see how to do that. Passing an Array into a Lambda Function We will cover four main methods to pass arrays into lambda functions in C++: ...
Read MoreHow to initialize multi-set with custom comparator in C++
In this article, we will learn how to initialize a std::multiset with a custom comparator in C++. A multiset is similar to a set, except that it allows duplicate elements. It stores elements in a sorted order based on a comparison function. By default, elements are compared using the < (less-than) operator. However, with a custom comparator, we can define how elements should be compared. For example, if we define a custom comparator that sorts elements in descending order and insert the following elements into the multiset: Input: 3 12 5 8 1 7 9 4 6 Output: {12, 9, ...
Read MoreC++ Program to count the number of days in a given month of a year
There are a total of 365 days in a normal year and 366 days in a leap year. In this article, we are going to learn how we can find the number of days in a month of a given particular year. Here, we will learn about different approaches for calculating the number of days in a given month using C++. How to Find the Number of Days in a Given Month? There are a total of 12 months in a year. The number of days in a given month from 1 to 12 in a given leap or non-leap ...
Read MoreHow quick commerce delivers so fast?
In today's time, everyone needs things instantly, whether it is information or products. Hence, the demand for quick commerce has increased, but the most important thing users want to know is how these companies manage quick commerce. So, Let's dive into the key factors that make quick commerce incredibly efficient. What is Quick Commerce? Quick commerce means that you can deliver your products and services instantly within 10-20 minutes at the doorstep of every customer. It is also called Q-commerce. The food delivery industry started this approach a long time ago but slowly it advanced its approach and now it ...
Read MoreMonitoring Disk Usage in Linux
Disk space is a precious resource on any Linux system. Whether you're running a small home server or a large enterprise cluster, it's crucial to monitor disk usage to prevent running out of space, identify potential issues, and optimize storage allocation. This comprehensive tutorial will explore various command-line tools and techniques for effectively monitoring disk usage on Linux, empowering you to keep your storage under control. Command-Line Tools for Monitoring Disk Usage Linux provides a rich set of command-line tools for monitoring disk space. Here are some of the most essential ones − df (Disk Free) The df command provides ...
Read MoreHow to Block SSH Server Attacks Using DenyHosts?
Secure Shell (SSH) stands as the cornerstone of remote server administration. It provides a secure channel for accessing and managing your servers. However, this essential service is also a prime target for malicious actors. Brute-force attacks, where attackers systematically try numerous username and password combinations, pose a significant threat to SSH security. DenyHosts offers a straightforward, albeit older, approach to mitigating these attacks by automatically blocking IP addresses after repeated failed login attempts. This tutorial provides a detailed walk through of installing and configuring DenyHosts on the latest Ubuntu LTS Version 24.04. Important Note − It's crucial to understand that ...
Read MoreHow to Debug and Fix Boot Issues in Linux?
Encountering a Linux system that refuses to boot can be a stressful experience. However, with a systematic approach and the right tools, you can often diagnose and resolve these issues. Here we will walk you through common boot problems, debugging techniques, and effective solutions to get your Linux system back on track. Understanding the Boot Process A brief recap of the boot process is helpful for troubleshooting − BIOS/UEFI − Hardware initialization and boot device selection. Bootloader (GRUB/systemd-boot) − Loads the kernel and initial RAM disk. Kernel ...
Read MoreHow to Delete User Accounts with Home Directory in Linux?
Proper user management is a crucial aspect of Linux system administration. When a user no longer needs access to a system, it's essential to delete their account and associated files securely. This comprehensive tutorial will explain how to delete user accounts and their home directories in Linux, covering different methods and important considerations for maintaining system security and data integrity. Why Delete User Accounts? Deleting user accounts is necessary for several reasons − Security − Removing inactive accounts prevents unauthorized access to the system. Resource Management − Deleting accounts frees up disk space occupied by user files and home ...
Read More