Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • An introduction to regular expressions

    If you're new to the world of Linux administration and open source software, you've probably only just started scratching the surface of the power this new world offers. Eventually, however, you'll start mining deeper depths. When that fateful moment arrives, chances are you're going to need to use a regular expression or two.

    [...]

    What does that bit of cryptic nonsense mean? Well, it's actually not nonsense. The above regular expression searches for a string of characters (/^ marks the beginning of the string and $/ marks the end), between three and 16 characters, that includes lowercase letters, the numbers 0-9, or an underscore or hyphen.

    Every regular expression has meaning and use. Although they might seem a bit complicated for new users, it's important to understand how they work.

  • Jussi Pakkanen: Do humans or compilers produce faster code?

    Modern optimizing compilers are truly amazing. They have tons and tons of tricks to make even crappy code run incredibly fast. Faster than most people could write by hand. This has lead some people to claim that program optimization is something that can be left to compilers, as they seem to be a lot better at it. This usually sparks a reply from people on the other end of the spectrum that say that they can write faster code by hand than any compiler which makes compilers mostly worthless when performance actually matters.

    In a way both of these viewpoints are correct. In another way they are both wrong. To see how, let's split this issue into two parts.

  • Payload, singleton, and stride lengths

    Once again I’m inventing terms for useful distinctions that programmers need to make and sometimes get confused about because they lack precise language.

    The motivation today is some issues that came up while I was trying to refactor some data representations to reduce reposurgeon’s working set. I realized that there are no fewer than three different things we can mean by the “length” of a structure in a language like C, Go, or Rust – and no terms to distinguish these senses.

    Before reading these definitions, you might to do a quick read through The Lost Art of Structure Packing.

    The first definition is payload length. That is the sum of the lengths of all the data fields in the structure.

  • How many function arguments?

    In Haskell (and many other functional languages) it's quite common for the implementation of a function to reference one less argument than the type signature declares:

    g :: foo -> bar
    g = length . reverse
    Known as point-free style by proponents (and pointless style by opponents), the function definition is a list of other functions which are composed together to produce a composite requiring a single argument: the missing one.

  • The Decline of Usability

    Designing UI:s is hard and application software can't please everyone all the time!

    This is true and, as a software developer of more than 20 years, I have a huge amount of respect for the complexity of UI design. I also happen to know that such complexity is not a valid excuse for willingly and knowingly breaking UI concepts that have been proven and working for, in some cases, more than four decades. In fact, a lot of the examples above introduce more complexity for the user to cope with. The intricacies of each application and window decoration must be learned separately and time and energy is spent by repeatedly parsing the differences.

  • lowdown — simple markdown translator

    lowdown is a Markdown translator producing HTML5, roff documents in the ms and man formats, and terminal output. The open source C source code has no dependencies.

    The tools are documented in lowdown(1) and lowdown-diff(1), the language in lowdown(5), and the library interface in lowdown(3).

  • IoT Adoption: Before and After COVID-19

    The survey data I’m referring to comes from a study conducted by the Eclipse Foundation about the adoption of commercial Internet of Things (IoT) technology. The aim of the study was to get a better understanding of the IoT industry landscape by identifying the requirements, priorities, and challenges faced by organizations deploying and using commercial IoT technologies. More than 350 respondents from multiple industries responded, with about a quarter of respondents coming from industrial production businesses.

  • Google's cross-platform UI toolkit has a Flutter on 'social development' with CodePen

    "Social development environment" CodePen has unfurled support for Flutter, Google's open-source cross-platform framework for mobile and web.

    CodePen is an online editor for HTML, CSS and JavaScript, intended for sharing design ideas, getting help with bugs, prototyping, or forming an online portfolio. A CodePen file is called a Pen, and is public by default. A Pen is limited to 1MB of code, but you can also create multi-file projects. Free users are limited to Pens, or one project with up to 10 files. Paying users get the option to mark their work as private, do collaborative editing, and eliminate ads. You can also use CodePen for deploying projects to production websites, though it is really optimised for demos and experiments.

  • The Cost of no Architecture

    Back in 2013, QNX might have been a good choice compared to Linux. Today, with Yocto and similar tools for developing embedded Linux systems, it feels like an odd choice to add a license cost to such a device. But no biggie. Back in the day this was not an unreasonable choice (and still isn’t for certain applications).

    The Flash stuff. There were alternatives back in 2013, but sure, there were plenty of developers at hand and things like Qt QML was still probably a bit clunky (I can’t recall the state of it back then – it required OpenGL ES, which I guess was a big ask back then).

    But the mix of techniques and tools. The on-board web servers. The complexity of a small system and the costs it brings to maintenance and testability. If this is the foundation for Harmony remotes and a platform that has been used for the better past of the past decade, I wonder if the added engineering costs for architecture the platform to be more optimized early on would not have paid off in lower maintenance costs, as well as lower hardware costs.

  • Rust-Written Redox OS Booting The 128-Thread AMD Ryzen Threadripper 3990X

    The Rust language focused Redox OS open-source operating system is now able to boot the AMD Ryzen Threadripper 3990X 64-core/128-thread processor and run with full multi-threading capabilities.

    While one of the fundamentals of the Rust programming language is on offering safe concurrency, Redox OS itself had a multi-core issue until this week when it was sorted out by lead Redox OS developer (and System76 engineer) Jeremy Soller.

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.