Feeds

Colin Watson: Going freelance

Planet Debian - Wed, 2024-01-10 04:50

I’ve mentioned this in a couple of other places, but I realized I never got round to posting about it on my own blog rather than on other people’s services. How remiss of me.

Anyway: after much soul-searching, I decided a few months ago that it was time for me to move on from Canonical and the Launchpad team there. Nearly 20 years is a long time to spend at any company, and although there are a bunch of people I’ll miss, Launchpad is in a reasonable state where I can let other people have a turn.

I’m now in business for myself as a freelance developer! My new company is Columbiform, and I’m focusing on Debian packaging and custom Python development. My services page has some self-promotion on the sorts of things I can do.

My first gig, and the one that made it viable to make this jump, is at Freexian where I’m helping with an exciting infrastructure project that we hope will start making Debian developers’ lives easier in the near future. This is likely to take up most of my time at least through to the end of 2024, but I may have some spare cycles. Drop me a line if you have something where you think I could be a good fit, and we can have a talk about it.

Categories: FLOSS Project Planets

Simon Josefsson: Trisquel on arm64: Ampere Altra

Planet Debian - Wed, 2024-01-10 04:26

Having had success running Trisquel on the ppc64 Talos II, I felt ready to get an arm64 machine running Trisquel. I have a Ampere Altra Developer Platform from ADLINK, which is a fairly powerful desktop machine. While there were some issues during installation, I’m happy to say the machine is stable and everything appears to work fine.

ISO images for non-amd64 platforms are unfortunately still hidden from the main Trisquel download area, so you will have to use the following procedure to download and extract a netinst ISO image (using debian-installer) and write it to a USB memory device. Another unfortunate problem is that there are no OpenPGP signatures or hash checksums, but below I publish one checksum.

wget -q http://builds.trisquel.org/debian-installer-images/debian-installer-images_20210731+deb11u9+11.0trisquel15_arm64.tar.gz tar xfa debian-installer-images_20210731+deb11u9+11.0trisquel15_arm64.tar.gz ./installer-arm64/20210731+deb11u9+11/images/netboot/mini.iso echo '311732519cc8c7c1bb2fe873f134fdafb211ef3bcb5b0d2ecdc6ea4e3b336357 installer-arm64/20210731+deb11u9+11/images/netboot/mini.iso' | sha256sum -c sudo wipefs -a /dev/sdX sudo dd if=installer-arm64/20210731+deb11u9+11/images/netboot/mini.iso of=/dev/sdX conv=sync status=progress

Insert the USB stick in a USB slot in the machine, and power up. Press ESCAPE at the BIOS prompt and select the USB device as the boot device. The first problem that hit me was that translations didn’t work, I selected Swedish but the strings were garbled. Rebooting and selecting the default English worked fine. For installation, you need Internet connectivity and I use the RJ45 port closest to VGA/serial which is available as enP5p1s0 in the installer. I wouldn’t connect the BMC RJ45 port to anything unless you understand the security implications.

During installation you have to create a EFI partition for booting, and I ended up with one 1GB EFI partition, one 512GB ext4 partition for / with discard/noatime options, and a 32GB swap partition. The installer did not know about any Trisquel mirrors, but only had the default archive.trisquel.org, so if you need to use a mirror, take a note of the necessary details. The installation asks me about which kernel to install, and I went with the default linux-generic which results in a 5.15 linux-libre kernel. At the end of installation, unfortunately grub failed with a mysterious error message: Unable to install GRUB in dummy. Executing 'grub-install dummy' failed. On another console there is a better error message: failed to register the EFI boot entry. There are some references to file descriptor issues. Perhaps I partitioned the disk in a bad way, or this is a real bug in the installer for this platform. I continued installation, and it appears the installer was able to write GRUB to the device, but not add the right boot menu. So I was able to finish the installation properly, and then reboot and manually type the following GRUB commands: linux (hd0,gpt2)/boot/vmlinuz initrd (hd0,gpt2)/boot/initrd.img boot. Use the GRUB ls command to find the right device. See images below for more information.

Booting and installing GRUB again manually works fine:

root@ampel:~# update-grub Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/background.cfg' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.15.0-91-generic Found initrd image: /boot/initrd.img-5.15.0-91-generic Found linux image: /boot/vmlinuz-5.15.0-58-generic Found initrd image: /boot/initrd.img-5.15.0-58-generic Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. Adding boot menu entry for UEFI Firmware Settings ... done root@ampel:~#

During installation I tend to avoid selecting any tasksel components, in part because it didn’t use a local mirror to gain network speed, and in part because I don’t want to generate OpenSSH keys in a possibly outdated environment that is harder to audit and reproducible rebuild than the finally installed system. When I selected the OpenSSH and GNOME tasksel, I get an error, but fortunately using apt get directly is simple.

root@ampel:~# tasksel Tasksel GNOME failed: tasksel: apt-get failed (100) root@ampel:~# apt-get install trisquel-gnome ssh

Graphics in GNOME was slow using the built-in ASPEED AST2500 VGA controller with linux-libre 5.15. There are kernels labeled 64k but I haven’t tested them, and I’m not sure they would bring any significant advantage. I simply upgraded to a more recent linux-libre 6.2 kernel via the linux-image-generic-hwe-11.0 virtual package. After a reboot, graphics in GNOME is usable.

root@ampel:~# apt-get install linux-image-generic-hwe-11.0

There seems to be some issue with power-saving inside GNOME, since the machine becomes unresponsive after 20 minutes, and I’m unable to make it resume via keyboard or power button. Disabling the inactivity power setting in GNOME works fine to resolve this.

I will now put this machine to some more heavy use and see how it handles it. I hope to find more suitable arm64-based servers to complement my ppc64el-based servers in the future, as this ADLINK Ampere Altra Developer Platform with liquid-cooling is more of a toy than a serious server for use in a datacentre.

Happy Trisquel-on-arm64 Hacking!

Categories: FLOSS Project Planets

Russell Coker: SAS vs SATA and Recovery

Planet Debian - Wed, 2024-01-10 01:30

SAS and SATA are electrically compatible to a degree that allows connecting a SATA storage device to a SAS controller. The SAS controller understands the SATA protocol so this works. A SAS device can’t be physically connected to a SATA controller and if you did manage to connect it then it wouldn’t work.

Some SAS RAID controllers don’t permit mixing SAS and SATA devices in the same array, this is a software issue and could be changed. I know that the PERC controllers used by Dell (at least the older versions) do this and it might affect many/most MegaRAID controllers (which is what PERC is).

If you have a hardware RAID array of SAS disks and one fails then you need a spare SAS disk and as the local computer store won’t have any you need some on hand.

