Found 448 Articles for Programming Scripts

How to count the number of matches in a Perl string?

Mukul Latiyan
Updated on 04-Apr-2023 15:50:30

516 Views

In Perl, we can find the number of matches in a string by different approaches. In this tutorial, we will discuss the three most widely used approaches. Searching for a Single Character in a Perl String Let's first take the case where we would want to search for a single character pattern in a string. For example, let's suppose we have a string that look something like this − "India.Japan.Russia.USA.China" And, we want to find the number of times "." (dot) appears in the above string. Example Consider the code shown below. my $countries ... Read More

How to count the number of keys in a Perl hash?

Mukul Latiyan
Updated on 04-Apr-2023 15:53:37

1K+ Views

There are times when we would want to know how many key-value pairs are present in a hash. These key-value pair counts are also known as the size of the hash. In Perl, we can find the number of keys in a Perl hash by using the "scalar" keyword or "keys" keyword. In this tutorial, we will explore two Perl examples where we will calculate the number of keys in a hash. Example Consider the code shown below. In this code, we have declared a hash named "countries" and in that hash, we have different countries, each having ... Read More

How to convert binary to decimal and vice versa in Perl?

Mukul Latiyan
Updated on 04-Apr-2023 15:48:37

494 Views

The conversion between binary to decimal and decimal to binary is a necessity when it comes to dealing with binary data and using them in some simple applications. In Perl, we can convert from decimal to binary and vice versa in multiple ways. In this tutorial, we will explore different examples where we will first convert a decimal value into a binary value and then a binary value into a decimal value. Decimal to Binary in Perl Let's first see an example where we are given two decimal values and we want to convert them to their binary representation. ... Read More

How to convert a string to a number in Perl?

Mukul Latiyan
Updated on 04-Apr-2023 15:47:18

2K+ Views

In Perl, we can convert a string into a number by appending the integer value 0 in front of it. There are some other approaches too, which we will discuss in this tutorial with the help of examples. Example Let's first consider the case where the string that we are trying to convert looks something like "123abc" or "23Hzbc". You can see that the it is a mixture of both integer values and characters. Consider the code shown below. my $firstStr = '23ASDF'; print "Convering First String to Number: ", $firstStr + 0; print ""; my $secondStr = ... Read More

How to compare two strings in Perl?

Mukul Latiyan
Updated on 04-Apr-2023 15:46:09

4K+ Views

Perl has methods and operators that determine whether two string values are equal or different. In Perl, the compare strings function is essential for comparing two strings and their values. This check examines if two string values are equal or not by using the "eq" and "ne" operators. We can also compare two strings with the help of the "lt, gt, ge, le" operators as well. In this tutorial, we will consider all the approaches that can be used to compare two strings in Perl. The "eq" and "ne" Operators in Perl Let's start with the eq and ... Read More

How to Use cd Command in Bash Scripts

Satish Kumar
Updated on 24-Mar-2023 15:59:40

9K+ Views

The cd command is one of most fundamental commands in Bash shell. It is used to change current working directory to a specified location. This command is particularly useful when navigating through file system, especially in situations where you need to access files or directories in a different location. In this article, we will explore how to use cd command in Bash scripts. What is cd Command? Before diving into usage of cd command, it is important to understand what it does. cd command is a built-in command in Bash that is used to change current working directory. When you ... Read More

How to Read Machine Learning Papers?

Parth Shukla
Updated on 16-Jan-2023 12:47:54

199 Views

Introduction Machine Learning and Deep Learning are emerging technologies in the current industry scenario. There is a lot of work related to the industry and significantly impacting the present world business scenario. There are lots of people who are trying to enter this field and want to get benefited. To master one field, it is necessary to get updated on the latest research works and the things happening in the latest days. There is a lot of content available on the internet that can b useful for the same. Still, the approach to reading these machine learning papers should be ... Read More

Introduction to Data Science in Python

Prabhdeep Singh
Updated on 11-Jan-2023 11:31:06

481 Views

As the world entered the era of big data in recent decades, the demand for more effective and efficient data storage greatly expanded. Businesses that use big data invest a lot of time and energy in creating frameworks that can hold a lot of information. The storage of vast amounts of data was then made possible by the creation of frameworks like Hadoop. As the storage issue can be resolved by using the frameworks the next issue that comes is to process the data that had already been stored. The solution to processing the data and getting the useful information ... Read More

Introduction to Git for Data Science

Prabhdeep Singh
Updated on 11-Jan-2023 11:20:43

846 Views

The data science and engineering fields are interacting more and more because data scientists are working on production systems and joining R&D teams. We want to make it simpler for data scientists without prior engineering experience to understand the core engineering best practices. We are building a manual on engineering subjects like Git, Docker, cloud infrastructure, and model serving that we hear data science practitioners think about. Introduction to Git A version control system called Git is made to keep track of changes made to a source code over time. Without a version control system, a collaboration between multiple people ... Read More

Python Data Science using List and Iterators

Prabhdeep Singh
Updated on 11-Jan-2023 11:23:00

183 Views

Data science is the process of organizing, processing, and analyzing vast amounts of data in order to extract knowledge and insights from them. It involves a number of different fields, including statistical and mathematical modelling, data extraction from its source, and methods for data visualization. Working with big data technology to gather both structured and unstructured data is commonly required. In the parts that follow, we'll examine several applications of data science and how python might be useful there. Python is a widely used high-level, general-purpose, object-oriented, and interpreted language. To utilize Python for a task, one only needs to ... Read More

1 2 3 4 5 ... 45 Next
Advertisements