FLOSS Project Planets

Ned Batchelder: Does Python have pointers?

Planet Python - Mon, 2024-03-11 07:27

People sometimes ask, “Does Python have pointers?” I hate to be the typical senior engineer, but this is one of those questions where the answer is, it depends what you mean by pointer.

The classic definition of a pointer is: a variable that holds the address of something else and that you can use to work with that something else. In very broad pseudo-code, it would be something like this:

myvar = SOMETHING;
mypointer = get_address_of(myvar);
print(get_value_via_pointer(mypointer));
## output is SOMETHING

This is useful because we can use a pointer to refer to data, setting the pointer in one part of the code with whatever logic we need to decide what data it should point to. Then elsewhere we can use the pointer without having to know what it’s referring to or how the decision was made. The pointer gives us an indirection that lets us separate concerns and write more modular code.

Many programming languages provide a pointer facility like this. For example, in C, the get_address_of() operation is ampersand, and the get_value_via_pointer() operation is star, and our code snippet would be:

int myvar = 17;
int *mypointer = &myvar;
print_int(*mypointer);      // outputs 17

Other languages like C++, C#, Go, Rust, Pascal, and even Fortran have similar capabilities.

OK, so what about Python? In one sense, Python doesn’t have a pointer concept like this. You could say that get_address_of() is provided by Python’s id() function, since (in CPython at least) it returns the memory address of the data:

myvar = 17
mypointer = id(myvar)   # ** not useful

But Python has no inverse operation: there’s no get_value_via_pointer() that can get you myvar given mypointer.

So Python doesn’t have the classic pair of operations to be able to work with pointers explicitly. But on the other hand, every variable in Python is a pointer, because variables in Python are names that refer to objects.

In Python, our simple example looks like this:

myvar = 17
mypointer = myvar
print(mypointer)    # outputs 17

When someone asks, does Python have pointers, perhaps the best answer is: it doesn’t have explicit pointers like some other languages, but everything is implicitly a pointer. So you have the power of pointers to use when you need them: you can have multiple data structures, then assign a variable to one you choose, and use the variable later. You’ve achieved the separation of “which data” from “work with the data” that pointers provide.

Maybe this is yet another case of Same words, different meanings.

Note:

  • Some languages like C also allow pointer arithmetic to adjust a pointer from one item in an array to another. Python’s references don’t allow for that.
  • Python’s standard library provides ctypes, which is great for interfacing with native C code, exposing details there including C pointers. This does not count as Python having explicit pointers.
Categories: FLOSS Project Planets

ComputerMinds.co.uk: Webform Protected Downloads

Planet Drupal - Mon, 2024-03-11 06:58

I recently produced the first release of the Webform Protected Downloads module that is compatible with Drupal 10. It provides the ability for sites to have 'gated' content which users can download once they have filled out a form for their details. This can convert engaged visitors into leads, set up licenses for customers, or simply validate a user for access to a file. Put simply, as the project's description says, this module could be useful to you if:

  • You want to offer some files for download to either anonymous or registered users
  • You don't want those files to be publicly accessible
  • You want to collect some data before granting access to the files
  • You want to be sure that the user gives a valid email address

One of our clients recently came to us with requirements along these lines for their Drupal 10 site, so I went out looking for suitable solutions. There are several similar modules, but this was the only one that fit these specific needs:

  1. There should be no way for the public to access the files without completing the webform.
  2. There could be more than one file to provide access to from a webform.
  3. The file(s) should be downloaded from the website rather than sent by email.

We had used the module on an old Drupal 7 site a long time ago, but there hadn't been any work on it for a few years and there was no release compatible with Drupal 10. However, development had started in a branch that had been automatically opened up to new maintainers. This was a great example of how that process can help the community keep modules up-to-date and secure with little fuss. All I had to do was confirm a few details myself, and within a few hours I had access to update the project. Of course, I'm building upon the great work that has been done by the previous maintainers - and in this case, Timotej Lovrecic especially, who had created an initial fork on GitHub that was compatible with Drupal 8.

Now that we have a version to use with Drupal 10; let me introduce you to how to use it! I'll assume you can already download and install the module

Screenshot of the handler settings (click image for full size)

When you configure the settings of a webform, you can set up 'handlers'. Emails sent to users or administrators are probably the most common sort of handler, so the tab to configure these under Webform's 'Settings' page is labelled 'Emails / Handlers'. Add a handler, and choose the 'Webform protected download' type in the popup.

From here you can control what amount of verification you want to apply to the download link (such as whether you want to restrict it to the user that submits the form or not), whether the link should only work once, or expire after some time. The file to protect can be uploaded at the bottom of the form. 

Once you've configured and saved your handler, the next step is to use tokens to set how a user receives their link. These could go in an email - in which case configure an email handler, or a confirmation message/page - which can be set from the 'Confirmation' tab of the Webform's 'Settings' page.

In either case, the token to use takes the format: [webform_submission:protected_download_url:my_handler_id]. (If you only have one protected download, you can skip that last part off so it is just [webform_submission:protected_download_url].) The handler ID should be the 'machine name' from your handler settings, which is also shown in a column in the list of handlers. The token will be replaced with the user's unique download URL, so you may wish to use it directly within a plain-text email, or as a link destination in a confirmation message (which is usually HTML).

Example of using a download token for a link within the confirmation message

With that token in the right place, when your guest completes the webform, they'll now receive the link to download the file they wanted - and you'll have what you wanted in return.

Let me know how you get on. Your feedback is welcome in the comments below or in the Webform Protected Downloads module's issue queue!

Categories: FLOSS Project Planets

The Drop Times: Dries Buytaert's Visit to Japan: Fostering Growth for Drupal Community

Planet Drupal - Mon, 2024-03-11 05:59
Explore the burgeoning impact of Dries Buytaert's visit to Japan, which fosters growth and collaboration within the local Drupal community. Delve into the anticipation surrounding his return and the promising prospects it brings for Drupal enthusiasts in Japan.
Categories: FLOSS Project Planets

Python Bytes: #374 Climbing the Python Web Mountain

