Language Selection

English French German Italian Portuguese Spanish

Development

Programming Leftovers

Filed under
Development
  • Using functions more

    Bash functions seem to sit in a sweet spot between aliases and full blown scripts. I’ve defined a number of functions in my dotfiles which are all useful. Unlike aliases, they can take parameters and have greater scope for doing things; unlike scripts, they run in the context of the current shell which means, for example, that I can set a value in a variable during the course of a function’s execution and it’s available directly afterwards, in the same shell session.

  • Some notes on upgrading programs with Python's pip

    My primary use of Python's pip package manager is to install programs like the Python LSP server; I may install these into either a contained environment (a virtual environment or a PyPy one) or as a user package with 'pip install --user'. In either case, the day will come when there's a new version of the Python LSP server (or whatever) and I want to update to it. As I noted down back in my pip cheatsheet, the basic command I want here is 'pip install --upgrade <package>', possibly with '--user' as well. However, it turns out that there are some complexities and issues here, which ultimately come about because pip is not the same sort of package manager as Fedora's DNF or Debian's apt.

  • OpenBSD's pledge and unveil from Python

    Years ago, OpenBSD gained two new security system calls, pledge(2) (originally tame(2)) and unveil. In both, an application surrenders capabilities at run-time. The idea is to perform initialization like usual, then drop capabilities before handling untrusted input, limiting unwanted side effects. This feature is applicable even where type safety isn’t an issue, such as Python, where a program might still get tricked into accessing sensitive files or making network connections when it shouldn’t. So how can a Python program access these system calls?

  • A good old-​fashioned Perl log analyzer

    A recent Lobsters post laud­ing the virtues of AWK remind­ed me that although the lan­guage is pow­er­ful and lightning-​fast, I usu­al­ly find myself exceed­ing its capa­bil­i­ties and reach­ing for Perl instead. One such appli­ca­tion is ana­lyz­ing volu­mi­nous log files such as the ones gen­er­at­ed by this blog. Yes, WordPress has stats, but I’ve nev­er let rein­ven­tion of the wheel get in the way of a good pro­gram­ming exercise.

  • Learning Path: Introduction to R

    Enhance your data science toolkit with our “Introduction to R” learning path: from the basis of the syntax, to operations and functions, for solid programming foundations.

    R is one of the most popular programming, scripting, and markup languages. Written by statisticians for statisticians, it is an incredible tool for data exploration, data manipulation, visualization and data analysis. If you don’t have it yet in your pocket, or if you would like to build better foundations for your programming skills, this workshop series is what you were looking for.

Programming Leftovers

Filed under
Development
  • Generate a minimal GStreamer build, tailored to your needs

    GStreamer is a powerful multimedia framework with over 30 libraries and more than 1600 elements in 230 plugins providing a wide variety of functionality. This makes it possible to build a huge variety of applications, however it also makes it tricky to ship in a constrained device. Luckily, most applications only use a subset of this functionality, and up until now there wasn't an easy way to generate a build with just enough GStreamer for a specific application.

    Thanks to a partnership with Huawei, you can now use gst-build to generate a minimal GStreamer build, tailored to a specific application, or set of applications. In this blog post, we'll look at the major changes that have been introduced in GStreamer to make this possible, and provide a small example of what can be achieved with minimal, custom builds.

  • How to reach craftsmanship? – vanitasvitae's blog

    I also taught myself coding. Well, I learned the basics of Java programming in school, but I kept on learning beyond that. My first projects were the typical mess that you’d expect from a beginner which has no idea what they are doing. Later I studied computer science and now I’m just a few credit points away from getting my masters degree. Yet, the university is not the place where you learn to code. They do teach you the basics of how a computer works, what a compiler is and even the theory behind creating your own compilers, but they hardly teach you how to write *good* code.

  • Perl Weekly Challenge 130: Odd Number and Binary Search Tree
  • Debugging by starting a REPL at a breakpoint is fun

    Hello! I was talking to a Python programmer friend yesterday about debugging, and I mentioned that I really like debugging using a REPL. He said he’d never tried it and that it sounded fun, so I thought I’d write a quick post about it.

    This debugging method doesn’t work in a lot of languages, but it does work in Python and Ruby and kiiiiiind of in C (via gdb).

  • Crunch numbers in Python with NumPy | Opensource.com

    NumPy, or Numerical Python, is a library that makes it easy to do statistical and set operations on linear series and matrices in Python. It is orders of magnitude faster than Python lists, which I covered in my notes on Python Data Types. NumPy is used quite frequently in data analysis and scientific calculations.

    I'm going to go over installing NumPy, and then creating, reading, and sorting NumPy arrays. NumPy arrays are also called ndarrays, short for n-dimensional arrays.

  • How I patched Python to include this great Ruby feature

    Ruby, unlike Python, makes lots of things implicit, and there's a special kind of if expression that demonstrates this well. It's often referred to as an "inline-if" or "conditional modifier", and this special syntax is able to return one value when a condition is true, but another value (nil, specifically) when a condition is false.