The Linux kernel has support for the MegaRAID/PERC superblocks so for at least some of the RAID types supported by MegaRAID/PERC you can just connect the disks to a Linux system and have it work (I’ve only tested on JBOD AKA a single-disk RAID-0). So if you have a server from Dell or IBM or any other company that uses MegaRAID which fails you can probably just put the disks into a non-RAID SAS controller and have them work. As Linux doesn’t care about the difference between SAS and SATA at the RAID level you could then add a SATA disk to an array of SAS disks. If you want to move an array from a dead Dell to a working IBM server or the other way around then you need it to be all SATA or all SAS. You can use a Linux system to mount an array used by Windows or any other OS and then migrate the data to a different array.

If you have an old array of SAS disks and one fails then it might be a reasonable option to just migrate the data to a new array of SATA SSDs. EG if you had 6*600G SAS disks you could move to 2*4TB SATA SSDs and get more storage, much higher performance, less power use, and less noise for a cost of $800 or so (you can spend more to get better performance) and some migration time.

Having a spare SAS controller for data recovery is convenient. Having a spare SAS disk for any RAID-5/RAID-6 is a good thing. Having lots of spare SAS disks probably isn’t useful as migrating to SATA is a better choice. SATA SSDs are bigger and faster than most SAS disks that are in production. I’m sure that someone uses SAS SSDs but I haven’t yet seen them in production, if you have a SAS system and need the performance that SSDs can give then a new server with U.2 (the SAS equivalent of NVMe) is the way to go). SATA hard drives are also the solution for seriously large storage, 16TB SATA hard drives are cheap and work in all the 3.5″ SAS systems.

It’s hard to sell old SAS disks as there isn’t much use for them.

