Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development

Misc.

  • Qt 5.15 Extended Support for subscription license holders

    For certain products with life cycles calculated in decades, Qt Extended Support can provide good insurance over the course of its life. Qt will offer an additional year of free Qt 5.15 LTS Extended Support for customers with a valid Qt for Application Development Enterprise, Qt for Device Creation Professional, or Qt for Device Creation Enterprise subscription license.

  • How to use libportal/libportal-qt – Jan Grulich

    There was a blog post from Peter Hutterer about Flatpak portals posted few months back. Peter explained what are portals and how do they work. Portals are used mostly because of security and sandbox/Wayland restrictions. Many times your only way to get access outside (opening a file, sending a notification, sharing a screen, etc.) is to use a portal. For most use-cases applications or developers don’t need to care about them as their support is usually implemented in libraries they use. For example Qt and GTK use portals internally so apps can use still the same APIs as before and they don’t need to worry about their apps not working in sandboxed environments. BUT there are still scenarios where libraries have unsufficient or none portal support, or a different options are desired so what are the options in this case if you still need to use portals?

  • Realloc C

    The concept of the realloc() function in the C programming language will be discussed in this article. To begin with this concept, we must know about the concept of memory allocation and the different functions of allocating memory in C. There are two types of memory allocation in the C programming language: Static memory allocation and Dynamic Memory Allocation.

  • Case Stellantis: One HMI product, 4 unique vehicle brands

    As announced earlier this month, the Qt framework was used to develop Stellantis's newly launched in-vehicle HMI across its iconic portfolio of European car brands. The project kicked off in 2018, and the first vehicles reached their happy new owners in 2021.

  • Understanding the ASCII Table

    The computers normally work by understating the numbers and to translate the numbers into characters a standard is created. This standard has given a specific set digit to each character whether it’s an alphabet or any symbol and the standard is called ASCII standard. Using the ASCII for each character has made communication easy between machines and humans.

    The ASCII is the acronym of the “American Standard Code for Information Interchange” and from the name it can be assumed that it is the code used for interchanging the information from machine to humans or machine to machine.

Java

  • What Is a TreeMap in Java?

    The value of a node in a tree is called the key. A binary tree is a tree, where each node does not have more than two children. A Binary Search Tree (BST) is a tree, where for each node, the right child is greater than or equal to the left child. This leads to the right half of the tree having values generally greater than those of the left half at each level. This means a binary search tree is partially sorted (a type of incomplete sorting). A BST can be kept in an array-like structure, with the root node being the first value.

    A binary tree can be made into different self-balancing trees with different sets of additional conditions, such as the AVL tree and the Red-Black Tree.

    The TreeMap in Java is a red-black tree. However, each node consists of a key and corresponding value (key/value pair) instead of just a key. Each key/value pair would be one element in an array-like structure. This article explains how to use a TreeMap in Java, beginning with a binary search tree, followed by the red-black tree, and then the Java TreeMap.

  • Stack and Queue in Java

    This article explains stack and queue in Java, beginning with the stack class. Stack is LIFO and Queue is FIFO – see details below.

  • Priority Queue in Java

    Assume that you offer service to three different people standing in front of you. The third person happens to be your friend. The service is supposed to be first-come_first-served. With first-come_first-served, the first person has the greatest priority; the second person has the greater priority; the third person, the lesser priority, and so on. You will not be punished, if you do not observe first-come_first-served. You decided to serve your friend first, then the first person, followed by the second person. This means you gave your friend the greatest priority. Looking at the scenario from the point of view of a robot, the third position had the greatest priority.

    The next day, the same three people came. This time, your friend is in the middle. You decided to serve him first, ahead of the person who came first, then the third person, and finally, the first person. So, this time, according to the robot, position 2 has the greatest priority, followed by position 3.

    On the third day, your friend is first, and you do first-come_first-served. The conclusion by anybody, and the robot, is that priority depends on who is concerned and by the position of each person. Note: in real life, priority does not always depend on first-come_first-served.

  • Pair Class for Java and Not for JavaFX

    Each line is a pair of key/value. The name of a fruit is the key, and its color is its value. It is possible to have another list where the keys are numbers or the values are numbers, or both keys and values are numbers. In the above list, the keys are strings and the values are strings.

    JavaFX is a Java library that is not installed with Java. It has a class called Pair, to be used for handling pairs. The problem with using the Pair class with Java, is that the programmer still has to install JavaFX onto Java, and learn how to use JavaFX.

  • Java StringBuilder

    A string object, instantiated from the Java String class, is an object that encapsulates a string literal. The problem with the string object in Java is that the literal characters cannot be modified. The StringBuffer class comes to the rescue. The literal for the StringBuffer is mutable. The StringBuffer also has the advantage of being thread-safe (safe for use by multiple threads). However, operations with the StringBuffer can be relatively long. So, there is a simpler form of the StringBuffer class, which is the StringBuilder class. StringBuilder is not thread-safe. The class is in the java.lang.* package, and does not need importation. This article explains the basics of the StringBuilder.

  • Java Collections Sort and Arrays Sort

    ArrayList and the Vector are each examples of a list in Java. There are other types of lists. A Collections class has the sort() method to sort a list in ascending order. It also has the reverseOrder() method, which enables sorting in descending (reverse) order. The reverseOrder method is not used ordinarily. It is used as an argument in one of the overloaded sort() methods. The Collections class is in the java.util.* package, which has to be imported by the programmer to be used.

  • How to Read From a Local File in Java

    A local file is in the hard drive or a flash drive attached to the USB port. Files can be classified into two categories: text files and byte files. Typical text files are files created by a text editor. The image file is an example of a byte file consisting mainly of raw bytes.

    This article gives a basic explanation of how to read local text and byte files in Java. To read a text file, use the class, FileReader. To read a byte file, use the class, FileInputStream. Both classes are in the java.io.* package, which should be imported. The first half of this article deals with reading text files, and the second half deals with the reading of byte files.

