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 sudhir sharma
975 articles
Find maximum path length in a binary matrix in Python
In this problem, we are given a square matrix of size m × n with each element either 0 or 1. If an element has value 1, it represents a connected cell; if the value is 0, it represents a disconnected cell. Our task is to find the maximum path length in a binary matrix by converting at most one 0 to 1. Problem Description To solve this problem, we need to find the largest length path consisting of all connected cells (1s) in the matrix. We can convert at most one 0 to 1 to maximize the ...
Read MoreDelete Node in a Linked List in Python
A linked list is a linear data structure where each element is a separate object, commonly referred to as a node. Each node contains two fields: the data and a pointer to the next node in the list. In this article, we'll learn how to delete a node from a singly linked list using Python. Suppose we have a linked list with a few elements. Our task is to delete a specific node, given only access to that node − not the head of the list ? Input: 1 → 3 → 5 → 7 → ...
Read MoreAmazing hacks of Python
Python is one of the programming languages known for its simple syntax and readability. Whether working on development, data analysis, or automation, Python provides the tools to get tasks done with less effort. But beyond the basics, Python has some hacks that make code not only shorter but also more efficient. These are not bugs or workarounds, but smart ways of using Python built-in features and functions to solve tasks in a faster manner. In this article, we are going to learn about amazing hacks of Python that can improve your coding efficiency. Performing a Swap Without ...
Read MoreHow to setup firewall in Linux?
Firewalls are an integral component of every contemporary computer system, safeguarding the network and protecting the system from unauthorized access. This guide explores Linux firewalls and demonstrates how to configure them effectively. A firewall is a network security device that monitors and restricts network traffic based on predefined security rules. Its primary function is to block unauthorized access to a computer system or network while allowing legitimate traffic. It functions as a gatekeeper, controlling what may enter and leave a network. There are two major options for configuring a firewall in Linux: iptables and firewalld. iptables ...
Read MoreWorking with tmux session
Tmux is a terminal multiplexer for Unix-based operating systems that enables multiple terminal sessions within a single window. It is particularly valuable when working with cloud-based services like AWS or Azure, allowing users to create separate terminal sessions for different tasks or remote users while maintaining persistent connections. When working with web services, you often need to create an EC2 instance on a web server and establish a session to work remotely. Tmux ensures that your work continues even if your connection drops, as sessions remain active on the server. Getting Started with AWS EC2 Here are ...
Read MoreHow to Keep Your Browser Safe on Work and Home Networks (with an Optional Chrome VPN Layer)
A single thoughtless click on a browser tab can cause hours of frantic IT calls, network scans, and security resets in numerous workplaces. When you seek a recipe or a good offer online, you may encounter pop-ups or phishing attempts that compromise security. These incidents happen frequently in our interconnected world. The browser serves as the front entrance to the Internet, whether you're in a busy office or at home. Like any front door, it can be secured and reinforced, or left open for threats to enter. This article discusses practical, step-by-step methods to strengthen your browser security across ...
Read MoreMaster TCL Scripting: Discover How to Sum Up n Natural Numbers with Looping Statements
TCL (Tool Command Language) scripting is a powerful scripting language commonly used for automating network device configuration and management tasks. In networking environments, TCL scripts help automate repetitive operations such as configuring interfaces, monitoring performance, and generating reports on routers and switches. One fundamental programming concept that demonstrates TCL's versatility is calculating the sum of n natural numbers using looping statements. This mathematical operation forms the foundation for many network automation calculations and serves as an excellent introduction to TCL scripting techniques. Algorithm for Summing Natural Numbers To calculate the sum of n natural numbers using TCL ...
Read MoreRevolutionize the TCL Scripting Skills: Master Arithmetic Operations with the Switch Statement!
TCL (Tool Command Language) is a powerful scripting language widely used in network automation, testing, and system administration. One of its most useful control structures is the switch statement, which provides an elegant way to handle multiple conditional branches when performing arithmetic operations. This article explores how to effectively use switch statements in TCL scripts to perform basic arithmetic operations like addition, subtraction, multiplication, and division with clean, maintainable code. Understanding Switch Statements in TCL Switch statements in TCL provide a cleaner alternative to multiple if-else constructs. They test a given variable against multiple values and execute ...
Read MoreHow to hide an IP address
An IP address is like a digital fingerprint, revealing your location and identity online. Just as you can use a disguise to hide your physical identity, you can also conceal your IP address to protect your privacy and security. Here are several effective methods to hide your IP address: Methods to Hide Your IP Address Virtual Private Network (VPN) A VPN creates a secure, encrypted tunnel for all your online activity and assigns you a new IP address from a different location. This makes it appear as though you are browsing from somewhere else entirely. ...
Read MorePoison Reverse vs Split Horizon
Routing protocols determine optimal paths for data transmission through networks by maintaining and updating routing tables. Two important loop-prevention techniques used in distance-vector routing protocols like RIP and EIGRP are Poison Reverse and Split Horizon. Both techniques address the counting-to-infinity problem that occurs when routers continuously exchange routing information, potentially creating loops that cause packets to circulate indefinitely. Split Horizon Split Horizon is a simple rule that prevents a router from advertising a route back through the same interface from which it learned that route. This technique stops routing information from bouncing between routers. ...
Read More