Feeds

Enrico Zini: How to right click

Planet Debian - Wed, 2024-12-04 11:51

I climbed on top of a mountain with a beautiful view, and when I started readying my new laptop for a work call (as one does on top of mountains), I realised that I couldn't right click and it kind of spoiled the mood.

Clicking on the bottom right corner of my touchpad left-clicked. Clicking with two fingers left-clicked. Alt-clicking, Super-clicking, Control-clicking, left clicked.

Here's there are two ways to simulate mouse buttons with touchpads in Wayland:

  • clicking on different areas at the bottom of the touchpad
  • double or triple-tapping, as long as the fingers are not too far apart

Skippable digression:

I'm not sure why Gnome insists in following Macs for defaults, which is what people with non-Mac hardware are less likely to be used to.

In my experience, Macs are as arbitrarily awkward to use as anything else, but they managed to build a community where if you don't understand how it works you get told you're stupid. All other systems (including Gnome) have communities where instead you get told (as is generally the case) that the system design is stupid, which at least gives you some amount of validation in your suffering.

Oh well.

How to configure right click

Surprisingly, this is not available in Gnome Shell settings. It can be found in gnome-tweaks: under "Keyboard & Mouse", "Mouse Click Emulation", one can choose between "Fingers" or "Area".

I tried both and went for "Area": I use right-drag a lot to resize windows, and I couldn't find a way, at least with this touchpad, to make it work consistently in "Fingers" mode.

Categories: FLOSS Project Planets

The Drop Times: Contribution Day at DrupalCon Singapore 2024: A Day of Collaboration and Innovation

Planet Drupal - Wed, 2024-12-04 11:42
As a leading open-source project, Drupal thrives on contributions from its global community. Contribution Day is a focused event at DrupalCon where individuals collaborate to improve Drupal. It’s a space for sharing expertise, mentoring others, and making tangible progress on various projects.
Categories: FLOSS Project Planets

The Drop Times: Meet the Speakers: DrupalCon Singapore 2024 Part 1

Planet Drupal - Wed, 2024-12-04 11:04
As part of the Meet the Speakers: DrupalCon Singapore 2024 series, The DropTimes highlights sessions by Yas Naoi on Behavior-Driven Development, Ajit Shinde on PHP 8 features, and Alexey Murz Korepov on observability in decoupled Drupal. This series provides a glimpse into the conference’s rich lineup and offers insights into what speakers are bringing to the event, happening December 9-11 at PARKROYAL COLLECTION Marina Bay.
Categories: FLOSS Project Planets

The Drop Times: TDT Is the Official Media Partner for DrupalCon Singapore 2024

Planet Drupal - Wed, 2024-12-04 11:04
The DropTimes will provide in-depth coverage of DrupalCon Singapore 2024, happening from December 9 to 11 at PARKROYAL COLLECTION Marina Bay. Follow for updates, insights, and highlights from Asia’s first DrupalCon in nearly a decade.
Categories: FLOSS Project Planets

Django Weblog: Django security releases issued: 5.1.4, 5.0.10, and 4.2.17

Planet Python - Wed, 2024-12-04 10:40

In accordance with our security release policy, the Django team is issuing releases for Django 5.1.4, Django 5.0.10, and Django 4.2.17. These releases address the security issues detailed below. We encourage all users of Django to upgrade as soon as possible.

CVE-2024-53907: Potential denial-of-service in django.utils.html.strip_tags()

The strip_tags() method and striptags template filter are subject to a potential denial-of-service attack via certain inputs containing large sequences of nested incomplete HTML entities.

Thanks to jiangniao for the report.

This issue has severity "moderate" according to the Django security policy.

CVE-2024-53908: Potential SQL injection in HasKey(lhs, rhs) on Oracle

Direct usage of the django.db.models.fields.json.HasKey lookup on Oracle is subject to SQL injection if untrusted data is used as a lhs value. Applications that use the jsonfield.has_key lookup through the __ syntax are unaffected.

Thanks to Seokchan Yoon for the report.

This issue has severity "high" according to the Django security policy.

Affected supported versions
  • Django main
  • Django 5.1
  • Django 5.0
  • Django 4.2
Resolution