Devices and Programming

Filed under
Development
Hardware
  • Foot pressure sensors detect Parkinson’s disease
  • Perl Monthly Report - August

    Well, right from day one, I have been getting to work on something I never worked on before. To be honest with you, I was expecting to fight with good old CGI ridden code mostly. I find myself lucky to have such a great supporting team. Right now I am playing with Elastic Search and I am enjoying it. Thanks to CPAN for such a cool library, Search::Elasticsearch.

  • Applying PEP 8

    Two recent threads on the python-ideas mailing list have overlapped to a certain extent; both referred to Python's style guide, but the discussion indicates that the advice in it may have been stretched further than intended. PEP 8 ("Style Guide for Python Code") is the longstanding set of guidelines and suggestions for code that is going into the standard library, but the "rules" in the PEP have been applied in settings and tools well outside of that realm. There may be reasons to update the PEP—some unrelated work of that nature is ongoing, in fact—but Pythonistas need to remember that the suggestions in it are not carved in stone.

  • This Week in Rust 408

Programming Leftovers

Filed under
Development
  • Steinar H. Gunderson: plocate in Fedora

    It seems that due to the work of Zbigniew Jędrzejewski-Szmek, plocate is now in Fedora Rawhide. This carries a special significance; not only in Fedora an important distribution, but it is also the upstream of mlocate. Thus, an expressed desire to replace mlocate with plocate over the next few Fedora releases feels like it carries a certain amount of support on the road towards world domination. Smile

  • Qt Creator 5.0.1 released

    Qt Creator 5.0.1 released

  • My Favorite Warnings: redundant and missing

    The redundant and missing warnings were added in Perl 5.22 to cover the case where a call to the printf or sprintf had more (redundant) or fewer (missing) arguments than the format calls for. The documentation says that they may be extended to other built-ins (pack and unpack being named specifically) but as of Perl 5.34.0 only the printf() built-ins are covered.

  • 10 Python Code Challenges for Beginners

    One of the best ways to test and practice your skills with Python is by solving coding challenges. You can learn a lot from books and online courses, but coding isn't an armchair activity. You have to write some code to make genuine progress.

    Coding challenges are perfect for this. Coding challenges are small problems you can solve with code. Just because they're small doesn't mean they won't put your knowledge to the test. Each bite-size challenge will focus on skills that you'll use later working on complete software projects.

  • Python (numpy && matplotlib) solving one relatively difficult math problem

    The problem itself is to find all solutions of the following equation on real axis

    cos (cos (cos (cos (x)))) - sin (sin (sin (sin (x)))) = 0

    We intend to prove that equation above doesn't have any solution via creating a python script importing NumPy and Matplotlib. Just recall that the function understudy has a period of 2*pi .

Why Many Linux App Developers Don’t Want Distros to Use Themes

Filed under
Development
GNU
Linux
GNOME

You may associate Linux with the freedom to make your desktop look however you want, but that’s not the case with GNOME. At least, not without knowing which extensions to install or how to read code. By default, GNOME is intended to look and feel a certain way, and many developers would prefer if Linux distributions didn’t change the appearance of their apps by using themes.

Is it an issue when you change the theme on your own personal machine? No, you know what you're getting yourself into. But confusion can arise when the customized experience comes presented as the default.

Read more

Ticketit: Open-source Laravel-based Ticketing System

Filed under
Development
Software

Laravel is a trending open-source modern PHP framework for building enterprise and complex as well as small apps.

As Laravel becomes the number one PHP framework with its large community and rich ecosystem, developers may require to add a ticketing and support system to their apps. Well, with Ticketit it takes no time.

Ticketit is a free self-hosted Laravel-based ticketing system. It can be integrated smoothly with other Laravel projects.

