Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
  • Megvii’s open-source platform offers Chinese AI alternative

    Artificial intelligence company Megvii has open-sourced its self-developed deep learning framework MegEngine, allowing developers around the world to use and improve on the platform.

  • Andy Wingo: firefox's low-latency webassembly compiler

    WebAssembly, as you know, is a virtual machine that is present in web browsers like Firefox. An important initial goal for WebAssembly was to be a good target for compiling programs written in C or C++. You can visit a web page that includes a program written in C++ and compiled to WebAssembly, and that WebAssembly module will be downloaded onto your computer and run by the web browser.

    A good virtual machine for C and C++ has to be fast. The throughput of a program compiled to WebAssembly (the amount of work it can get done per unit time) should be approximately the same as its throughput when compiled to "native" code (x86-64, ARMv7, etc.). WebAssembly meets this goal by defining an instruction set that consists of similar operations to those directly supported by CPUs; WebAssembly implementations use optimizing compilers to translate this portable instruction set into native code.

    There is another dimension of fast, though: not just work per unit time, but also time until first work is produced. If you want to go play Doom 3 on the web, you care about frames per second but also time to first frame. Therefore, WebAssembly was designed not just for high throughput but also for low latency. This focus on low-latency compilation expresses itself in two ways: binary size and binary layout.

  • AMD Developers Looking At GNU C Library Platform Optimizations For Zen

    It's long overdue but AMD engineers are now looking at refactoring the GNU C Library (Glibc) platform support to enhance the performance for AMD Zen processors.

    Stemming from Glibc semantics that effectively "cripple AMD" in just checking for Intel CPUs while AMD CPUs with Glibc are not even taking advantage of Haswell era CPU features, AMD developers are now looking at properly plumbing AMD Zen platform support into this important C library for Linux users.

  • LLVM Developers Are Still Debating How To Handle The Intel JCC Erratum Mitigation

    Disclosed back in mid-November was the Intel JCC Erratum that required a CPU microcode update to mitigate and that in turn had broad performance hits. But via toolchain updates, some of that overhead can be offset. The GNU Assembler patches were quickly merged and new options exposed for helping to decrease that performance hit but on the LLVM side the developers are still working on their mitigation with some design decisions still to be made.

  • Swift 5.2 takes flight

    After a good half year of work, Swift is now available in version 5.2, bringing key path expressions as functions and callable values of user-defined nominal types to Apple’s general-purpose language.

    The two features mentioned are a result of the Swift Evolution process and show ways to realise more functional programming concepts. Callable values for example define function-like behaviour and can be called using function call syntax, something that wasn’t an option before.

  • Glibc's Usage Of Performance-Boosting "RSEQ" Is Still Coming Together

    Introduced into the Linux 4.18 kernel back in June 2018 was the new RSEQ system call for "Restartable Sequences" to provide faster user-space operations on per-CPU data by avoiding atomic operations updates. Sadly, seeing user-space make use of RSEQ has been a slow process.

    Restartable Sequences can make for faster querying of the current CPU number, incrementing per-CPU counters, modifying data protected by per-CPU spinlocks, writing/reading per-CPU ring buffers, and similar operations. One of the big potential users of RSEQ that we've been waiting to see its adoption on has been the GNU C Library (Glibc).

  • Reducing memory consumption in librsvg, part 3: slack space in Bézier paths
  • Build a Kubernetes Operator in 10 minutes with Operator SDK

    In Kubernetes, objects are analogous to a job or a completed task in the real world. You can use them to define common tasks, store them in a version control system, and apply them with kubectl apply. Kubernetes ensures that this triggers everything necessary to bring your declarative description to life by creating the depending resources (like pods) to run your software. Kubernetes contains a number of built-in object types that can be created with this workflow, like Deployments and Services.

    With Operators, Kubernetes allows cluster maintainers or software providers to define their own Kubernetes object types, called custom resource definitions (CRDs). These objects can be handled by the Kubernetes API, just like built-in object types. Inside the Operator code, authors can define how to act on those custom objects.

    The Operator user can use kubectl apply to create an object of this custom type, which is called a custom resource (CR).

  • Back to Paws

    It has been a little while since I played with my little PAWS and yes like many of us these days I have been just a little distracted, trip planned, trip changed, trip canceled etc etc etc.

    Anyway to recap where I left off I was just getting the 'SubscribeToShard' action to work with a HTTP stream to work, after a fashion anyway. Then I got side tracked a little playing about with the problem of testing if the stream was correctly sending data down the pipe and if I was decoding it correctly.

    As a byproduct of getting to the bottom of that I finally figured out what the PAWS 'Paginators' are for and I guess how to use them.

  • Getting started with hidden Markov models using Perl

    A Markov model (named after the mathematician Andrey Markov) is used for forecasting in systems of random change. Markov's insight is that good predictions in this context can be made from only the most recent occurrence of an event, ignoring any occurrences before the current one. The approach might be described as memoryless or history-agnostic prediction.

    Markov's first example (in 1913) predicted vowel occurrences in Pushkin's poem "Eugeny Onegin." The challenge today is to find a research area in which Markov models play no role. Such models are used to study thermodynamics and statistical mechanics; bioinformatics, enzyme activity, and population dynamics; solar irradiance and wind power; price trends; speech recognition and generation; data compression and pattern recognition; reinforcement learning and gesture recognition. The list goes on and on.

  • Improving pretty-printing in Python

    The python-ideas mailing list is typically used to discuss new features or enhancements for the language; ideas that gain traction will get turned into Python Enhancement Proposals (PEPs) and eventually make their way to python-dev for wider consideration. Steve Jorgensen recently started a discussion of just that sort; he was looking for a way to add customization to the "pretty-print" module (pprint) so that objects could change the way they are displayed. The subsequent thread went in a few different directions that reflect the nature of the mailing list—and the idea itself.