Patches to resolve the issue have been applied to Django's main, 5.1, 5.0, and 4.2 branches. The patches may be obtained from the following changesets.

CVE-2024-53907: Potential denial-of-service in django.utils.html.strip_tags() CVE-2024-53908: Potential SQL injection in HasKey(lhs, rhs) on Oracle The following releases have been issued

The PGP key ID used for this release is Sarah Boyce: 3955B19851EA96EF

General notes regarding security reporting

As always, we ask that potential security issues be reported via private email to security@djangoproject.com, and not via Django's Trac instance, nor via the Django Forum, nor via the django-developers list. Please see our security policies for further information.

Categories: FLOSS Project Planets

Tag1 Consulting: Migrating your Data from D7 to D10: Public and private file migrations

Planet Drupal - Wed, 2024-12-04 10:20

After discussing how to avoid entity ID conflicts in the previous article, we are finally ready to start migrating content. The first entity we will focus on is files, covering both public and private file migrations. We will share tips and hacks related to performance optimizations and discuss how to handle files hosted outside of Drupal.

mauricio Wed, 12/04/2024 - 07:20
Categories: FLOSS Project Planets

Freelock Blog: Automatically send notifications to Matrix

Planet Drupal - Wed, 2024-12-04 10:00
Automatically send notifications to Matrix Anonymous (not verified) Wed, 12/04/2024 - 07:00 Tags Development Open Source ECA Matrix Automation Drupal Planet

When you work on a team, it's useful to have notifications go to a chat room where you can coordinate any necessary action. Reviewing a comment before publishing, seeing stories as they are written, getting notified of new orders are the kinds of things we like having in a shared room.

Categories: FLOSS Project Planets

Droptica: What to Do When You Forgot or Lost Your Drupal Admin Password?

Planet Drupal - Wed, 2024-12-04 09:17

Losing access to your Drupal admin account can be a stressful experience. Your admin password is the key to maintaining and managing your website and being locked out can halt your ability to make critical updates or manage content. Fortunately, there are several methods to regain access, whether you're using Drupal 7 or the latest version of the system. This guide will walk you through the possible options to reset your password and return to your web page.

Categories: FLOSS Project Planets

Real Python: Expression vs Statement in Python: What's the Difference?

Planet Python - Wed, 2024-12-04 09:00

After working with Python for a while, you’ll eventually come across two seemingly similar terms: expression and statement. When you browse the official documentation or dig through a Python-related thread on an online forum, you may get the impression that people use these terms interchangeably. That’s often true, but confusingly enough, there are cases when the expression vs statement distinction becomes important.

So, what’s the difference between expressions and statements in Python?

Get Your Code: Click here to download the free sample code you’ll use to learn about the difference between expressions and statements.

Take the Quiz: Test your knowledge with our interactive “Expression vs Statement in Python: What's the Difference?” quiz. You’ll receive a score upon completion to help you track your learning progress:

Interactive Quiz

Expression vs Statement in Python: What's the Difference?

In this quiz, you'll test your understanding of Python expressions vs statements. Knowing the difference between these two is crucial for writing efficient and readable Python code.

In Short: Expressions Have Values and Statements Cause Side Effects

When you open the Python glossary, you’ll find the following two definitions:

Expression: A piece of syntax which can be evaluated to some value. (…) (Source)

Statement: A statement is part of a suite (a “block” of code). A statement is either an expression or one of several constructs with a keyword, (…) (Source)

Well, that isn’t particularly helpful, is it? Fortunately, you can summarize the most important facts about expressions and statements in as little as three points:

  1. All instructions in Python fall under the broad category of statements.
  2. By this definition, all expressions are also statements—sometimes called expression statements.
  3. Not every statement is an expression.

In a technical sense, every line or block of code is a statement in Python. That includes expressions, which represent a special kind of statement. What makes an expression special? You’ll find out now.

Expressions: Statements With Values

Essentially, you can substitute all expressions in your code with the computed values, which they’d produce at runtime, without changing the overall behavior of your program. Statements, on the other hand, can’t be replaced with equivalent values unless they’re expressions.

Consider the following code snippet:

Python >>> x = 42 >>> y = x + 8 >>> print(y) 50 Copied!

In this example, all three lines of code contain statements. The first two are assignment statements, while the third one is a call to the print() function.

