Found 33676 Articles for Programming

Modelling the Newton Raphson Method in Python

Dr Pankaj Dumka
Updated on 15-Mar-2023 16:13:20

2K+ Views

In this tutorial, I will show you how to evaluate the roots of a polynomial or transcendental equation with the help of a numerical method known as the Newton Raphson method. This is an iterative method in which we start with a initial guess (of independent variable) and then evaluate the new value of 𝑥 based on the guess. And the process goes on till the convergence is achieved. The method is explained with the help of a diagram as shown below. Based on $x_{g}$ the value of function $(f^{'} \left ( x_{g} \right ))$ is evaluated. Then a ... Read More

Modelling the Projectile Motion using Python

Dr Pankaj Dumka
Updated on 14-Mar-2023 16:10:15

10K+ Views

Let us first understand some basic concepts and equations based on which the projectile motion can be modelled. The figure shown below explains some basic terminologies of projectile motion. Here, "u" is the velocity with which the projectile is being projected. 𝛼 is the angle of projection of the projectile. The path taken up by the projectile during its flight. Range is the maximum horizontal distance travelled by the projectile. $\mathrm{h_{max}}$ is the maximum height attained by the projectile. Moreover, the time taken up by the projectile to travel the range is called as time of flight. The projectile ... Read More

PHP and Xvfb usage

Satish Kumar
Updated on 14-Mar-2023 16:14:56

1K+ Views

Introduction Xvfb stands for "X Virtual Frame Buffer" which is used to create a virtual display in memory without any attached physical display device. It allows running graphical applications without any actual graphics hardware. PHP is a server-side scripting language widely used for web development. In this article, we will discuss how we can use Xvfb with PHP to run graphical applications in headless mode. Why do we need Xvfb with PHP? PHP is a server-side scripting language and doesn't provide any direct support for graphics and user interfaces. Most of PHP-based web applications are built on top of popular ... Read More

Run a Qt app in a different language

Satish Kumar
Updated on 14-Mar-2023 16:12:25

1K+ Views

Qt is a cross-platform application framework that is widely used for developing applications with graphical user interfaces. It is written in C++ and supports a range of programming languages, including Python, Ruby, and Java. One of most useful features of Qt is its support for internationalization, which allows developers to create applications that can be easily localized for different languages and cultures. In this article, we will discuss how to run a Qt app in a different language. Introduction to Internationalization Internationalization, also known as i18n, is process of designing and developing applications that can be easily localized for different ... Read More

Eclipse fails to start via an Application Launcher

Satish Kumar
Updated on 14-Mar-2023 16:09:40

5K+ Views

Eclipse is one of most popular Integrated Development Environment (IDE) used by millions of developers around world. It provides a comprehensive set of tools and features for developing Java applications, web applications, and other software projects. However, like any software, Eclipse may encounter issues and errors that can prevent it from starting up via an application launcher. In this article, we will discuss some common causes of Eclipse startup failure and how to troubleshoot them. Possible Causes of Eclipse Startup Failure Corrupted Installation One of most common reasons why Eclipse fails to start is a corrupted installation. This could be ... Read More

Haskell Program to Display Prime Numbers Between Two Intervals

Akhil Sharma
Updated on 13-Mar-2023 15:27:44

313 Views

In Haskell, we can display Prime Numbers between Two Intervals using user-defined functions and list comprehension. In the first example, we are going to use (isPrime and primesInRange) user-defined functions and in the second example, we are going to use list comprehension. Algorithm Step 1 − The Data.List library is imported. Step 2 − The user-defined isPrime function is defined. Step 3 − Program execution will be started from main function. The main() function has whole control of the program. Step 4 − The variables named, “lower” and “upper” are being initialized. It will hold the range between which ... Read More

Haskell Program to Display Armstrong Number Between Two Intervals

Akhil Sharma
Updated on 13-Mar-2023 15:27:13

177 Views

In Haskell, we can useuser-defined functions and using recursion. In the first example we are going to use (user-defined, isArmstrong and armstrongInRange) function and in the second example, we are going to use recursion with base and recursive case. Algorithm Step 1 − The user-defined isArmstrong function is defined Step 2 − Program execution will be started from main function. The main() function has whole control of the program. It is written as main = do. Step 3 − The variables named, “lower” and “upper” are being initialized. It will hold the range between which the armstrong numbers ... Read More

Haskell Program to Display Prime Numbers Between Intervals Using Function

Akhil Sharma
Updated on 13-Mar-2023 15:26:15

204 Views

In Haskell, we can Display Prime Numbers Between Intervals using user-defined function along with filter function and recursion. In the first example we are going to use user-defined, (isPrime) function with (primeInRange a b = filter isPrime [a..b] ) function and in the second example, we are going to use recursion with base and recursive case. Algorithm Step 1 − The Data.List library is imported. Step 2 − The user-defined isPrime function is defined as, Step 3 − Program execution will be started from main function. The main() function has whole control of the program. It is written as ... Read More

Haskell Program to Make a Simple Calculator Using switch...case

Akhil Sharma
Updated on 13-Mar-2023 15:25:32

966 Views

In this article we are going to learn how to make a simple calculator in Haskell using switch…case. In the first example, we are going to use case statements with different operators and in the second example, we are going to use map of functions as (fromList [('+', (+)), ('-', (-)), ('*', (*)), ('/', (/))]). Method 1: Program to make a simple calculator using case statement In this method, a simple calculator program in Haskell is formed which takes three arguments, x, op and y. The x and y are of type Double and op is of type Char. The ... Read More

Haskell Program to Display Factors of a Number

Akhil Sharma
Updated on 13-Mar-2023 15:23:45

788 Views

In Haskell, we can list comprehension, filter function and recursion to display factors of a number. In the first example we are going to use (factors n = [x | x n `mod` x == 0) [1..n]) function. And in third example, we are going to use recursion with base and recursive case. Algorithm Step 1 − The user-defined factors function is defined using internal functions. Step 2 − Program execution will be started from main function. The main() function has whole control of the program. It is written as main = do. Step 3 − The variable ... Read More

Advertisements