More in Tux Machines

Fedora Elections and IBM/Red Hat Leftovers

  • Fedora 33 elections nominations now open

    Candidates may self-nominate. If you nominate someone else, please check with them to ensure that they are willing to be nominated before submitting their name. The steering bodies are currently selecting interview questions for the candidates. Nominees submit their questionnaire answers via a private Pagure issue. The Election Wrangler or their backup will publish the interviews to the Community Blog before the start of the voting period. Fedora Podcast episodes will be recorded and published as well. Please note that the interview is mandatory for all nominees. Nominees not having their interview ready by end of the Interview period (2020-11-19) will be disqualified and removed from the election.

  • 12 Tips for a migration and modernization project

    Sometimes migration/modernization projects are hard to execute because there are many technical challenges, like the structure of legacy code, customer environment, customer bureaucracy, network issues, and the most feared of all, production bugs. In this post I'm going to explain the 12-step migration / modernization procedure I follow as a consultant using a tip-based approach. I have some experience with this kind of situation because I’ve already passed by different kinds of projects with several kinds of problems. Over time you start to recognize patterns and get used to solving the hard problems. So, I thought: Wouldn't it be cool to create a procedure based on my experience, so that I can organize my daily work and give the transparency that the customers and managers want? To test this out, I did this for one customer in my hometown. They were facing a Red Hat JBoss EAP migration/modernization project. The results of the project were outstanding. The customer said they were even more satisfied with the transparency. The project manager seemed really comfortable knowing all about the details through the project and pleased with reducing the risk of unexpected news.

  • Awards roll call: June 2020 to October 2020

    We are nearly at the end of 2020 and while the pace continues to increase, we want to take a moment to acknowledge and celebrate some of the successes of Red Hat's people and their work. In the last four months, several Red Hatters and Red Hat products are being recognized by leading industry publications and organizations for efforts in driving innovation.

  • How developers can build the next generation of AI advertising technology – IBM Developer

    As we look across the most rapidly transforming industries like financial services, healthcare, retail – and now advertising, developers are putting open source technologies to work to deliver next-generation features. Our enterprise clients are looking for AI solutions that will scale with trust and transparency to solve business problems. At IBM®, I have the pleasure of focusing on equipping you, the developers, with the capabilities you need to meet the heightened expectations you face at work each day. We’re empowering open source developers to drive the critical transformation to AI in advertising. For instance, at the IBM Center for Open source Data and AI Technologies (CODAIT), enterprise developers can find open source starting points to tackle some of your thorniest challenges. We’re making it easy for developers to use and create open source AI models that can ultimately help brand marketers go deeper with AI to reach consumers more effectively.

