Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • Create a patch for LibreOffice directly in gerrit

    Possibly, you are a great C++ developer or conversely you write your first strings in C++ and you want make LibreOffice better with pair (or more!) string of code.
    We'll suppose you already know what strings and in which file(s) of the LibreOffice source code you age going to change.
    I'll talk here about using gerrit for that change making.

  • Multiple screens support in Qt for Android

    It has been a while since I last wrote about Qt on Android, mostly because the things were quite, a few bug fixes here and there but no features that it worth to mention. Today I have a pleasure to tell you about multiple screen support in Qt for Android.

    This feature is very useful for apps that can use a second screen (e.g. your big screen TV, the rear sit screen of your car, etc.) to present their content. These apps can be anything from a photo viewer, or an Impress(PowerPoint) presentation to a game*. The phone usually turns into a remote control for the application on the second screen.

    Before we proceed I want to highlight the fact that this is work in progress and hopefully it will be part of Qt 5.12 release (at least as a private API).

    Traditionally Android had only one screen (your phone) but starting with API 17, they added support for multiple screens.

  • A better Toolforge: upgrading the Kubernetes cluster

    One of the most successful and important products provided by the Wikimedia Cloud Services team at the Wikimedia Foundation is Toolforge. Toolforge is a platform that allows users and developers to run and use a variety of applications that help the Wikimedia movement and mission from the technical point of view in general. Toolforge is a hosting service commonly known in the industry as a Platform as a Service (PaaS). Toolforge is powered by two different backend engines, Kubernetes and GridEngine.

    This article focuses on how we made a better Toolforge by integrating a newer version of Kubernetes and, along with it, some more modern workflows.

    The starting point in this story is 2018. Yes, two years ago! We identified that we could do better with our Kubernetes deployment in Toolforge. We were using a very old version, v1.4. Using an old version of any software has more or less the same consequences everywhere: you lack security improvements and some modern key features.

    Once it was clear that we wanted to upgrade our Kubernetes cluster, both the engineering work and the endless chain of challenges started.

    It turns out that Kubernetes is a complex and modern technology, which adds some extra abstraction layers to add flexibility and some intelligence to a very old systems engineering need: hosting and running a variety of applications.

  • 8 CI/CD best practices to set you up for success

    Continuous integration (CI) and continuous delivery (CD) are usually associated with DevOps, DevSecOps, artificial intelligence for IT operations (AIOps), GitOps, and more. It's not enough to just say you're doing CI and CD; there are certain best practices that, if used well and consistently, will make your CI/CD pipelines more successful.

    The phrase "best practices" suggests the steps, processes, ways, iterations, etc. that should be implemented or executed to get the best results out of something like software or product delivery. In CI/CD, it also includes the way monitoring is configured to support design and deployment.

    [...]

    Incorporating telemetry, a "highly automated communications process by which measurements are made and other data collected at remote or inaccessible points and transmitted to receiving equipment for monitoring, display, and recording," is one option to build continuous metrics, monitoring, and alerting into your CI/CD pipelines.

    [...]

    Best practices around responding to failure should be built into a build, test, deploy, analysis, and design system. This is not only about considering which failure-response systems should be designed, built, and deployed; the ways organizations or teams will respond should also be well thought out and executed.

    The ideal culture considers failures to be features and an opportunity to learn, rather than a way to place blame. Blameless retrospectives or postmortems are a best practice that allows teams to focus on facts, consider many perspectives, assign action items, and learn.

    Creating a culture of learning and innovation around continuous integration and delivery is another best practice that will result in continuous experimentation and improvement in the short term and sustainability, reliability, and stability in the long run.

  • Roll Your Own Frameworks

    When I build an application, I build frameworks along the way. I recently realized that not everybody thinks this is normal, so I thought I'd give a description of what I do and why I think it's a good idea.

    But let's stop for a moment and briefly discuss what I understand to be a software development framework. Examples of frameworks are frontend web frameworks like React, backend web frameworks like Django, UI component frameworks like Ant Design, an ORM like SQLAlchemy, or a form library like mstform (which I helped create), and so on.

    A framework can be large or small, but in the end it's code that fulfills some task that you can control by plugging in your own code and declarations. Frameworks are declarative in nature, and declarations tend to be easier to understand and maintain than code that has a lot of moving imperative parts. This way frameworks also help you structure your application. My article Framework Patterns discusses a bunch of ways frameworks let you do that.

  • Python vs JavaScript for Pythonistas

    If you’re serious about web development, then you’ll need to learn about JavaScript at some point. Year after year, numerous surveys have shown that JavaScript is one of the most popular programming languages in the world, with a large and growing community of developers. Just like Python, modern JavaScript can be used almost anywhere, including the front end, back end, desktop, mobile, and the Internet of Things (IoT). Sometimes it might not be an obvious choice between Python vs JavaScript.

  • Assertions About Exceptions With pytest.raises()

    I got some feedback related to Bite 243 recently. Since that's a testing bite, it means working with pytest and specifically checking for exceptions with pytest.raises(). The comment got me to look at this handy feature of pytest with fresh eyes, and it seemed like a trip worth sharing!

  • PyDev of the Week: Qiusheng Wu

    This week we welcome Qiusheng Wu (@giswqs) as our PyDev of the Week! Qiusheng has developed several Python packages that you can check out on Github. Specifically they are geemap, lidar, whitebox and they are used for advanced geospatial analysis. Qiusheng also has a website where you can learn more about his research and interests.

    [...]

    My name is Qiusheng Wu. I obtained my Ph.D. degree in Geography from the University of Cincinnati in 2015. Currently, I am a tenure-track Assistant Professor of Geographic Information Science (GIS) in the Department of Geography at the University of Tennessee, Knoxville (UTK). Prior to joining UTK, I was a tenure-track Assistant Professor in the Department of Geography at Binghamton University, State University of New York (2015-2019).

    My research interests include Geographic Information Science (GIS), remote sensing, and environmental modeling. More specifically, I am interested in applying geospatial big data, machine learning, and cloud computing (e.g., Google Earth Engine) to study environmental change, especially surface water and wetland inundation dynamics. I am a strong advocate of open science and reproducible research. I have developed and published various open-source packages for advanced geospatial analysis (e.g., geemap, lidar, whitebox), which are available on GitHub. I recently created a YouTube channel to share video tutorials for using the Earth Engine Python API and geemap Python package. My goal is to make geospatial technologies and GIS programming easier and more accessible. More information about my research and teaching can be found at https://wetlands.io.

  • Michael Catanzaro: Patching Vendored Rust Dependencies

    Recently I had a difficult time trying to patch a CVE in librsvg. The issue itself was simple to patch because Federico kindly backported the series of commits required to fix it to the branch we are using downstream. Problem was, one of the vendored deps in the old librsvg tarball did not build with our modern rustc, because the code contained a borrow error that was not caught by older versions of rustc. After finding the appropriate upstream fix, I tried naively patching the vendored dep, but that failed because cargo tries very hard to prevent you from patching its dependencies, and complains if the dependency does not match its checksum in Cargo.lock. I tried modifying the checksum in Cargo.lock, but then it complains that you modified the Cargo.lock. It seems cargo is designed to make patching dependencies as difficult as possible, and that not much thought was put into how cargo would be used from rpmbuild with no network access.

  • Gradle 6.4 arrives with support for building and testing Java modules

    The open source build automation system Gradle has been released in version 6.4. Among other new features, breaking changes and bug fixes, it now supports building and testing Java modules. Read on to find out how to use the new feature and what else is new.

