Programming Scripts Articles - Page 3 of 37

How to check if a file exists in Perl?

Mukul Latiyan
Updated on 14-Mar-2023 18:05:09

4K+ Views

In this tutorial, we will take a couple of examples and demonstrate how you can if a file exists or not, with the help of Perl. Let's suppose we have a simple text file called "sample.txt" with the following data − This is a sample txt file that contains some content inside it. TutorialsPoint is simply amazing! We will use a Perl code to check whether this file exists or not. Example 1 The most basic approach to check whether a file exists or not is to use the "-e" flag and then pass the name of the file. ... Read More

How to check if a Perl array contains a particular value?

Mukul Latiyan
Updated on 26-Dec-2022 16:28:21

9K+ Views

In Perl, we can check whether an array contains a particular value or not with the help of the "grep" keyword. The grep function in Perl is used to filter the input supplied in the function as a parameter out of the list of items. Similar to Linux, it uses the given input to find the matching value. The grep() Method "grep" is a built-in function in Perl, we can pass our regular expression inside this function. It will check the input for matching values and return a list based on whether the condition is true or false. Syntax As ... Read More

How to break out of a loop in Perl?

Mukul Latiyan
Updated on 26-Dec-2022 16:23:22

11K+ Views

In most programming languages, we can use the "break" keyword to break out of any type of loop. In Perl too, we have the "break" keyword available, but the keyword that is used the most to break out of a loop is the "last" keyword. The "last" Statement in Perl The "last" statement is used in Perl loops to exit a loop immediately; it is the equivalent of the "break" statement in C/C++ and Java. In practice, you often use the "last" statement to exit a loop if one of the conditions is met, for example, you find an ... Read More

Fuzzy Logic and Probability: The Confusing Terms

AmitDiwan
Updated on 14-Oct-2022 11:58:23

2K+ Views

In this article, you will understand the difference between fuzzy logic and probability. Fuzzy logic It is a many-valued logic where the truth value of variables may be a real number between 0 and 1, including 0 and 1. Everything is associated with a degree. It is based on natural language processing. It can be integrated with programming. It is best suited for approximation. It is generally used by quantitative analysts. It helps understand the concept of vagueness. It captures the meaning of partial truth. The degree of membership is in a set. It is used in air conditioners, ... Read More

Voca: The Ultimate Javascript library for String Manipulation

Mukul Latiyan
Updated on 11-Oct-2022 14:24:39

529 Views

Voca is a JavaScript library that is used for manipulating strings. In this tutorial, we will take multiple examples to show how you can use the different functions available in Voca. Features of Voca Before we see all the examples, let's highlight some features that Voca brings to the table − It provides a multitude of functions that can be used to manipulate, query, escape, format strings. It also provides a detailed and searchable documentation. It supports a wide range of environments like Node, js, Safari 7+, Chrome, Firefox etc. It doesn't require any dependencies How to Install ... Read More

Logging HTTP Requests and Errors using Morgan.js

Mukul Latiyan
Updated on 11-Oct-2022 14:18:24

2K+ Views

Morgan is a middleware that is available for Node.js which is used when we want to log HTTP requests. It is mainly used in Express projects. Morgan helps us simplify the logging work of HTTP requests that come and sent from an application in a single statement. In normal situations, developers often write all the logging code by hand and then end up logging what to store, how to save, and where everything is saved. It helps in gathering logs from your server and also prepares them for reading. It also has many predetermined defaults built-in to help the developers. ... Read More

What are top JavaScript animation libraries?

Kalyan Mishra
Updated on 11-Oct-2022 08:57:37

1K+ Views

Have you ever thought of creating complex animations using CSS, well in JavaScript also there are some libraries which helps in creating animation and tasks that CSS also cannot perform. AS CSS animations are limited in functionality on the other hand JavaScript libraries are fast and reliable So, this article we will be learning about some of the best JavaScript animation libraries using which you can create animations in JavaScript. Let’ see some of the JavaScript animation libraries. Anime.js Anime.js is known as lightweight animation library which s use to animate HTML, JavaScript objects, CSS selectors and DOM attributes, arrays ... Read More

Difference between location.host and location.hostname in JavaScript

Imran Alam
Updated on 10-Oct-2022 11:57:01

4K+ Views

JavaScript's Location object provides access to the current URL's components. One can think of this object as a read-only window into the current location. There are two properties of the Location object that are often confused: host and hostname. Location.host The host property returns the hostname, port number, and protocol of the current URL. For example, if the current URL is "http://example.com:8080/path/to/page.html", the value of host would be "example.com:8080". Advantages of using location.host There are also a few advantages to using location.host over location.hostname. First, it is more specific. If you need the port number or protocol, you can be ... Read More

Design a Digital Clock in Neumorphism Style using JavaScript

Imran Alam
Updated on 08-Dec-2022 13:19:12

491 Views

In this tutorial, we will be discussing how to design a digital clock in neumorphism style using JavaScript. Neumorphism is a new design trend that has been gaining popularity in recent years. It is characterized by soft, rounded shapes and subtle shadows. The HTML We will start by creating a basic HTML structure for our clock. We will need a container element, and within that, we will have an element for the clock face and another for the control buttons. Below is the HTML code for our clock − Start Stop ... Read More

Building a Text Editor using Quill.js

Mukul Latiyan
Updated on 15-Jun-2023 12:14:16

4K+ Views

Quill is a free and open-source text editor that falls under the category of WYSIWYG editors and is mainly built for the modern web that we use today. It is a highly customizable text editor and has many expressive API. Quill is very easy to use and provides a good interface that is even understandable to those that have worked on markup only. In this tutorial, we will take multiple examples to explain how you can build a text editor using Quill.js. While there are dozens of rich text editors that belong to the WYSIWYG text editors, the most widely ... Read More

Advertisements