Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • Simple C++ Hello World Tutorial – Linux Hint

    C++ is a flexible, general-purpose programming language that was originally created in 1985 by Bjarne Stroustrup, a Danish computer scientist. Today, C++ is considered to be one of the most powerful languages used for software development.
    C++ is used in various domains, such as embedded software, real-time operating systems, game development, and finance, and because it supports both procedural and object-oriented programming styles, it is both strong and versatile.

    In this article, we are going to discuss the basic structure of a C++ program and show you how to write a simple “Hello World” program.

  • Best C++ Editors [Ed: Not recommended as 40% of those are Microsoft]

    Computer Science is one of the hottest prospects these days. With the world around us relying heavily on technology, this comes off as no surprise as everything is gradually becoming digitized and the demand for people skilled in this field keeps on increasing. The Internet has also exploded in the last couple of years and this has in turn led to an increase in the market for computers and devices related to it.

    However, the beauty of Computer Science isn’t only in its high success in the industry but also in how it is structured. It offers the best blend of mathematics and engineering, along with providing a platform where programmers can create and develop things simple with just a computer, similar to how an artist does with a paintbrush. Since Computer Science itself is composed of multiple subfields, there have been various programming languages developed each of which has been specifically designed for certain tasks. One such programming language that is immensely popular and lies at the crux of game development, animations, and operating systems is C++ which shall also be the topic of our discussion in this article where we would be looking at the best editors that are available for C++ programming.

  • How to Read and Write to a File in C++

    In this article, we are going to show you how to read and write to a file in the C++ programming language by using several examples. To understand C++ file operations like read and write, we must first understand the concept of a stream in C++.

  • Convert XML to Associative Array in PHP – Linux Hint

    XML (Extensible Markup Language) is one type of markup language that is used to store the data in a human-readable format. It is different from other markup languages. Every tag of this language is user-defined. Using XML is the better solution to store a small amount of data when you don’t want to use any database for storing data. The data from the XML document can be easily accessed and used in any web application using a PHP script. How the XML document can be parsed and stored into an associative array is shown in this tutorial.

  • Hidden Tuples | Adam Young’s Web Log

    If you are going to write a Sudoku solver, write a brute force, depth first search. You can get it running fast enough.

    But what if you couldn’t? What if the puzzles were so big that solving them by brute force was not computationally feasible? A Sudoku puzzle is build on a basis of 3: The Blocks are 3X3, there are 3X 3 of them in the puzzle, and the rows and columns are are 9 cells (3 * 3) long. This approach scales up. If you were to do a basis of 4, you could use the Hexadecimal digits, and have 16 X 16 puzzles.

    A Basis of K leads to a puzzle size of (K^4). The basis can be any integer. A Basis of 10 would lead to a puzzle size of 1000.

    [...]

    The digits_out removal is, I think, ineffectual. I convinced myself that I needed it when I wrote it, but I am fairly certain that the cells out side of the found list will never contain those numbers.

    I am not certain if it makes sense to run this algorithm unless it is coupled with other techniques that make use of the small reductions found by it to do larger reductions on the whole board.

    If we go back to our Sudoku puzzles with basis > 3, the tuples found by this technique can be larger than 4. I suspect that there is a relationship of the the nature Basis+1. Thus, for our basis of 10, we probably could expect to find matches with a tuple size of 11, slightly greater than one in ten cells in a house.

    But this algorithm is expensive. The tuple map grows with the number of elements on the board. I’ve not calculated the growth, but I suspect it is of the nature of n^2. Still that should be better than N! or exponential.

  • 3 Free Books to Learn Dart - LinuxLinks

    Dart is a client-optimized programming language for fast apps on multiple platforms. Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web.

    Dart is a multi-paradigm, object-oriented, class defined, garbage-collected, scripting language using a C-style syntax that transcompiles optionally into JavaScript. It supports interfaces, mixins, abstract classes, reified generics, static typing, and a sound type system.

    Dart is developed by Google and is used to build mobile, desktop, backend and web applications.

    The language is published under the BSD license.

    There are very few free books about programming in Dart.

  • Learning meson · Martin Pitt

    Last Friday at Red Hat the fourth Day of Learning happened. This time I picked the meson build system. More and more projects have switched to it, like systemd more than 3 years ago, or most of GNOME. Back then I was really impressed by how much faster a systemd build became with meson – but now I actually want to learn it, peek behind the curtain, be able to contribute to projects that use it, and to know if a conversion makes sense.

    Also, I have been sponsoring Jussi’s Debian meson package uploads for years now, it’s really time to understand what exactly I am uploading there!

  • Nibble Stew: Proposal for target-private directories for compilers

    One of the greatest strengths of the classical C compiler model is that all compile jobs are fully isolated. This means that they can be run perfectly in parallel. This same feature is also one of its greatest weaknesses. There are no ways for individual compile jobs to communicate with each other even if they wanted to. This could be useful for things like caching. As an example a compiler might transparently create "precompiled headers" of sorts during one compilation and use them in other compilations if needed. This might also be useful for languages that require scanning steps before building such as Fortran and C++ using modules.

    [...]

    Meson and CMake already to pretty much exactly this as they store object files in special directories. I don't know enough about Autotools to know how much work it would be, though it does have the concept of higher level build targts. Handwritten Makefiles would need to be tweaked by hand as with every change. Visual Studio solutions are already split up to per-target project files so adding new flags there should be fairly simple.

    The best part is that this change would be fully backwards compatible. If the private dir argument is not used, the compilers would behave in exactly the same way they do now.

  • Dependency Injection in Java | Adam Young’s Web Log

    You might be thinking that this is a long solved problem. I think I have something a little bit different.

    This is very similar to the C++ based one that I wrote long ago.

    There are several design decisions in this approach that I would like to make explicit.

  • Python Filter Function – Linux Hint

    The filter is a built-in Python function. It filters the specified sequence or iterable through a function that checks each item or element in the iterable to be true or false. To put it simply, the filter function filters the iterable through a function. The given function test each item of the sequence or iterable and returns the true if the item satisfied the given criteria. As a result, the filter() function constructs a new iterator. The most commonly used iterable are lists, tuples, and dictionaries. This article briefly describes the filter() function with the help of examples.

    [...]

    The filter() is a Python built-in function that is used to filter the iterable on a given function. This article explains the filter() function with examples.

  • Weekly Python StackOverflow Report: (ccxlix) stackoverflow python report
  • User Authentication · Matt Layman

    In the previous Understand Django article, we learned about the structure of a Django application and how apps are the core components of a Django project. In this article, we’re going to dig into Django’s built-in user authentication system. We’ll see how Django makes your life easier by giving you tools to help your web application interact with the users of your site.

  • Perl Weekly Challenge 85: Triplet Sum and Power of Two Integers | laurent_r [blogs.perl.org]

    These are some answers to the Week 85 of the Perl Weekly Challenge organized by Mohammad S. Anwar.

This perpetual calendar displays the date, month, and day

  • Arduino Blog » This perpetual calendar displays the date, month, and day using cryptic rings

    Earlier this year we covered an automated perpetual calendar, which used three ring gears to align the date, month, and day of the week with a viewing window. After building one of these devices, Wolfspaw was inspired to create a new “spin” on it by combining it with a linear Cryptic Calendar, featuring digits that only make sense in the viewing window.

    The resulting project looks like a few rings inscribed with alien symbols, until each is rotated in place. This frames the numerical date, as well as abbreviated month and day so that they can be read.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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.