When you look at each line more closely, you can start disassembling the corresponding statement into subcomponents. For example, the assignment operator (=) consists of the parts on the left and the right. The part to the left of the equal sign indicates the variable name, such as x or y, and the part on the right is the value assigned to that variable.

The word value is the key here. Notice that the variable x is assigned a literal value, 42, that’s baked right into your code. In contrast, the following line assigns an arithmetic expression, x + 8, to the variable y. Python must first calculate or evaluate such an expression to determine the final value for the variable when your program is running.

Arithmetic expressions are just one example of Python expressions. Others include logical expressions, conditional expressions, and more. What they all have in common is a value to which they evaluate, although each value will generally be different. As a result, you can safely substitute any expression with the corresponding value:

Python >>> x = 42 >>> y = 50 >>> print(y) 50 Copied!

This short program gives the same result as before and is functionally identical to the previous one. You’ve calculated the arithmetic expression by hand and inserted the resulting value in its place.

Note that you can evaluate x + 8, but you can’t do the same with the assignment y = x + 8, even though it incorporates an expression. The whole line of code represents a pure statement with no intrinsic value. So, what’s the point of having such statements? It’s time to dive into Python statements and find out.

Statements: Instructions With Side Effects

Statements that aren’t expressions cause side effects, which change the state of your program or affect an external resource, such as a file on disk. For example, when you assign a value to a variable, you define or redefine that variable somewhere in Python’s memory. Similarly, when you call print(), you effectively write to the standard output stream (stdout), which, by default, displays text on the screen.

Note: While statements encompass expressions, most people use the word statement informally when they refer to pure statements or instructions with no value.

Okay. You’ve covered statements that are expressions and statements that aren’t expressions. From now on, you can refer to them as pure expressions and pure statements, respectively. But it turns out there’s a middle ground here.

Read the full article at https://realpython.com/python-expression-vs-statement/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Drupal life hack's: How can AI help in understanding regular expressions using Drupal examples?

Planet Drupal - Wed, 2024-12-04 08:54
How can AI help in understanding regular expressions using Drupal examples? admin Wed, 12/04/2024 - 15:54
Categories: FLOSS Project Planets

The Drop Times: Axelerant’s IDMC Digital Overhaul Earns Splash Awards Asia Nomination

Planet Drupal - Wed, 2024-12-04 08:00
In the second episode of The DropTimes' "Splash Award Finalists" series, explore how Axelerant’s innovative work for the Internal Displacement Monitoring Centre (IDMC) has transformed its digital platform. Learn how this project tackles global displacement challenges and why it’s a contender for the 'Not-for-Profit' category at the Splash Awards Asia.
Categories: FLOSS Project Planets

Bits from Debian: "Ceratopsian" will be the default theme for Debian 13

Planet Debian - Wed, 2024-12-04 07:30

The theme "Ceratopsian" by Elise Couper has been selected as the default theme for Debian 13 "trixie". The theme is inspired by Trixie's (the fictional character from Toy Story) frill and is also influenced by a previously used theme called "futurePrototype" by Alex Makas.

After the Debian Desktop Team made the call for proposing themes, a total of six choices were submitted. The desktop artwork poll was open to the public, and we received 2817 responses ranking the different choices, of which Ceratopsian has been ranked as the winner among them.

We'd like to thank all the designers that have participated and have submitted their excellent work in the form of wallpapers and artwork for Debian 13.

Congratulations, Elise, and thank you very much for your contribution to Debian!

Categories: FLOSS Project Planets

Ned Batchelder: Testing some tidbits

Planet Python - Wed, 2024-12-04 07:03

I posted a Python tidbit about checking if a string consists entirely of zeros and ones:

I got a bunch of replies suggesting other ways. I wanted to post those, but I also wanted to check if they were right. A classic testing structure would have required putting them all in functions, etc, which I didn’t want to bother with.

So I cobbled together a test harness for them (also in a gist if you want):

GOOD = [
    "",
    "0",
    "1",
    "000000000000000000",
    "111111111111111111",
    "101000100011110101010000101010101001001010101",
]

BAD = [
    "x",
    "nedbat",
    "x000000000000000000000000000000000000",
    "111111111111111111111111111111111111x",
    "".join(chr(i) for i in range(10000)),
]