Even though, the project is archived on GitHub, many Laravel developers are forking it and integrating it in their projects.

Read more

New Intel Tremont Optimizations Heading To The GCC Compiler

Filed under
Development
GNU

The GNU Compiler Collection has already supported Intel's Tremont cores as used by the low-power Jasper Lake platform. Now though coming to GCC are some optimizations to further enhance the performance when targeting the Tremont micro-architecture.

The new GCC Tremont patches include updating the memcpy/memset inline strategies, updated handling around vector and SSE conversions, switching to using the Haswell scheduling mountain, enabling a number of other options.

Read more

Solus abandons GTK

Filed under
Development

One of the leaders of the Solus Linux project, Joshua Strobl, announced his intention to abandon GTK in the development of both future versions of Budgie and the entire ecosystem of applications in Solus. On his blog, he made a number of criticisms of the current state and development plans of GTK, as well as the GNOME development philosophy.

According to him, the widespread implantation of Adwaita as the only true desktop theme and the accompanying removal of part of the API for various kinds of customization has added headaches to developers who maintain the GNOME stack in distributions or integrate their applications into it. All suggested options for customizing the look and feel of GTK-based applications and related libraries are rejected, and members of the GNOME team are insolently rude in response in tickets and social media.

Joshua also complains that GTK4, released a little less than a year ago, slightly complicated the code for working with widgets by prohibiting direct inheritance. But he sees a much more important problem with the abolition of the X11 API, in particular for obtaining the configuration of the connected monitors. Moving towards full support for Wayland, GNOME removed the X server polling functionality, instructing the developer to write their own interfaces to access X11 directly (or to APIs of other operating systems, if the application turned out to be cross-platform).

Read more

Also:

Rolled back to gtk2 version of yad

Programming Leftovers

Filed under
Development
  • Show Unicode code points for UTF-8 characters

    Like the title says, I wanted to show the Unicode code points (formatted \uxxxx) for a set of UTF-8 characters. There are programs that do just that in a number of programming languages, but I wanted to do the job with garden-variety shell tools.

    The solution I've chosen is based on a 2019 SuperUser suggestion from Brazilian developer Danilo G. Veraszto. The trick is to first convert the character to "UNICODEBIG" (big-endian Unicode) encoding with iconv. I pass the output to xxd, set to put a space between every two bytes (-g 2)...

  • Java 17 / JDK 17: General Availability
    JDK 17, the reference implementation of Java 17, is now Generally
    Available.  We shipped build 35 as the first Release Candidate of
    JDK 17 on 6 August, and no P1 bugs have been reported since then.
    Build 35 is therefore now the GA build, ready for production use.
    
    
  • Java 17 / OpenJDK 17 Hits GA With Maturing Vector API, Removal Planned For Applet API

    Java's Vector API is quite exciting and building off the initial code in Java 16. The Java Vector API aims to make it easy to allow run-time handling and optimal vector instruction generation across CPU architectures for SSE, AVX, Arm NEON, and other instruction set extensions.

    Java 17 is quite notable in that it will be a Long-Term Support (LTS) release, including from Oracle.

  • Kafka Monthly Digest – August 2021 – IBM Developer

    This is the 43rd edition of the Kafka Monthly Digest. In this edition, I’ll cover what happened in the Apache Kafka community in August 2021.

  • A Candid explainer: Quirks

    If you made it this far, you now have a good understanding of what Candid is, what it is for and how it is used. For this final post, I’ll put the spotlight on specific aspects of Candid that are maybe surprising, or odd, or quirky. This section will be quite opinionated, and could maybe be called “what I’d do differently if I’d re-do the whole thing”.

    Note that these quirks are not serious problems, and they don’t invalidate the overall design. I am writing this up not to discourage the use of Candid, but merely help interested parties to understand it better.

  • oneAPI Level Zero Loader v1.5 Released With VPU Driver Recognition, Multi-Driver Support

    Intel has released a new version of their loader for oneAPI Level Zero for loading the Level Zero software driver components.

Programming and Software Patents

