Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • How C++ Modify Arrays in Function

    Arrays have been widely known among programmers and developers. We have been using arrays in almost every structural language to object-oriented language. As we know, arrays store more than one value in their indexes, and we also modify the arrays. So, in today’s article, we will be deliberating how to modify the arrays in functions of C++. Start by logging in from the Linux system and launching the terminal with the “Ctrl+Alt+T” shortcut.

  • Digging into Julia's package system [LWN.net]

    We recently looked at some of the changes and new features arriving with the upcoming version 1.7 release of the Julia programming language. The package system provided by the language makes it easier to explore new language versions, while still preserving multiple versions of various parts of the ecosystem. This flexible system takes care of dependency management, both for writing exploratory code in the REPL and for developing projects or libraries.

    [...]

    For a while I've thought that the Plots package needed a particular feature. This morning I cloned the project to my computer, added the feature, made a pull request on GitHub, made a change suggested by one of the maintainers, and got it approved. The entire elapsed time for this process was about five hours. In this section I'll describe two more package system commands that make it easier to hack on public packages.

    In the REPL, I entered package mode, then executed develop Plots. This command, which can be shortened to dev, clones the named package's Git repository to the user's machine in the directory .julia/dev/. Since Plots is a big package with many source files, this took about two minutes.

    This command also alters the environment so that using Plots imports from the version under development, rather than the official version. The command free Plots returns to using the official version. One can switch back and forth between these two incarnations of the package freely, as subsequent dev commands won't download anything, but simply switch back to the development version.

    I entered the development directory and created a branch for my feature with the git checkout ‑b command. The package manager doesn't require this; it's happy to let you mangle the master branch. But I had plans to ask that my feature be merged into master, and needed to create a branch for it. Packages under develop are loaded from the file tree, not from the Git repository.

    Then I wanted to edit the function to add my feature. But where is it? Plots has 37 files in its src tree. Because of multiple dispatch, each function can have dozens of methods associated with it, all with the same name. This makes finding a particular method in the source difficult to accomplish with simple grep commands.

  • A QEMU case study in grappling with software complexity [LWN.net]

    There are many barriers to producing software that is reliable and maintainable over the long term. One of those is software complexity. At the recently concluded 2021 KVM Forum, Paolo Bonzini explored this topic, using QEMU, the open source emulator and virtualizer, as a case study. Drawing on his experience as a maintainer of several QEMU subsystems, he made some concrete suggestions on how to defend against undesirable complexity. Bonzini used QEMU as a running example throughout the talk, hoping to make it easier for future contributors to modify QEMU. However, the lessons he shared are equally applicable to many other projects.

    Why is software complexity even a problem? For one, unsurprisingly, it leads to bugs of all kinds, including security flaws. Code review becomes harder for complex software; it also makes contributing to and maintaining the project more painful. Obviously, none of these are desirable.

    The question that Bonzini aimed to answer is "to what extent can we eliminate complexity?"; to do that he started by distinguishing between "essential" and "accidental" complexity. The notion of these two types of complexity originates from the classic 1987 Fred Brooks paper, "No Silver Bullet". Brooks himself is looking back to Aristotle's notion of essence and accident.

    Essential complexity, as Bonzini put it, is "a property of the problem that a software program is trying to solve". Accidental complexity, instead, is "a property of the program that is solving the problem at hand" (i.e. the difficulties are not inherent to the problem being solved). To explain the concepts further, he identified the problems that QEMU is solving, which constitute the essential complexity of QEMU.

  • Notes from the Git Contributors' Summit 2021, virtual, Oct 19/20
    
    we held our second all-virtual Summit over the past two days. It was the
    traditional unconference style meeting, with topics being proposed and
    voted on right before the introduction round. It was really good to see
    the human faces behind those email addresses.
    
    32 contributors participated, and we spanned the timezones from PST to
    IST. To make that possible, the event took place on two days, from
    1500-1900 UTC, which meant that the attendees from the US West coast had
    to get up really early, while it was past midnight in India at the end.
    
    I would like to thank all participants for accommodating the time, and in
    particular for creating such a friendly, collaborative atmosphere.
    
    A particular shout-out to Jonathan Nieder, Emily Shaffer and Derrick
    Stolee for taking notes. I am going to send out these notes in per-topic
    subthreads, replying to this mail.
    
    
  • Notes from the 2021 Git Contributors' Summit

    For those who are curious about where the development of Git is headed: Johannes Schindelin has posted an extensive set of notes from the just-concluded Git Contributors' Summit.

  • How to find a substring in Python

    Python is a versatile language having many built in methods and libraries. Strings and substrings are an important part of every programming language; python provides different methods to deal with strings and substrings, we check if a python string has a substring for a variety of reasons, but conditional statements are the most typical application. To find substrings in a string, python language provides many predefined methods.

  • How to find the average of a list in Python

    Average (Arithmetic mean) is a mathematical function which is calculated by adding the numeric values in the list and dividing them by the count of numbers of the list. Python provides several built-in mathematical functions; consequently it provides different ways to calculate the average of a list.

  • Ian Jackson: Going to work for the Tor Project

    I have accepted a job with the Tor Project.

    I joined XenSource to work on Xen in late 2007, as XenSource was being acquired by Citrix. So I have been at Citrix for about 14 years. I have really enjoyed working on Xen. There have been a variety of great people. I'm very proud of some of the things we built and achieved. I'm particularly proud of being part of a community that has provided the space for some of my excellent colleagues to really grow.

  • This Week In Rust: This Week in Rust 413
  • Oracle Releases GraalVM 21.3 With Java 17 Support, Other Enhancements

    Oracle has published its latest quarterly update to GraalVM, the open-source Java JVM/JDK implemented in Java that also supports other execution modes and programming languages from Python to R to Ruby.

    Given last month's release of Java 17 / OpenJDK 17, GraalVM 21.3 has added Java 17 support. Plus there are many other improvements to its various language front-ends and other components. Some of the GraalVM 21.3 highlights include:

    - Java 17 support with GraalVM builds based on Oracle Java 17 and OpenJDK 17. OpenJDK 11 also continues to be supported while OpenJDK 8 is no longer supported by GraalVM.

  • Security updates for Thursday

    Security updates have been issued by Debian (python-babel, squashfs-tools, and uwsgi), Fedora (gfbgraph and rust-coreos-installer), Mageia (aom, libslirp, redis, and vim), openSUSE (fetchmail, go1.16, go1.17, mbedtls, ncurses, python, squid, and ssh-audit), Red Hat (java-1.8.0-openjdk and java-11-openjdk), Scientific Linux (java-1.8.0-openjdk and java-11-openjdk), SUSE (fetchmail, git, go1.16, go1.17, ncurses, postgresql10, python, python36, and squid), and Ubuntu (linux, linux-aws, linux-aws-hwe, linux-azure, linux-azure-4.15, linux-dell300x, linux-gcp, linux-gcp-4.15, linux-hwe, linux-kvm, linux-raspi2, linux-snapdragon, linux, linux-bluefield, linux-gcp-5.4, linux-hwe-5.4, linux-kvm, linux-oem-5.10, and linux-oem-5.13).