TESTS = """
    # The original checks
    all(c in "01" for c in s)
    set(s).issubset({"0", "1"})
    set(s) <= {"0", "1"}
    re.fullmatch(r"[01]*", s)
    s.strip("01") == ""
    not s.strip("01")

    # Using min/max
    "0" <= min(s or "0") <= max(s or "1") <= "1"
    not s or (min(s) in "01" and max(s) in "01")
    ((ss := sorted(s or "0")) and ss[0] in "01" and ss[-1] in "01")

    # Using counting
    s.count("0") + s.count("1") == len(s)
    (not (ctr := Counter(s)) or (ctr["0"] + ctr["1"] == len(s)))

    # Using numeric tests
    all(97*c - c*c > 2351 for c in s.encode())
    max((abs(ord(c) - 48.5) for c in "0"+s)) < 1
    all(map(lambda x: (ord(x) ^ 48) < 2, s))

    # Removing all the 0 and 1
    re.sub(r"[01]", "", s) == ""
    len((s).translate(str.maketrans("", "", "01"))) == 0
    len((s).replace("0", "").replace("1", "")) == 0
    "".join(("1".join((s).split("0"))).split("1")) == ""

    # A few more for good measure
    set(s + "01") == set("01")
    not (set(s) - set("01"))
    not any(filter(lambda x: x not in {"0", "1"}, s))
    all(map(lambda x: x in "01", s))
"""

import re
from collections import Counter
from inspect import cleandoc

g = {
    "re": re,
    "Counter": Counter,
}

for test in cleandoc(TESTS).splitlines():
    test = test.partition("#")[0]
    if not test:
        continue
    for ss, expected in [(GOOD, True), (BAD, False)]:
        for s in ss:
            result = eval(test, {"s": s} | g)
            if bool(result) != expected:
                print("OOPS:")
                print(f"   {s = }")
                print(f"   {test}")
                print(f"   {expected = }")

It’s a good thing I did this because a few of the suggestions needed adjusting, especially for dealing with the empty string. But now they all work, and are checked!

BTW, if you prefer Mastodon to BlueSky, the posts are there too: first and second.

Categories: FLOSS Project Planets

LostCarPark Drupal Blog: Drupal Advent Calendar day 4 - Drupal.org

Planet Drupal - Wed, 2024-12-04 04:00
Drupal Advent Calendar day 4 - Drupal.org james Wed, 12/04/2024 - 09:00

Today Tim Lehnen from the Drupal Association joins us to talk about some of the changes taking place on the Drupal.org website as part of Starshot.

For day 4 of the Drupal Advent calendar, it’s a familiar face: Drupal.org! When we say “Come for the code, stay for the community!” Drupal.org is where we welcome everyone to join us.  Sure, you can find all the code, extensions, and documentation you need here, but Drupal.org is so much more. It’s the place where one of the greatest communities in open source gathers to communicate, collaborate, and celebrate.

Drupal.org is also a part of Drupal…

Tags
Categories: FLOSS Project Planets

Django Weblog: Help us make it happen ❤️

Planet Python - Wed, 2024-12-04 03:53

And just like that, 2024 is almost over! If your finances allow, donate to the Django Software Foundation to support the long-term future of Django.

84%

Of our US $200,000.00 goal for 2024, as of December 4th, 2024, we are at:

  • 83.6% funded
  • $167,272.85 donated

Donate to support Django

Other ways to give Why give to the Django Software Foundation?

Our main focus is direct support of Django's developers. This means:

  • Organizing and funding development sprints so that Django's developers can meet in person.
  • Helping key developers attend these sprints and other community events by covering travel expenses to official Django events.
  • Providing financial assistance to community development and outreach projects such as Django Girls.
  • Providing financial assistance to individuals so they can attend major conferences and events.
  • Funding the Django Fellowship program, which provides full-time staff to perform community management tasks in the Django community.

Still curious? See our Frequently Asked Questions about donations.

Categories: FLOSS Project Planets

FSF Blogs: The Licensing and Compliance Team is fighting for freedom and we need your help

GNU Planet! - Tue, 2024-12-03 17:25
The Licensing and Compliance Lab has been diligently serving the free software community.
Categories: FLOSS Project Planets