More in Tux Machines

Programming Leftovers

  • This Week in Rust 340
  • Simplify data visualization in Python with Plotly

    Plotly is a plotting ecosystem that allows you to make plots in Python, as well as JavaScript and R. In this series of articles, I'm focusing on plotting with Python libraries.

  • Perl Hacks, Perl School, and the future of Perl publishing

    Dave Cross, long-time Perl user, trainer, and author, recently released The Best of Perl Hacks, a curated collection of his best posts from his Perl Hacks blog. His imprint, Perl School, has published six e-books, including two that I wrote. There’s an unrelated book, Perl Hacks: Tips & Tools For Programming, Debugging, And Surviving, by chromatic, Damian Conway, and Curtis “Ovid” Poe. It’s also very good, but completely separate from Dave’s.

  • Qt for Automation changed to Qt M2M Protocols

    Qt M2M Protocols is now automatically included for free to every new Qt Device Creation subscription. The additional distribution license price has been removed as well. Qt Application Development license holders can buy Qt M2M Protocols separately.

  • Using Visual Studio Code for Qt Applications – Part Two

    In the last blog post we saw an essential, C++ oriented, Visual Studio Code setup. That was enough to get going right away, but we can still definitely do more and better. Here I’ll show you how to get a complete setup for your qmake and CMake projects, all this while also wearing a Qt hat (on top of my C++ hat) and having a deeper look at the Qt side. Build qmake Qt projects Qmake is not integrated with Visual Studio Code the way CMake is, so setting up a qmake project for build is slightly more convoluted than doing the same with CMake. This means we’ll have to define our own build tasks. We’re going to do this in two stages: build steps definition and build steps combination, leveraging the fact that Visual Studio Code implements task dependencies and ordered sequential execution of dependencies.

  • Where Did Software Go Wrong?

    Computers were supposed to be “a bicycle for our minds”, machines that operated faster than the speed of thought. And if the computer was a bicycle for the mind, then the plural form of computer, Internet, was a “new home of Mind.” The Internet was a fantastic assemblage of all the world’s knowledge, and it was a bastion of freedom that would make time, space, and geopolitics irrelevant. Ignorance, authoritarianism, and scarcity would be relics of the meatspace past.

    Things didn’t quite turn out that way. The magic disappeared and our optimism has since faded. Our websites are slow and insecure; our startups are creepy and unprofitable; our president Tweets hate speech; we don’t trust our social media apps, webcams, or voting machines. And in the era of coronavirus quarantining, we’re realizing just how inadequate the Internet turned out to be as a home of Mind. Where did it all go wrong?

  • good idea bad implementation crosstalk

    Unfortunately products like the latter seem quite common. Most things in my house are still rather dumb because regrettably few products are actually the same thing, but smarter. Instead smart devices are inevitably some inscrutable machine intelligence physically manifested in my house. So no thanks. Battle lines drawn, everybody pick a side, good idea or bad implementation, and fight!