Related posts:

  1. Cheap SATA Disks in a Dell PowerEdge T410 A non-profit organisation I support has just bought a Dell...
  2. HP ML350P Gen8 I’m playing with a HP Proliant ML350P Gen8 server (part...
  3. Dell PowerEdge T320 and Linux I recently bought a couple of PowerEdge T320 servers, so...
Categories: FLOSS Project Planets

Dirk Eddelbuettel: Rcpp 1.0.12 on CRAN: New Maintenance / Update Release

Planet Debian - Tue, 2024-01-09 19:54

The Rcpp Core Team is once again thrilled to announce a new release 1.0.12 of the Rcpp package. It arrived on CRAN early today, and has since been uploaded to Debian as well. Windows and macOS builds should appear at CRAN in the next few days, as will builds in different Linux distribution–and of course at r2u should catch up tomorrow. The release was uploaded yesterday, and run its reverse dependencies overnight. Rcpp always gets flagged nomatter what because the grandfathered .Call(symbol) but … we had not single ‘change to worse’ among over 2700 reverse dependencies!

This release continues with the six-months January-July cycle started with release 1.0.5 in July 2020. As a reminder, we do of course make interim snapshot ‘dev’ or ‘rc’ releases available via the Rcpp drat repo and strongly encourage their use and testing—I run my systems with these versions which tend to work just as well, and are also fully tested against all reverse-dependencies.

Rcpp has long established itself as the most popular way of enhancing R with C or C++ code. Right now, 2791 packages on CRAN depend on Rcpp for making analytical code go faster and further, along with 254 in BioConductor. On CRAN, 13.8% of all packages depend (directly) on Rcpp, and 59.9% of all compiled packages do. From the cloud mirror of CRAN (which is but a subset of all CRAN downloads), Rcpp has been downloaded 78.1 million times. The two published papers (also included in the package as preprint vignettes) have, respectively, 1766 (JSS, 2011) and 292 (TAS, 2018) citations, while the the book (Springer useR!, 2013) has another 617.

This release is incremental as usual, generally preserving existing capabilities faithfully while smoothing our corners and / or extending slightly, sometimes in response to changing and tightened demands from CRAN or R standards.

The full list below details all changes, their respective PRs and, if applicable, issue tickets. Big thanks from all of us to all contributors!

Changes in Rcpp release version 1.0.12 (2024-01-08)
  • Changes in Rcpp API:

    • Missing header includes as spotted by some recent tools were added in two places (Michael Chirico in #1272 closing #1271).

    • Casts to avoid integer overflow in matrix row/col selections have neem added (Aaron Lun #1281).

    • Three print format correction uncovered by R-devel were applied with thanks to Tomas Kalibera (Dirk in #1285).

    • Correct a print format correction in the RcppExports glue code (Dirk in #1288 fixing #1287).

    • The upcoming OBJSXP addition to R 4.4.0 is supported in the type2name mapper (Dirk and Iñaki in #1293).

  • Changes in Rcpp Attributes:

    • Generated interface code from base R that fails under LTO is now corrected (Iñaki in #1274 fixing a StackOverflow issue).
  • Changes in Rcpp Documentation:

    • The caption for third figure in the introductory vignette has been corrected (Dirk in #1277 fixing #1276).

    • A small formatting issue was correct in an Rd file as noticed by R-devel (Dirk in #1282).

    • The Rcpp FAQ vignette has been updated (Dirk in #1284).

    • The Rcpp.bib file has been refreshed to current package versions.

  • Changes in Rcpp Deployment:

    • The RcppExports file for an included test package has been updated (Dirk in #1289).

Thanks to my CRANberries, you can also look at a diff to the previous release Questions, comments etc should go to the rcpp-devel mailing list off the R-Forge page. Bugs reports are welcome at the GitHub issue tracker as well (where one can also search among open or closed issues).

If you like this or other open-source work I do, you can sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Categories: FLOSS Project Planets

TypeThePipe: Plot your GIS data with GeoPandas and Plotnine. A single glance insightful visualization

Planet Python - Tue, 2024-01-09 19:00
pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { color: #008000; } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { color: #008000; font-weight: bold; } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */


Geographical Data Visualization in Python with GeoPandas

Working with geographical data can often be a bit tricky for the uninitiated. This post aims to shed some light for those who are encountering geo data for the first time and want an easy way to perform initial manipulations and plot it to gain their first insights.

We’re about to dive into a sea of coordinates, shapes, and a whole lot of mapping magic!


GIS data formats

First of all, we want to make a summary about the most used data formats for geo data. These are the unsung heroes in the world of mapping and spatial analysis. Imagine trying to describe the vastness of our planet without them – it’s like trying to paint a masterpiece with just one color. Not happening, right?

First up in our parade of geo data superstars are formats like Shapefile (SHP), the old faithful of the geo world. But you’ll need a complete set of three files that are mandatory to make up a shapefile. The three required files are: .SHP for geometry, .SHX is the shape index position and .DBF is the attribute data.

Developed by ESRI, it’s like the trusty old pickup truck – not the flashiest but gets the job done. Then there’s GeoJSON, the cool kid on the block. It’s all about simplicity and web-friendliness, perfect for those who love to mingle with JavaScript and web mapping.

And let’s not forget about KML (Keyhole Markup Language), the go-to for Google Earth enthusiasts. It’s like having a GPS in your pocket – straightforward and ready to guide you through those virtual globetrotting adventures. Each of these formats has its own quirks and charms, kind of like different types of pasta – some are better suited for hearty meaty sauces, while others are perfect for a light seafood affair.

In short, the world of geo data formats is as diverse and colorful as the world it represents. Whether you’re a GIS guru or a casual map enthusiast, getting to know these formats is like getting the keys to a whole new world of spatial wonders

Yuo can check more info here!


Load SHAP data into Python object

Let’s kick things off by accessing the geo data and geometries. Imagine we are a company with central stations spread across the Spanish territory, responsible for the alerts in their vicinity. Each station acts as a sentinel, vigilantly monitoring and responding to the events unfolding around it. So we will begin with defining the country over which we’re planning to plot the stations and event coordinates.

Now, here comes the fun part: we load the Shape data using GeoPandas. It’s like unlocking a treasure chest of geographical wonders! GeoPandas makes it a breeze, turning what could be a complex task into a walk in the park. Imagine GeoPandas as your trusty GPS, guiding you through the intricate world of geo data with ease and precision. So, grab your data, let’s fire up GeoPandas, and watch as those lines of code magically transform into a map full of possibilities!

import geopandas as gp import pandas as pd def filter_shp_peninsular_data(df: pd.DataFrame) -> pd.DataFrame: return df[df["acom_name"] != "Canarias"] spain_gis_map = gp.read_file('./data/georef-spain-provincia/georef-spain-provincia-millesime.shp') peninsular_gis_map = filter_shp_peninsular_data(spain_gis_map)

We can filter out any layer in the GeoPandas read_file function with the bbox and mask parameters. But let’s keep it simple for the moment and just load and filter out it.

For ease of use, we are going to load and filter also the alerts peninsular data. You can easily apply coordinates filters in order to focus in one specific geography. We will transform our internal data read with Polars to GeoPandas dataframe to show how it could be do, but it is not strictly necessary.

from shapely.geometry import Point import polars as pl def filter_df_peninsular_data(df: pd.DataFrame) -> pd.DataFrame: peninsular_bounds_min = peninsular_gis_map["geometry"].bounds.min() peninsular_bounds_max = peninsular_gis_map["geometry"].bounds.max() return df.filter( ( pl.col("x")>=peninsular_bounds_min["minx"] ) & ( pl.col("x")<=peninsular_bounds_max["maxx"] ) & ( pl.col("y")>=peninsular_bounds_min["miny"] ) & ( pl.col("y")<=peninsular_bounds_max["maxy"] ) ) alerts_geo_df = pl.read_csv("alers_data.csv") alerts_geo_df = gp.GeoDataFrame({ "geometry": alerts_geo_df["coord"].map_elements(lambda x: Point(x)), "alert_solved": alerts_geo_df["alert_solved"].is_not_null(), "x": alerts_geo_df["x"], "y": alerts_geo_df["y"], }) stations_geo_df = pl.read_csv("stations_data.csv") stations_geo_df = gp.GeoDataFrame({ "geometry": stations_geo_df["coord"].map_elements(lambda x: Point(x)), "x": stations_geo_df["x"], "y": stations_geo_df["y"], })


Geopandas plotting with Plotnine

Let’s start with our mission to plot a map sprinkled with stations (in cheerful yellow) and events (in bold red and blue).

Once we have the data both country layers and our project datapoints properly formated as GeoPandas DataFrames

The geom_map function is our stroke of genius, turning geographical data into visual narratives.

( ggplot() + geom_map(peninsular_gis_map, fill=None) + geom_map(alerts_geo_df, aes(fill="alert_solved"), size=2) + geom_map(stations_geo_df, colour="yellow", size=3) + labs( title="Alerts solved y/n, by location + Stations (yellow)", caption = "Data from 2023-01-01 to 2023-02-01", ) )


Geopandas plotting the most representative category by location

Now, we’re not just mapping points; we’re painting a picture of the most representative category by location. Think of it as a data detective story, where each clue (or data point) reveals a part of the bigger picture.

Here’s how we crack the case:

( ggplot() + geom_bin2d(alerts_geo_df, aes(x="x", y="y", fill="alert_solved"), bins = 30) + geom_map(stations_geo_df, colour="yellow", size=3) + labs( title="Alerts solved y/n, by location + Stations (yellow)", caption = "Data from 2023-01-01 to 2023-02-01", ) )

With geom_bin2d, we’re transforming our map into a vibrant tapestry, showcasing the most contacted categories in a kaleidoscope of colors. Each square on this grid is like a pixel, together weaving the story of our data’s journey across the Spanish landscape. And, of course, our stations, marked in sunny yellow, stand out as beacons in this sea of information.


Stay updated on Python tips

Hopefully, this post has helped familiarize you with GeoPandas, GIS data nd Plotnine in Python.

If you want to stay updated…

#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; width:100%;} #mc_embed_signup .button { background-color: #0294A5; /* Green */ color: white; transition-duration: 0.4s; } #mc_embed_signup .button:hover { background-color: #379392 !important; } Suscribe for more Python posts! p { word-spacing: 3px; text-indent: 20px; text-align: justify; } .page-subtitle { text-align: left !important; text-indent: 0px !important; } .card-text { text-align: left !important; text-indent: 0px !important; } .hljs-keyword,.hljs-selector-tag,.hljs-subst{color:#2e8516;font-weight:bold}.hljs-comment, .hljs-quote { color: #0e847b; font-style: italic; }.hljs-number, .hljs-literal, .hljs-variable, .hljs-template-variable, .hljs-tag .hljs-attr { color: #008021; }
Categories: FLOSS Project Planets

Read the Docs: Read the Docs newsletter - January 2024

Planet Python - Tue, 2024-01-09 19:00
News and updates
  • We have shipped New improvements to redirects, making our redirects much more powerful and flexible.

  • We have shipped an updated approach to notifications. Currently there isn’t much UX difference, but as we move forward with this project we will be able to provide more context and control to users.

  • We continue to work on improving Addons, our new approach to documentation integrations. New documentation and bug fixing continues to happen.

  • We shipped version 2.0 of our Read the Docs Sphinx Theme, which adds support for new Sphinx releases and drops support for many old versions of Sphinx and Python.

You can always see the latest changes to our platforms in our Read the Docs Changelog.

Upcoming changes
  • Addons will be made more configurable in our new beta dashboard, starting a trend of moving away from the old dashboard for new features.

  • Our beta dashboard continues to be tested in public beta, and new functionality for Addons configuration will only be available in that new interface.

  • We continue to work on some business model changes enabled by the new redirects work, including allowing access to Forced Redirects for more users.

Want to follow along with our development progress? View our full roadmap 📍️

Possible issues
  • Users need to update their webhooks before January 31, 2024 if they are configured without a secret. All users who need to take action should have received email and site notifications about this.

  • We are discussing removing support for all VCS systems except Git, as our userbase is heavily biased towards Git users and it will simplify maintenance and development of features. We stopped developing features for Mercurial, Subversion, and Bazaar years ago, and we are considering removing support for them entirely. We will be reaching out to these users to get feedback on this change.

Questions? Comments? Ideas for the next newsletter? Contact us!

Categories: FLOSS Project Planets

KDE's 6th Megarelease - Release Candidate 1

Planet KDE - Tue, 2024-01-09 19:00
Plasma 6, Frameworks and Gear draw closer

Every few years we port the key components of our software to a new version of Qt, taking the opportunity to remove cruft and leverage the updated features the most recent version of Qt has to offer us.

KDE's megarelease is less than 50 days away. At the end of February 2024 we will publish Plasma 6, Frameworks 6, and a whole new set of applications in a special edition of KDE Gear all in one go.

If you have been following the updates here, here and here, you will know we are making our way through the testing phase and gradually reaching stability. KDE is making available today the first Release Candidate version of all the software we will include in the megarelease.

As with the Alpha and Beta versions, this is a preview intended for developers and testers. The software provided is nearing stability, but is still not 100% safe to use in a production environment. We still recommend you continue using stable versions of Plasma, Frameworks and apps for your everyday work. But if you do use this, watch out for bugs and report them promptly, so we can solve them.

Read on to find out more about KDE's 6th Megarelease, what it covers, and how you can help make the new versions of Plasma, KDE's apps and Frameworks a success now.

Plasma

Plasma is KDE's flagship desktop environment. Plasma is like Windows or macOS, but is renowned for being flexible, powerful, lightweight and configurable. It can be used at home, at work, for schools and research.

Plasma 6 is the upcoming version of Plasma that integrates the latest version of Qt, Qt 6, the framework upon which Plasma is built.

Plasma 6 incorporates new technologies from Qt and other constantly evolving tools, providing new features, better support for the latest hardware, and supports for the hardware and software technologies to come.

You can be part of the new Plasma. Download and install a Plasma 6-powered distribution (like Neon Unstable) to a test machine and start trying all its features. Check the Contributing section below to find out how you can deliver reports of what you find to the developers.

KDE Gear

KDE Gear is a collection of applications produced by the KDE community. Gear includes file explorers, music and video players, text and video-editors, apps to manage social media and chats, email and calendaring applications, travel assistants, and much more.

Developers of these apps also rely on the Qt toolbox, so most of the software will also be adapted to use the new Qt6 toolset and we need you to help us test them too.

Frameworks

KDE's Frameworks add tools created by the KDE community on top of those provided by the Qt toolbox. These tools give developers more and easier ways of developing interfaces and functionality that work on more platforms.

Among many other things, KDE Frameworks provide

  • widgets (buttons, text boxes, etc.) that make building your apps easier and their looks more consistent across platforms, including Windows, Linux, Android and macOS
  • libraries that facilitate storing and retrieving configuration settings
  • icon sets, or technologies that make the integration of the translation workflow of applications easier

KDE's Frameworks also rely heavily on Qt and will also be upgraded to adapt them to the new version 6. This change will add more features and tools, enable your applications to work on more devices, and give them a longer shelf life.

Contributing

KDE relies on volunteers to create, test and maintain its software. You can help too by...

  • Reporting bugs -- When you come across a bug when testing the software included in this Alpha Megarelease, you can report it so developers can work on it and remove it. When reporting a bug
    • make sure you understand when the bug is triggered so you can give developers a guide on how to check it for themselves
    • check you are using the latest version of the software you are testing, just in case the bug has been solved in the meantime
    • go to KDE's bug-tracker and search for your bug to make sure it does not get reported twice
    • if no-one has reported the bug yet, fill in the bug report, giving all the details you think are significant.
    • keep tabs on the report, just in case developers need more details.
  • Solving bugs -- Many bugs are easy to solve. Some just require changing a version number or tweaking the name of a library to its new name. If you have some basic programming knowledge of C++ and Qt, you too can help carry the weight of debugging KDE's software for the grand release in February.
  • Joining the development effort -- You may have a deeper knowledge development, and would like to contribute to KDE with your own solutions. This is the perfect moment to get involved in KDE and contribute with your own code.
  • Donating to KDE -- Creating, debugging and maintaining the large catalogue of software KDE distributes to users requires a lot of resources, many of which cost money. Donating to KDE helps keep the day-to-day operation of KDE running smoothly and allows developers to concentrate on creating great software. KDE is currently running a drive to encourage more people to become contributing supporters, but you can also give one-time donations if you want.
A note on pre-release software

Pre-release software is only suited for developers and testers. Alpha/Beta/RC software is unfinished, will be unstable and will contain bugs. It is published so volunteers can trial-run it, identify its problems, and report them so they can be solved before the publication of the final product.

The risks of running pre-release software are many. Apart from the hit to productivity produced by instability and the lack of features, using pre-release software can lead to data loss, and, in extreme cases, damage to hardware. That said, the latter is highly unlikely in the case of KDE software.

The version of the software included in KDE's 6th Megarelease is beta software. We strongly recommend you do not use it as your daily driver.

If, despite the above, you want to try the software distributed in KDE's 6th Megarelease, you do so under your sole responsibility, and in the understanding that the main aim, as a tester, you help us by providing feedback and your know-how regarding the software. Please see the Contributing section above.

Categories: FLOSS Project Planets

PyCoder’s Weekly: Issue #611 (Jan. 9, 2024)

Planet Python - Tue, 2024-01-09 14:30

#611 – JANUARY 9, 2024
View in Browser »

How to Get the Current Time in Python

In this video course, you’ll be getting the current time in Python. You’ll get your hands on a datetime object that represents the current time. You’ll see how to format it according to international standards, and you’ll even check out how computers represent time.
REAL PYTHON course

Using a Markov Chain to Generate Readable Nonsense

Describes a simple Markov chain algorithm to generate reasonable-sounding but utterly nonsensical text, and presents some example outputs as well as a Python implementation in only 20 lines of code.
BEN HOYT

End-to-End Data Science Workflows: ML Workflows With Python

Learn Machine Learning workflow with Python & Posit Team in this insightful video. Starting with an example classification model, through design, development, deployment, & maintenance, learn from our experience with thousands of enterprise customers →
POSIT sponsor

Top Python Libraries of 2023

Tryolab’s 9th annual Top Python libraries list. Loads of LLM stuff this time around, not surprisingly.
DESCOINS & ALFARO

DjangoCon Europe 2024 CFP Now Open

DJANGO SOFTWARE FOUNDATION

Django Bugfix Releases Issued: 4.2.9 and 5.0.1

DJANGO SOFTWARE FOUNDATION

Python GUI Designer “PAGE” 8.0 Released

THEDESIGNATEDGEEK.XYZ • Shared by Greg Walters

Python Jobs Senior Python Architect and Tech Lead (America)

Six Feet Up

Python Tutorial Editor (Anywhere)

Real Python

More Python Jobs >>>

Articles & Tutorials Efficient Inequality Joins in Pandas

Joins in Pandas are equality based. However, there are other scenarios that require joins on inequality or a combination of equi and non-equi joins. Usually in Pandas this is executed via a Cartesian join which can be inefficient as well as memory intensive. This article shows an efficient way to handle inequality joins in Pandas.
SAMUEL ORANYELI • Shared by Samuel oranyeli

2023 Real Python Tutorial & Video Course Wrap-Up

Three members of the Real Python team are joining us this week: Kate Finegan, Tappan Moore, and Philipp Acsany. We wanted to share a year-end wrap-up with tutorials, step-by-step projects, code conversations, and video courses that showcase what our team created in 2023.
REAL PYTHON podcast

Advice for New Devs Who’ve Read Other Advice Essays

After reading some programming advice posts, this author decided a lot of them concentrated on the wrong things. Here is his own take. Associated HN discussion.
HILLEL WAYNE

Building a Bootstrap Styled Form in Vanilla Django

When playing with django-crispy-forms, David wondered what it would take to build a Bootstrap 5 form in Django without any third party libraries. This article outlines the work involved.
DAVID SMITH

Where Have You Installed Your Python Packages?

This article introduces virtual environments and what it means to run pip install. It includes information about the sys module and variables it uses to look for your packages.
KE PI

How to Use Python in Excel Natively

How to use Python in Excel natively using libraries like Pandas, NumPy, Matplotlib, Seaborn and more for analysis and spectacular charts. Includes a cheat sheet.
MYNDA TREACY

My Proof-of-Concept Record Type

As part of a conversation as to whether Python should include a struct-like syntax, Brett has created a project. This post outlines the proof-of-concept.
BRETT CANNON

Python Rgonomics

If you’re coming to Python from R, this article outlines some libraries that have an R-like feel, helping you make the transition to Pythonic workflows.
EMILY RIEDERER

10 Things Software Developers Should Learn About Learning

Developers want and need to perpetually learn. Needing to learn and knowing how are two different things though, and this article highlights key ideas to teach yourself how to learn better.
BROWN, HERMANS, & MARGULIEUX

Don’t Use Python’s @property

A quick opinion piece on the over-use of the @property decorator and how it can lead to misunderstandings in your code.
JAMES BENNETT

10 Noteworthy AI Research Papers of 2023

This article is a compilation of 10 noteworthy AI research papers of 2023.
SEBASTIAN RASCHKA

Projects & Code django-ninja-crud: CRUD Endpoints & Tests With Ninja

GITHUB.COM/HBAKRI

pathway: Framework for Real-Time Data Processing

GITHUB.COM/PATHWAYCOM

cyclopts: Intuitive CLIs Based on Python Type Hints

GITHUB.COM/BRIANPUGH

netchecks: Tool to Validate Assumptions About the Network

GITHUB.COM/HARDBYTE

arrest: Validate REST API Calls Using Pydantic and HTTPX

GITHUB.COM/S-BOSE

Events Building Python Communities Around Python for Kids

January 10 to January 11, 2024
NOKIDBEHIND.ORG

Weekly Real Python Office Hours Q&A (Virtual)

January 10, 2024
REALPYTHON.COM

Python Atlanta

January 12, 2024
MEETUP.COM

PyDelhi User Group Meetup

January 13, 2024
MEETUP.COM

DFW Pythoneers 2nd Saturday Teaching Meeting

January 13, 2024
MEETUP.COM

Inland Empire Python Users Group Monthly Meeting

January 17, 2024
MEETUP.COM

Happy Pythoning!
This was PyCoder’s Weekly Issue #611.
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

PreviousNext: Symfony Messenger’s message and message handlers and a comparison with @QueueWorker

Planet Drupal - Tue, 2024-01-09 14:29

This post covers Symfony Messenger’s message and message handlers, which are the day to day code developers using features of Symfony Messenger typically will be working on.

by daniel.phin / 10 January 2024

This post is part 2 in a series about Symfony Messenger.

  1. Introducing Symfony Messenger integrations with Drupal
  2. Symfony Messenger’ message and message handlers, and comparison with @QueueWorker
  3. Real-time: Symfony Messenger’ Consume command and prioritised messages
  4. Automatic message scheduling and replacing hook_cron
  5. Adding real-time processing to QueueWorker plugins
  6. Making Symfony Mailer asynchronous: integration with Symfony Messenger
  7. Displaying notifications when Symfony Messenger messages are processed
  8. Future of Symfony Messenger in Drupal

The Symfony Messenger integration with Drupal provided by the SM project is the only requirement for the following examples.

A message itself is very flexible, as it doesn't require annotations, attributes, or specific class namespace. It only needs to be a class serialisable by Symfony. For simplicity, don’t include any complex objects like Drupal entities. Opt to store entity UUIDs instead.

At its most simple implementation, a message handler is:

  • a class at the Messenger\ namespace
  • with a #[AsMessageHandler] class attribute
  • an __invoke method. Where its first argument is an argument typehinted with the message class.

Example message and message handler:

namespace Drupal\my_module; final class MyMessage { public function __construct(public string $foo) {} } namespace Drupal\my_module\Messenger; use Drupal\Core\State\StateInterface; use Symfony\Component\Messenger\Attribute\AsMessageHandler; #[AsMessageHandler] final class MyMessageHandler { public function __construct(StateInterface $state) {} public function __invoke(\Drupal\my_module\MyMessage $message): void { // Do something with $message. $this->state->set('storage', $message->foo); } }

And dispatch code:

$bus = \Drupal::service(\Symfony\Component\Messenger\MessageBusInterface::class); $bus->dispatch(new MyMessage(foo: 'bar'));

Non-autowirable dependency injection

Message handlers use autowiring by default, so you don’t need ContainerFactoryPluginInterface and friends.

In the rare case that dependencies are not autowirable, you can opt to define a message handler as a tagged service instead of a class with #[AsMessageHandler] attribute and define dependencies explicitly. The same __invoke and argument typehinting semantics apply.

services: my_module.my_message_handler: class: Drupal\my_module\Messenger\MyMessageHandler arguments: - '@my_module.myservice' tags: - { name: messenger.message_handler } Comparison with Legacy Drupal Queues

Typically, when setting up a Drupal queue, you’ll be putting together a rigid class with a verbose annotation. When compared to the functionality of the messenger and handler above, the equivalent @QueueWorker looks like:

namespace Drupal\my_module\Plugin\QueueWorker; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\Core\Queue\QueueWorkerBase; use Drupal\Core\State\StateInterface; use Symfony\Component\DependencyInjection\ContainerInterface; /** * @QueueWorker( * id = "my_module_queue", * title = @Translation("My Module Queue"), * cron = {"time" = 60} * ) */ final class MyModuleQueue extends QueueWorkerBase implements ContainerFactoryPluginInterface { private function __construct( array $configuration, $plugin_id, $plugin_definition, private StateInterface $state, ) { parent::__construct($configuration, $plugin_id, $plugin_definition); } public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition): static { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('state'), ); } public function processItem(mixed $data): void { // Do something with $data. $this->state->set('storage', $data['foo']); } }

And dispatch code

\Drupal::service('queue') ->get('my_module_queue') ->createItem(['foo' => 'bar']);

Notice the hard-to-remember annotation, boilerplate dependency injection, and mixed-type processItem argument $data . In comparison, Symfony Messenger messages and message handlers are easier to use thanks to PHP attributes.

Routing messages to transports

All messages will be handled synchronously by default. To route messages to specific transports, routing needs to be configured.

Behind the scenes, routing is a simple map of class/namespaces to transports defined in a container parameter.

parameters: sm.routing: Drupal\my_module\MyMessage: doctrine Drupal\my_module\MyMessage2: synchronous 'Drupal\my_module\*': doctrine '*': doctrine

Keys are either verbatim class names, partial class namespace followed by asterisk, or a standalone asterisk indicating the fallback. The values are the machine name of a transport. SM includes a synchronous transport out of the box, which indicates messages are handled in the same thread as it is dispatched. The doctrine database transport is available as a separate module. I’d recommend always using an asynchronous transport like Doctrine.

Routing configuration UI

SM includes a configuration UI submodule that allows site builders to build a routing map without needing to mess with YAML. The container parameter is set automatically as soon as the form is saved.

Advanced usage of messages and handlersAdding stamps to messages

A common use case for adding stamps to a message is to delay the message for an amount of time. A stamp is created and attached to the envelope containing the message to be processed:

$envelope = new Envelope( message: new MyMessage(foo: 'bar'), stamps: [\Symfony\Component\Messenger\Stamp\DelayStamp::delayUntil(new \DateTimeImmutable('tomorrow'))], ); $bus = \Drupal::service(\Symfony\Component\Messenger\MessageBusInterface::class); $bus->dispatch($envelope);Multiple handlers per message

For more advanced use cases, multiple handlers can be configured for a message. Useful if you want to listen for messages that you do not own. For example, additional handling of the Symfony Mailer email message:

namespace Drupal\my_module\Messenger; use Symfony\Component\Messenger\Attribute\AsMessageHandler; use Drupal\Core\State\StateInterface; #[AsMessageHandler] final class MyMessageHandler { public function __construct(StateInterface $state) {} public function __invoke(\Symfony\Component\Mailer\Messenger\SendEmailMessage $message): void { $this->state->set( 'sent_emails_counter', $this->state->get('sent_emails_counter', 0) + 1, ); } }

Both this custom handler and the original \Symfony\Component\Mailer\Messenger\MessageHandler::__invoke handler will be invoked.

Multiple messages per handler

Handlers can be configured to handle multiple message types. Instead of using the #[AsMessageHandler] attribute on the class, use it with methods.

namespace Drupal\my_module\Messenger; use Drupal\Core\State\StateInterface; use Symfony\Component\Messenger\Attribute\AsMessageHandler; final class MyMessageHandler { #[AsMessageHandler] public function myHandler1(\Drupal\my_module\MyMessage $message): void { // Do something with $message. } #[AsMessageHandler] public function myHandler2(\Drupal\my_module\MyMessage2 $message2): void { // Do something with $message2. } }

The next post covers the worker, the heart of messenger’s real-time capabilities.

Tagged Symfony, Symfony Messenger, QueueWorker
Categories: FLOSS Project Planets

Steinar H. Gunderson: IOS-XE HTTPS certificates from Let's Encrypt

Planet Debian - Tue, 2024-01-09 14:01

Newer Cisco wireless controllers run IOS-XE instead of AireOS, but they still don't speak ACME (which would let them integrate with Let's Encrypt); they support only SCEP, which I guess is basically Microsoft-and-Cisco only? Something like that.

But it is possible to get it to work nevertheless, and get proper and free certificates for the web administration interface. Unfortunately, I don't think you can use HTTP authentication (since you can't drop arbitrary files into webui:), but assuming you've got some sort of DNS authentication going, you can use that and then autodeploy the certificate using a script as follows:

#! /bin/bash HOST=$1 ENDPOINT=letsencrypt-$( date +%Y%m%d ) PASSWORD=$( pwgen -s 16 ) /usr/bin/certbot certonly --manual --preferred-challenges dns -d $HOST --authenticator manual --key-type rsa echo $PASSWORD | openssl pkcs12 -export -in /etc/letsencrypt/live/$HOST/fullchain.pem -inkey /etc/letsencrypt/live/$HOST/privkey.pem -out $ENDPOINT.p12 -passout stdin scp -O $ENDPOINT.p12 admin@$HOST:flash:$ENDPOINT.p12 ssh admin@$HOST <<EOF crypto pki import $ENDPOINT pkcs12 flash:$ENDPOINT.p12 password $PASSWORD conf t ip http secure-trustpoint $ENDPOINT exit wr EOF

Exercises for the reader:

  • Set up non-manual DNS for whatever setup (it's really weird that there's no included nsupdate support in Certbot, only various cloud offerings).
  • Make this into a deploy hook instead of a shell script that runs after certonly
  • Set up SSH certificates so that you can SSH into the host without passwords

You'll need to have SCP enabled (there's no obvious way of doing un-base64 from the command line?), which you can do with

ip scp enable aaa authentication login default local aaa authorization exec default local none

and probably some other magic stuff if you're using TACACS or similar.

Categories: FLOSS Project Planets

Thomas Koch: Chromium gkt-filechooser preview size

Planet Debian - Tue, 2024-01-09 12:59
Posted on January 9, 2024 Tags: debian, free software, life

I wanted to report this issue in chromiums issue tracker, but it gave me:

“Something went wrong, please try again later.”

Ok, then at least let me reply to this askubuntu question. But my attempt to signup with my launchpad account gave me:

“Launchpad Login Failed. Please try logging in again.”

I refrain from commenting on this to not violate some code of conduct.

So this is what I wanted to write:

GTK file chooser image preview size should be configurable

The file chooser that appears when uploading a file (e.g. an image to Google Fotos) learned to show a preview in issue 15500.

The preview image size is hard coded to 256x512 in kPreviewWidth and kPreviewHeight in ui/gtk/select_file_dialog_linux_gtk.cc.

Please make the size configurable.

On high DPI screens the images are too small to be of much use.

Yes, I should not use chromium anymore.

Categories: FLOSS Project Planets

The Drop Times: The Profound Impact of Mentorship and Guidance

Planet Drupal - Tue, 2024-01-09 12:04

Dear Readers,

Have you ever felt the transformative power of a teacher's or mentor's encouragement? Anatole France, the French poet and journalist, once encapsulated this influence by saying, 

"Nine-tenths of education is encouragement."

It's astonishing how teachers can nurture love or sow seeds of positivity, potentially steering an entire future. When a child moves beyond their family circle, teachers often step into a pivotal role. Their impact isn't confined to imparting knowledge; it extends to shaping perspectives, igniting passions, and defining life paths.

Just as many attribute their accomplishments to teachers who unearthed their hidden talents guiding their paths, the Drupal community thrives on mentors who play a pivotal role. Like educators, these mentors guide newcomers, share their expertise, and foster an environment conducive to growth within the Drupal ecosystem. They serve as pillars, offering invaluable guidance and insights enriching the community with their depth of knowledge and experience.

In this context, Michael Anello shines as a beacon within the Drupal realm. His trajectory, from teaching engineering to co-founding DrupalEasy—a hub for Drupal-centric training, career development, and consultancy—mirrors the impact of a guiding force.  The DropTimes had the opportunity to interview Michael Anello. He reflects on his journey, the evolution of Drupal, navigating challenges in the learning process and steering DrupalEasy through adaptations to accommodate various skill levels. In essence, his role echoes the influence of those pivotal teachers who shape destinies within the dynamic and ever-evolving landscape of the Drupal community.

In another enlightening interview, the multifaceted expertise of Lyubomir Filipov, a Group Architect and Deputy Program Manager at FFW, takes centre stage. His journey spans various roles—from organizer to academician to mentor—an embodiment of the diverse skills of an expert Drupal developer.

Lyubomir Filipov operates as a leader by example, orchestrating the convergence of talent with opportunity. He's instrumental in shaping career trajectories for over 800 professionals at FFW, ensuring that the right individuals find their niche within the company. 

Our adept sub-editor, Alka Elizabeth, skillfully conducted these insightful conversations, shedding light on the depth and breadth of Michael Anello's and Lyubomir Filipov's contributions within the Drupal sphere. Alka also delved into a Reddit discussion about the recent changes to not just Drupal alone but the economy, AI, and growth of other CMSs like WordPress, Wix, and Shopify. 

On a side note, I've compiled a thorough overview highlighting TDT's significant milestones of the past year.

Speaking of events, The DropTimes has been announced as the official Media Partner for Drupal Mountain Camp 2024, Switzerland. To learn more about the event, visit the official website. You can also follow our tag Drupal Mountain Camp to catch every update. 

February 06 is DrupalCon Portland's registration kickoff—don't miss out! Find all the essential details right here. Stay tuned for more updates and announcements as the event draws nearer. 

The highly anticipated return of the PHP Conference Kansai 2024—a momentous occasion for PHP engineers in Japan is back after a notable six-year hiatus. Do check out the details here

As MidCamp 2024 draws near, it invites organizations to unite and bolster the vibrant Drupal community together. 

FLDC 2024's countdown has commenced! Seize the early bird registration before January 12 and save $25 on your attendance fees. Don't wait—the deadline is approaching fast!  

Fan tickets for DrupalCamp Poland are available until November 1, 2024—grab yours before time runs out.  A list of the Drupal events for the week is published here.

Acquia's latest release, the e-book "Achieving Success with Headless and Hybrid CMSs," provides in-depth insights into the benefits of employing CMS in various architectures—traditional, headless, or hybrid. For more information, dive into this informative resource.

Some notable news highlights include WeebPal's celebration of its 12th anniversary, dubbed the Silk or Fine Linen Jubilee, featuring an enticing offer for website owners. They're offering 12 participants an opportunity to upgrade from Drupal 9 to Drupal 10 free of cost.  

Centarro is rejoicing in its most substantial release yet: Drupal Commerce 2.37. Learn more about it here.

A groundbreaking addition to Drupal's arsenal is the newly launched Error Reporting module, poised to transform code analysis and debugging for effortless operations. Dive deeper into its capabilities here.

While more stories beckon for exploration, constraints compel us to halt further selection. To get timely updates, follow us on LinkedIn, Twitter and Facebook.

Keep enjoying your Drupal journey! 
Thank you,

With warm wishes,
Elma John
Sub-Editor, TheDropTimes

Categories: FLOSS Project Planets

Tag1 Consulting: Unraveling the ETL Process - Transform

Planet Drupal - Tue, 2024-01-09 10:33

In the second episode of our three-part series on the ETL Migration process, we delve into the most involved stage of Drupal migration: Transformation. This episode features insights from Tag1 Consulting’s experts, including Mike Ryan, co-creator of Drupal Migrate, and notable contributor Benji Fisher. They analyze the Transformation phase in the ETL process, specifically examining Drupal’s unique “row-by-row” approach, and the discussion session revolves around the advantages and challenges of this method, with a strong emphasis on optimizing performance within the transformation pipeline. The episode is a treasure trove for those considering or currently working on Drupal migrations, as it steps into the technical realm while touching on the practical aspects of transforming data during a migration. Benji expresses his fascination with this particular stage, describing it as a playground for innovation and detailing the intricacies that make it the heart of the migration process. This discussion is essential for developers and IT professionals seeking to understand or undertake large-scale Drupal migrations. Part 1 | Part 2 | Part 3 - Coming soon! Please let us know if you have specific migration-related topics you'd like to see us cover. Or, reach out and let us know if we...

Read more janez Tue, 01/09/2024 - 07:33
Categories: FLOSS Project Planets

PyCharm: How to Connect Django With MongoDB

Planet Python - Tue, 2024-01-09 09:06
One of the most popular web frameworks, Django, has adopted the “batteries included” philosophy. This means that you can build a production-ready application using only the vanilla Django with no extensions or other frameworks. Even the database SQLite is available out of the box. SQLite is great for learning and developing small applications, but has […]
Categories: FLOSS Project Planets

Real Python: Python Basics Exercises: Functions and Loops

Planet Python - Tue, 2024-01-09 09:00

As you learned in Python Basics: Functions and Loops, functions serve as the fundamental building blocks in almost every Python program. They’re where the real action happens!

You now know that functions are crucial for breaking down code into smaller, manageable chunks. They enable you to define actions that your program can execute repeatedly throughout your code. Instead of duplicating the same code whenever your program needs to accomplish a particular task, you can simply call the function.

However, there are instances when you need to repeat certain code multiple times in a row. This is where loops become invaluable.

In this Python Basics Exercises video course, you’ll practice:

  • Creating user-defined functions
  • Implementing for loops
  • Getting user input
  • Rounding numbers

This video course is part of the Python Basics series, which accompanies Python Basics: A Practical Introduction to Python 3. You can also check out the other Python Basics courses.

Note that you’ll be using IDLE to interact with Python throughout this course.

[ 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

Android Java Bindings in Qt 6.7

Planet KDE - Tue, 2024-01-09 07:17

The Qt for Android plugin, introduced more than a decade ago, has been a game-changing change that opened a multitude of possibilities for developers looking to harness the power and flexibility of Qt for Android application development. Since then, many Android, Qt, and plugin changes have been made to support new features. However, neither the overall architecture nor the public Java bindings have changed much. These bindings contain wrappers for the Android Activity. It is about time we did that! 

Categories: FLOSS Project Planets

ADCI Solutions: Layout Builder: A Drupal module that makes working with content easy

Planet Drupal - Tue, 2024-01-09 05:59

The advantages of Drupal CMS always include its friendliness to users who cannot write code. In most cases, these users are content managers. How can you give more power to the content manager of your Drupal website? Add the Layout Builder module that makes building web pages as easy as putting Lego bricks together.

Categories: FLOSS Project Planets

Python Bytes: #366 Put It In The Backlog

Planet Python - Tue, 2024-01-09 03:00
<strong>Topics covered in this episode:</strong><br> <ul> <li><a href="https://tonybaloney.github.io/posts/python-gets-a-jit.html"><strong>Python 3.13 gets a JIT</strong></a></li> <li><a href="https://fosstodon.org/@basnijholt/111605262871991435">UniDep - Unified Conda and Pip Dependency Management</a></li> <li><a href="https://hynek.me/articles/pull-requests-branch/"><strong>Don’t Start Pull Requests from Your Main Branch</strong></a></li> <li><a href="https://github.com/pomponchik/instld"><strong>instld: The simplest package management</strong></a></li> <li><strong>Extras</strong></li> <li><strong>Joke</strong></li> </ul><a href='https://www.youtube.com/watch?v=PRaTs3PnJvI' style='font-weight: bold;'>Watch on YouTube</a><br> <p><strong>About the show</strong></p> <p>Sponsored by us! Support our work through:</p> <ul> <li>Our <a href="https://training.talkpython.fm/"><strong>courses at Talk Python Training</strong></a></li> <li><a href="https://courses.pythontest.com/p/the-complete-pytest-course"><strong>The Complete pytest Course</strong></a></li> <li><a href="https://www.patreon.com/pythonbytes"><strong>Patreon Supporters</strong></a></li> </ul> <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://tonybaloney.github.io/posts/python-gets-a-jit.html"><strong>Python 3.13 gets a JIT</strong></a></p> <ul> <li>Anthony Shaw</li> <li>Great article that walks through JIT concepts with a small example as if you were writing a parser in Python instead of C.</li> <li>Covers <ul> <li>What is a JIT?</li> <li>What is a copy-and-patch JIT? and Why?</li> <li>How does the Python JIT work?</li> <li>Is it faster?</li> <li>This is a building block to future improvements</li> </ul></li> </ul> <p><strong>Michael #2:</strong> <a href="https://fosstodon.org/@basnijholt/111605262871991435">UniDep - Unified Conda and Pip Dependency Management</a></p> <ul> <li>🔄 Single requirements.yaml for both #Conda &amp; #Pip.</li> <li>⚙️ Works with pyproject.toml &amp; setup.py.</li> <li>🏢 Perfect for monorepos.</li> <li>🔒 Create consistent conda-lock files for multiple projects.</li> <li>🌍 Platform-specific support.</li> <li>🚀 <code>unidep install</code> for easy setup.</li> <li><a href="https://github.com/basnijholt/unidep">Full source page</a>.</li> </ul> <p><strong>Brian #3:</strong> <a href="https://hynek.me/articles/pull-requests-branch/"><strong>Don’t Start Pull Requests from Your Main Branch</strong></a></p> <ul> <li>Hynek Schlawack</li> <li>When contributing to other users’ repositories, always start a new branch in your fork.</li> <li>Reasons to not use main <ul> <li>Forces you to only have one change in progress</li> <li>Merges will generate conflicts and you can’t pull from that branch anymore. Need to kill the fork and start over</li> <li>If the target repo has branch protection on, then maintainers can’t push to your branch.</li> </ul></li> <li>Hynek also provides a way to fix things if you’ve already started your changes on a main branch fork.</li> </ul> <p><strong>Michael #4:</strong> <a href="https://github.com/pomponchik/instld"><strong>instld: The simplest package management</strong></a></p> <ul> <li>Thanks to this package, it is very easy to manage the lifecycle of packages.</li> <li>⚡ Run your code without installing libraries.</li> <li>⚡ You can use 2 different versions of the same library in the same program.</li> <li>⚡ You can use incompatible libraries in the same project, as well as libraries with incompatible/conflicting dependencies.</li> <li>⚡ It's easy to share written scripts. The script file becomes self-sufficient - the user does not need to install the necessary libraries.</li> <li>⚡ The library does not leave behind "garbage". After the end of the program, no additional files remain in the system.</li> </ul> <p><strong>Extras</strong> </p> <p>Brian: </p> <ul> <li><a href="https://courses.pythontest.com/p/complete-pytest-course">The Complete pytest Course</a> is now actually complete <ul> <li>Although updates will happen when and if necessary as pytest/Python changes.</li> <li>To celebrate, <strong><em>use code 2024 in January for 10% off</em></strong> any pricing option.</li> </ul></li> <li>More episodes of <a href="https://pythonpeople.fm">Python People</a> and <a href="https://podcast.pythontest.com">Python Test</a> on the way now <ul> <li>That course took up a lot of my time in late 2023</li> <li>Just released an <a href="https://pythonpeople.fm/episodes/will-vincent-django-writing-technical-books">episode with Will Vincent</a> and Python Test will have a new episode this week and for the foreseeable future.</li> <li>Let me know if you want to be on Python People or Python Test</li> </ul></li> </ul> <p>Michael:</p> <ul> <li><em>Hatch follow up: Great coverage of Hatch v1.8.0! One small correction: only the binaries for Hatch are signed with the certificate from the PSF.</em> - <strong>Ofek</strong></li> <li><a href="https://status.python.org/incidents/0mld3fml68nd">PyPI new user registration temporarily suspended</a></li> <li>Pagefind and <a href="https://fosstodon.org/@mkennedy/111637520985150159">how I’m using it</a></li> <li><a href="https://www.youtube.com/watch?v=KeegA_uzzSo">Talk Python Live: Data Doodles event</a> coming early Feb</li> <li>New essay: <a href="https://mkennedy.codes/posts/ai-features-a-waste-of-time/">AI Features a Waste of Time?</a></li> </ul> <p><strong>Joke:</strong> <a href="https://workchronicles.com/put-it-in-the-backlog/">Put it in the backlog</a></p>
Categories: FLOSS Project Planets

Pages