Programming: Qt, PHP, JS and Bash

  • Qt 6 To Ship With Package Manager For Extra Libraries - Phoronix

    Adding to the list of changes coming with the Qt 6 toolkit, The Qt Company has now outlined their initial implementation of a package manager to provide additional Qt6 modules.

  • Qt for MCUs 1.5 released

    A new release of Qt for MCUs is now available in the Qt Installer. If you are new to Qt for MCUs, you can try it out here. Version 1.5 introduces new platform APIs for easy integration of Qt for MCUs on any microcontroller, along with an in-depth porting guide to get you going. Additionally, it includes a set of C++ APIs to load new images at runtime into your QML GUI. As with every release, 1.5 also includes API improvements and bug fixes, enhancing usability and stability.

  • KDDockWidgets v1.1 has been released! - KDAB - KDAB on Qt

    KDDockWidgets v1.1 is now available! Although I just wrote about v1.0 last month, the 1.1 release still managed to get a few big features.

  • KDAB TV celebrates its first year - KDAB

    A year ago KDAB started a YouTube channel dedicated to software development with Qt, C++ and 3D technologies like OpenGL. We talked to Sabine Faure, who is in charge of the program, about how it worked out so far and what we can expect in the future.

  • How to build a responsive contact form with PHP – Linux Hint

    Contact forms are commonly used in web applications because they allow the visitors of the website to communicate with the owner of the website. For most websites, responsive contact forms can be easily accessed from various types of devices such as desktops, laptops, tablets, and mobile phones. In this tutorial, a responsive contact form is implemented, and the submitted data is sent as an email using PHP.

  • Applying JavaScript’s setTimeout Method

    With the evolution of the internet, JavaScript has grown in popularity as a programming language due to its many useful methods. For example, many websites use JavaScript’s built-in setTimeout method to delay tasks. The setTimeout method has many use cases, and it can be used for animations, notifications, and functional execution delays.Because JavaScript is a single-threaded, translative language, we can perform only one task at a time. However, by using call stacks, we can delay the execution of code using the setTimeout method. In this article, we are going to introduce the setTimeout method and discuss how we can use it to improve our code.

  • Removing Characters from String in Bash – Linux Hint

    At times, you may need to remove characters from a string. Whatever the reason is, Linux provides you with various built-in, handy tools that allow you to remove characters from a string in Bash. This article shows you how to use those tools to remove characters from a string. [...] Sed is a powerful and handy utility used for editing streams of text. It is a non-interactive text editor that allows you to perform basic text manipulations on input streams. You can also use sed to remove unwanted characters from strings. For demonstration purposes, we will use a sample string and then pipe it to the sed command.

Python Programming

  • Dissecting a Web stack - The Digital Cat

    Having recently worked with young web developers who were exposed for the first time to proper production infrastructure, I received many questions about the various components that one can find in the architecture of a "Web service". These questions clearly expressed the confusion (and sometimes the frustration) of developers who understand how to create endpoints in a high-level language such as Node.js or Python, but were never introduced to the complexity of what happens between the user's browser and their framework of choice. Most of the times they don't know why the framework itself is there in the first place. The challenge is clear if we just list (in random order), some of the words we use when we discuss (Python) Web development: HTTP, cookies, web server, Websockets, FTP, multi-threaded, reverse proxy, Django, nginx, static files, POST, certificates, framework, Flask, SSL, GET, WSGI, session management, TLS, load balancing, Apache. In this post, I want to review all the words mentioned above (and a couple more) trying to build a production-ready web service from the ground up. I hope this might help young developers to get the whole picture and to make sense of these "obscure" names that senior developers like me tend to drop in everyday conversations (sometimes arguably out of turn). As the focus of the post is the global architecture and the reasons behind the presence of specific components, the example service I will use will be a basic HTML web page. The reference language will be Python but the overall discussion applies to any language or framework. My approach will be that of first stating the rationale and then implementing a possible solution. After this, I will point out missing pieces or unresolved issues and move on with the next layer. At the end of the process, the reader should have a clear picture of why each component has been added to the system.

  • Introducing AutoScraper: A Smart, Fast and Lightweight Web Scraper For Python | Codementor

    In the last few years, web scraping has been one of my day to day and frequently needed tasks. I was wondering if I can make it smart and automatic to save lots of time. So I made AutoScraper!

  • django-render-block 0.8 (and 0.8.1) released!

    A couple of weeks ago I released version 0.8 of django-render-block, this was followed up with a 0.8.1 to fix a regression. django-render-block is a small library that allows you render a specific block from a Django (or Jinja) template, this is frequently used for emails when you want multiple pieces of an email together in a single template (e.g. the subject, HTML body, and text body), but they need to be rendered separately before sending.

  • Pyston v2: 20% faster Python | The Pyston Blog

    We’re very excited to release Pyston v2, a faster and highly compatible implementation of the Python programming language. Version 2 is 20% faster than stock Python 3.8 on our macrobenchmarks. More importantly, it is likely to be faster on your code. Pyston v2 can reduce server costs, reduce user latencies, and improve developer productivity. Pyston v2 is easy to deploy, so if you’re looking for better Python performance, we encourage you to take five minutes and try Pyston. Doing so is one of the easiest ways to speed up your project.

  • Pyston v2 Released As ~20% Faster Than Python 3.8 - Phoronix

    Version 2.0 of Pyston is now available, the Python implementation originally started by Dropbox that builds on LLVM JIT for offering faster Python performance. Pyston developers believe their new release is about 20% faster than the standard Python 3.8 and should be faster for most Python code-bases.

  • Python int to string – Linux Hint

    Python is one of the universal languages that support various types of data types like integer, decimal point number, string, and complex number. We can convert one type of data type to another data type in Python. This data type conversion process is called typecasting. In Python, an integer value can easily be converted into a string by using the str() function. The str() function takes the integer value as a parameter and converts it into the string. The conversion of int to string is not only limited to the str() function. There are various other means of int to string conversion. This article explains the int to string conversion with various methods.

  • Python isinstance() Function – Linux Hint

    Python is one of the best and efficient high-level programming languages. It has a very straightforward and simple syntax. It has very built-in modules and functions that help us to perform the basic tasks efficiently. The Python isinstance() function evaluates either the given object is an instance of the specified class or not.