More in Tux Machines

today's howtos

  • How to Change HiDPI Scaling Settings on Linux

    For years, laptops and computer monitors have come with increasingly high-resolution displays. Text that looks great on a 1080p display can be too small and unreadable on a 4K one. Operating systems can upscale what's on-screen, but since 4K and other high-resolution screens come in many different sizes, there's no one-size-fits-all solution. Linux distributors have a particularly challenging time in part because Linux rarely comes pre-installed on devices. So, if you're a Linux user looking to tweak HiDPI settings, how do you go about this, and what do you need to know? Let's find out.

  • Full Circle Magazine: Full Circle Magazine #177

    Excerpt from my Editorial: Probably for the first time in FCM history we only have enough for two HowTo articles. […] As stated last month: we DESPERATELY need articles. I’ve got nothing spare. So, PLEASE, spend a few moments to write SOMETHING about what you know. It can be ANYTHING as long as it has something to do with Linux; hardware/software reviews, a how-to on something, even your story of how you found Ubuntu/Linux (of any flavor). Send whatever to: ronnie@fullcirclemagazine.org

  • Whatsdesk- Install WhatsApp Client on Ubuntu 22.0 | 20.04 - Linux Shout

    WhatsApp client is not officially available for Linux systems, hence, we can install an unofficial one i.e WhatsDesk on Ubuntu 22.04 | 20.04 using SNAP craft. Although Linux is not anymore the OS of developers only, still, WhatApp official client app is not available to install on Ubuntu. Therefore, if someone wants to use WhatsApp on Linux, they either have to use its web version or need to go for any third part unofficial client such as WhatsDesk.

  • How to Find Process ID (PID and PPID) in Linux

    Knowing the PID and PPID of a process can be helpful if you need to manage or interact with a process running on your system. There are numerous ways to get the PID (Process ID) and PPID (Parent Process ID) of a given process in Linux.

  • Install Discord Client on openSUSE Leap 15 - LinuxCapable

    Discord is a free voice, video, and text chat app used by tens of millions of people ages 13+ to talk and hang out with their communities and friends. Users communicate with voice calls, video calls, text messaging, media, and files in private chats or as part of communities called “servers.” Discord is available on Windows, macOS, and Linux Distros. In the following tutorial, you will learn how to install Discord client on openSUSE Leap 15. The tutorial will use the terminal for installation found in Activities> Show Applications > Terminal.

  • Install GNOME Tweaks Tool on Ubuntu 20.04 LTS - LinuxCapable

    GNOME is a popular desktop used on many Linux distributions, including Ubuntu. The GNOME Tweaks tool allows users to modify and change the cosmetics in their GNOME desktop environment, which is popular amongst users that are not satisfied entirely with the GUI. Some of the things you can do with GNOME Tweaks are edit font colors and scaling, disable animations for desktop speed improvement, change themes, manage GNOME extensions, bar changes, and much more. In the following tutorial, you will learn how to install GNOME Tweaks on Ubuntu 20.04 LTS Focal Fossa.

  • Install Grafana On Ubuntu / Rocky Linux & Fedora | Tips On UNIX

    Grafana is an open-source Analytics software with visualization. It provides you with tools to turn your time series database data into insightful graphs and visualizations. Grafana supports multiple data sources like Prometheus, Graphite, InfluxDB, Elasticsearch, Zabbix, etc… This tutorial will be helpful for beginners to install Grafana on Ubuntu 20.04 LTS, Rocky Linux 8, AlmaLinux 8, and Fedora 35.

  • Install UNRAR on Fedora Linux 35 - LinuxCapable

    UNRAR is widely known and used amongst Windows users. RAR files are much smaller archives and compress better than ZIP for most files by compressing files “together,” saving more space. UNRAR does not come pre-installed natively on Fedora and is not featured in its repositories. The following tutorial will show you how to install UNRAR on Fedora Linux 35 Workstation or Server with RPM FUSION, along with the most commonly used commands.