The Licensing and Compliance Team is fighting for freedom and we need your help

FSF Blogs - Tue, 2024-12-03 17:24
The Licensing and Compliance Lab has been diligently serving the free software community.
Categories: FLOSS Project Planets

Kushal Das: Basedpyright and neovim

Planet Python - Tue, 2024-12-03 15:50

Basedpyright is a fork of pyright with various type checking improvements, improved vscode support and pylance features built into the language server. It has a list of benefits over Pyright.

In case you want to use that inside of neovim using Mason, you will have to remember to have the configuration inside of a settings key. The following is from my setup.

basedpyright = { settings = { basedpyright = { analysis = { diagnosticMode = 'openFilesOnly', typeCheckingMode = 'basic', capabilities = capabilities, useLibraryCodeForTypes = true, diagnosticSeverityOverrides = { autoSearchPaths = true, enableTypeIgnoreComments = false, reportGeneralTypeIssues = 'none', reportArgumentType = 'none', reportUnknownMemberType = 'none', reportAssignmentType = 'none', }, }, }, }, },

Struggled for a few hours to fix this couple of days ago.

Categories: FLOSS Project Planets

PyCoder’s Weekly: Issue #658 (Dec. 3, 2024)

Planet Python - Tue, 2024-12-03 14:30

#658 – DECEMBER 3, 2024
View in Browser »

Django Performance: Scaling and Optimization

Performance tuning in the context of Django applications is the practice of enhancing both the efficiency and effectiveness of your web project to optimize its runtime behavior. This article tells you a lot of what you need to know.
LOADFORGE.COM

Python’s pathlib Module

Python’s pathlib module is the tool to use for working with file paths. This post contains pathlib quick reference tables and examples.
TREY HUNNER

Python Developers: Scrape Any Website Without Getting Blocked

ZenRows handles all anti-bot bypass for you, from rotating proxies and headless browsers to CAPTCHAs and AI. Get a complete web scraping toolkit to extract all the data you need with a single API call. Try ZenRows now for free →
ZENROWS sponsor

Managing Dependencies With Python Poetry

Learn how Python Poetry can help you start new projects, maintain existing ones, and master dependency management.
REAL PYTHON course

Nuitka Release 2.5

NUITKA.NET

Quiz: NumPy Practical Examples: Useful Techniques

REAL PYTHON

Quiz: Interacting With Python

REAL PYTHON

Discussions Add Optional if break: Suite to for/while

PYTHON.ORG

Articles & Tutorials Advent of Code 2024

This annual tradition is a series of small programming puzzles that can be completed in any programming language.
ADVENTOFCODE.COM

CI/CD for Python With GitHub Actions

With most software following agile methodologies, it’s essential to have robust DevOps systems in place to manage, maintain, and automate common tasks with a continually changing codebase. By using GitHub Actions, you can automate your workflows efficiently, especially for Python projects.
REAL PYTHON

How to Debug Your Textual Application

Textual is a great Python package for creating a lightweight, powerful, text-based user interface. Debugging TUIs can be a challenge though as you no longer can use print() and the application may not even run in your IDE’s terminal interface. This post talks about how to debug a TUI.
MIKE DRISCOLL

Reactive Notebooks and Deployable Web Apps in Python

What are common issues with using notebooks for Python development? How do you know the current state, share reproducible results, or create interactive applications? This week on the show, we speak with Akshay Agrawal about the open-source reactive marimo notebook for Python.
REAL PYTHON podcast

Constraints Are Good: Python’s Metadata Dilemma

Python’s initial flexibility in packaging with the executable setup.py has meant that people have come to expect this power. In this post Armin argues that if constraints had been there in the first place we’d be in a better place now.
ARMIN RONACHER

Demystifying ODBC With Python

Open Database Connectivity (ODBC) is used to connect to various databases. This article aims to help you understand ODBC better by implementing database communications from scratch only using Python.
PRESTON BLACKBURN • Shared by Preston Blackburn

What the PSF Conduct WG Does

In the past week Brett has had two different people tell him what the PSF Conduct Working Group did, and both were wrong. This post tries to correct what might be common misconceptions.
BRETT CANNON

Introduction to Retrogame Programming With Pyxel

