Language Selection

English French German Italian Portuguese Spanish

Programming/Development Leftovers

Filed under
Development

Perl

Java

  • Basic Datatypes in Java

    A data type in a programming language is an attribute that instructs the computer on how to interpret the value given to the data. Datatypes can be classified into various categories on the basis of the value they store. Datatypes in Java are generally categorized into the following types.

  • Binary Search in Java

    Searching an array for the position of a value, and sorting the array, are two different processes. Searching means verifying if a value called the key, is found in the array. Sorting means putting all the values in the array in a particular order (ascending or descending). If an array is not sorted and searching is required, then the program has to start from index zero, then to index 1, then index 2, and so on, until it reaches the index of the value it is looking for. If the value occurs more than once, the first index should be returned.

    If the array is sorted first, say in ascending order, then searching becomes easy. The index is either less than the index for the middle element, if the key is less than the value of the middle index, or the index is equal to or greater than that of the middle index, if the value is equal to or greater than that of the middle index value.

    So just split the array into two. If the value lies on the left side, no need to waste time searching the right side; just search the left side. If the value lies on the right side, no need to waste time searching the left side; just search the right side. Since the array is already sorted completely, when either side is arrived at, it is split again into two, and only one of the new pairs of sides is searched. In fact, searching this way is just by splitting into two, until the index of the value is arrived at. No actual search in terms of scanning takes place because the array is already sorted. There may be some slight moving right, and some slight moving left in the array during the search.

    Binary implies, two. And so this kind of searching is called binary searching. There are different sorting orders: All the values in the array can be sorted in ascending order or descending order completely. An array can also be sorted in what is known as Binary Search Tree format. This is not complete sorting in ascending or descending order. However, the binary algorithm search still works with this format.

    This article explains Java Binary Search. Binary search algorithm in Java works on an array that is already sorted. Only complete sorting in ascending order is considered in this article. This article begins with illustration of the binary search algorithm. It then goes on to explain how to use the binarySearch() methods of the Java Arrays class.

  • Booleans in Java explained

    The datatypes in Java are categorized into two broader categories. One is primitive and the other is the non-primitive data type. Boolean belongs to the primitive data type of Java. Java Boolean variable takes either true or false value, and thus a Boolean variable or expression plays a vital role in decision making for programmers. This article provides an informative guide about Java Boolean and Java expression.

  • Bubble Sort with Java

    Bubble sort is the simplest sorting algorithm: Assume that there are elements in a row that are not sorted. Bubble sort scans the row from the left, swapping any adjacent pair of elements that are not in the correct order. This scanning of the whole row is repeated repeatedly until the whole row is sorted. If the sorting is to be ascending, then the adjacent pair is swapped to make the element on the left less than the element on the right. If the sorting is to be descending, then the adjacent pair is swapped to make the element on the left greater than the element on the right.

  • How to Set Path in Java

    Java is a renowned object-oriented programming language that is used to build multiple software. Due to its numerous advantages, it has become a popular choice for programmers and developers. There are multiple crucial things that should be kept in mind while coding in Java; setting a path is one of them.
    After installing a java platform you need to set a path for the operating system to find JDK packages and convert the source code into an executable code.

    Note: If your java files are being saved inside the JDK/bin folder then there is no need to set the path because the required tools such as java, javac will lie inside the active directory.

  • Operator’s precedence in java

    There are several Java operators that handle operations such as addition, subtraction, division, comparison, and much more. All these operations are assisted by several operators. The operators are applied to operands and they form an expression.

    An expression may contain one or multiple operators. In the case of multiple operators, the operators that have higher precedence will be solved first and then other operators are evaluated based on the precedence order. Thus, the precedence of the order must be known when you are working on expressions that contain multiple operators. This article provides a descriptive guide on operators’ precedence in Java.

Misc.

  • Nibble Stew: Converting Godot game engine to Meson, how you can help

    Note that if you encounter bugs, please do not file them against the upstream project unless you have verified that they also occur with a regular SCons build.

    Currently it compiles and runs for me on Linux, Windows and macOS, but the more people can verify it the better.

    It would be especially useful if people could test it on Android. FWICT the original uses Android Studio for the Java bits and somehow uses SCons to build a shared library that is used. The Meson build does build the shared lib, but it has not been tested. If someone with Android dev experience could set up and test the whole pipeline it would be great.

    The same goes for iOS, though I know even less how it should be set up as I have not really done iOS development. It should build for iOS (there is a cross file in the repo) but FWICT it has never been tested beyond that.

  • The Curious Case of the Responsible Process

    As of some of you might remember, Mac OS X Mountain Lion (10.8) added a new Privacy tab to the Security & Privacy pane of System Preferences.

  • Qt 6.3 Beta Released

    We have released the first Qt 6.3 Beta today. During the beta phase we provide multiple subsequent beta releases via the online installer. Target is to finalize Qt 6.3 based on the feedback received during the beta phase and release the Qt 6.3.0 at the end of March.

    Qt 6.3 brings multiple new features and improvements, as well as adds two new modules compared to Qt 6.2. For more information about the Qt 6.3 release, please check out the overview of the most important changes in Qt 6.3. We have already blogged about some of the new items coming with Qt 6.3 and will be publishing more posts in this blog around Qt 6.3 in the weeks to come.

    After the first beta released today, we will push out multiple new beta releases using the online installer. With this approach, it is easy for users to test the new features and provide feedback. We are not planning to publish separate blog posts for the subsequent beta releases and release candidate(s). In addition to binaries, source packages of each beta release are also available for those who prefer to build themselves.

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.