Found 34484 Articles for Programming

Performance of 2-Level Paging

Way2Class
Updated on 19-Jul-2023 17:02:56

543 Views

A two-level paging system, sometimes known as hierarchical paging, is a way to translate virtual addresses to physical addresses in a computer system with a lot of physical memory. The page table is split into two sections in a two-level paging scheme: a top-level page table and a bottom-level page table. Pointers to the bottom-level page tables are present in the top-level page table. A piece of the virtual address space is mapped to a component of the physical address space in each bottom-level page table. The processor initially utilizes the page number to index into the top-level page table ... Read More

Using Guava's Collectors for Collecting Streams to Immutable Collections in Java

Siva Sai
Updated on 19-Jul-2023 18:17:01

85 Views

In the world of Java programming, Google's open-source Guava library introduces powerful utilities that bolster the Java developer's toolkit. Among these, Guava's Collectors bring a unique enhancement, enabling a seamless transition of data from streams to immutable collections. This article provides a detailed guide on leveraging Guava's Collectors for collecting streams into immutable collections in Java. The Power of Immutable Collections Immutable objects have a fixed state after their creation, which means they cannot be modified. This property brings a host of benefits, including simplicity, thread-safety, and the guarantee that they will always remain in a consistent state. Java's core ... Read More

Performance metrics for mutual exclusion Algorithm

Way2Class
Updated on 19-Jul-2023 17:01:39

412 Views

Mutual exclusion is a program object that relates to the condition that no two concurrent processes be in the same crucial region at the same time. It is offered to prevent the race condition from occurring. If a current process is accessing the crucial part, it prohibits another concurrent process from entering there. In a nutshell, only one process is authorized to perform the vital part at any one moment. What are performance metrics for mutual exclusion? Programming object mutual exclusion describes the need that no two concurrent processes take place in a crucial region at the same time. It ... Read More

Using Above Below Primitive to Test Whether Two Lines Intersect in Java

Siva Sai
Updated on 19-Jul-2023 18:11:57

67 Views

Geometrical computations play an essential role in various domains of computer science such as computer graphics, gaming, and computational geometry. Among the myriad of geometric operations, determining whether two lines intersect is a fundamental problem. In this article, we'll take an in-depth look at how to test if two lines intersect using the above/below primitive method in Java Understanding the Concept The above/below primitive is a fundamental concept in computational geometry. It helps determine whether a point lies above, below, or on a line. To assess whether two lines intersect in the two-dimensional plane, one needs to check if the ... Read More

Java Program to sort a HashMap by Keys and Values

Way2Class
Updated on 19-Jul-2023 17:46:54

294 Views

HashMap, a frequently employed data structure in the Java programming language, enables programmers to store key-value pairs. This data structure is an exceedingly efficient method for storing data and allows for swift value retrieval based on keys. However, on occasion, it may become necessary to arrange the HashMap by its keys or values. In this article, we will delve into the procedures for sorting a HashMap in Java by its keys and values, as well as examine the performance implications associated with each technique. Time complexity and HashMap The time complexity of the above technique for sorting a HashMap by ... Read More

Java Program to store Unicode characters using Character Literals

Way2Class
Updated on 19-Jul-2023 17:45:26

2K+ Views

Unicode is an international character set that encompasses a vast range of characters, symbols, and scripts from many languages across the globe. Java programming language, being platform-independent, has built-in support for Unicode characters, allowing developers to create applications that can work seamlessly with diverse languages and scripts. In Java, the char data type is used to store Unicode characters, and character literals are used to represent these characters in the source code. A character literal is a single Unicode character enclosed in single quotes (' ') and can be assigned directly to a char variable. Algorithm Step 1 ... Read More

Understanding actionPerformed and ActionListener

Siva Sai
Updated on 19-Jul-2023 21:50:06

354 Views

In the realm of Java programming, the actionPerformed method is a central aspect of handling event-driven programming concepts. It is part of the ActionListener interface and helps manage user interactions with GUI components. In this article, we will explore how to utilize the actionPerformed method from another Java class, enhancing the modularity and readability of your code. Understanding actionPerformed and ActionListener Before we proceed, let's delve into what action Performed and Action Listener are. The Action Listener interface is part of the java.awt.event package. It includes the action Performed method, which is triggered when an action event occurs, such as ... Read More

Generate square or circular thumbnail image with Python - Pillow

Amrinder Singh
Updated on 19-Jul-2023 16:16:13

610 Views

Thumbnail images are commonly used in a variety of applications to present photos in a compact and visually appealing manner. They enable users to navigate through a huge number of photographs fast and effortlessly since they are compact, compressed images that faithfully depict the original image. Python is popular for manipulation and processing of images. A well-known Python library for working with images is the Python Imaging Library (PIL), now called Pillow that offers a large number of tools for carrying out various image-processing operations, such as cropping, resizing, and applying filters. Approaches ... Read More

Clean Web Scraping Data Using clean-text in Python

Prince Yadav
Updated on 19-Jul-2023 14:46:34

1K+ Views

Web scraping has evolved as an effective method for obtaining information from websites. It allows individuals and organizations to collect information for a variety of objectives, including market research, sentiment analysis, and data−driven decision−making. However, online scraping frequently produces unstructured and jumbled data that must be cleaned and preprocessed before it can be used efficiently. The clean−text module in Python provides a complete and efficient solution for cleaning web scraping data, allowing users to preprocess and extract important insights from their scraped data. Clean−text is a robust Python package for text cleaning and preprocessing. It includes a variety of functions ... Read More

Classification of text documents using sparse features in Python Scikit Learn

Prince Yadav
Updated on 19-Jul-2023 14:44:38

119 Views

In today's digital age, efficiently categorizing text documents has become crucial. One approach to this is using sparse features in Python's Scikit−Learn library. Sparse features involve representing each document as a high−dimensional vector, with each dimension corresponding to a unique word in the corpus. In this article, we'll explore the theory and implementation of text classification using sparse features in Scikit−Learn. You'll gain practical skills in data preprocessing, feature extraction, model selection, and evaluation. Whether you're a researcher, data scientist, or developer, this article will provide valuable insights into text classification using Python. Getting Started Sparse feature representation is a ... Read More

Advertisements