Pyxel is a Rust based framework for building retro games that comes with a Python API wrapper. This step-by-step tutorial shows you how to do some basic sprite animation to get started.
MATHIEU LECARME

Speeding Up Data Retrieval From PostgreSQL With Psycopg

Formatting and concatenating query result columns on the PostgreSQL side and then parsing them in Python might sometimes be faster than fetching the columns as separate values.
ALIAKSEI YALETSKI • Shared by Tiendil

Django Application Performance Optimization Checklist

“Improve the performance of your Django application by understanding, testing, and implementing some common optimization techniques.”
SANKET RAI

Top 10 Rules of Continuous Integration

Continuous Integration (CI) is key to rapid deployment of new features. This post gives you ten rules to consider when doing CI.
KRISTINA NIKOLOVA

Projects & Code Sensei: Simplifying API Client Generation

CROCOFACTORY.DEV • Shared by Alexey

QodoAI Cover-Agent: AI Tool for Automated Test Generation

GITHUB.COM/CODIUM-AI

Peek: Like print, but Easy

SALABIM.ORG • Shared by Ruud van der Ham

pyvista: 3D Plotting and Mesh Analysis

GITHUB.COM/PYVISTA

python-fire: Automatically Generate Command Line Interfaces

GITHUB.COM/GOOGLE

Events Weekly Real Python Office Hours Q&A (Virtual)

December 4, 2024
REALPYTHON.COM

PyCon Tanzania 2024

December 4 to December 6, 2024
PYCON.OR.TZ

DELSU Tech Invasion 2.0

December 4 to December 6, 2024
HAMPLUSTECH.COM

Canberra Python Meetup

December 5, 2024
MEETUP.COM

Sydney Python User Group (SyPy)

December 5, 2024
SYPY.ORG

PyLadies Amsterdam: Introduction to Data Storytelling

December 7, 2024
MEETUP.COM

Happy Pythoning!
This was PyCoder’s Weekly Issue #658.
View in Browser »

[ Subscribe to 🐍 PyCoder’s Weekly 💌 – Get the best Python news, articles, and tutorials delivered to your inbox once a week >> Click here to learn more ]

Categories: FLOSS Project Planets

Python Insider: Python 3.13.1, 3.12.8, 3.11.11, 3.10.16 and 3.9.21 are now available

Planet Python - Tue, 2024-12-03 14:01

Another big release day! Python 3.13.1 and 3.12.8 were regularly scheduled releases, but they do contain a few security fixes. That makes it a nice time to release the security-fix-only versions too, so everything is as secure as we can make it.

Python 3.13.1

Python 3.13’s first maintenance release. My child is all growed up now, I guess! Almost 400 bugfixes, build improvements and documentation changes went in since 3.13.0, making this the very best Python release to date.

https://www.python.org/downloads/release/python-3131/

Python 3.12.8

Python 3.12 might be slowly reaching middle age, but still received over 250 bugfixes, build improvements and documentation changes since 3.12.7.

https://www.python.org/downloads/release/python-3128/
Python 3.11.11

I know it’s probably hard to hear, but this is the second security-only release of Python 3.11. Yes, really! Oh yes, I know, I know, but it’s true! Only 11 commits went in since 3.11.10.

https://www.python.org/downloads/release/python-31111/
Python 3.10.16

Python 3.10 received a total of 14 commits since 3.10.15. Why more than 3.11? Because it needed a little bit of extra attention to keep working with current GitHub practices, I guess.

https://www.python.org/downloads/release/python-31016/
Python 3.9.21

Python 3.9 isn’t quite ready for pasture yet, as it’s set to receive security fixes for at least another 10 months. Very similarly to 3.10, it received 14 commits since 3.9.20.

https://www.python.org/downloads/release/python-3921/
Stay safe and upgrade!

As always, upgrading is highly recommended to all users of affected versions.

Enjoy the new releases

Thanks to all of the many volunteers who help make Python Development and these releases possible! Please consider supporting our efforts by volunteering yourself or through organization contributions to the Python Software Foundation.

Regards from your tireless, tireless release team,
Thomas Wouters
Ned Deily
Steve Dower
Pablo Galindo Salgado
Łukasz Langa 

Categories: FLOSS Project Planets

Pages