Found 26375 Articles for Server Side Programming

Sort a string without altering the position of vowels

Prabhdeep Singh
Updated on 11-Jul-2023 09:02:29
Sorting a string means we have to arrange a given string either in an ascending or descending order or any given order. In this problem given a string 'str' of size n. Our aim is to sort the given string without altering means without changing the position of vowels present in the string. Let's see examples with explanations below to understand the problem in a better way. Sample Examples Input 1 str = “abdecokfee” Output 1 abcedofkee Explanation Constant present in the string = bdckf Sort the constant string = bcdfk Merge the given string with the sorted instant string ... Read More

Maximum Number of 0s Placed Consecutively at the Start and End in any Rotation of a Binary String

Prabhdeep Singh
Updated on 11-Jul-2023 09:00:04
Binary string means the string contains only two types of char either 1 or 0. It is known as base 2. In this problem, we have given a binary string str and also the size of the string 'n'. Our task is to find the maximum number of zeros places consecutively at the start and end of any rotation of a binary string. Let's see examples with explanations below to understand the problem in a better way. Sample Example Input 1 str = “101001, n = 6 Output 1 2 Explanation The string can be rotated in any of the ... Read More

C++ Program for Left Rotation and Right Rotation of a String

Prabhdeep Singh
Updated on 11-Jul-2023 08:56:40
Rotation means we have to shift each character forward or backward direction. In the case of forward, the last character is forwarded to the index 0 also known as right rotation. In the case of backward first character at index 0 is backward to the last index also known as left rotation. In this problem, we have given a string of characters and integer d. Our task is to print the left rotated string or right rotated string by d integer. Only the permutation of the current string changes, not the length or frequency of the characters in the ... Read More

How To Track ISS (International Space Station) Using Python?

Tushar Sharma
Updated on 10-Jul-2023 19:31:33
Exploring the whereabouts of the International Space Station (ISS) and witnessing its real−time movements can be an exhilarating experience. The following article aims to showcase how Python can be utilized to track the ISS, utilizing the ISS API provided by Open Notify and visualizing its location on an interactive world map with the aid of the `folium` library. Installing the Required Libraries Before we embark on our ISS tracking journey, it is necessary to install a couple of libraries: `requests`, which facilitates API calls, and `folium`, which empowers the creation of captivating interactive maps. pip install requests ... Read More

How to test Typing Speed using Python?

Tushar Sharma
Updated on 10-Jul-2023 19:25:10
If you've ever pondered the swiftness at which you can type or desire to refine your typing prowess, we possess a solution tailor−made for you! Within the confines of this composition, we shall delve into a simple approach that entails evaluating your typing speed utilizing Python. Fret not if you find yourself at the nascent stages of programming or if technical jargon leaves you feeling bewildered. We shall meticulously expound upon every facet using easily comprehensible verbiage, elucidating the process step by step. Step 1: Embarking on a Pythonic Journey To commence this undertaking, it is imperative to ensure that ... Read More

How to Terminate a Running Process on Windows in Python?

Tushar Sharma
Updated on 10-Jul-2023 19:20:22
When delving into the realm of Python development on a Windows operating system, there will undoubtedly be occasions where the need arises to terminate a running process. The motives behind such termination could span a wide array of scenarios, including unresponsiveness, excessive resource consumption, or the mere necessity to halt script execution. In this comprehensive article, we shall explore various methods to accomplish the task of terminating a running process on Windows using Python. By leveraging the 'os' module, the 'psutil' library, and the `subprocess` module, we will equip ourselves with a versatile toolkit to address this imperative task. Method ... Read More

How to take backups of MySQL databases using Python?

Tushar Sharma
Updated on 10-Jul-2023 18:31:34
Safeguarding the integrity and recoverability of your MySQL database is of paramount importance to mitigate the risks associated with data loss and corruption. Python, a versatile programming language, offers a myriad of libraries and techniques for seamless interaction with MySQL databases and accomplishing efficient backup procedures. This article delves into three distinct methodologies for creating MySQL database backups using Python, encompassing the utilization of the subprocess module, integration of the mysqldump command with the pymysql library, and leveraging the robust capabilities of the MySQL Connector/Python library. Through practical examples, we will delve into the intricacies of these techniques. Method 1: ... Read More

How to return an array to the function in Golang?

Aman Sharma
Updated on 10-Jul-2023 17:13:28
In programming, to make the code more modular, usable, and readable we break the code into different functions. For example, we have to swap two numbers at different places so instead of swapping in place we create a different function and call it everywhere. In some use cases, we need a function that returns multiple values at once. For this, we have a data structure called arrays in programming that is nothing but a collection of multiple values of the same type. In this tutorial, we are going to learn about how to return an array in function as an ... Read More

How to Return a String from the Function in Golang?

Aman Sharma
Updated on 10-Jul-2023 17:10:56
In programming, to make the code more modular, usable, and readable we break the code into different small blocks and these blocks are known as functions. A string is a data structure consisting of a set of alphabets. In solving any programming problem we want that the function should return some set of alphabets then we create a string in the function that the function returns in the end. This tutorial will explain this concept with the help of two examples. In the first example, we will define two strings and create a function that will return the string ... Read More

How to Pass an Array to the Function in Golang?

Aman Sharma
Updated on 10-Jul-2023 17:04:40
In programming, to make the code more modular, usable, and readable we break the code into different functions. For example, we have to sort some set of numbers for which we will create a separate function. For this, we have a data structure called arrays in programming that is nothing but a collection of multiple values of the same type. Once the array of numbers is sorted then at the end of that function we have to return the sorted elements so in this article we will see how to return the array. Syntax The syntax to declare a function ... Read More
1 2 3 4 5 ... 2638 Next
Advertisements