Graphics: Wayland, Radeon, and Mesa

  • Sony Engineer Talks Up Using Flutter + Wayland For Their Embedded Interfaces - Phoronix

    A Sony engineer confirmed at this week's Embedded Linux Conference Europe that the company has begun using the Flutter toolkit atop Wayland as their means of developing user-interfaces on embedded systems. Hidenori Matsubayashi of Sony talked at ELCE 2020 about their evaluation of different GUI toolkits for embedded use and ultimately how they fell for Flutter and Wayland. They came to that decision when evaluating the likes of Electron, Qt, GTK, WebKit/Chromium with WebView, and the many other options out there. Their design requirements were needing to be able to make "beautiful" user interfaces, support easy development, exhibit low CPU and RAM requirements, work across display servers and software stacks, and the toolkit must allow use within proprietary software.

  • Linux Support Expectations For The AMD Radeon RX 6000 Series

    Lisa Su is about to begin the presentation unveiling the much anticipated Radeon RX 6000 "Big Navi" (RDNA 2) graphics cards. This article will be updated live as the event progresses but first up let's recap the current Linux open-source driver state for these forthcoming graphics cards. Under the codename Sienna Cichlid, the Linux support for the next-generation Navi graphics cards have been underway going back to the middle of the year. There is initial support for the next-gen hardware within the recent released Linux 5.9 kernel and Mesa 20.2. This still puts it just out-of-reach for seeing out-of-the-box support in the likes of Ubuntu 20.10 given the 5.8 kernel so the user must manually move to the newer kernel. At least with the likes of Fedora Workstation 33 there will be Linux 5.9 as a stable release update. Also important to the driver equation is needing to be using LLVM 11.0+ for the GFX10.3 back-end target and also ensuring to have the latest linux-firmware for the binary microcode files needed for GPU initialization. So at least going into this launch it's great there is at least open-source driver support available but not necessarily easy reach for all users right now. By the time of the spring 2021 Linux distributions like Ubuntu 21.04 there should be nice out-of-the-box support for those wanting good support without any hassles. Or if you are on an enterprise distribution like RHEL/CentOS or SUSE Linux Enterprise or Ubuntu 20.04 LTS, AMD should be providing their usual Radeon Software for Linux packaged driver that ships updated user and kernel-space components for deploying their driver that way.

  • Mesa 20.3 Supports Intel Alder Lake Gen12 Graphics - Phoronix

    Last week Intel open-source engineers began publishing Linux kernel patches for the "Alder Lake S" graphics support. That work should be found in the Linux 5.11 cycle being christened as stable in early 2021. In user-space, Alder Lake graphics patches also appeared for their OpenCL / oneAPI Level Zero compute stack and now merged into Mesa 20.3 as well for OpenGL / Vulkan support. Given that Alder Lake is using Intel Xe "Gen12" graphics as found already for Tiger Lake and Rocket Lake, the actual driver-side enablement is quite minimal thanks to employing the existing code paths. The Alder Lake "ADL-S" support was merged into Mesa on Tuesday and is just 20 lines of new code. That consists of just adding the new PCI IDs and then the family bits for the Alder Lake family and indicating they make use of Gen12 features.