New Theme Brings libadwaita’s Sleek Looks to Older GTK Apps

This third-party theme back-ports the bulk of the libadwaita stylesheet to a regular GTK theme that works with GTK3 apps. As this theme is under active development you can’t be too picky if there are a few unpadded highlights or errant pixels; it’s not a 1:1 clone of what you seen in GNOME 42 screenshots (or any GTK4 libadwaita apps you currently use) but it’s a close enough approximation. Also: this is purely superficial; you won’t magically find GTK4 features, widgets, or animations nestled inside your GTK3 apps. Read more

Chrome and Mozilla: Privacy, Net Neutrality, and Firefox Changes

  • Google Just Gave You the Best Reason Yet to Finally Quit Using Chrome

    Ultimately, that change in the way Google is looking at Chrome--that it isn't a tool that serves its users, but is a tool that serves up users to advertisers, albeit in a slightly more privacy protective way--is a bad sign. It's also the best reason to finally ditch it altogether.

  • In California, an Important Victory for Net Neutrality

    Today, the Ninth Circuit court upheld California’s net neutrality law, affirming that California residents can continue to benefit from the fundamental safeguards of equal treatment and open access to the internet. This decision clears the way for states to enforce their own net neutrality laws, ensuring that consumers can freely access ideas and services without unnecessary roadblocks. Net neutrality matters, as much of our daily life is now online. It ensures that consumers are protected from ISPs blocking or throttling their access to websites, or creating fast lanes and slow lanes for popular services.

  • How to restore Firefox's classic download behavior

    Mozilla plans to change the download behavior of the Firefox web browser in Firefox 97; this guide helps restore the classic download functionality of the browser. Firefox users who download files currently get a download prompt when they do so. The prompt displays options to open the file using an application or save it to the local system. Starting in Firefox 97, Firefox is not displaying the prompt anymore by default.

This week in KDE: Getting Plasma 5.24 ready for release - Adventures in Linux and KDE

Plasma 5.24 is almost ready! I mentioned last week that I haven’t been posting about fixes for regressions in 5.24 that never got released, because there would be too many. Nonetheless people have been working very hard on this, and we’re down to only 7, with two of them having open merge requests! Working on those is appreciated, as it helps improve the stability of the final release in a week and a half. Read more