Filed under
Development
  • Oracle Java 17 delivers thousands of performance and security updates

    Oracle released Java 17, the latest version of the world’s number one programming language and development platform. Java 17 delivers thousands of performance, stability, and security updates, as well as 14 JEPs (JDK Enhancement Proposals) that further improve the Java language and platform to help developers be more productive.

  • A Rant on Personal Software Projects

    In contrast, a product personal project focuses on what it does and the experience as an end-user interacts with it. Maybe it has a great README, a slick user experience, or does something better than anything else out there. The point is that it is focused on the end-user that uses it rather than the person who makes it. It doesn’t particularly matter what it looks like on the inside. It could be based on COBOL and be a tangle of spaghetti internally. Clean code helps with maintenance and project longevity, but it does absolutely nothing for the product experience.

  • Paul E. Mc Kenney: Stupid RCU Tricks: Making Race Conditions More Probable

    Given that it is much more comfortable chasing down race conditions reported by rcutorture than those reported from the field, it would be good to make race conditions more probable during rcutorture runs than in production. A number of tricks are used to make this happen, including making rare events (such as CPU-hotplug operations) happen more frequently, testing the in-kernel RCU API directly from within the kernel, and so on.

    Another approach is to change timing. Back at Sequent in the 1990s, one way that this was accomplished was by plugging different-speed CPUs into the same system and then testing on that system. It was observed that for certain types of race conditions, the probability of the race occurring increased by the ratio of the CPU speeds. One such race condition is when a timed event on the slow CPU races with a workload-driven event on the fast CPU. If the fast CPU is (say) two times faster than the slow CPU, then the timed event will provide two times greater “collision cross section” than if the same workload was running on CPUs running at the same speed.

    Given that modern CPUs can easily adjust their core clock rates at runtime, it is tempting to try this same trick on present-day systems. Unfortunately, everything and its dog is adjusting CPU clock rates for various purposes, plus a number of modern CPUs are quite happy to let you set their core clock rates to a value sufficient to result in physical damage. Throwing rcutorture into this fray might be entertaining, but it is unlikely to be all that productive.

    Another approach is available on multi-socket systems, namely, making use of memory latency. The idea is for the rcutorture scripting to place one pair of a given scenario's vCPUs in the hyperthreads of a single core within one socket and to place another pair of that same scenario's vCPUs in the hyperthreads of a single core of the other socket. The theory is that the different communications latencies and bandwidths within a core on the one hand and between sockets on the other should have roughly the same effect as does varying CPU core clock rates.

  • Square joins the Open Invention Network | ZDNet

    The OIN, the world's largest patent non-aggression consortium, protects Linux and related open-source software and the companies behind them from patent attacks and patent trolls. The OIN recently broadened its scope from core Linux programs and adjacent open-source code by expanding its Linux System Definition to other patents such as the Android Open Source Project (AOSP) and the Extended File Allocation Table (exFAT) file system.

    That may not sound to you like a natural fit for a retail financial services and digital payments company which is best known for its ubiquitous Square Reader for smartcards, but actually, it is. Behind it is a foundation of open-source software.

    As Bob Lee, Square's former CTO, once said, "Open source is part of our DNA. As a member of the open-source community -- and a company that's benefited from many open source libraries -- we have a responsibility to pay it forward. We always have the mindset to open-source our code when we build."

Syndicate content

More in Tux Machines

Type Title Author Replies Last Postsort icon
Story The Fast File Search App ‘FSearch’ Goes Stable via 0.1 Release [Ubuntu PPA] Roy Schestowitz 27/09/2021 - 4:47pm
Story IBM/Red Hat/Fedora Leftovers Roy Schestowitz 27/09/2021 - 4:44pm
Story Geniatech GTW410 – An ultra compact IoT gateway based on Snapdragon 410E SoC Roy Schestowitz 27/09/2021 - 4:36pm
Story Open Hardware/Modding Projects Roy Schestowitz 27/09/2021 - 4:35pm
Story Brave reduces the page load performance cost of its adblocker Roy Schestowitz 1 27/09/2021 - 4:28pm
Story Linux Foundation: PaSh, LFMS, and 'Studies' Roy Schestowitz 17 27/09/2021 - 4:19pm
Story Kernel: Google, Xen, and Mesa Roy Schestowitz 6 27/09/2021 - 4:16pm
Story Top 11 Reasons Why Linux is Better than Windows Roy Schestowitz 27/09/2021 - 3:52pm
Story 9to5Linux Weekly Roundup: September 26th, 2021 Marius Nestor 1 27/09/2021 - 3:51pm
Story today's leftovers Roy Schestowitz 27/09/2021 - 3:33pm