Working with web applications often requires parsing some HTML tables to extract the content in the appropriate format, most often in JSON format which is better for storage, transfer, or API communication. One of the most popular formats used for data exchange is JSON, mainly due to its lightweight nature and ease of integration on the front and back end. This article highlights different methods for making a JSON representation of an HTML table in JavaScript. Approaches to Convert HTML Table to JSON Using JavaScript’s querySelector and loops. Using forEach ... Read More
In this article, we will go over a Java program that counts the number of child nodes of the root node in a JTree using Java. This program uses the getChildCount() method to retrieve and display the count of direct child nodes under the root. This is helpful for applications involving hierarchical structures, like directories or organizational charts. Steps to count the child of the root node in a JTree Following are the steps to count the child of the root node in a JTree −Import the necessary classes JFrame, JTree, and DefaultMutableTreeNode from java.swing package.Create a main class named SwingDemo.Define the ... Read More
This article will teach us to convert a string into a numeric primitive type using Integer.valueOf() in Java. By the end, you’ll see how this method takes a string of numbers and transforms it into an integer type, making it usable for arithmetic operations or any other number-based logic. Problem Statement Write a Java program to convert a numeric string to an integer using the Integer.valueOf() method and display the result. Below is a demostration of the same − Input str = "989" Output 989 Steps to convert a string into a numeric primitive type Following are the steps to convert a ... Read More
Mean, Median, and Mode are key statistical measures that help in describing a dataset's central tendency and distribution. These quantities help in understanding the central tendency and distribution of the given data. In this article, we will learn how to find the Mean if the Median and Mode of a given array are known in C++. Problem Statement We are given an array of numbers, and we need to find the mean if the median and mode are provided in C++. Example Input: [5, 15, 25, 35, 35, 40, ... Read More
In this article, we'll learn how to check whether the entered value is ASCII 7-bit alphabetic lowercase in Java. In ASCII, the lowercase alphabets begin with the character ‘a’ and end with ‘z’. We will write a program checking whether a character is a lowercase alphabetic character using a simple if-else statement. Problem Statement We are given a character, and we need to create a Java program that checks whether the character is a lowercase letter in the ASCII 7-bit range, meaning it falls between 'a' and 'z'. We will also check if the character is uppercase, meaning ... Read More
In this article, we will learn how to create BigDecimal values in Java using strings. The BigDecimal class provides a way to handle large or precise numbers, making it useful for high-precision arithmetic. By creating BigDecimal objects from strings, we make sure that the exact number is represented without any loss of precision. Problem Statement Given two large decimal values as strings, write a Java program to create BigDecimal objects and perform addition and multiplication on them.Input Value 1: "37578975.8768"Value 2: "62567878.9768"Output Value1 : 37578975.8768 Value 2 : 62567878.9768 Addition Operation = 100146854.8536 Multiplication Operation = 6265976294387200.48179648 Steps to ... Read More
A palindrome is a word, phrase, number, or other sequence of characters that reads the same from both backward and forward sides. In strings, the palindrome strings are those strings that can be read the same from both left and right sides. In this article, we are going to learn how we can check if a given string is palindrome or not using the two-pointer technique in C++. Problem We are given a string, and we have to check if it is palindrome or not using the two-pointer method in C++. Example 1 ... Read More
Mean, Median, and Mode are fundamental statistical measures that are used to describe the central tendency and also explain the spread of the sheet. These three measures help in understanding the overall distribution of the data. In this article, we are going to learn how to find the Median if we are given the Mean and Mode of an array in C++. Problem Statement We are given an array of numbers, and we need to calculate the Median, in case when Mean and Mode of an array are given in C++. Example Input [5, 15, 25, 35, ... Read More
The read and write operations on a file can be done by using specific commands. The module required to perform these operations must be imported first. The required module is 'fs', which is called the File System module in Node.js Write Operation on a File After the File System file is imported then, the writeFile() operation is called. The writeFile() method is used to write into the file in JavaScript. Syntax writeFile(path, inputData, callBackFunc) Parameters The writeFile() function accepts three parameters as mentioned below. Path: The first parameter is the path of ... Read More
Introduction Monitoring CPU temperature on a Linux system is essential for maintaining optimal performance and preventing hardware damage. The CPU (central processing unit) is the brain of your computer, and it generates heat as it processes data. Over time, this heat can cause your CPU to slow down or even fail altogether. By monitoring your CPU temperature, you can identify potential issues before they cause permanent damage to your system. Understanding CPU Temperature on Linux CPU temperature is a measure of how hot the processor is running and is an important metric for computer performance. The faster a processor works, ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP