Found 34486 Articles for Programming

Golang program to compute all prime numbers up to a given number using concurrency

Akhil Sharma
Updated on 04-Aug-2023 16:22:28

224 Views

In this Go language article, we will write programs to compute all prime numbers up to a given number using concurrent execution. Concurrent execution is the process of executing multiple tasks simultaneously. In Golang, go routines and channels are used to create concurrent programs. Go routines are lightweight threads which are managed by the Go runtime and channels help in the communication between Go routines without any conflicts. Syntax func make ([] type, size, capacity) The make function in go language is used to create an array/map it accepts the type of variable to be created, its size ... Read More

Golang program to return the nth number in fibonacci sequence using dynamic programming

Akhil Sharma
Updated on 04-Aug-2023 14:57:49

968 Views

In this article, we will write Go language programs to return the nth number in Fibonacci sequence using dynamic programming. It is a technique used to solve complex problems by breaking them into smaller sub problems. Memoization is the process of storing the output of the function calls in some data structure by which the next time call is made it need not calculate the output again, it can use that value to make the computation which in return lessens the execution time. Syntax func make ([] type, size, capacity) The make function in go language is used to ... Read More

How to simulate mouse movements using Python?

S Vijay Balaji
Updated on 24-Aug-2023 12:21:04

4K+ Views

When it comes to automation, be it to setup your computer on start-up or to farm coins on a clicker game, it becomes essential to simulate mouse movements and clicks. And what better way to do this than use Python! For performing this particular task of automating or simulating your mouse movement, we will be using Python’s mouse library that has various methods and functionalities to help simulate your mouse on your computer. Now that you know what we will be working with, let us get started! Getting Started Firstly, we need to install the mouse library. Since this library ... Read More

How to schedule simple alarms in Python?

S Vijay Balaji
Updated on 24-Aug-2023 12:20:22

181 Views

Creating a simple alarm clock is one of the basic projects that can help you understand the basics of time manipulation, running system commands, playing audio files and other such essential topics. And, in this tutorial, we will be learning how to build one. For this, we will be working with the PyGame module to play the audio file and the datetime module to get the current system time. Alright, let us get started then! Getting Started For playing the audio file, we will be using the PyGame module. This module does not come pre-packaged with Python. So, we’ll be ... Read More

Creating Snow Effect using the Arcade Module in Python

S Vijay Balaji
Updated on 04-Aug-2023 13:11:24

132 Views

We’ve all wanted to add additional effects to our presentation or to a video. These effects help us in better present our product or helps increase user experience. And in this tutorial, you will learn how to implement the snow effect using the arcade module. You can use this in your games to create a snow drizzle or a rain drop effect. You can even go ahead and set it up as a screen timeout effect. That being said, let us get started! Getting Started Throughout this tutorial, we will be using the arcade module that helps users create game ... Read More

3-coloring is NP Complete

Aayush Shukla
Updated on 04-Aug-2023 12:55:57

343 Views

3-shading is an exemplary NP-complete issue in chart hypothesis where the goal is to decide whether a given diagram can be hued utilizing three tones, to such an extent that no two neighboring vertices share a similar variety. The issue is delegated NP-complete, importance there is no known effective calculation to tackle it for all occasions, and checking a potential arrangement should be possible in polynomial time. Numerous other NP-complete issues can be decreased to 3-shading, showing its computational intricacy and its importance in understanding the more extensive class of NP-complete issues. Subsequently, 3-shading assumes a major part in the ... Read More

Automate GUI Interactions in Python using the PyAutoGUI Library

S Vijay Balaji
Updated on 04-Aug-2023 12:50:02

553 Views

PyAutoGUI is a fantastic module for automating graphical user interface interactions in Python applications. It enables developers to imitate user input and automate repetitive operations, making it a good choice for testing, data entry, and other jobs that require interacting with GUIs. PyAutoGUI is a cross-platform library that supports all major operating systems such as Windows, Linux, and macOS. In this tutorial, we'll understand how to use Python's PyAutoGUI package to automate GUI interactions. We'll start by installing PyAutoGUI and learning how to use it. Then, we'll delve further into the library's features, such as keyboard and mouse control and ... Read More

Build a Simple Chatbot in Python using Errbot

S Vijay Balaji
Updated on 04-Aug-2023 12:45:36

143 Views

You can use Errbot (a chatbot) to start scripts interactively from your chatrooms. The most important feature of errbot is that it connects to any chat server you want it to and has a range of features. It can even connect to your slack and discord channels and interact with users. Now that you know what we are dealing with, let us get started. Getting Started It’s better to download errbot in a virtual environment rather than directly installing it. Firstly, we have to download and install the errbot library. We’ll be using the pip package manger to do this. ... Read More

How to Convert a Numpy Array to Tensor?

Mukul Latiyan
Updated on 03-Aug-2023 18:16:10

5K+ Views

Numpy is a popular Python library used for numerical computing and scientific computing, providing a powerful array object for handling large and multi−dimensional arrays. However, when it comes to machine learning, deep learning, and neural networks, PyTorch is a widely used library that provides an efficient and flexible platform for building and training these models. While Numpy arrays and PyTorch tensors are similar in many ways, they have different properties and methods, which makes it necessary to convert a Numpy array to a PyTorch tensor when using PyTorch for machine learning applications. In this article, we will explore the process ... Read More

How to Control a PC from anywhere using Python?

Mukul Latiyan
Updated on 03-Aug-2023 18:15:09

4K+ Views

Remote access to computers has become increasingly important, especially in today's work from home environment. While there are many commercial tools available for remote access, Python provides a simple yet effective way to remotely control your PC from anywhere using the Python programming language. In this article, we will explore how to control your PC from anywhere using Python. We will discuss how to establish a remote connection between two computers, how to use Python to execute commands on the remote PC, and how to transfer files between the local and remote computers. With this knowledge, you can remotely access ... Read More

Advertisements