Planet Python - Mon, 2024-03-11 04:00
<strong>Topics covered in this episode:</strong><br> <ul> <li><a href="https://www.piglei.com/articles/en-6-ways-to-improve-the-arch-of-you-py-project/"><strong>6 ways to improve the architecture of your Python project (using import-linter)</strong></a></li> <li><a href="https://github.com/piercefreeman/mountaineer">Mountaineer</a></li> <li><a href="https://python-history.blogspot.com/2010/08/why-pythons-integer-division-floors.html"><strong>Why Python's Integer Division Floors</strong></a></li> <li><a href="https://hatchet.run"><strong>Hatchet</strong></a></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=SaV3sJ8FlZU' style='font-weight: bold;'data-umami-event="Livestream-Past" data-umami-event-episode="374">Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by ScoutAPM: <a href="https://pythonbytes.fm/scout"><strong>pythonbytes.fm/scout</strong></a></p> <p><strong>Connect with the hosts</strong></p> <ul> <li>Michael: <a href="https://fosstodon.org/@mkennedy"><strong>@mkennedy@fosstodon.org</strong></a></li> <li>Brian: <a href="https://fosstodon.org/@brianokken"><strong>@brianokken@fosstodon.org</strong></a></li> <li>Show: <a href="https://fosstodon.org/@pythonbytes"><strong>@pythonbytes@fosstodon.org</strong></a></li> </ul> <p>Join us on YouTube at <a href="https://pythonbytes.fm/stream/live"><strong>pythonbytes.fm/live</strong></a> to be part of the audience. Usually Tuesdays at 11am PT. Older video versions available there too.</p> <p><strong>Brian #1:</strong> <a href="https://www.piglei.com/articles/en-6-ways-to-improve-the-arch-of-you-py-project/"><strong>6 ways to improve the architecture of your Python project (using import-linter)</strong></a></p> <ul> <li>Piglei</li> <li>Using <a href="https://github.com/seddonym/import-linter">import-linter</a> to <ul> <li>define architectural layers</li> <li>check to make sure imports don’t violate (import from upper layers)</li> <li>can also check for more contracts, such as <ul> <li>forbidden - disallow a specific from/to import </li> <li>independence - list of modules that shouldn’t import from each other</li> </ul></li> </ul></li> <li>Fixing violations <ul> <li>a process introduced to set exceptions for each violation in a config file</li> <li>then fix violations 1 at a time (nice approach)</li> <li>use the whole team if you can</li> </ul></li> <li>Common methods for fixing dependency issues <ul> <li>Merging and splitting modules</li> <li>Dependency Injection, including using protocols to keep type hints without the need to import just for types</li> <li>Use simpler dependency types</li> <li>Delaying function implementations <ul> <li>module global methods set by caller, or adding a simple plugin/callback system</li> </ul></li> <li>Configuration driven <ul> <li>Setting import statements in a config file and using <code>import_string()</code> at runtime</li> </ul></li> <li>Replace function calls with event-driven approaches</li> </ul></li> </ul> <p><strong>Michael #2:</strong> <a href="https://github.com/piercefreeman/mountaineer">Mountaineer</a></p> <ul> <li>Mountaineer is a batteries-included web framework for Python and React.</li> <li>Mountaineer focuses on developer productivity above all else, with production speed a close second. <ul> <li>📝 Typehints up and down the stack: frontend, backend, and database</li> <li>🎙️ Trivially easy client[HTML_REMOVED]server communication, data binding, and function calling</li> <li>🌎 Optimized server rendering for better accessibility and SEO</li> <li>🏹 Static analysis of web pages for strong validation: link validity, data access, etc.</li> <li>🤩 Skip the API or Node.js server just to serve frontend clients</li> </ul></li> </ul> <p><strong>Brian #3:</strong> <a href="https://python-history.blogspot.com/2010/08/why-pythons-integer-division-floors.html"><strong>Why Python's Integer Division Floors</strong></a></p> <ul> <li>Guido van Rossum</li> <li>Integer division always floors (toward negative infinity) instead of truncating. (C truncates)</li> <li>5//2 → 2</li> <li>-5//2 → -3</li> <li>5//-2 → -3</li> <li>Reason, <ul> <li>For nice mathematical relationships with // and % (modulo).</li> <li>a//b = quotient (q), a%b = remainder (r)</li> <li>such that b*q + r = a, and 0 &lt;= r &lt; b <ul> <li>This works for both positive and negative a values</li> <li>For negative b, the second rule has to change to 0 &gt;= r &gt; b </li> </ul></li> </ul></li> <li>If you truncate (like C does), you have to use abs(r) for the first rule to work.</li> <li>Theory of why C doesn’t do it this way: Probably a hardware limitation at the time when C was designed, due to “sign + magnitude” integers instead of modern two’s compliment integers.</li> </ul> <p><strong>Michael #4:</strong> <a href="https://hatchet.run"><strong>Hatchet</strong></a></p> <ul> <li>Hatchet is a distributed, fault-tolerant task queue which replaces traditional message brokers and pub/sub systems. </li> <li>It’s built to solve problems like concurrency, fairness, and durability</li> <li>Concurrency, Fairness, and Rate limiting: Enable FIFO, LIFO, Round Robin, and Priority Queues with built-in strategies to avoid common pitfalls.</li> <li>Architected for Resiliency: Customizable retry policies and built-in error handling to recover from transient failures.</li> </ul> <p><strong>Extras</strong> </p> <p>Brian:</p> <ul> <li><a href="https://pythontest.com/216"><strong>Charlie Marsh on uv in PythonTest episode 216</strong></a></li> </ul> <p>Michael:</p> <ul> <li><a href="https://training.talkpython.fm/courses/build-an-audio-ai-app-with-python-and-assemblyai"><strong>Build An Audio AI App Course</strong></a> [free!]</li> <li><a href="https://training.talkpython.fm/courses/python-type-hint-course-with-hands-on-examples"><strong>Rock Solid Python with Python Typing Course</strong></a></li> <li><a href="https://mstdn.social/@RayScript/111919177551660638"><strong>Coolio</strong></a></li> </ul> <p><strong>Joke:</strong> <a href="https://workchronicles.com/not-if-but-when/"><strong>Breaking Prod</strong></a></p>
Categories: FLOSS Project Planets

Activity-aware Firefox 0.4.2 & packages for Debian and Arch

Planet KDE - Sun, 2024-03-10 19:00

If you have not been following this blog series, I made a wrapper for Firefox to be able to run different tabs (and more) in different KDE Plasma Activities.

Often a hurdle to using a piece of software is that it is not packaged for Linux distros.

Kudos to Aurélien Couderc (coucouf), who packaged already 0.4.1 for Debian and provided the patch to make it easier to package to different distros.

With 0.4.2 version of Activity-aware Firefox we applied that patch. Other then that, the functionality remains the same as in 0.4.1.

Then I also wrote an AUR package, so Arch, EndeavourOS etc. should be covered now too.

As a consequence, Repology now lists 12 distro packages for Activity-aware Firefox – that is a great start!

But while large, Debian- and Arch-based distros are just a subset of all available FOSS operating systems that KDE Plasma and Firefox run on. If someone were to put it on Open Build Service to cover also RPM-based and other distros, that would be a great boon!

Contributions welcome, as I am reaching the limit of my skills here.

hook out → server migration successful – more on that some other day

Categories: FLOSS Project Planets

hyperbole @ Savannah: GNU Hyperbole Major Release 9 (V9.0.1) Rhapsody

GNU Planet! - Sun, 2024-03-10 18:22
Overview


GNU Hyperbole 9.0.1, the Rhapsody release, is now available on GNU ELPA. 
And oh what a release it is: extensive new features, new video
demos, org and org roam integration, Markdown and Org file support in
HyRolo, recursive directory and wildcard file scanning in HyRolo, and
much more.

What's new in this release is extensively described here:

  www.gnu.org/s/hyperbole/HY-NEWS.html

  Everything back until release 8.0.0 is new since the last major release
  announcement (almost a year and a half ago), so updates are extensive.

Hyperbole is like Markdown for hypertext.  Hyperbole automatically
recognizes dozens of common patterns in any buffer regardless of mode
and transparently turns them into hyperbuttons you can instantly
activate with a single key.  Email addresses, URLs, grep -n outputs,
programming backtraces, sequences of Emacs keys, programming
identifiers, Texinfo and Info cross-references, Org links, Markdown
links and on and on.  All you do is load Hyperbole and then your text
comes to life with no extra effort or complex formatting.

But Hyperbole is also a personal information manager with built-in
capabilities of contact management/hierarchical record lookup,
legal-numbered outlines with hyperlinkable views and a unique window
and frame manager.  It is even Org-compatible so you can use all of
Org's capabilities together with Hyperbole.

Hyperbole stays out of your way but is always a key press away when
you need it.  Like Emacs, Org, Counsel and Helm, Hyperbole has many
different uses, all based around the theme of reducing cognitive load
and improving your everyday information management.  It reduces
cognitive load by using a single Action Key, {M-RET}, across many
different contexts to perform the best default action in each.

Hyperbole has always been one of the best documented Emacs packages.
With Version 9 comes excellent test coverage: over 400 automated tests
are run with every update against every major version of Emacs since
version 27, to ensure quality.  We hope you'll give it a try.

Videos


If you prefer video introductions, visit the videos linked to below;
otherwise, skip to the next section.

GNU Hyperbole Videos with Web Links


Installing and Using Hyperbole


To install within GNU Emacs, use:

   {M-x package-install RET hyperbole RET}

   Hyperbole installs in less than a minute and can be uninstalled even
   faster if ever need be.  Give it a try.

Then to invoke its minibuffer menu, use:

   {C-h h} or {M-x hyperbole RET}

The best way to get a feel for many of its capabilities is to invoke the
all new, interactive FAST-DEMO and explore sections of interest:

   {C-h h d d}

To permanently activate Hyperbole in your Emacs initialization file, add
the line:

   (hyperbole-mode 1)

Hyperbole is a minor mode that may be disabled at any time with:

   {C-u 0 hyperbole-mode RET}

The Hyperbole home page with screenshots is here:

   www.gnu.org/s/hyperbole

For use cases, see:

   www.gnu.org/s/hyperbole/HY-WHY.html

For what users think about Hyperbole, see:

   www.gnu.org/s/hyperbole/hyperbole.html#user-quotes

Enjoy,

The Hyperbole Team

Categories: FLOSS Project Planets

Drupal Association blog: Meet Imre, empowering Drupal's growth as a board member of the Drupal Association

Planet Drupal - Sun, 2024-03-10 09:30

We're delighted to introduce Imre Gmelig Meijling, one of the newest members elected in October of the Drupal Association Board. Imre, CEO at React Online Digital Agency in The Netherlands, brings a wealth of digital experience from roles at organizations like the United Nations World Food Programme, Disney, and Port of Rotterdam.

Imre is not only a member of the Drupal Association Board of Directors but also serves as an executive member on the DrupalCon Europe Advisory Committee. Previously, he chaired the Dutch Drupal Association, expanding marketing efforts and establishing a successful Drupal Partner Program. Imre played a key role in launching drupal.nl, a community website used by several countries. He co-created the Splash Awards and led Drupaljam, a Dutch Drupal event with almost 500 attendees. In 2023, Imre joined the Drupal Business Survey.

As a recent board member, Imre shares insights on this exciting journey:

What are you most excited about when it comes to joining the Drupal Association board?
I am very excited about joining the Drupal Association Board and contributing with insights and perspectives from the digital business market in Europe. Drupal has a strong market position with many opportunities for the coming years. I look forward to supporting the marketing team in their expanding efforts. I am particularly proud and excited to be part of an inclusive global community. Being part of an inclusive global community and supporting the Open Web Manifesto aligns closely with my personal values.

What do you hope to accomplish during your time on the board?
I aim to help expand Drupal's marketing outreach aiming for more wonderful brands and organizations adopting Drupal and attracting new talent to get involved with Drupal. I am also looking forward to establishing and sustaining relationships between Europe and other regions with the Drupal Association and finding ways to work even more closely together.