Android Leftovers

Ryzen 9 3900X/3950X vs. Core i9 10900K In 380+ Benchmarks

Following our initial Core i5 10600K and Core i9 10900K Linux benchmarks last week, here is a much larger comparison I have been working on since then in looking specifically at the Ryzen 9 3900X and 3950X against the Core i9 10900K. It's the largest to date with nearly 400 benchmarks being tested, most of them real-world test cases. The past number of days I have been running this Core i9 10900K vs. Ryzen 9 3900X vs. Ryzen 9 3950X comparison with 381 benchmarks out of 138 distinct applications/workloads on both systems. With this round of benchmarking the Gigabyte Z490 AORUS MASTER and ASUS ROG CROSSHAIR VIII HERO were at play with 2 x 8GB DDR4-3600 Corsair memory, Samsung 970 EVO NVMe SSD, and Radeon RX 5700 XT graphics. Benchmarking was run off Ubuntu 20.04 LTS while upgrading to the Linux 5.7 Git kernel for the very latest kernel bits. All other Ubuntu 20.04 packages were at their respective defaults. Read more

Compact 8K video encoder runs Linux on Kaby Lake

Advantech has launched a “VEGA-8300E 8K Broadcast Video Encoder” and streaming appliance for 8Kp60, 10-bit 4:2:2 HEVC real-time encoding. The system runs Ubuntu on a 7th Gen Kaby Lake CPU and offers 2x hot-swappable SATA bays. We realize that most of you are not in the market for an 8K video encoder, but we occasionally like to check in on the high-end video world where Linux is steadily making inroads. Normally Advantech’s VEGA-8300E 8K Broadcast Video Encoder would have been showcased at the NAB Show, which has been cancelled due to the pandemic. (Some NAB content is available on the online NAB Show Express.) We heard about the VEGA-8300E from an Advantech announcement on Businesswire that revealed the product has won a 2020 Best of Show Special Edition Award presented by TV Technology. Read more