Language Selection

English French German Italian Portuguese Spanish

Programming Leftovers

Filed under
Development
  • Type instances

    The particular nature of our work is up for any amount of debate, but the basic fact of it comes with a few requirements, and they are by and large inevitable if you wish to be a well-behaved, well-integrated member of the GNOME community. One of which is: “please, think of the language bindings”. These days, luckily for all of us, this means writing introspectable interfaces that adhere to fairly sensible best practices and conventions.

    [...]

    Please, please use GObject. Writing type system code is already boring and error prone, which is why we added a ton of macros to avoid people shooting themselves in both their feet, and we hammered away all the special snowflake API flourishes that made parsing C API to generate introspection data impossible.

    I can only recommend you go down the GTypeInstance route if you’ve done your due diligence on what that entails, and are aware that it is a last resort if GObject simply does not work within your project’s constraints.

  • The joys and perils of C and C++ aliasing, Part 1

    In C, C++, and some other programming languages, the term aliasing refers to a situation where two different expressions or symbols refer to the same object. When references access that object in different ways—as both reads and stores—there are consequences for the order in which these mixed accesses can happen. The value that is stored first is expected to be read by the subsequent access. In many instances, aliasing is harmless: It is common, safe, and usually optimally efficient to use two pointers of the same type to read, and even to write to the same object. But in some cases, using aliasing symbols for mixed accesses is less benign, and can adversely affect the correctness or efficiency of your code.

    Although there are quite a few articles on this subject, most tend to focus on the rules and requirements outlined in the standards (such as the strict aliasing rule). In this article, I focus on the details of the C and C++ language restrictions, their challenges and pitfalls, and examples demonstrating the restrictions’ beneficial effects in optimized code. In Part 2, I will present exemptions from aliasing, which can help you get around the restrictions more or less safely. I also consider some of the common pitfalls of aliasing and mixed accesses, and the actual problems these pitfalls might cause.

  • Why I switched from Java to Kotlin

    Kotlin is a cross-platform, general-purpose programming language that runs on the Java Virtual Machine (JVM). JetBrains led its implementation, which began in 2010, and it has been open source since early in its development.
    The great news for Java developers is that Kotlin is interoperable with Java. Standard Java code can be included in a Kotlin program, and Kotlin can be included in a Java program. That immense investment in compatibility means if you come from a Java background, picking up Kotlin will feel familiar and be a low risk since it will run alongside any of your existing Java code.

    To introduce you to Kotlin, I will go over some of its basic syntax, ranging from variables to defining functions and classes. If you want to follow along and learn some of the language's features, there is a great browser-based Kotlin playground you can use.

    [...]

    Kotlin's simplicity and Java interoperability equate to little risk that you will spend time learning something that isn't useful. After taking your first steps into Kotlin, you may never look at your Java code or the JVM the same way again.

  • New feature highlights in Elixir Cross Referencer v2.0

    Maxime Chrétien has extended Elixir to support kernel configuration parameters. Actually, he contributed a new parser to the universal-ctags project to do so. This way, you can explore C sources and Kconfig files and find the declarations and uses of kernel parameters...

  • Excellent Free Books to Learn Eiffel

    Eiffel is an object-oriented programming language designed by Bertrand Meyer (an object-orientation proponent and author of Object-Oriented Software Construction) and Eiffel Software.

  • Fortran newsletter: June 2020

    Welcome to the June 2020 edition of the monthly Fortran newsletter. The newsletter comes out on the first calendar day of every month and details Fortran news from the previous month.

  • sidetable - Create Simple Summary Tables in Pandas

    Today I am happy to announce the release of a new pandas utility library called sidetable. This library makes it easy to build a frequency table and simple summary of missing values in a DataFrame. I have found it to be a useful tool when starting data exploration on a new data set and I hope others find it useful as well.

    This project is also an opportunity to illustrate how to use pandas new API to register custom DataFrame accessors. This API allows you to build custom functions for working with pandas DataFrames and Series and could be really useful for building out your own library of custom pandas accessor functions.

  • Using pandas to plot data in Python

    In this series of articles on Python-based plotting libraries, we're going to look at an example of making plots using pandas, the hugely popular Python data manipulation library. Pandas is a standard tool in Python for scalably transforming data, and it has also become a popular way to import and export from CSV and Excel formats.

    On top of all that, it also contains a very nice plotting API. This is extremely convenient—you already have your data in a pandas DataFrame, so why not use the same library to plot it?

  • 2020.21/22 Four by Wenzel

    Wenzel P. P. Peppmeyer has written not one, not two, not three, but four blogs in the past two weeks, each addressing some feature or quirk of the Raku Programming Language.

  • Monthly Report - May

    I have been doing Monthly Report since June 2018 non-stop. It has become a ritual for me now. It gives me an opportunity to look upon my activities. Since the beginning of the year 2020, I have made conscious decision to slow down as far as submitting Pull Request. I have also stopped playing CPAN game of daily upload after breaking the chain three times. I am happy that Perlancar is keeping the game alive. It has given me space to try something new. Although COVID-19 keeping us indoor all the time, still looking for interesting project to keep the mind busy.

  • PHP 8.0 JIT Is Offering Very Compelling Performance Ahead Of Its Alpha

    With the PHP 8.0 schedule putting the first alpha release for the middle of June, I've been trying out its latest Git state in recent days for looking at its performance as well as when enabling its brand new JIT (Just In Time) compiler support that is new to PHP8. The results are quite compelling and here are metrics going back to the days of PHP 5.4 for comparison.