What specific skill or perspective do you contribute to the board?
Being part of an inclusive global community and supporting the Open Web Manifesto aligns closely with my personal values. Working with Drupal at various digital agencies in Europe, I support the growth of Drupal from a business-perspective, but having a technical background, I know the strength of the Drupal community has and can be for brands. Having been in both worlds for a long time, I will help and make sure we bring them together.

I was Chair of the Board for the Dutch Drupal Association, in which time a successful Dutch Partner Program was launched. Also, marketing and advertising on mainstream media was taking off during that time. I was also involved in the design and setup of the Dutch Drupal website, which is now open source. I co-founded the Splash Awards and I am Executive Member of the DrupalCon Europe Community Advisory Committee. I will share all of my experiences where I can. 

How has Drupal impacted your life or career?
It's part of my life, both professional as well as personal, for over 16 years.

Tell us something that the Drupal community might not know about you.
I own my own digital agency in The Netherlands, React Online. I began my career as a UX designer and front end developer for Lotus Notes applications, called 'groupware' at the time, a long gone predecessor to the social collaboration platforms that we now know well. Interestingly, my birthday is on January 15, just like Drupal!

Share a favorite quote or piece of advice that has inspired you.
A true leader is not one with the most followers, but one who makes the most leaders out of others. A true master is not the one with the most students, but one who makes masters out of others.

We can't wait to experience the incredible contributions Imre will make during his time on the Drupal Association Board. Thank you, Imre, for dedicating yourself to serving the Drupal community through your board work! Connect with Imre on LinkedIn.

The Drupal Association Board of Directors comprises 12 members, with nine nominated for staggered 3-year terms, two elected by the Drupal Association members, and one reserved for the Drupal Project Founder, Dries Buyteart. The Board meets twice in person and four times virtually annually, overseeing policy establishment, executive director management, budget approval, financial reports, and participation in fundraising efforts.

Categories: FLOSS Project Planets

Thorsten Alteholz: My Debian Activities in February 2024

Planet Debian - Sun, 2024-03-10 08:22
FTP master

This month I accepted 242 and rejected 42 packages. The overall number of packages that got accepted was 251.

This was just a short month and the weather outside was not really motivating. I hope it will be better in March.

Debian LTS

This was my hundred-sixteenth month that I did some work for the Debian LTS initiative, started by Raphael Hertzog at Freexian.

