Found 34488 Articles for Programming

Python script to generate dotted text from any image

Mrudgandha Kulkarni
Updated on 11-Aug-2023 16:29:03

287 Views

In the digital age, manipulating images and creating artistic effects has become a common practice. One intriguing effect is the generation of dotted text from an image. This process involves converting the pixels of an image into a pattern of dots, creating an intriguing visual representation of the text. In this blog post, we will explore how to create a Python script that can generate dotted text from any given image. By leveraging the power of Python and some essential libraries, we can automate the process and easily generate stunning dotted text effects. Understanding Dotted Text Before we jump into ... Read More

Python Script to create random jokes using pyjokes

Mrudgandha Kulkarni
Updated on 11-Aug-2023 15:03:26

529 Views

Are you looking to add some humor to your Python scripts or applications? Whether you're building a chatbot, developing a command-line tool, or simply want to entertain yourself with a random joke, the pyjokes library is here to help. With pyjokes, you can effortlessly generate jokes in various categories and customize them to suit your preferences. In this blog post, we will explore how to use the pyjokes library to create random jokes in Python. We'll cover the installation process, generating jokes from different categories, customizing the jokes, displaying them in console applications or web pages, and handling any potential ... Read More

Java Program to Illustrates Use of Static Inner Class

Sakshi Ghosh
Updated on 11-Aug-2023 14:30:01

101 Views

Here, we will demonstrate the usage of static inner class using the Java program. Before diving deep into the topic, let us get acquainted with the term Static Inner Class . Static Inner Class An inner class is the one, which is defined within another class. A Static Inner Class is a nested class that is a static member of the outer class. Other static members can be used to access it without first instantiating the outer class. A static nested class lacks access to the instance variables and methods of the outer class, much like static member’s java. Example ... Read More

Java Program to illustrate Total Marks and Percentage Calculation

Sakshi Ghosh
Updated on 09-Jul-2024 16:03:18

1K+ Views

We will demonstrate how total marks and percentages are calculated using Java programs. The term total marks refer to the summation of all the available marks, while the term percentage refers to the number obtained by dividing the calculated marks by total marks and multiplying the resultant by 100. percentage_of_marks = (obtained_marks/total_marks) × 100 Problem Statement Given a Java program to calculate the total marks and percentage of a student in a given set of subject. Input marks = { 69, 88, 77, 89, 98, 100, 57, 78 } Output Total Marks is: 656 Total Percentage is: ... Read More

Java Program to illustrate the Usage of Hexadecimal

Sakshi Ghosh
Updated on 11-Aug-2023 14:24:07

128 Views

Here, the usage of Hexadecimal shall be demonstrated through the Java Program. Let us get acquainted with the term Hexadecimal before seeing a Java program. The Hexadecimal is a type of number system that has a base value of 16. There are 16 symbols representing hexadecimal numbers. These symbols or values are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. Each digit represents a decimal value.  The hexadecimal numbers from 0 to 9 are equivalent to decimal numbers from 0 to 9. Further, A represents 10, B represents 11, C represents ... Read More

Java Program to Illustrate the Availability of Default Constructor of the Super Class to the Sub Class by Default

Sakshi Ghosh
Updated on 11-Aug-2023 14:04:10

73 Views

Here, we will demonstrate the availability of the default constructor of the super class to the sub class by default through Java Program. Before diving deep into the topic, let us get acquainted with the term Constructor, Super class, and subclass. Constructor A special method in Java is considered for the initialization of an object. The name of the constructor is the same as the class name and it does not return anything. A default constructor is invoked by itself whenever an object is created using a new keyword. There are following three types of constructors in Java ... Read More

Java Program to Illustrate Escaping Characters in Regex

Sakshi Ghosh
Updated on 11-Aug-2023 13:03:31

474 Views

Here, we will demonstrate escaping characters in Regex through Java Program. Before diving deep into the topic, let us get acquainted with the term Escaping Characters and Regex. Regex It is an acronym for a Regular expression. It is an API that offers users to define String patterns that are useful for finding, modifying, and editing strings. A couple of areas of strings where Regex is frequently used to define the limitations include email validation and passwords. The java.util.regex package encompasses regular expressions. Escape character When a character is preceded by a backslash (\), it includes numbers, alphabets, and ... Read More

Total numbers with no repeated digits in a range

Vaishnavi Tripathi
Updated on 16-Aug-2023 10:38:47

3K+ Views

In this article, we will discuss different approaches to calculate the number of positive integers which have no repeated digits between a given range Low to high. The first approach is a brute force approach which iterates over all the numbers in the range and check if they contain repeated digits. In our second approach, we calculated the desired count using prefix array while in our last approach we used the concept of memorization in dynamic programming to get the desired result. Problem Statement: We are given two numbers low and high and we have to find the count of ... Read More

Tomohiko Sakamoto’s Algorithm- Finding the day of the week

Vaishnavi Tripathi
Updated on 16-Aug-2023 10:32:42

262 Views

In this article, we will discuss what is Tomohiko Sakamoto’s algorithm and how this algorithm is used to identify which day of the week does the given date occurs. There are multiple algorithms to know the day of the week but this algorithm is the most powerful one. This algorithm finds the day of the month on which the date occurs in least possible time and least space complexity. Problem statement − We are given a date as per Georgian calendar and our task is to find out which day of the week occurs on the given date using ... Read More

Recursive Practice Problems with Solutions

Vaishnavi Tripathi
Updated on 16-Aug-2023 10:22:31

1K+ Views

In this article, we will discuss a few recursive practice problems with their detailed solutions. Let us first understand what recursion is and how it works: Recursion − Recursion is a programming technique in which a function or method calls itself multiple times in order to solve a problem. The function breaks down the problem into smaller sub-problems and solves them until it reaches a base case. The base case is a stopping condition that makes sure that the function stops calling itself and returns a result in finite time. Recursion is a powerful technique for solving complex ... Read More

Advertisements