Found 34494 Articles for Programming

How to Create Custom Class in Java?

Harischandra Prasad
Updated on 16-Oct-2023 12:32:55

404 Views

In Java, a class is a fundamental component of object-oriented programming. It serves as a blueprint or template for defining the structure and behavior of objects. A class contains both data, represented by fields or variables, and behaviors, represented by methods or functions, which manipulate that data. In Java, a custom class is a user-defined class that allows you to create objects with specific properties and behaviors tailored to your application's requirements. It serves as a blueprint or template for creating objects of that class type. Custom classes encapsulate related data and operations into a single entity, promoting code organization, ... Read More

Move Files to Creation and Modification Date Named Directories using Python

Nikitasha Shrivastava
Updated on 16-Oct-2023 12:04:47

113 Views

In this problem statement we have to move all the files in the folder with the name of creation and modification date directory with the help of Python. In this task we will use some predefined libraries of Python for smooth processing of relocating the files. Understanding the Problem As we have seen, managing the files as per the date or modification and creation time. So here in this article we will simplify this task by creating the Python script to move the files as per the creation and modification dates by giving the folder name as the modification or ... Read More

How to Create and Modify Properties File Form Java?

Harischandra Prasad
Updated on 16-Oct-2023 12:21:50

100 Views

Program in Text and XML Format? In Java, a project's properties file is made up of text-based key-value pairs that are commonly stored with the .properties extension. The key-value pair of contents are presented line by line, and they are often created using notepad, Wordpad, etc. Properties files serve as valuable repositories for storing critical and confidential data. In this article, we will explore the process of creating a properties file using a Java program. The Properties class in this (java.util.Properties) package offers multiple utility store methods that facilitate the storage of properties in either Text Format or XML ... Read More

Move all the files from subfolders to the main folder using Python

Nikitasha Shrivastava
Updated on 16-Oct-2023 12:04:10

605 Views

The given problem statement is to relocate all the files from the subfolders to the main folder using Python. So we will use the OS and Shutil libraries of Python to do this task. Understanding the Logic for the Problem In this task, we are required to move all the files that exist in the subfolder in the main folder using Python programming language. So for doing this process we will specify the source folder path and destination or main folder path. And we will be using python’s os and shutil libraries for doing this task. So first we will ... Read More

How to Create a TreeMap in Reverse Order in Java?

Harischandra Prasad
Updated on 16-Oct-2023 12:18:37

475 Views

In this article, we will learn how to create a TreeMap in reverse order in java. Firstly, we need to know about TreeMap. A TreeMap in Java is a class that implements the SortedMap interface, which extends the Map interface. It is a collection that stores key-value pairs and organizes them based on their natural order or a custom Comparator provided during its creation. This approach provides efficient performance for common operations such as adding, removing, and retrieving elements from the TreeMap. It has an average time complexity of O(log n), which ensures efficient execution. Syntax for Creating a TreeMap ... Read More

How to Create a Thread-Safe ConcurrentHashSet in Java?

Harischandra Prasad
Updated on 16-Oct-2023 12:14:02

256 Views

In this article, we will see what are the possibilities available to create thread-safe HashSet instances and see what will be equivalent to ConcurrentHashMap for HashSet. We will also look at the benefits and drawbacks of each approach. Before JDK8 we are not able to create a Thread Safe ConcurrentHashMap because  java.util.concurrent package in JDK8 does not provide a class named ConcurrentHashSet, two new methods were added that are discussed below. ConcurrentHashMap is the Map implementation that allows us to modify the Map while iterating. The ConcurrentHashMap operations are thread-safe. ConcurrentHashMap doesn't allow null for keys and values. Ways to ... Read More

motion_blur() in Python Wand

Nikitasha Shrivastava
Updated on 16-Oct-2023 12:03:21

25 Views

In the given problem statement we have to apply a motion_blur function for an image using the Python wand library. Sometimes we are needed to perform the blur operation on some images. So using the Python wand we can do this task easily and blur the image to any extent. What is Python Wand? The wand is a tool, which is used to convert the format of images. It can convert the image from one format to another. This library provides a wide range of functions to perform different kinds of operations of the image for manipulating them. To install ... Read More

Modify Equal Tuple Rows in Python

Nikitasha Shrivastava
Updated on 16-Oct-2023 12:01:43

32 Views

In this article we will learn how to modify equal tuple rows with the help of Python programming. Whenever we talk about data, sometimes we need to modify that data also. So here we will modify equal tuple rows data as per the equality of the records. Understanding the Problem The problem at hand is to modify the given tuple for equal rows using python. So we will be having a list of tuples and our task is to modify as per the condition for the particular tuple row in the given list. Let's see the usage of the following ... Read More

How to move and overwrite files and folders using Python?

Nikitasha Shrivastava
Updated on 16-Oct-2023 12:01:03

1K+ Views

The files are very important documents in our systems. In files we store our important data and moving these files is also an important task to organize the system. So we will learn how to move and also overwrite the files and folders using Python modules. Understanding the Logic for the Problem The problem at hand is that we have to create a code for moving and overwriting the files and folders in Python. For solving this problem we will import os and shutil libraries of Python. So with the help of these libraries we can move and overwrite the ... Read More

Finding the Summation of Nested Record Values in Python

Nikitasha Shrivastava
Updated on 16-Oct-2023 11:58:04

34 Views

The problem statement requires finding the summation of nested record values using Python. Sometimes we are required to add the values present in the data so that time this approach can be useful as record is the powerful dataset in terms of updating or manipulating the data using the keys. Understanding the Problem The given problem is to find the addition of values in the given record so here we will be using the nested dictionary as a record. And we will implement the code using Python. And the nested dictionaries are the dictionary inside the dictionary. And we have ... Read More

Advertisements