More in Tux Machines

Linux Plumbers Conference Not Sold Out and Annual X.Org / Wayland / Mesa Conference Going Virtual

  • Linux Plumbers Conference: Linux Plumbers Conference is Not Sold Out

    We’re really sorry, but apparently the Cvent registration site we use has suffered a bug which is causing it to mark the conference as “Sold Out” and, unfortunately, since today is the beginning of the American Independence day weekend, we can’t get anyone to fix it until Monday. However, rest assured there are plenty of places still available, so if you can wait until Monday, you should be able to register for the conference as soon as the site is fixed.

  • The Annual X.Org / Wayland / Mesa Conference Is Going Virtual Due To COVID-19

    XDC 20 was set to take place this September in Poland but is now moving to an online event as a result of the ongoing coronavirus / COVID-19 pandemic.  The X.Org Foundation has decided to make XDC 2020 a virtual conference due to uncertainty over the COVID-19 situation come September in Europe. This will be the first time the annual X.Org Developers' Conference has been an entirely online event.  The announcement was made today as well as extending the call for presentations by an additional two weeks. 

Security: Patches and diffoscope 150 released

  • Security updates for Friday

    Security updates have been issued by Debian (docker.io and imagemagick), Fedora (alpine, firefox, hostapd, and mutt), openSUSE (opera), Red Hat (rh-nginx116-nginx), SUSE (ntp, python3, and systemd), and Ubuntu (firefox, linux, linux-aws, linux-aws-hwe, linux-gcp, linux-gcp-4.15, linux-gke-4.15, linux-hwe, linux-kvm, linux-oem, linux-oracle, linux-raspi2, linux-snapdragon, linux, linux-aws, linux-gcp, linux-kvm, linux-oracle, linux-riscv, linux, linux-azure, linux-gcp, linux-gcp-5.3, linux-hwe, linux-kvm, linux-oracle, linux-oracle-5.3, linux-gke-5.0, linux-oem-osp1, net-snmp, and samba).

  • What is Software Security?

    Software security is the building of secure software with inherent defense so that it continues to function under malicious attacks, to the satisfaction of the users and owners of the software. This article explains the threats and solutions, from a general point of view. Standard vocabulary in information security is also explained. You should be computer and Internet literate to understand this article; you should also have studied a computer language, e.g., Perl, C, C++, PHP, etc. What is secured is information and software packages (applications and documents). Information is any message that is useful to anybody. “Information” is a vague word. The context in which it is used gives its meaning. It can mean news, lecture, tutorial (or lesson), or solution. A software package is usually a solution to some problem or related problems. In the past, all information not spoken was written on paper. Today, the software can be considered as a subset of information.

  • L1TF Cache Flushing Mode Could Soon Be Controlled Via Kconfig Build Option

    Approaching the two year anniversary next month of the L1TF / Foreshadow vulnerability, a Google engineer has proposed allowing the default mitigation state to be controlled via a Kconfig build-time option. This speculative execution attack on Intel CPUs has been mitigated since August 2018 and has offered for KVM virtual machine mitigation the kvm-intel.vmentry_l1d_flush module parameter for controlling the L1 data cache flushing behavior. But now a Google engineer has proposed setting the default L1 data flushing mode to be configurable at build-time via a new KVM_VMENTRY_L1D_FLUSH knob. This knob doesn't provide any new L1 Terminal Fault mitigation but rather just allows adjusting the default behavior for the default configuration of that kernel image, whether it be to never flush the cache before a VMENTER, conditionally flush, or the most impactful state of always flushing.

  • diffoscope 150 released

    The diffoscope maintainers are pleased to announce the release of diffoscope version 150.