More in Tux Machines

digiKam 7.7.0 is released

After three months of active maintenance and another bug triage, the digiKam team is proud to present version 7.7.0 of its open source digital photo manager. See below the list of most important features coming with this release. Read more

Dilution and Misuse of the "Linux" Brand

Samsung, Red Hat to Work on Linux Drivers for Future Tech

The metaverse is expected to uproot system design as we know it, and Samsung is one of many hardware vendors re-imagining data center infrastructure in preparation for a parallel 3D world. Samsung is working on new memory technologies that provide faster bandwidth inside hardware for data to travel between CPUs, storage and other computing resources. The company also announced it was partnering with Red Hat to ensure these technologies have Linux compatibility. Read more

today's howtos

  • How to install go1.19beta on Ubuntu 22.04 – NextGenTips

    In this tutorial, we are going to explore how to install go on Ubuntu 22.04 Golang is an open-source programming language that is easy to learn and use. It is built-in concurrency and has a robust standard library. It is reliable, builds fast, and efficient software that scales fast. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel-type systems enable flexible and modular program constructions. Go compiles quickly to machine code and has the convenience of garbage collection and the power of run-time reflection. In this guide, we are going to learn how to install golang 1.19beta on Ubuntu 22.04. Go 1.19beta1 is not yet released. There is so much work in progress with all the documentation.

  • molecule test: failed to connect to bus in systemd container - openQA bites

    Ansible Molecule is a project to help you test your ansible roles. I’m using molecule for automatically testing the ansible roles of geekoops.

  • How To Install MongoDB on AlmaLinux 9 - idroot

    In this tutorial, we will show you how to install MongoDB on AlmaLinux 9. For those of you who didn’t know, MongoDB is a high-performance, highly scalable document-oriented NoSQL database. Unlike in SQL databases where data is stored in rows and columns inside tables, in MongoDB, data is structured in JSON-like format inside records which are referred to as documents. The open-source attribute of MongoDB as a database software makes it an ideal candidate for almost any database-related project. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the MongoDB NoSQL database on AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux.

  • An introduction (and how-to) to Plugin Loader for the Steam Deck. - Invidious
  • Self-host a Ghost Blog With Traefik

    Ghost is a very popular open-source content management system. Started as an alternative to WordPress and it went on to become an alternative to Substack by focusing on membership and newsletter. The creators of Ghost offer managed Pro hosting but it may not fit everyone's budget. Alternatively, you can self-host it on your own cloud servers. On Linux handbook, we already have a guide on deploying Ghost with Docker in a reverse proxy setup. Instead of Ngnix reverse proxy, you can also use another software called Traefik with Docker. It is a popular open-source cloud-native application proxy, API Gateway, Edge-router, and more. I use Traefik to secure my websites using an SSL certificate obtained from Let's Encrypt. Once deployed, Traefik can automatically manage your certificates and their renewals. In this tutorial, I'll share the necessary steps for deploying a Ghost blog with Docker and Traefik.