Programming Leftovers
Qt and WebAssembly
-
Qt 6.3.2 Released
I am happy to announce we have released the Qt 6.3.2 today.
The Qt 6.3.2 will be the last release from Qt 6.3 series. As a patch release Qt 6.3.2 does not add any new functionality but It contains more than 330 bug fixes, security updates and other improvements to the top of Qt 6.3.1 release. See more information about the most important changes and bug fixes from the Qt 6.3.2 release note.
-
Qt WebAssembly Q-A, Part 1
WebAssembly is a bytecode representation that is meant to be targeted by high-level programming languages such as C++ and to be executed inside a virtual machine in a browser. It will change the way you design your embedded devices, applications, and other software. Qt for WebAssembly allows you to run your C++ applications on popular web browsers, such as Google Chrome and Mozilla Firefox – and our efforts to support more browsers are continuous.
Perl / Raku
-
Saving Perl packages through local
In Perl there is an expression local. It substitutes the specified value with undef until the end of the block. The values can be global hashes, arrays and scalars, as well as elements or slices of hashes and scalars. The problem is that package hashes are not saved by local. By package hashes I mean a hash with a colon at the end (%Package::) which stores the package symbols (GLOB).
Java
-
Java File Input Stream in Ubuntu 20.04
“In this article, we will be discussing different ways to read data from files into a byte array by using the Java Input Stream class. This class represents a sorted stream of bytes from a file. There are multiple functions in the Java Input Stream class that are commonly used and will be discussed in this article, like the read(), available(), skip(), and close() methods. These methods are used to read files of different extensions like bin or txt files and can be altered to get information from any point in the file. We will be implementing these methods in the Ubuntu 20.04 environment in this article.
There are many more methods of File Input Stream class which are also very helpful in getting data from a file; some of them are int read(byte[] b), this function reads data from the input stream up to b.length bytes in length. File Channel gets the channel(): The specific File Channel object connected to the file input stream is returned using it. Finalize() is used to ensure that the close() function is invoked when there is no longer reference to the file input stream.”
-
Java File List Files in Ubuntu 22.04
“In this article, we will be focusing on the list files function in the File class in the Java programming language. The list files function returns the name of the files in the form of an array and is usually called in the File[] data type variable. The files class object is used for getting the directory name for the list files function so that it knows where to look for the files. We will be implementing several examples of this function in our article.”
-
Java ObjectInputStream
“Information written via the object of an ObjectOutputStream is primarily accessed using the ObjectInputStream class. The main objective of the ObjectInputStream class would be to reconstruct the basic data and entities that are produced by employing ObjectOutputStream class. By making use of a SocketStream, ObjectInputStream may also be employed to transfer objects across different hosts. Therefore, we have decided to write a helpful guide for our Ubuntu 20.04 system to cast off the objectinputstream class object to read data from the file input stream. Let’s start with the opening of a console.”
-
Java ReadFields
“To read objects that have previously been written by ObjectOutputStream, we use the ObjectInputStream class of the java.io package and the java.io.ObjectOutputStream package that has the readFields() function. The persistent fields are read from the stream and made available by name using the java.io.ObjectInputStream.readFields() function. The Readfields() function is a non-static function that can only be accessed through the class object; if we attempt to get the method directly by class name, we will encounter an error. When reading fields, the readFields() function may raise an exception.”
-
PrintWriter Class
“This class offers text-output stream object representations that are formatted for printing. It uses every print technique available in PrintStream. It lacks ways for writing unencoded byte streams, which a program should utilize instead of writing raw bytes. Unlike the PrintStream class, which does automatic flushing anytime a newline character is output, this class only performs flushing whenever the println, printf, or format operations are called. These techniques substitute the platform’s internal line separator with the newline character.
Despite several of its constructors being capable of doing so, this class’s methods never throw I/O exceptions. The client can verify if any errors have been encountered by using the checkError() call.”
Python
-
Pandas Dataframe Unique
The most popular Python library which is utilized in data science is called Pandas. It offers Python programmers high-performance, user-friendly, and data analysis tools. Once you understand the fundamental functions and how to utilize them, Pandas is a potent tool for altering data. In “pandas” the standard methods for storing data in a tabular form are the DataFrames. We can utilize some “pandas” methods for getting the unique values in the “pandas” DataFrame’s column. When we need to get unique values in the DataFrame’s columns and don’t want duplication of values in the “pandas” DataFrame’s column, we can use the methods that “pandas” provides for doing this. Let’s look at such methods in this guide, along with some examples and output to get unique values in the DataFrame’s column of “pandas”.
-
Pandas DatetimeIndex
Pandas contribute to one of the rapid, adaptable packages which is popularly used as a machine learning tool that honors to be an open-source package by python. It is being built after Numpy for making the data import, analysis, and cleaning much easier.
Pandas’ dataframe datetime column contains all the information of the specific recorded data in years, months, dates & times (in hours, minutes & seconds). DatetimeIndex is the method that converts this datetime column into an index column and attributes the output date as an index in the dataframe. It also allows access or analyze the data at that specific date, year, month, and time (in hours, minutes, and seconds) or range of dates for further operations instead of going through all the dataframe. In this article, we’ll get to know how we can convert the datetime column of the dataframe (pandas) into an index column using the python programming language or python script.
-
Pandas Display Max Rows
Pandas are among the most popular tools used today by data scientists to analyze tabular data. To deal with tabular content, it offers a quicker and more effective API. Whenever we view data frames during analysis, Pandas automatically sets various display behaviors to default values. These display behaviors include how many rows and columns to show, the accuracy of floats in each data frame, column sizes, etc. Depending on the requirements, we may occasionally need to modify these defaults. Pandas have a variety of approaches for altering default behavior. Leveraging the “options” attribute of pandas enabled us to change this behavior.
-
Pandas Insert Row
“A Python framework for working with data frames is called Pandas. It may be used for a variety of purposes, including reading, exporting CSV files, and converting NumPy arrays to dataFrames. Three parameters make up the Pandas dataFrame. DataFrames are quite helpful since they offer a simple way to print a table view and then modify it as needed. You might need to establish a new data frame and add rows selectively when using the dataFrame for data analysis to generate a data frame with particular records.
Unless you assign names to each row, the index will be the integer starting at zero for the associated row. Additionally, it is simple to refer to a column by its name, such as “Data,” or by its location within the DataFrame.”
-
Pandas Insert() Column
“Python provides a wide range of data structures and operations for handling numerical and time series data. The DataFrame we have created or imported in Pandas can be used for a variety of purposes. The columns in the data frame can also be adjusted, along with the data source. Pandas make many of the tedious, time-consuming tasks associated with working the data simple. There are four ways to add a column to a DataFrame in Pandas, but in this article, we are using the panda’s column “insert()” function.
Once we have built or loaded our dataFrame in Pandas, there are a variety of things we could want to accomplish. For example, we might keep manipulating data, for instance, by changing the columns in the data frame. Next, we must understand how to include columns in a data frame If the majority of the data are coming from one data provider, but some data are coming from another. A column can be easily added to a Pandas dataFrame.”
-
Pandas isna
“Pandas is one of the packages of python language that makes the data analysis much better and easier to go on with. In the domain of computer science, analyzing the data and preprocessing is almost at every step, and in which the missing data is a whole lot time-consuming and crucial process to do. So, here comes the “pandas isna,” which is a function that is used to detect the missing values from the data. It works in a way that returns a boolean similar size object, which indicates the values in the given data are “NA”, which means none, and the characters such as strings that are empty declared.
The missing values show as the “nan” or “none,” as explained. Pandas isna method does not have any parameters involved. The return type is a dataframe with a boolean. The “NaN” indicates the “true” values. Otherwise, every other data is mapped as “false”. For the implementation of the codes, we will be using the tool “spyder,” which is in infused “python” language. The pandas isna is a new object of panda whose input object is of the same size.”