Mozilla: SpiderMonkey and Filter Treeherder Development

  • SpiderMonkey Newsletter 5 (Firefox 78-79)

    SpiderMonkey is the JavaScript engine used in Mozilla Firefox. This newsletter gives an overview of the JavaScript and WebAssembly work we’ve done as part of the Firefox 78 and 79 Nightly release cycles. If you like these newsletters, you may also enjoy Yulia’s weekly Compiler Compiler live stream, a guided tour of what it is like to work on SpiderMonkey and improve spec compliance.

  • In Filter Treeherder jobs by test or manifest path I describe the feature.

    In Filter Treeherder jobs by test or manifest path I describe the feature. In this post I will explain how it came about. I want to highlight the process between a conversation and a deployed feature. Many times, it is an unseen part of the development process that can be useful for contributors and junior developers who are trying to grow as developers. Back in the Fall of 2019 I started inquiring into developers’ satisfaction with Treeherder. This is one of the reasons I used to go to the office once in a while. One of these casual face-to-face conversations led to this feature. Mike Conley explained to me how he would look through various logs to find a test path that had failed on another platform (see referenced post for further details). After I understood the idea, I tried to determine what options we had to implement it. I wrote a Google Doc with various alternative implementations and with information about what pieces were needed for a prototype. I requested feedback from various co-workers to help discover blind spots in my plans. Once I had some feedback from immediate co-workers, I made my idea available in a Google group (increasing the circle of people giving feedback). I described my intent to implement the idea and was curious to see if anyone else was already working on it or had better ideas on how to implement it. I did this to raise awareness in larger circles, reduce duplicate efforts and learn from prior work. I also filed a bug to drive further technical discussions and for interested parties to follow up on the work. Fortunately, around the same time Andrew Halberstadt started working on defining explicitly what manifests each task executes before the tasks are scheduled (see bug). This is a major component to make the whole feature on Treeherder functional. In some cases, talking enough about the need can enlist others from their domains of expertise to help with your project.

  • Filter Treeherder jobs by test or manifest path

    This feature is useful for developers and code sheriffs because it permits them to determine whether or not a test that fails in one platform configuration also fails in other ones. Previously, this was difficult because certain test suites are split into multiple tasks (aka “chunks”). In the screenshot below, you can see that the manifest path devtools/client/framework/browser-toolbox/test/browser.ini is executed in different chunks.

Debian-based Grml 2020.06 Released and NsCDE in Debian-based Sparky

  • Grml 2020.06 – Codename Ausgehfuahangl

    We did it again™, at the end of June we released Grml 2020.06, codename Ausgehfuahangl. This Grml release (a Linux live system for system administrators) is based on Debian/testing (AKA bullseye) and provides current software packages as of June, incorporates up to date hardware support and fixes known issues from previous Grml releases. I am especially fond of our cloud-init and qemu-guest-agent integration, which makes usage and automation in virtual environments like Proxmox VE much more comfortable.

  • NsCDE

    There is a new desktop available for Sparkers: NsCDE What is NsCDE? Not so Common Desktop Environment (NsCDE) is a retro but powerful (kind of) UNIX desktop environment which resembles CDE look (and partially feel) but with a more powerful and flexible framework beneath-the-surface, more suited for 21st century unix-like and Linux systems and user requirements than original CDE. NsCDE can be considered as a heavyweight FVWM theme on steroids, but combined with a couple other free software components and custom FVWM applications and a lot of configuration, NsCDE can be considered a lightweight hybrid desktop environment.