During my allocated time I uploaded:

  • [DLA 3739-1] libjwt security update for one CVE to fix some ‘constant-time-for-execution-issue
  • [libjwt] upload to unstable
  • [#1064550] Bullseye PU bug for libjwt
  • [#1064551] Bookworm PU bug for libjwt
  • [#1064551] Bookworm PU bug for libjwt; upload after approval
  • [DLA 3741-1] engrampa security update for one CVE to fix a path traversal issue with CPIO archives
  • [#1060186] Bookworm PU-bug for libde265 was flagged for acceptance
  • [#1056935] Bullseye PU-bug for libde265 was flagged for acceptance

I also started to work on qtbase-opensource-src (an update is needed for ELTS, so an LTS update seems to be appropriate as well, especially as there are postponed CVE).

Debian ELTS

This month was the sixty-seventth ELTS month. During my allocated time I uploaded:

  • [ELA-1047-1]bind9 security update for one CVE to fix an stack exhaustion issue in Jessie and Stretch

The upload of bind9 was a bit exciting, but all occuring issues with the new upload workflow could be quickly fixed by Helmut and the packages finally reached their destination. I wonder why it is always me who stumbles upon special cases? This month I also worked on the Jessie and Stretch updates for exim4. I also started to work on an update for qtbase-opensource-src in Stretch (and LTS and other releases as well).

Debian Printing

This month I uploaded new upstream versions of:

This work is generously funded by Freexian!

Debian Matomo

I started a new team debian-matomo-maintainers. Within this team all matomo related packages should be handled. PHP PEAR or PECL packages shall be still maintained in their corresponding teams.

This month I uploaded:

This work is generously funded by Freexian!

Debian Astro

This month I uploaded a new upstream version of:

Debian IoT

This month I uploaded new upstream versions of:

Categories: FLOSS Project Planets

Vasudev Kamath: Cloning a laptop over NVME TCP

Planet Debian - Sun, 2024-03-10 07:45

Recently, I got a new laptop and had to set it up so I could start using it. But I wasn't really in the mood to go through the same old steps which I had explained in this post earlier. I was complaining about this to my colleague, and there came the suggestion of why not copy the entire disk to the new laptop. Though it sounded like an interesting idea to me, I had my doubts, so here is what I told him in return.

  1. I don't have the tools to open my old laptop and connect the new disk over USB to my new laptop.
  2. I use full disk encryption, and my old laptop has a 512GB disk, whereas the new laptop has a 1TB NVME, and I'm not so familiar with resizing LUKS.

He promptly suggested both could be done. For step 1, just expose the disk using NVME over TCP and connect it over the network and do a full disk copy, and the rest is pretty simple to achieve. In short, he suggested the following:

  1. Export the disk using nvmet-tcp from the old laptop.
  2. Do a disk copy to the new laptop.
  3. Resize the partition to use the full 1TB.
  4. Resize LUKS.
  5. Finally, resize the BTRFS root disk.
Exporting Disk over NVME TCP

The easiest way suggested by my colleague to do this is using systemd-storagetm.service. This service can be invoked by simply booting into storage-target-mode.target by specifying rd.systemd.unit=storage-target-mode.target. But he suggested not to use this as I need to tweak the dracut initrd image to involve network services as well as configuring WiFi from this mode is a painful thing to do.

So alternatively, I simply booted both my laptops with GRML rescue CD. And the following step was done to export the NVME disk on my current laptop using the nvmet-tcp module of Linux:

modprobe nvemt-tcp cd /sys/kernel/config/nvmet mkdir ports/0 cd ports/0 echo "ipv4" > addr_adrfam echo 0.0.0.0 > addr_traaddr echo 4420 > addr_trsvcid echo tcp > addr_trtype cd /sys/kernel/config/nvmet/subsystems mkdir testnqn echo 1 >testnqn/allow_any_host mkdir testnqn/namespaces/1 cd testnqn # replace the device name with the disk you want to export echo "/dev/nvme0n1" > namespaces/1/device_path echo 1 > namespaces/1/enable ln -s "../../subsystems/testnqn" /sys/kernel/config/nvmet/ports/0/subsystems/testnqn

These steps ensure that the device is now exported using NVME over TCP. The next step is to detect this on the new laptop and connect the device:

nvme discover -t tcp -a <ip> -s 4420 nvme connectl-all -t tcp -a <> -s 4420

Finally, nvme list shows the device which is connected to the new laptop, and we can proceed with the next step, which is to do the disk copy.

Copying the Disk

I simply used the dd command to copy the root disk to my new laptop. Since the new laptop didn't have an Ethernet port, I had to rely only on WiFi, and it took about 7 and a half hours to copy the entire 512GB to the new laptop. The speed at which I was copying was about 18-20MB/s. The other option would have been to create an initial partition and file system and do an rsync of the root disk or use BTRFS itself for file system transfer.

dd if=/dev/nvme2n1 of=/dev/nvme0n1 status=progress bs=40M Resizing Partition and LUKS Container

The final part was very easy. When I launched parted, it detected that the partition table does not match the disk size and asked if it can fix it, and I said yes. Next, I had to install cloud-guest-utils to get growpart to fix the second partition, and the following command extended the partition to the full 1TB:

growpart /dev/nvem0n1 p2

Next, I used cryptsetup-resize to increase the LUKS container size.

cryptsetup luksOpen /dev/nvme0n1p2 ENC cryptsetup resize ENC

Finally, I rebooted into the disk, and everything worked fine. After logging into the system, I resized the BTRFS file system. BTRFS requires the system to be mounted for resize, so I could not attempt it in live boot.

btfs fielsystem resize max / Conclussion

The only benefit of this entire process is that I have a new laptop, but I still feel like I'm using my existing laptop. Typically, setting up a new laptop takes about a week or two to completely get adjusted, but in this case, that entire time is saved.

An added benefit is that I learned how to export disks using NVME over TCP, thanks to my colleague. This new knowledge adds to the value of the experience.

Categories: FLOSS Project Planets

Talk Python to Me: #452: Top Quart (async Flask) Extensions

Planet Python - Sun, 2024-03-10 04:00
Have you heard of Quart? It's the fully-async version of Flask created by Philip Jones who is working closely with the Flask team on these parallel projects. The TL;DR; version is that if you want to take advantage of async and await and you're using Flask, you want to give Quart a solid look. We've spoken to Philip previously about Quart. This time around here's here to share his top Quart extensions and libraries you can adopt today.<br/> <br/> <strong>Episode sponsors</strong><br/> <br/> <a href='https://talkpython.fm/posit'>Posit</a><br> <a href='https://talkpython.fm/training'>Talk Python Courses</a><br/> <br/> <strong>Links from the show</strong><br/> <br/> <div><b>Pallets Team on ExTwitter</b>: <a href="https://twitter.com/PalletsTeam" target="_blank" rel="noopener">@PalletsTeam</a><br/> <b>Quart Framework</b>: <a href="https://quart.palletsprojects.com/en/latest/index.html" target="_blank" rel="noopener">quart.palletsprojects.com</a><br/> <b>Using Quart Extensions</b>: <a href="https://quart.palletsprojects.com/en/latest/how_to_guides/quart_extensions.html" target="_blank" rel="noopener">quart.palletsprojects.com</a><br/> <br/> <b>Quart Tasks</b>: <a href="https://quart-tasks.readthedocs.io/en/latest/index.html" target="_blank" rel="noopener">quart-tasks.readthedocs.io</a><br/> <b>Quart Minify</b>: <a href="https://github.com/AceFire6/quart_minify/" target="_blank" rel="noopener">github.com</a><br/> <b>Quart Db</b>: <a href="https://github.com/pgjones/quart-db" target="_blank" rel="noopener">github.com</a><br/> <b>Hypercorn</b>: <a href="https://github.com/pgjones/hypercorn/" target="_blank" rel="noopener">github.com</a><br/> <b>Quart-CORS</b>: <a href="https://github.com/pgjones/quart-cors" target="_blank" rel="noopener">github.com</a><br/> <b>Quart-Auth</b>: <a href="https://github.com/pgjones/quart-auth" target="_blank" rel="noopener">github.com</a><br/> <b>Quart-Rate</b>: <a href="https://github.com/pgjones/quart-rate-limiter" target="_blank" rel="noopener">github.com</a><br/> <b>Quart-Schma</b>: <a href="https://github.com/pgjones/quart-schema" target="_blank" rel="noopener">github.com</a><br/> <b>Flask-Socket</b>: <a href="https://github.com/miguelgrinberg/flask-sock" target="_blank" rel="noopener">github.com</a><br/> <b>Quart-SqlAlchemy</b>: <a href="https://github.com/joeblackwaslike/quart-sqlalchemy" target="_blank" rel="noopener">github.com</a><br/> <b>Flask-Login</b>: <a href="https://github.com/pgjones/quart-flask-patch/blob/main/tests/test_flask_login.py" target="_blank" rel="noopener">github.com</a><br/> <b>greenback</b>: <a href="https://github.com/oremanj/greenback" target="_blank" rel="noopener">github.com</a><br/> <b>secure</b>: <a href="https://github.com/cak/secure" target="_blank" rel="noopener">github.com</a><br/> <b>msgspec</b>: <a href="https://jcristharif.com/msgspec/structs.html" target="_blank" rel="noopener">jcristharif.com</a><br/> <b>Server-Sent Events</b>: <a href="https://pgjones.gitlab.io/quart/how_to_guides/server_sent_events.html" target="_blank" rel="noopener">pgjones.gitlab.io</a><br/> <b>Watch this episode on YouTube</b>: <a href="https://www.youtube.com/watch?v=p80S1eLDQQQ" target="_blank" rel="noopener">youtube.com</a><br/> <b>Episode transcripts</b>: <a href="https://talkpython.fm/episodes/transcript/452/top-quart-async-flask-extensions" target="_blank" rel="noopener">talkpython.fm</a><br/> <br/> <b>--- Stay in touch with us ---</b><br/> <b>Subscribe to us on YouTube</b>: <a href="https://talkpython.fm/youtube" target="_blank" rel="noopener">youtube.com</a><br/> <b>Follow Talk Python on Mastodon</b>: <a href="https://fosstodon.org/web/@talkpython" target="_blank" rel="noopener"><i class="fa-brands fa-mastodon"></i>talkpython</a><br/> <b>Follow Michael on Mastodon</b>: <a href="https://fosstodon.org/web/@mkennedy" target="_blank" rel="noopener"><i class="fa-brands fa-mastodon"></i>mkennedy</a><br/></div>
Categories: FLOSS Project Planets

Valhalla's Things: Low Fat, No Eggs, Lasagna-ish

Planet Debian - Sat, 2024-03-09 19:00
Posted on March 10, 2024
Tags: madeof:atoms, craft:cooking

A few notes on what we had for lunch, to be able to repeat it after the summer.

There were a number of food intolerance related restrictions which meant that the traditional lasagna recipe wasn’t an option; the result still tasted good, but it was a bit softer and messier to take out of the pan and into the dishes.

On Saturday afternoon we made fresh no-egg pasta with 200 g (durum) flour and 100 g water, after about 1 hour it was divided in 6 parts and rolled to thickness #6 on the pasta machine.

Meanwhile, about 500 ml of low fat almost-ragù-like meat sauce was taken out of the freezer: this was a bit too little, 750 ml would have been better.

On Saturday evening we made a sauce with 1 l of low-fat milk and 80 g of flour, and the meat sauce was heated up.

Then everything was put in a 28 cm × 23 cm pan, with 6 layers of pasta and 7 layers of the two sauces, and left to cool down.

And on Sunday morning it was baked for 35 min in the oven at 180 °C.

With 3 people we only had about two thirds of it.

Next time I think we should try to use 400 - 500 g of flour (so that it’s easier to work by machine), 2 l of milk, 1.5 l of meat sauce and divide it into 3 pans: one to eat the next day and two to freeze (uncooked) for another day.

No pictures, because by the time I thought about writing a post we were already more than halfway through eating it :)

Categories: FLOSS Project Planets

MidCamp - Midwest Drupal Camp: Looking for Non-Technical Training?

Planet Drupal - Sat, 2024-03-09 17:08
Looking for Non-Technical Training?

With less than two weeks to go, trainings at MidCamp 2024 are on sale and filling up fast. 

This year we’re excited to offer two great options for non-technical folk, also open to technical attendees who are looking for alternative options:

Tech Career Tune-Up: Navigating Your Path in Tech with Confidence and Clarity

Dive into a transformative 3-hour workshop designed by Nichole Addeo of Mythic Digital, specifically for tech professionals.

"Tech Career Tune-Up: Navigating Your Path in Tech with Confidence and Clarity" offers a unique blend of career reflection, exploration, and mental wellness tools tailored to address the challenges unique to the tech world.

Learn More

What am I Getting Myself Into? A Drupal Crash Course for Non-Developers

If you’re new to Drupal, then this hands on course is the class for you. Rod Martin of Promet Source will teach the key concepts you need to understand, navigate and use a Drupal site.

Learn how to build a Drupal 10 site, from content and user organization, to working with modules and themes. This training will answer the questions you didn’t even know to ask!

Learn More

Important Dates:

  • Save $100 before the regular ticket pricing ends: March 14

  • See you there! MidCamp 2024: March 20-22

Save $100 before March 14

Categories: FLOSS Project Planets

How YOU Help With Quality

Planet KDE - Sat, 2024-03-09 16:53

In today’s other blog post, I mentioned how we’ve been getting a huge number of bug reports since the Mega-Release. If you’re not in software engineering, this probably seems like a bad thing. “Oh no, why so many bugs? Didn’t you test your software properly!?”

Since most people are not involved in software engineering, this perspective is common and understandable. So I’d like to shed a light on the assumptions behind it, and talk about the challenges involved in improving software quality, which is a passion of mine.

Don’t kill the messenger

See, bug reports are a “don’t kill the messenger” type of thing. Bugs are there whether they get reported or not, and getting them reported is important so you have a more accurate picture of how your software is actually being used by real people in the real world.

In our KDE world, the alternative to “lots of bug reports” isn’t “few bug reports because there are few bugs” but rather “few bug reports because the software isn’t actually being used much so no one is finding the bugs.” What matters more is the severity of the actionable bug reports.

What bug-free software looks like

That sounds so defeatist! Surely it must actually be possible to have bug-free software, right?

Yes. But to achieve it, you have to test literally every possible thing the software can do to make sure it performs correctly in the environment in which it’s doing it. If the software can do infinite things in infinite environments, then testing also becomes infinite and therefore impossible, so combinations get missed and bugs sneak through. Bug-free software must aggressively limit the scope and variety of those environments to just the ones that can be tested. What does that look like in practice?

  • Limit what the software can do in the first place. Remove as many features, options, and settings as possible without compromising the product’s necessary core functionality.
  • Limit how the user can modify and extend the software after release. No user-created themes, widgets, scripts–nothing! Every modification to what the software can do or how it looks must go through a the same QA team that QAd the software in its original state. 1st-party modifications only.
  • Limit the versions of upstream 3rd-party libraries, dependencies, and kernels that the software is allowed to use. Lock those versions and test everything the software can do on those specific versions.
  • Limit how downstream 3rd-party user-facing software (i.e. apps) can interface with the system. Lock it down in a sandbox as much as you can so any misbehavior can’t affect the rest of the system.
  • Limit the hardware that the software stack is allowed to run on. Test everything the software can do only on that hardware.

Does this sound very much like how KDE software is developed, distributed, and used? I’d say it’s more like how Apple builds products (and note that Apple products still have bugs, but I digress)! By contrast: KDE develops lots of features and options; we’re liberal with supported library, dependency, and kernel versions; and we don’t prevent you from installing our software on any random device you can get your hands on.

You can see the challenge right away! The foundation of quality is a set of restrictions that we don’t want to impose on ourselves and our users. You folks reading this probably don’t want us to impose them on you, either.

Quality from chaos

So is it just impossible to ensure quality in a permissive environment? No, but it’s harder. That’s right: we in the KDE free software world set for ourselves a fundamentally more difficult task than the big corporations with their billions of dollars of resources. Given this, I think we’ve done a pretty darn impressive job with the Mega-Release. And judging by initial impressions out there, it seems like many others agree too!

So how did we do it?

We lengthened our beta period to 3 months and relied on bug reports from people using the software in their own personal environments.

Yes you, loyal reader! We wanted to hear how our software was working on your 12-year-old Netbook. We wanted to hear how it worked when plugged into two TVs and a rotated monitor, all through a KVM switch. We wanted to hear how it coped with the most bizarre-looking 3rd-party themes. By using our flexible and non-limited software in your diverse ways on your diverse hardware, you’re testing it and finding all the bugs that we lack the resources to find ourselves.

Does this sort of QA work sound like something you don’t want to do? That’s 100% fine. But then you need for someone else to be the QA team for you. There are two options:

  • Buy a computer with KDE software pre-installed; there are a lot of them now! Then it’s the vendor’s responsibility to have done adequate QA on their own products. Is it buggy anyway? Complain to them or find a better vendor!
  • If you’re going to install it yourself, limit yourself to common hardware, default software settings, and operating systems that are relatively conservative in their update schedules. Then the QA has been provided by others who who already used your exact setup and reported all the bugs affecting it.
Become a superhero

But what if you do want to help out with making the software better for others, but you’re not a programmer? Congratulations, you’re a real-life superhero.

We’ve already talked about reporting bugs. It’s also important to do a good job with your bug reports so they’re actionable! I’ll encourage folks to read through our documentation about this. Low-quality bug reports don’t just waste our time, they waste yours as well!

But where do all those 150-200 bug reports per day that I mentioned actually go? There’s a flip side which is that someone needs to do something with every single one of them. The more bug reports we get (which, again, is good!) the more we need people to help triaging them.

Because the truth is, most bug reports don’t begin life being actionable for developers. They may be missing key information; they may be mistaking a feature for a bug; they may be describing an issue in someone else’s software; they may be about an issue that was already fixed in a version of the software that the reporter doesn’t have; they may be describing a real issue but in an unclear and confusing way; and so on.

The job of bug triagers is to make each of these bug reports actionable. Ask for missing information! Move them to the right products! Set the version and severity appropriately! Mark already reported bugs as duplicates of the existing report! Mark obvious upstream or downstream issues accordingly and direct people to the places where they can report the bugs to the responsible developers! Try to reproduce the issue yourself and mark it as confirmed if you can! And so on. It isn’t terribly glamorous work, so there aren’t very many people lining up to be volunteer bug triagers, unlike developers. But it’s very important. And so every person who helps out adds resources to what’s currently a very small team, making a massive difference in the process.

If you’ve been looking for a way to help out KDE in a way that doesn’t require programming or a consistent time commitment, this is it. Triage a few bugs here, a few bugs there. Chip in when you can. If 30 people each triaged three bugs a day (this would take under 10 minutes, on average), we’d be in an amazing position.

So get started today! I’m available to help in the #kde-bugs Matrix room.

Still don’t wanna? Donate to KDE e.V. so we can eventually hire our own professional bug triage and QA team!

Categories: FLOSS Project Planets

Working Build With KDE Frameworks 6

Planet KDE - Sat, 2024-03-09 16:26

With KDE’s Frameworks 6 being released recently, I’ve been working on getting Tellico to compile with it. It didn’t actually take too much work since I’ve been gradually porting away from any deprecated functions in Qt5.

There’s plenty to do to make sure everything is fully functional and has the correct appearance. But I’m hopeful to have a release soon. At the moment, the master branch compiles with either KF5/Qt5 or KF6/Qt6.

Categories: FLOSS Project Planets

Reproducible Builds: Reproducible Builds in February 2024

Planet Debian - Sat, 2024-03-09 11:53

Welcome to the February 2024 report from the Reproducible Builds project! In our reports, we try to outline what we have been up to over the past month as well as mentioning some of the important things happening in software supply-chain security.

Reproducible Builds at FOSDEM 2024

Core Reproducible Builds developer Holger Levsen presented at the main track at FOSDEM on Saturday 3rd February this year in Brussels, Belgium. However, that wasn’t the only talk related to Reproducible Builds.

However, please see our comprehensive FOSDEM 2024 news post for the full details and links.


Maintainer Perspectives on Open Source Software Security

Bernhard M. Wiedemann spotted that a recent report entitled Maintainer Perspectives on Open Source Software Security written by Stephen Hendrick and Ashwin Ramaswami of the Linux Foundation sports an infographic which mentions that “56% of [polled] projects support reproducible builds”.


Three new reproducibility-related academic papers

A total of three separate scholarly papers related to Reproducible Builds have appeared this month:

Signing in Four Public Software Package Registries: Quantity, Quality, and Influencing Factors by Taylor R. Schorlemmer, Kelechi G. Kalu, Luke Chigges, Kyung Myung Ko, Eman Abdul-Muhd, Abu Ishgair, Saurabh Bagchi, Santiago Torres-Arias and James C. Davis (Purdue University, Indiana, USA) is concerned with the problem that:

Package maintainers can guarantee package authorship through software signing [but] it is unclear how common this practice is, and whether the resulting signatures are created properly. Prior work has provided raw data on signing practices, but measured single platforms, did not consider time, and did not provide insight on factors that may influence signing. We lack a comprehensive, multi-platform understanding of signing adoption and relevant factors. This study addresses this gap. (arXiv, full PDF)


Reproducibility of Build Environments through Space and Time by Julien Malka, Stefano Zacchiroli and Théo Zimmermann (Institut Polytechnique de Paris, France) addresses:

[The] principle of reusability […] makes it harder to reproduce projects’ build environments, even though reproducibility of build environments is essential for collaboration, maintenance and component lifetime. In this work, we argue that functional package managers provide the tooling to make build environments reproducible in space and time, and we produce a preliminary evaluation to justify this claim.

The abstract continues with the claim that “Using historical data, we show that we are able to reproduce build environments of about 7 million Nix packages, and to rebuild 99.94% of the 14 thousand packages from a 6-year-old Nixpkgs revision. (arXiv, full PDF)


Options Matter: Documenting and Fixing Non-Reproducible Builds in Highly-Configurable Systems by Georges Aaron Randrianaina, Djamel Eddine Khelladi, Olivier Zendra and Mathieu Acher (Inria centre at Rennes University, France):

This paper thus proposes an approach to automatically identify configuration options causing non-reproducibility of builds. It begins by building a set of builds in order to detect non-reproducible ones through binary comparison. We then develop automated techniques that combine statistical learning with symbolic reasoning to analyze over 20,000 configuration options. Our methods are designed to both detect options causing non-reproducibility, and remedy non-reproducible configurations, two tasks that are challenging and costly to perform manually. (HAL Portal, full PDF)


Mailing list highlights

From our mailing list this month:


Distribution work

In Debian this month, 5 reviews of Debian packages were added, 22 were updated and 8 were removed this month adding to Debian’s knowledge about identified issues. A number of issue types were updated as well. […][…][…][…] In addition, Roland Clobus posted his 23rd update of the status of reproducible ISO images on our mailing list. In particular, Roland helpfully summarised that “all major desktops build reproducibly with bullseye, bookworm, trixie and sid provided they are built for a second time within the same DAK run (i.e. [within] 6 hours)” and that there will likely be further work at a MiniDebCamp in Hamburg. Furthermore, Roland also responded in-depth to a query about a previous report


Fedora developer Zbigniew Jędrzejewski-Szmek announced a work-in-progress script called fedora-repro-build that attempts to reproduce an existing package within a koji build environment. Although the projects’ README file lists a number of “fields will always or almost always vary” and there is a non-zero list of other known issues, this is an excellent first step towards full Fedora reproducibility.


Jelle van der Waa introduced a new linter rule for Arch Linux packages in order to detect cache files leftover by the Sphinx documentation generator which are unreproducible by nature and should not be packaged. At the time of writing, 7 packages in the Arch repository are affected by this.


Elsewhere, Bernhard M. Wiedemann posted another monthly update for his work elsewhere in openSUSE.


diffoscope

diffoscope is our in-depth and content-aware diff utility that can locate and diagnose reproducibility issues. This month, Chris Lamb made a number of changes such as uploading versions 256, 257 and 258 to Debian and made the following additional changes:

  • Use a deterministic name instead of trusting gpg’s –use-embedded-filenames. Many thanks to Daniel Kahn Gillmor dkg@debian.org for reporting this issue and providing feedback. [][]
  • Don’t error-out with a traceback if we encounter struct.unpack-related errors when parsing Python .pyc files. (#1064973). []
  • Don’t try and compare rdb_expected_diff on non-GNU systems as %p formatting can vary, especially with respect to MacOS. []
  • Fix compatibility with pytest 8.0. []
  • Temporarily fix support for Python 3.11.8. []
  • Use the 7zip package (over p7zip-full) after a Debian package transition. (#1063559). []
  • Bump the minimum Black source code reformatter requirement to 24.1.1+. []
  • Expand an older changelog entry with a CVE reference. []
  • Make test_zip black clean. []

In addition, James Addison contributed a patch to parse the headers from the diff(1) correctly [][] — thanks! And lastly, Vagrant Cascadian pushed updates in GNU Guix for diffoscope to version 255, 256, and 258, and updated trydiffoscope to 67.0.6.


reprotest

reprotest is our tool for building the same source code twice in different environments and then checking the binaries produced by each build for any differences. This month, Vagrant Cascadian made a number of changes, including:

  • Create a (working) proof of concept for enabling a specific number of CPUs. [][]
  • Consistently use 398 days for time variation rather than choosing randomly and update README.rst to match. [][]
  • Support a new --vary=build_path.path option. [][][][]


Website updates

There were made a number of improvements to our website this month, including:


Reproducibility testing framework

The Reproducible Builds project operates a comprehensive testing framework (available at tests.reproducible-builds.org) in order to check packages and other artifacts for reproducibility. In February, a number of changes were made by Holger Levsen:

  • Debian-related changes:

    • Temporarily disable upgrading/bootstraping Debian unstable and experimental as they are currently broken. [][]
    • Use the 64-bit amd64 kernel on all i386 nodes; no more 686 PAE kernels. []
    • Add an Erlang package set. []
  • Other changes:

    • Grant Jan-Benedict Glaw shell access to the Jenkins node. []
    • Enable debugging for NetBSD reproducibility testing. []
    • Use /usr/bin/du --apparent-size in the Jenkins shell monitor. []
    • Revert “reproducible nodes: mark osuosl2 as down”. []
    • Thanks again to Codethink, for they have doubled the RAM on our arm64 nodes. []
    • Only set /proc/$pid/oom_score_adj to -1000 if it has not already been done. []
    • Add the opemwrt-target-tegra and jtx task to the list of zombie jobs. [][]

Vagrant Cascadian also made the following changes:

  • Overhaul the handling of OpenSSH configuration files after updating from Debian bookworm. [][][]
  • Add two new armhf architecture build nodes, virt32z and virt64z, and insert them into the Munin monitoring. [][] [][]

In addition, Alexander Couzens updated the OpenWrt configuration in order to replace the tegra target with mpc85xx [], Jan-Benedict Glaw updated the NetBSD build script to use a separate $TMPDIR to mitigate out of space issues on a tmpfs-backed /tmp [] and Zheng Junjie added a link to the GNU Guix tests [].

Lastly, node maintenance was performed by Holger Levsen [][][][][][] and Vagrant Cascadian [][][][].


Upstream patches

The Reproducible Builds project detects, dissects and attempts to fix as many currently-unreproducible packages as possible. We endeavour to send all of our patches upstream where appropriate. This month, we wrote a large number of such patches, including:


If you are interested in contributing to the Reproducible Builds project, please visit our Contribute page on our website. However, you can get in touch with us via:

Categories: FLOSS Project Planets

Iustin Pop: Finally learning some Rust - hello photo-backlog-exporter!

Planet Debian - Sat, 2024-03-09 08:30

After 4? 5? or so years of wanting to learn Rust, over the past 4 or so months I finally bit the bullet and found the motivation to write some Rust. And the subject.

And I was, and still am, thoroughly surprised. It’s like someone took Haskell, simplified it to some extents, and wrote a systems language out of it. Writing Rust after Haskell seems easy, and pleasant, and you:

  • don’t have to care about unintended laziness which causes memory “leaks” (stuck memory, more like).
  • don’t have to care about GC eating too much of your multi-threaded RTS.
  • can be happy that there’s lots of activity and buzz around the language.
  • can be happy for generating very small, efficient binaries that feel right at home on Raspberry Pi, especially not the 5.
  • are very happy that error handling is done right (Option and Result, not like Go…)

On the other hand:

  • there are no actual monads; the ? operator kind-of-looks-like being in do blocks, but only and only for Option and Result, sadly.
  • there’s no Stackage, it’s like having only Hackage available, and you can hope all packages work together well.
  • most packaging is designed to work only against upstream/online crates.io, so offline packaging is doable but not “native” (from what I’ve seen).

However, overall, one can clearly see there’s more movement in Rust, and the quality of some parts of the toolchain is better (looking at you, rust-analyzer, compared to HLS).

So, with that, I’ve just tagged photo-backlog-exporter v0.1.0. It’s a port of a Python script that was run as a textfile collector, which meant updates every ~15 minutes, since it was a bit slow to start, which I then rewrote in Go (but I don’t like Go the language, plus the GC - if I have to deal with a GC, I’d rather write Haskell), then finally rewrote in Rust.

What does this do? It exports metrics for Prometheus based on the count, age and distribution of files in a directory. These files being, for me, the pictures I still have to sort, cull and process, because I never have enough free time to clear out the backlog. The script is kind of designed to work together with Corydalis, but since it doesn’t care about file content, it can also double (easily) as simple “file count/age exporter”.

And to my surprise, writing in Rust is soo pleasant, that the feature list is greater than the original Python script, and - compared to that untested script - I’ve rather easily achieved a very high coverage ratio. Rust has multiple types of tests, and the combination allows getting pretty down to details on testing:

  • region coverage: >80%
  • function coverage: >89% (so close here!)
  • line coverage: >95%

I had to combine a (large) number of testing crates to get it expressive enough, but it was worth the effort. The last find from yesterday, assert_cmd, is excellent to describe testing/assertion in Rust itself, rather than via a separate, new DSL, like I was using shelltest for, in Haskell.

To some extent, I feel like I found the missing arrow in the quiver. Haskell is good, quite very good for some type of workloads, but of course not all, and Rust complements that very nicely, with lots of overlap (as expected). Python can fill in any quick-and-dirty scripting needed. And I just need to learn more frontend, specifically Typescript (the language, not referring to any specific libraries/frameworks), and I’ll be ready for AI to take over coding 😅…

So, for now, I’ll need to split my free time coding between all of the above, and keep exercising my skills. But so glad to have found a good new language!

Categories: FLOSS Project Planets

This week in KDE: a deluge of new features

Planet KDE - Sat, 2024-03-09 01:26

The floodgates are fully open and developers have started landing juicy features for Plasma 6.1!

But not just that… we asked for bug reports and you folks gave us bug reports! Usually we get 30-50 per day, but now we’re up to 150-200. It’s kind of crazy.

Now, this doesn’t mean the software is actually really buggy. It means that people are using the software! Most of the bug reports actually not about KDE issues at all: graphics driver issues, bugs in themes, and bugs in 3rd-party apps. And many are duplicates of existing known issues, or really weird exotic issues only reproducible with specific combinations of off-by-default settings.

Of course some are more significant, but at this point I think we’ve got most of them fixed. There are still a couple open–such slow login and black lock screens with certain setups–but both have open merge requests to fix them, so I expect those to be fixed pretty soon too.

New Features

You can now split embedded terminal views in Kate horizontally or vertically (Akseli Lahtinen, Kate 24.05. Link)

You can now configure whether the magnifier in Spectacle’s Rectangular Region mode is always on, always off, or only on while holding down the Shift key (Noah Davis, Spectacle 24.05. Link)

There are now “edge barrier” and “corner barrier” features when you’ve using a multi-screen setup. These barriers add virtual spacing between screens, so that it’s easier for you to click on the pixels touching shared screen edges. Why would you want to do this? For example to make auto-hide panels between screens possible, and to make it easy to click the close button of a maximized window with another screen next to it. Note that these features are Wayland-only. And yes, you can turn these features off if you don’t like them, and also adjust the size of the barrier’s virtual space (Yifan Zhu, Plasma 6.1):

You can now hide the Web Browser widget’s navigation bar, making it suitable for cases where it’s simply monitoring the same web page you never navigate away from (Shubham Arora, Plasma 6.1. Link)

Manual session saving now works on Wayland. Note that until real session restore is added, this will be hooking into the “real fake session restore” feature I blogged about a few weeks ago (David Edmundson, Plasma 6.1. Link)

UI Improvements

When you have Spectacle configured to not take a screenshot when launched, the window that appears on launch now gives you the opportunity to take a screen recording too (Noah Davis, 24.05. Link)

Search results for pages in System Settings now better prioritize exact name matches (Alexander Lohnau, Plasma 6.0.1. Link)

Using a keyboard shortcut to activate the Calculator widget on a Panel now passes focus to it correctly so you can start typing to calculate things immediately (Akseli Lahtinen, Plasma 6.0.2. Link)

When using the Kicker Application Menu launcher, you can now do calculation and unit conversion, and find the power and session actions by searching for them (me: Nate Graham, Plasma 6.1. Link)

The new “Shake cursor to find it” effect is now enabled by default (Vlad Zahorodnii, Plasma 6.1. Link)

The new Printers page in System Settings now does a better job of helping you figure out what to do next when it finds a driverless network printer that doesn’t have the right drivers installed (yes, that sounds like a contradiction, but such is life) (Mike Noe, Plasma 6.1. Link)

Panel widgets’ popups now close when you click on an empty area of the Task Manager (David Edmundson, Plasma 6.1. Link)

By default, XWayland apps are now allowed to listen for non-alphanumeric keypresses, and shortcuts using modifier keys. This lets any global shortcut features they may have work with no user intervention required, while still not allowing arbitrary listening for alphanumeric keypresses which could potentially be used maliciously (me: Nate Graham, Plasma 6.1. Link)

Bluetooth connection failures are now additionally mentioned in the widget pop-up itself, right next to the thing you clicked on to try the connection which is where your eyeballs were probably still looking (Kai Uwe Broulik, Plasma 6.1. Link)

The width of the clipboard history popup that appears when you press Meta+V now has a width that’s capped at a lower, more sane level when you’re using a ultrawide screen (Dominique Hummel, Plasma 6.1. Link)

Bug Fixes

Gwenview no longer crashes when opening certain FITS image files (Albert Astals Cid, Gwenview 24.02.1. Link)

Minimizing a Dolphin window no longer causes all of its panels to get hidden (Nicolas Fella, Dolphin 24.02.1. Link)

Fixed a glitch with multi-line text selection in Okular (Okular 24.02.1. Link)

While dragging a file in Dolphin, if it happens to pass over other files and linger there for a bit, the other files no longer get immediately opened (Akseli Lahtinen, Dolphin 24.05. Link)

Plasma no longer crashes when you open Kickoff or Kicker while uninstalling an app that’s in the Favorites list (Marco Martin, Plasma 6.0.1. Link)

Launching/activating items with the Enter key in the Kicker Application Menu once again works (Marco Martin, Plasma 6.0.1. Link)

“Get [app name]” search results from KRunner once again work (Nicolas Fella, Plasma 6.0.1. Link)

Fixed a regression with System Tray icon support that caused some apps’ tray icons to show the wrong icon (Nicolas Fella, Plasma 6.0.1. Link)

When you drag multiple files from Dolphin onto the desktop, they no longer stack on top of one another until Plasma is restarted (Marco Martin, Plasma 6.0.1. Link)

Discover no longer crashes when you search for various fairly common terms, including “libreoffice” (Aleix Pol Gonzalez, Plasma 6.0.2. Link)

Fixed the “Move to Desktop > All Desktops” titlebar menu item on X11 (Nicolas Fella, Plasma 6.0.2. Link)

Fixed a case where Plasma could exit (not crash) with a Wayland protocol error after turning screens off and back on again (Vlad Zahorodnii, Plasma 6.0.2. Link)

Fixed a case where KWin could crash when a window was opened on a secondary screen plugged into a secondary GPU (Xaver Hugl, Plasma 6.0.2. Link)

Our previous fix for VLC and MPV not being able to maximize turned out not to be enough, so we beefed it up, and now it should actually always work (Łukasz Patron, Plasma 6.0.2. Link 1 and link 2)

Fixed a bug that could cause Night Color to not work on systems with certain graphics hardware (Xaver Hugl, Plasma 6.0.2. Link)

The first search result in the Kicker Application Menu is no longer sometimes covered up by the search field (Marco Martin, Plasma 6.0.2. Link)

When you drag a window off the left side of the screen, the cursor no longer moves unexpectedly (Yifan Zhu, Plasma 6.0.2. Link)

Setting your system language to “C” on System Settings’ Region & Language page no longer mangles the text of the previews for individual formats (Han Young, Plasma 6.0.2. Link)

Fixed a case where Discover could crash on launch when its Flatpak backend is active (David Redondo, Plasma 6.1. Link)

When you have a Panel at the top of the screen, showing its config dialog no longer overlaps the global Edit Mode Toolbar; instead, the toolbar jumps down to the bottom of the screen where there’s plenty of space for it (Niccolò Venerandi, Plasma 6.1. Link)

Downloading items in the “Get New [thing]” dialogs that only have a single file available once again works (Akseli Lahtinen, Frameworks 6.1. Link)

Various actions throughout KDE apps that open the default terminal app–such as Dolphin’s “Open Terminal Here” menu item–once again work (Nicolas Fella, Frameworks 6.1. Link)

“Horizontal bars” graphs in various System Monitor widgets now use the right colors (Arjen Hiemstra, Frameworks 6.1. Link)

Menu items in context menus for text fields in QtQuick-based apps are now translated (Evgeny Chesnokov, Frameworks 6.1. Link)

Made a bunch of places icons in the Breeze icon theme respect the accent color, just like their compatriots (Someone going by the pseudonym “leia uwu”, Frameworks 6.1. Link)

Other bug information of note:

Performance & Technical

Fixed a source of lag and frame drops on some systems with certain graphics hardware (Xaver Hugl, Plasma 6.0.1. Link)

Automation & Systematization

Wrote a tutorial for how to set up automatic publishing of your KDE app to KDE’s F-Droid repository (Ingo Klöcker, Link)

Updated the tutorial for how to write a System Settings page (KCM) to reflect modernity (Akseli Lahtinen, Link)

Added an autotest ensuring that a special feature of KConfig and desktops files works (David Faure, Link)

…And Everything Else

This blog only covers the tip of the iceberg! If you’re hungry for more, check out https://planet.kde.org, where you can find more news from other KDE contributors.

How You Can Help

Please help with bug triage! The Bugzilla volumes are extraordinary right now and we are overwhelmed. I’ll be doing another blog post on this tomorrow; for now, if you’re interested, read this.

Otherwise, visit https://community.kde.org/Get_Involved to discover other ways to be part of a project that really matters. Each contributor makes a huge difference in KDE; you are not a number or a cog in a machine! You don’t have to already be a programmer, either. I wasn’t when I got started. Try it, you’ll like it! We don’t bite!

As a final reminder, 99.9% of KDE runs on labor that KDE e.V. didn’t pay for. If you’d like to help change that, consider donating today!

Categories: FLOSS Project Planets

Krita Monthly Update – Edition 13

Planet KDE - Fri, 2024-03-08 19:00

Welcome to all krita artists, this monthly zine is curated for you by the Krita-promo team.

Development report
  • Changes to KDE Binary Factory - Krita Next and Krita Plus builds

    Nightly builds for Windows and Linux have been moved to GitLab. Binary Factory is now decommissioned. Due to this change the nightly build service is temporarily discontinued. The developers are working on getting the build up again.

  • New Krita website is released.

    The work for the new website was ongoing for some time so we are glad to announce that it is live now. The new website offers a light and dark theme. It is cleaner and the translation to other languages is much easier now. We are always working to improve the website so if you find any rough edges please let us know.

  • Internal Roadmap for Krita

    The developers had an online meeting on 26th February to discuss the future path for Krita development. Stay tuned for an upcoming blog post here for more details about this meeting. In the meantime, enjoy these meeting highlights. The agenda for the meeting was:

    • How to handle social networks and having a social media strategy.

      Krita’s social media presence was handled by the developers earlier, but since they are busy with Krita’s development, we can request volunteers to help us. Krita-Artists group of volunteers can be asked to handle social media posting and any volunteers are welcome to join the group.

    • Challenges and feasibility of keeping the support for Android version.

      The person who was handling the support for the Android version has gotten busy with life so currently there is no one to look after it. The builds are also stopped due to our build server getting decommissioned. Dmitry is looking into the automated build issue but the team needs a way to keep the support up. There may be close to 500,000 users of Krita on this platform. Volunteers are more than welcome to join us in this endeavour.

    • Various other aspects related to development

      • The developers discussed some features that can be implemented such as audio waveform support in the animation timeline and the future path for creating a mobile UI.
      • A Strategy for porting Krita to the next version of Qt (Qt is the underlying base that is used to build Krita).
      • Areas where GPU computation can help. Artists who joined the meeting said that filters and transform masks were slow in krita. Our Liquify tool also needs a performance boost. So GPU utilisation in this area is welcome.
      • Tiar will be investigating how to do AI assisted Inking. Disclaimer - this doesn’t mean we will be using the popular AI models out there. We intend to do this ethically and as this is still in the initial investigation stage, the developers are still discussing various aspect about how to approach this subject.
      • How to handle PS style clipping mask - Deif Lou has done an awesome job in researching and investigating the clipping mask, layer effects and blending mode technicalities. The team intends to look into this and tackle this feature together.
  • New features that got merged this month

    • Close Gap in fill tool is finally here!

      YRH created a gap-closing patch for the fill tool and that patch has been accepted to master. In this post, YRH points out that Dmitry and Krita users on this forum were instrumental in getting this done. You can read these latest comments and get the test builds from this post.

      There should have been a video here but your browser does not seem to support it. (Video created by David Revoy)

    • Text tool on-canvas basic rich text editing

      Wolthera has been busy with text tool for some time now. You can tell by the text tool update thread that she is merging really exciting things one after the other. This month, Krita got support for on-canvas text editing with basic rich text support. As kaichi1342 reports on the forum, currently common shortcuts like Ctrl B, I, U for bold italics and underline are working, full and partial color change of text works on canvas.

      There should have been a video here but your browser does not seem to support it. (Video created by Wolthera)

    • Docker support added to popup palette

      Freyalupen implemented docker support in the right click popup palette which can be of immense help for people who work on minimal canvas-only mode or for people using Krita on tablets. You can now use various dockers like the layer docker, brush preset history, etc., right from the right click popup palette.

      There should have been a video here but your browser does not seem to support it. (Video created by freyalupen)

Community report Monthly Art Challenge

Krita-Artists’ Monthly Art Challenge is a great way to stretch your skills and learn more about Krita.

February’s Art Challenge theme was Architectural/Urban, designed by Elixiah. We had a full slate of submissions to vote on at the end of the month. Mythmaker won the challenge with this image:

The challenge for this month is Marvellous Metal. Why not join in? It’s a friendly competition where we even share tips and help each other with challenge submissions on the WIP thread.

YouTube Growth

The Krita YouTube channel has reached 80,000 subscribers. That’s a gain of 17,000 subs in just over a year. Ramon’s most recent video, 5.2.2 New Features, has already had more than 86,000 views over the last month.

Featured artwork Introducing “Best of Krita-Artists” Featured Artwork Nomination Process

Great news: Members Hall and the nomination process is now open to all Krita-Artists members. Everyone has the opportunity to nominate artwork for the featured gallery. Monthly submission threads will open on the 15th of each month. We’ll use your submissions to create a poll which will determine the top four. The winning images will be added to the featured gallery.

The current instructions and submission thread explains everything you need to know in order to nominate artwork that you feel represents the best of Krita-Artists. In January, we’ll create an annual poll to vote for the very best from 2024.

Noteworthy plugin

Shortcut Composer v1.5.0 Released (this update requires Krita 5.2.2 or higher)

Highlights of new features:

  • New action: Rotate brush which rotates the brush tip of the current preset
  • New action: Rotate canvas
  • Tooltips with additional info that appear when hovering over settings

Tutorial of the month

From David Revoy: Grayscale to Color – Character Design “A commented step-by-step guide and advice on how to paint an original fantasy character design from scratch in Krita.”

Notable changes in code

This section has been compiled by [freyalupen]. (Feb 5 - Mar 5, 2024)

Stable branch (5.2.2+): Bugfixes:

Stable branch (5.2.2+) backports from Unstable: Bugfixes:

Unstable branch (5.3.0-prealpha): Features:

  • [Text Tool] Implement basic rich text editing in the on-canvas text tool. This includes changing the color with the color selectors, setting bold/italic/underline with keyboard shortcuts, and rich text copy/paste. (merge request, Wolthera van Hövell)
  • [Fill Tool] Implement 'Close Gap' option in the Fill Tool and Contiguous Selection Tool. This allows the unleaked filling of gapped lineart by treating gaps of a configured size as if they were closed. (merge request, Maciej Jesionowski)
  • [Popup Palette, Dockers] Add ability to show dockers, such as the Layers docker, in the Popup Palette's side panel. The On-Canvas Brush Editor that was in this panel is now a docker. (merge request, Freya Lupen)
  • [Brush Engines] Add Photoshop-like brush texturing modes where Strength affects the texture instead of the dab, enabled with the 'Soft texturing' checkbox in the brush Pattern Options. (merge request, Deif Lou)
  • [File Formats: JPEG-XL] Update libjxl and add options to export JPEG-XL with CICP profile and lossless alpha. (merge request, Rasyuqa A H (Kampidh))
  • [Grids and Guides Docker] Add button to delete all guides. (merge request, reinold rojas)
  • [Animation: Onion Skins Docker] Add Reset option for Onion Skins' opacity in a right-click menu, to reset them to the default values. (WISHBUG:466977) (commit, Emmet O'Neill)

Bugfixes:

These changes are made available for testing in the latest development builds:

(macOS and Android builds will be available in the future.)

Ways to help Krita

Krita is a Free and Open Source application, mostly developed by an international team of enthusiastic volunteers. Donations from Krita users to support maintenance and development is appreciated. Join the Development Fund with a monthly donation. Or make a one-time donation here.

Categories: FLOSS Project Planets

Seth Michael Larson: Regex character “$” doesn't mean “end-of-string”

Planet Python - Fri, 2024-03-08 19:00
Regex character “$” doesn't mean “end-of-string” AboutBlogNewsletterLinks Regex character “$” doesn't mean “end-of-string”

Published 2024-03-09 by Seth Larson
Reading time: minutes

This article is about a bit of surprising behavior I recently discovered using Python's regex module (re) while developing SBOM tooling for CPython.

Folks who've worked with regular expressions before might know about ^ meaning "start-of-string" and correspondingly see $ as "end-of-string". So the pattern cat$ would match the string "lolcat" but not "internet cat video".

The behavior of ^ made me think that $ was similar, but they aren't always symmetrical and the behavior is platform-dependent. Specifically for Python with multiline mode disabled the $ character can match either the end of a string or a trailing newline before the end of a string.

So if you're trying to match a string without a newline at the end, you can't only use $ in Python! My expectation was having multiline mode disabled wouldn't have had this newline-matching behavior, but that isn't the case.

Next logical question is how does one match the end of a string without a newline in Python?

After doing more research on Python and other regular expression syntaxes I also found \z and \Z as candidates for "end-of-string" characters.

Multi-line mode is enabled with re.MULTILINE in Python, the docs have the following to say:

When re.MULTILINE is specified the pattern character '$' matches at the end of the string and at the end of each line (immediately preceding each newline). By default, '$' only matches at the end of the string and immediately before the newline (if any) at the end of the string.

Let's see how these features work together across multiple platforms:

Pattern matches "cat\n"? "cat$" multiline "cat$" no multiline "cat\z" "cat\Z" PHP ✅ ✅ ❌ ✅ ECMAScript ✅ ❌ ⚠️ ⚠️ Python ✅ ✅ ⚠️ ❌ Golang ✅ ❌ ❌ ⚠️ Java 8 ✅ ✅ ❌ ✅ .NET 7.0 ✅ ✅ ❌ ✅ Rust ✅ ❌ ❌ ⚠️
  • ✅: Pattern matches the string "cat\n"
  • ❌: Pattern does not match the string "cat\n"
  • ⚠️: Pattern is invalid or character not supported.

Summarizing the above table, if matching a trailing newline is acceptable then $ with multiline mode works consistently across all platforms, but if we wanted to not match a trailing newline then things get more complicated.

To not match a trailing newline, use \z on all platforms except Python and ECMAScript where you'll need to use \Z or $ without multiline mode respectively. Hope you learned something about regular expressions today!

Note: The table of data was gathered from regex101.com, I didn't test using the actual runtimes.

Thanks for reading! ♡ Did you find this article helpful and want more content like it? Get notified of new posts by subscribing to the RSS feed or the email newsletter.

This work is licensed under CC BY-SA 4.0

Categories: FLOSS Project Planets

Valhalla's Things: Elastic Neck Top Two: MOAR Ruffles

Planet Debian - Fri, 2024-03-08 19:00
Posted on March 9, 2024
Tags: madeof:atoms, craft:sewing, FreeSoftWear

After making my Elastic Neck Top I knew I wanted to make another one less constrained by the amount of available fabric.

I had a big cut of white cotton voile, I bought some more swimsuit elastic, and I also had a spool of n°100 sewing cotton, but then I postponed the project for a while I was working on other things.

Then FOSDEM 2024 arrived, I was going to remote it, and I was working on my Augusta Stays, but I knew that in the middle of FOSDEM I risked getting to the stage where I needed to leave the computer to try the stays on: not something really compatible with the frenetic pace of a FOSDEM weekend, even one spent at home.

I needed a backup project1, and this was perfect: I already had everything I needed, the pattern and instructions were already on my site (so I didn’t need to take pictures while working), and it was mostly a lot of straight seams, perfect while watching conference videos.

So, on the Friday before FOSDEM I cut all of the pieces, then spent three quarters of FOSDEM on the stays, and when I reached the point where I needed to stop for a fit test I started on the top.

Like the first one, everything was sewn by hand, and one week after I had started everything was assembled, except for the casings for the elastic at the neck and cuffs, which required about 10 km of sewing, and even if it was just a running stitch it made me want to reconsider my lifestyle choices a few times: there was really no reason for me not to do just those seams by machine in a few minutes.

Instead I kept sewing by hand whenever I had time for it, and on the next weekend it was ready. We had a rare day of sun during the weekend, so I wore my thermal underwear, some other layer, a scarf around my neck, and went outside with my SO to have a batch of pictures taken (those in the jeans posts, and others for a post I haven’t written yet. Have I mentioned I have a backlog?).

And then the top went into the wardrobe, and it will come out again when the weather will be a bit warmer. Or maybe it will be used under the Augusta Stays, since I don’t have a 1700 chemise yet, but that requires actually finishing them.

The pattern for this project was already online, of course, but I’ve added a picture of the casing to the relevant section, and everything is as usual #FreeSoftWear.

  1. yes, I could have worked on some knitting WIP, but lately I’m more in a sewing mood.↩︎

Categories: FLOSS Project Planets

Pages