Feeds
Ned Batchelder: Echos of the People API user guide
PyCon 2024 just happened, and as always it was a whirlwind of re-connecting with old friends, meeting new friends, talking about anything and everything, juggling, and getting simultaneously energized and exhausted. I won’t write about everything that happened, but one thread sticks with me: the continuing echos of my talk from last year.
If you haven’t seen it yet, I spoke at PyCon 2023 about the ways engineers can use their engineering skills to interact better with people, something engineers stereotypically need help with. I called it People: The API User’s Guide.
A number of people mentioned the talk to me this year, which was very gratifying. It’s good to hear that it stuck with people. A few said they had passed it on to others, which is a real sign that it landed well with them.
On the other hand, at lunch one day, someone asked me if I had done a talk last year, and I sheepishly answered, “um, yeah, I did the opening keynote...” It’s hard to answer that question without it becoming a humble brag!
The most unexpected echo of the talk was at the coverage.py sprint table. Ludovico Bianchi was working away when he turned to me and said, “oh, I forgot to send you this last year!” He showed me this picture he drew during the talk a year ago:
I’ve only ever stayed for one day of sprints. It can be hard to get people started on meaty issues in that short time. We have a good time anyway, and merge a few pull requests. This year, three people came back who sprinted with me in 2023, another sign that something is going right.
Once the sprint was over, Ludovico also sketched Sleepy into the group photo of the sprint gang:
Half the fun of preparing last year’s talk was art-directing the illustrations by my son Ben, similar to how we had worked to make Sleepy Snake. As much as I like hearing that people like my words, as a dad it’s just as good to hear that people like Ben’s art. Seeing other people play with Sleepy in clever ways is extra fun.
FSF Events: Free Software Directory meeting on IRC: Friday, May 24, starting at 12:00 EDT (16:00 UTC)
Release GCompris 4.1
Today we are releasing GCompris version 4.1.
It contains bug fixes and graphics improvements on multiple activities.
It is fully translated in the following languages:
- Arabic
- Bulgarian
- Breton
- Catalan
- Catalan (Valencian)
- Greek
- Spanish
- Basque
- French
- Galician
- Croatian
- Hungarian
- Italian
- Lithuanian
- Malayalam
- Dutch
- Norwegian Nynorsk
- Polish
- Brazilian Portuguese
- Romanian
- Russian
- Slovenian
- Swedish
- Turkish
- Ukrainian
It is also partially translated in the following languages:
- Azerbaijani (97%)
- Belarusian (86%)
- Czech (95%)
- German (95%)
- UK English (95%)
- Esperanto (99%)
- Estonian (95%)
- Finnish (94%)
- Hebrew (95%)
- Indonesian (99%)
- Macedonian (90%)
- Portuguese (95%)
- Slovak (83%)
- Albanian (99%)
- Swahili (99%)
- Chinese Traditional (95%)
You can find packages of this new version for GNU/Linux, Windows, Android, Raspberry Pi and macOS on the download page. This update will also be available soon in the Android Play store, the F-Droid repository and the Windows store.
Thank you all,
Timothée & Johnny
parallel @ Savannah: GNU Parallel 20240522 ('Tbilisi') released
GNU Parallel 20240522 ('Tbilisi') has been released. It is available for download at: lbry://@GnuParallel:4
Quote of the month:
GNU Parallel é mais um daqueles "como eu vivia sem isso?!"
-- Ivan Augusto @ivanaugustobd@twitter
New in this release:
- --onall now supports sshpass - user:pass@host.
- --memfree kills do not count as --retries.
- Bug fixes and man page updates.
GNU Parallel - For people who live life in the parallel lane.
If you like GNU Parallel record a video testimonial: Say who you are, what you use GNU Parallel for, how it helps you, and what you like most about it. Include a command that uses GNU Parallel if you feel like it.
GNU Parallel is a shell tool for executing jobs in parallel using one or more computers. A job can be a single command or a small script that has to be run for each of the lines in the input. The typical input is a list of files, a list of hosts, a list of users, a list of URLs, or a list of tables. A job can also be a command that reads from a pipe. GNU Parallel can then split the input and pipe it into commands in parallel.
If you use xargs and tee today you will find GNU Parallel very easy to use as GNU Parallel is written to have the same options as xargs. If you write loops in shell, you will find GNU Parallel may be able to replace most of the loops and make them run faster by running several jobs in parallel. GNU Parallel can even replace nested loops.
GNU Parallel makes sure output from the commands is the same output as you would get had you run the commands sequentially. This makes it possible to use output from GNU Parallel as input for other programs.
For example you can run this to convert all jpeg files into png and gif files and have a progress bar:
parallel --bar convert {1} {1.}.{2} ::: *.jpg ::: png gif
Or you can generate big, medium, and small thumbnails of all jpeg files in sub dirs:
find . -name '*.jpg' |
parallel convert -geometry {2} {1} {1//}/thumb{2}_{1/} :::: - ::: 50 100 200
You can find more about GNU Parallel at: http://www.gnu.org/s/parallel/
You can install GNU Parallel in just 10 seconds with:
$ (wget -O - pi.dk/3 || lynx -source pi.dk/3 || curl pi.dk/3/ || \
fetch -o - http://pi.dk/3 ) > install.sh
$ sha1sum install.sh | grep 883c667e01eed62f975ad28b6d50e22a
12345678 883c667e 01eed62f 975ad28b 6d50e22a
$ md5sum install.sh | grep cc21b4c943fd03e93ae1ae49e28573c0
cc21b4c9 43fd03e9 3ae1ae49 e28573c0
$ sha512sum install.sh | grep ec113b49a54e705f86d51e784ebced224fdff3f52
79945d9d 250b42a4 2067bb00 99da012e c113b49a 54e705f8 6d51e784 ebced224
fdff3f52 ca588d64 e75f6033 61bd543f d631f592 2f87ceb2 ab034149 6df84a35
$ bash install.sh
Watch the intro video on http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1
Walk through the tutorial (man parallel_tutorial). Your command line will love you for it.
When using programs that use GNU Parallel to process data for publication please cite:
O. Tange (2018): GNU Parallel 2018, March 2018, https://doi.org/10.5281/zenodo.1146014.
If you like GNU Parallel:
- Give a demo at your local user group/team/colleagues
- Post the intro videos on Reddit/Diaspora*/forums/blogs/ Identi.ca/Google+/Twitter/Facebook/Linkedin/mailing lists
- Get the merchandise https://gnuparallel.threadless.com/designs/gnu-parallel
- Request or write a review for your favourite blog or magazine
- Request or build a package for your favourite distribution (if it is not already there)
- Invite me for your next conference
If you use programs that use GNU Parallel for research:
- Please cite GNU Parallel in you publications (use --citation)
If GNU Parallel saves you money:
- (Have your company) donate to FSF https://my.fsf.org/donate/
GNU sql aims to give a simple, unified interface for accessing databases through all the different databases' command line clients. So far the focus has been on giving a common way to specify login information (protocol, username, password, hostname, and port number), size (database and table size), and running queries.
The database is addressed using a DBURL. If commands are left out you will get that database's interactive shell.
When using GNU SQL for a publication please cite:
O. Tange (2011): GNU SQL - A Command Line Tool for Accessing Different Databases Using DBURLs, ;login: The USENIX Magazine, April 2011:29-32.
GNU niceload slows down a program when the computer load average (or other system activity) is above a certain limit. When the limit is reached the program will be suspended for some time. If the limit is a soft limit the program will be allowed to run for short amounts of time before being suspended again. If the limit is a hard limit the program will only be allowed to run when the system is below the limit.
Evgeni Golov: Upgrading CentOS Stream 8 to CentOS Stream 9 using Leapp
Warning to the Planet Debian readers: the following post might shock you, if you're used to Debian's smooth upgrades using only the package manager.
Leapp?!Contrary to distributions like Debian and Fedora, RHEL can't be upgraded using the package manager alone.
Instead there is a tool called Leapp that takes care of orchestrating the update and also includes a set of checks whether a system can be upgraded at all. Have a look at the RHEL documentation about upgrading if you want more details on the process itself.
You might have noticed that the title of this post says "CentOS Stream" but here I am talking about RHEL. This is mostly because Leapp was originally written with RHEL in mind.
Upgrading CentOS 7 to EL8When people started pondering upgrading their CentOS 7 installations, AlmaLinux started the ELevate project to allow upgrading CentOS 7 to CentOS Stream 8 but also to AlmaLinux 8, Rocky 8 or Oracle Linux 8.
ELevate was essentially Leapp with patches to allow working on CentOS, which has different package signature keys, different OS release versioning, etc.
Sadly these patches were never merged back into Leapp.
Making Leapp work with CentOS Stream 8 (and other distributions)At some point I noticed that things weren't moving and EL8 to EL9 upgrades were coming closer (and I had my own systems that I wanted to be able to upgrade in place).
Annoyed-Evgeni-Development is best development? Not sure, but it produced a set of patches that allowed some movement:
- make RedHatSignedRpmScanner distribution agnostic allowed Leapp to load GPG keys for alternative distributions, thus correctly identifying their packages
- call correct mkdir when trying to create /etc/rhsm/facts made Leapp not crash on systems without /etc/rhsm, like those not subscribed to Red Hat
- default to NO_RHSM mode when subscription-manager is not found made Leapp work better out of the box on systems without subscriptions
- load all substitutions from etc made Leapp work properly on distributions that ship additional repository URL substitutions
- be less strict when figuring out major version in initrd made Leapp work with CentOS Stream initrds that have non X.Y versions
However, this is not yet the end of the story. At least convert dot-less CentOS versions to X.999 is open, and another followup would be needed if we go that route. But I don't expect this to be merged soon, as the patch is technically wrong - yet it makes things mostly work.
The big problem here is that CentOS Stream doesn't have X.Y versioning, just X as it's a constant stream with no point releases. Leapp however relies on X.Y versioning to know which package changes it needs to perform. Pretending CentOS Stream 8 is "RHEL" 8.999 works if you assume that Stream is always ahead of RHEL.
This is however a CentOS only problem. I still need to properly test that, but I'd expect things to work fine with upstream Leapp on AlmaLinux/Rocky if you feed it the right signature and repository data.
Actually upgrading CentOS Stream 8 to CentOS Stream 9 using LeappLike I've already teased in my HPE rant, I've actually used that code to upgrade virt01.conova.theforeman.org to CentOS Stream 9. I've also used it to upgrade a server at home that's responsible for running important containers like Home Assistant and UniFi. So it's absolutely battle tested and production grade! It's also hungry for kittens.
As mentioned above, you can't just use upstream Leapp, but I have a Copr: evgeni/leapp.
# dnf copr enable evgeni/leapp # dnf install leapp leapp-upgrade-el8toel9Apart from the software, we'll also need to tell it which repositories to use for the upgrade.
# vim /etc/leapp/files/leapp_upgrade_repositories.repo [c9-baseos] name=CentOS Stream $releasever - BaseOS metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=$basearch&protocol=https,http gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1 [c9-appstream] name=CentOS Stream $releasever - AppStream metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-9-stream&arch=$basearch&protocol=https,http gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1Depending on the setup and installed packages, more repositories might be needed. Just make sure that the $stream substitution is not used as Leapp doesn't override that and you'd end up with CentOS Stream 8 repos again.
Once all that is in place, we can call leapp preupgrade and let it analyze the system.
Ideally, the output will look like this:
# leapp preupgrade … ============================================================ REPORT OVERVIEW ============================================================ Reports summary: Errors: 0 Inhibitors: 0 HIGH severity reports: 0 MEDIUM severity reports: 0 LOW severity reports: 3 INFO severity reports: 3 Before continuing consult the full report: A report has been generated at /var/log/leapp/leapp-report.json A report has been generated at /var/log/leapp/leapp-report.txt ============================================================ END OF REPORT OVERVIEW ============================================================But trust me, it won't ;-)
As mentioned above, Leapp analyzes the system before the upgrade. Some checks can completely inhibit the upgrade, while others will just be logged as "you better should have a look".
Firewalld Configuration AllowZoneDrifting Is UnsupportedEL7 and EL8 shipped with AllowZoneDrifting=yes, but since EL9 this is not supported anymore. As this can potentially break the networking of the system, the upgrade gets inhibited.
Newest installed kernel not in useAdmit it, you also don't reboot into every new kernel available! Well, Leapp won't let that pass and inhibits the upgrade.
Cannot perform the VDO check of block devicesIn EL8 there are two ways to manage VDO: using the dedicated vdo tool and via LVM. If your system uses LVM (it should!) but not VDO, you probably don't have the vdo package installed. But then Leapp can't check if your LVM devices really aren't VDO without the vdo tooling and will inhibit the upgrade. So you gotta install vdo for it to find out that you don't use VDO…
LUKS encrypted partition detectedYeah. Sorry. Using LUKS? Straight into the inhibit corner!
But hey, if you don't use LUKS for / you can probably get away by deleting the inhibitwhenluks actor. That worked for me, but remember the kittens!
Really upgrading CentOS Stream 8 to CentOS Stream 9 using LeappThe headings are getting silly, huh?
Anyway, once leapp preupgrade is happy and doesn't throw any inhibitors anymore, the actual (real?) upgrade can be done by calling leapp upgrade.
This will download all necessary packages and create an intermediate initramfs that contains all the things needed for the upgrade and ask you to reboot.
Once booted, the upgrade itself takes somewhere between 5 and 10 minutes. Then another minute or 5 to relabel your disks with the new SELinux policy.
And three reboots (into the upgrade initramfs, into SELinux relabel, into real OS) of a ProLiant DL325 - 5 minutes each? 😿
And then for good measure another one, to flip SELinux from permissive to enforcing.
Are we done yet? Nope.
There are a few post-upgrade tasks you get to do yourself. Yes, the switching of SELinux back to enforcing is one of them. Please don't forget it.
Using the system after the upgradeA customer once said "We're not running those systems for the sake of running systems, but for the sake of running some application ontop of them". This is very true.
libvirt doesn't support Spice/QXLIn EL9, support for Spice/QXL was dropped, so if you try to boot a VM using it, libvirt will nicely error out with
Error starting domain: unsupported configuration: domain configuration does not support video model 'qxl'Interestingly, because multiple parts of the VM are invalid, you can't edit it in virt-manager (at least the one in Fedora 39) as removing/fixing one part requires applying the new configuration which is still invalid.
So virsh edit <vm> it is!
Look for entries like
<channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> <graphics type='spice' autoport='yes'> <listen type='address'/> </graphics> <audio id='1' type='spice'/> <video> <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> <redirdev bus='usb' type='spicevmc'> <address type='usb' bus='0' port='2'/> </redirdev> <redirdev bus='usb' type='spicevmc'> <address type='usb' bus='0' port='3'/> </redirdev>and either just delete the or (better) replace them with VNC/cirrus
<graphics type='vnc' port='-1' autoport='yes'> <listen type='address'/> </graphics> <audio id='1' type='none'/> <video> <model type='cirrus' vram='16384' heads='1' primary='yes'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> Podman needs re-login to private registriesOne of the machines I've updated runs Podman and pulls containers from GitHub which are marked as private. To do so, I have a personal access token that I've used to login to ghcr.io. After the CentOS Stream 9 upgrade (which included an upgrade to Podman 5), pulls stopped working with authentication/permission errors. No idea what exactly happened, but a simple podman login fixed this issue quickly.
$ echo ghp_token | podman login ghcr.io -u <user> --password-stdin shim has an el8 tagOne of the documented post-upgrade tasks is to verify that no EL8 packages are installed, and to remove those if there are any.
However, when you do this, you'll notice that the shim-x64 package has an EL8 version: shim-x64-15-15.el8_2.x86_64.
That's because the same build is used in both CentOS Stream 8 and CentOS Stream 9. Confusing, but should really not be uninstalled if you want the machine to boot ;-)
Are we done yet?Yes! That's it. Enjoy your CentOS Stream 9!
Glyph Lefkowitz: A Grand Unified Theory of the AI Hype Cycle
The history of AI goes in cycles, each of which looks at least a little bit like this:
- Scientists do some basic research and develop a promising novel mechanism, N. One important detail is that N has a specific name; it may or may not be carried out under the general umbrella of “AI research” but it is not itself “AI”. N always has a few properties, but the most common and salient one is that it initially tends to require about 3x the specifications of the average computer available to the market at the time; i.e., it requires three times as much RAM, CPU, and secondary storage as is shipped in the average computer.
- Research and development efforts begin to get funded on the hypothetical potential of N. Because N is so resource intensive, this funding is used to purchase more computing capacity (RAM, CPU, storage) for the researchers, which leads to immediate results, as the technology was previously resource constrained.
- Initial successes in the refinement of N hint at truly revolutionary possibilities for its deployment. These revolutionary possibilities include a dimension of cognition that has not previously been machine-automated.
- Leaders in the field of this new development — specifically leaders, like lab administrators, corporate executives, and so on, as opposed to practitioners like engineers and scientists — recognize the sales potential of referring to this newly-“thinking” machine as “Artificial Intelligence”, often speculating about science-fictional levels of societal upheaval (specifically in a period of 5-20 years), now that the “hard problem” of machine cognition has been solved by N.
- Other technology leaders, in related fields, also recognize the sales potential and begin adopting elements of the novel mechanism to combine with their own areas of interest, also referring to their projects as “AI” in order to access the pool of cash that has become available to that label. In the course of doing so, they incorporate N in increasingly unreasonable ways.
- The scope of “AI” balloons to include pretty much all of computing technology. Some things that do not even include N start getting labeled this way.
- There’s a massive economic boom within the field of “AI”, where “the field of AI” means any software development that is plausibly adjacent to N in any pitch deck or grant proposal.
- Roughly 3 years pass, while those who control the flow of money gradually become skeptical of the overblown claims that recede into the indeterminate future, where N precipitates a robot apocalypse somewhere between 5 and 20 years away. Crucially, because of the aforementioned resource-intensiveness, the gold owners skepticism grows slowly over this period, because their own personal computers or the ones they have access to do not have the requisite resources to actually run the technology in question and it is challenging for them to observe its performance directly. Public critics begin to appear.
- Competent practitioners — not leaders — who have been successfully using N in research or industry quietly stop calling their tools “AI”, or at least stop emphasizing the “artificial intelligence” aspect of them, and start getting funding under other auspices. Whatever N does that isn’t “thinking” starts getting applied more seriously as its limitations are better understood. Users begin using more specific terms to describe the things they want, rather than calling everything “AI”.
- Thanks to the relentless march of Moore’s law, the specs of the average computer improve. The CPU, RAM, and disk resources required to actually run the software locally come down in price, and everyone upgrades to a new computer that can actually run the new stuff.
- The investors and grant funders update their personal computers, and they start personally running the software they’ve been investing in. Products with long development cycles are finally released to customers as well, but they are disappointing. The investors quietly get mad. They’re not going to publicly trash their own investments, but they stop loudly boosting them and they stop writing checks. They pivot to biotech for a while.
- The field of “AI” becomes increasingly desperate, as it becomes the label applied to uses of N which are not productive, since the productive uses are marketed under their application rather than their mechanism. Funders lose their patience, the polarity of the “AI” money magnet rapidly reverses. Here, the AI winter is finally upon us.
- The remaining AI researchers who still have funding via mechanisms less vulnerable to hype, who are genuinely thinking about automating aspects of cognition rather than simply N, quietly move on to the next impediment to a truly thinking machine, and in the course of doing so, they discover a new novel mechanism, M. Go to step 1, with M as the new N, and our current N as a thing that is now “not AI”, called by its own, more precise name.
A non-exhaustive list of previous values of N have been:
- Neural networks and symbolic reasoning in the 1950s.
- Theorem provers in the 1960s.
- Expert systems in the 1980s.
- Fuzzy logic and hidden Markov models in the 1990s.
- Deep learning in the 2010s.
Each of these cycles has been larger and lasted longer than the last, and I want to be clear: each cycle has produced genuinely useful technology. It’s just that each follows the progress of a sigmoid curve that everyone mistakes for an exponential one. There is an initial burst of rapid improvement, followed by gradual improvement, followed by a plateau. Initial promises imply or even state outright “if we pour more {compute, RAM, training data, money} into this, we’ll get improvements forever!” The reality is always that these strategies inevitably have a limit, usually one that does not take too long to find.
Where Are We Now?So where are we in the current hype cycle?
- Here’s a Computerphile video which explains some recent research into LLM performance. I’d highly encourage you to have a look at the paper itself, particularly Figure 2, “Log-linear relationships between concept frequency and CLIP zero-shot performance”.
- Here’s a series of posts by Simon Willison explaining the trajectory of the practicality of actually-useful LLMs on personal devices. He hasn’t written much about it recently because it is now fairly pedestrian for an AI-using software developer to have a bunch of local models, and although we haven’t quite broken through the price floor of the gear-acquisition-syndrome prosumer market in terms of the requirements of doing so, we are getting close.
- The Rabbit R1 and Humane AI Pin were both released; were they disappointments to their customers and investors? I think we all know how that went at this point.
- I hear Karius just raised a series C, and they’re an “emerging unicorn”.
- It does appear that we are all still resolutely calling these things “AI” for now, though, much as I wish, as a semasiology enthusiast, that we would be more precise.
History does not repeat itself, but it does rhyme. This hype cycle is unlike any that have come before in various ways. There is more money involved now. It’s much more commercial; I had to phrase things above in very general ways because many previous hype waves have been based on research funding, some really being exclusively a phenomenon at one department in DARPA, and not, like, the entire economy.
I cannot tell you when the current mania will end and this bubble will burst. If I could, you’d be reading this in my $100,000 per month subscribers-only trading strategy newsletter and not a public blog. What I can tell you is that computers cannot think, and that the problems of the current instantation of the nebulously defined field of “AI” will not all be solved within “5 to 20 years”.
AcknowledgmentsThank you to my patrons who are supporting my writing on this blog. Special thanks also to Ben Chatterton for a brief pre-publication review; any errors remain my own. If you like what you’ve read here and you’d like to read more of it, or you’d like to support my various open-source endeavors, you can support my work as a sponsor! I am also available for consulting work if you think your organization could benefit from expertise on topics like “what are we doing that history will condemn us for”. Or, you know, Python programming.
Lullabot: Drupal Release Planning in the Enterprise
Yesterday, your CTO mandated that all new CMS builds would be on Drupal and that all existing CMS platforms would be consolidated to Drupal within the next three years. Great! Time to start prioritizing sites, hiring teams, and planning development and launch schedules.
Real Python: The Python calendar Module: Create Calendars With Python
The Python calendar module provides several ways to generate calendars for Python programs. It also includes a variety of functions for working with calendar data as strings, numbers, and datetime objects.
In this tutorial, you’ll learn how to use the calendar module to create and customize calendars with Python.
By the end of this tutorial, you’ll be able to:
- Display calendars in your terminal with Python
- Create plain text and HTML calendars
- Format calendars for specific locales and display conventions
- Use calendar-related functions and methods to access lower-level calendar data in a variety of formats
Get Your Code: Click here to download the free sample code you’ll use to learn about creating calendars with the calendar module in Python.
Take the Quiz: Test your knowledge with our interactive “The Python calendar Module” quiz. You’ll receive a score upon completion to help you track your learning progress:
Interactive Quiz
The Python calendar ModuleIn this quiz, you'll test your understanding of the calendar module in Python. It'll evaluate your proficiency in manipulating, customizing, and displaying calendars directly within your terminal. By working through this quiz, you'll revisit the fundamental functions and methods provided by the calendar module.
Displaying Calendars in Your TerminalUnix and Unix-like operating systems such as macOS and Linux include a cal command-line utility for displaying calendars in an interactive console:
Shell $ cal May 2024 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Copied!Python provides a similar tool, which allows you to run the calendar module as a command-line script. To begin exploring the Python calendar module, open up your terminal program and enter the following command:
Shell $ python -m calendar 2024 January February March Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 1 2 3 4 1 2 3 8 9 10 11 12 13 14 5 6 7 8 9 10 11 4 5 6 7 8 9 10 15 16 17 18 19 20 21 12 13 14 15 16 17 18 11 12 13 14 15 16 17 22 23 24 25 26 27 28 19 20 21 22 23 24 25 18 19 20 21 22 23 24 29 30 31 26 27 28 29 25 26 27 28 29 30 31 April May June Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 1 2 3 4 5 1 2 8 9 10 11 12 13 14 6 7 8 9 10 11 12 3 4 5 6 7 8 9 15 16 17 18 19 20 21 13 14 15 16 17 18 19 10 11 12 13 14 15 16 22 23 24 25 26 27 28 20 21 22 23 24 25 26 17 18 19 20 21 22 23 29 30 27 28 29 30 31 24 25 26 27 28 29 30 July August September Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 1 2 3 4 1 8 9 10 11 12 13 14 5 6 7 8 9 10 11 2 3 4 5 6 7 8 15 16 17 18 19 20 21 12 13 14 15 16 17 18 9 10 11 12 13 14 15 22 23 24 25 26 27 28 19 20 21 22 23 24 25 16 17 18 19 20 21 22 29 30 31 26 27 28 29 30 31 23 24 25 26 27 28 29 30 October November December Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 1 2 3 1 7 8 9 10 11 12 13 4 5 6 7 8 9 10 2 3 4 5 6 7 8 14 15 16 17 18 19 20 11 12 13 14 15 16 17 9 10 11 12 13 14 15 21 22 23 24 25 26 27 18 19 20 21 22 23 24 16 17 18 19 20 21 22 28 29 30 31 25 26 27 28 29 30 23 24 25 26 27 28 29 30 31 Copied!Running python -m calendar with no arguments outputs a full year’s calendar for the current year. To display the full calendar for a different year, pass in the integer representation of a year as the first argument of the calendar command:
Shell $ python -m calendar 1989 Copied!To view a single month, pass in both a year and a month as the second parameter:
Shell $ python -m calendar 2054 07 July 2054 Mo Tu We Th Fr Sa Su 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Copied!As you can see in these examples, the calendar module can display calendars for both past and future dates. According to the official documentation, the calendar module uses the current Gregorian calendar, extended indefinitely in both directions. It also uses the ISO 8601 standard, which is an international standard for exchanging and communicating date and time-related data.
Now that you know how to display calendars in your terminal with Python, you can move on and explore other approaches to creating calendars as plain text or HTML markup representations.
Creating Text-Based CalendarsTo generate plain text calendars, the calendar module provides calendar.TextCalendar with methods to format and print monthly and yearly calendars.
TextCalendar.formatyear() accepts a single parameter for the year, like the calendar command-line script. Try it out in your Python REPL by executing the following code:
Python >>> import calendar >>> text_calendar = calendar.TextCalendar() >>> text_calendar.formatyear(2024) ' 2024\n\n January (...)' Copied! Read the full article at https://realpython.com/python-calendar-module/ »[ 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 ]
Drupal Association blog: DrupalCon Portland 2024 - Recapping Drupal’s most significant North American event!
Written by DrupalCon Portland Marketing Committee members Iwantha Lekamge, Luke McCormick, and Christina Lockhart.
DrupalCon Portland 2024 has come to an end, and what an exciting event it was. The City of Roses welcomed back Drupalists from around the world with open arms as we gathered at the Oregon Convention Center once more. It’s always great to get together with the rest of the Drupal community in person, and this particular DrupalCon was full of exciting news, from announcing a new version of Drupal to updated branding for the Drupal project. Four days full of networking and learning with the community through over 70+ sessions went by so quickly!
Attendees gather at DrupalCon Portland 2024 for the group photo
Whether you could not attend the conference or want a reminder of how awesome it was, we’ve broken down each day of the event in our DrupalCon Portland 2024 recap. Read on to learn more about how each day went!
Day OneDay One of DrupalCon Portland kicked off with a morning of sessions, including Key to Collaboration—How to Build Psychological Safety with Individuals and Teams. This session, led by Britany Acre and Cori Neslund, was an impactful examination of the value of psychological safety. It explained how having it (or not) can affect teams, some best practices to build it within teams, and reviewed tools that can help teams based on their current state.
Another session highlight on Monday morning included Accessibility Audits -The many shapes and sizes, what’s the right fit for you with Kathy Beck and Julie Elman. During this session, the two speakers discussed why accessibility matters, the components of an audit, and steps that teams can take to ensure their work is accessible.
Next up came the Welcoming Remarks prior to the Driesnote, where we witnessed Michael Anello win the Aaron Winborn award - congratulations on a well-deserved win, Michael! The excitement in the air continued when we found out where the next few DrupalCons will be held: Barcelona, Singapore, and Atlanta! Three vibrant, exciting cities that will be a perfect fit for the Drupal community. We can’t wait to attend!
This year’s Driesnote, one of the most anticipated parts of DrupalCon, introduced a new version of Drupal – Drupal Starshot. Speaker and Drupal founder Dries Buytaert explained how Drupal Starshot will bring a new wave of users to the Drupal Community. Drupal Starshot, which aims to build the new default download of Drupal, will be a package built on Drupal core. It will include refined common features from the contributed project ecosystem to create a great user experience out of the box. You can learn more about Drupal Starshot and make your Drupal Starshot Pledge!
Driesnote
Photo of the attendees at the Welcoming Reception
At the end of the day, the Expo Hall Welcome Party celebrated the start of an exciting week. Along with a food truck and libations, the crowd enjoyed a robot DJ, giant Lite Brite, and a 360–degree photo booth. See all of the images from the booth on the DrupalCon Portland Flick.r group!
Day TwoDay Two of the conference held the highly relevant keynote, Open Source AI Now: Why Open Must Win the AI War, with Alex Salkever. During his keynote, Alex walked the audience through the significant changes that AI will bring to every industry.
Day 2 Keynote by Alex Salkever
Other highlights from Tuesday included Gábor Hojtsy’s deep dive into what to expect from Drupal 11, the Women in Drupal Luncheon, and many other informative sessions – some of which you can watch now on the DrupalCon Portland 2024 YouTube playlist. The Women in Drupal Luncheon, in particular, celebrated the women of Drupal, with four panelists from Four Kitchens discussing being either the only woman in a particular role or one of the few.
Day Two continued with a few Drupal Association sessions, including the Drupal Association Public Board Meeting and Innovation and Contributions Challenges with Alex Moreno and Irina Zaks. Alex and Irina shared their research on innovation and contribution friction analysis, which led to an open discussion on what resources are needed to propel Drupal to the next level.
Day ThreeThe third day of DrupalCon Portland 2024 was a dynamic conclusion to the conference, filled with insightful sessions, collaborative workshops, and networking opportunities. The day began with the highly anticipated Drupal Initiative Leads Keynote, where initiative leads for nine projects shared updates on current and future endeavors within the Drupal community. Among these updates were the results of the six Pitchburg projects, showcasing innovative developments such as the Drupal API client, Decoupled Layout Builder, Policy-based access, Mentor the Mentor project, JSON Document Storage, and Drupal Gutenberg Editor.
Initiative Updates:
- Amber Himes Matz – Issue Queue changes, designed to increase the "throughput" of the issue queue. Since almost all improvements in Drupal's code come through the issue queue, improving this system ripples down helpfully throughout the entire Drupal ecosystem.
- Janez Urevc - Introducing Gander, the new core performance-testing framework that has been added to core. This change will make it dramatically easier to monitor and improve performance in the code that runs a huge proportion of the Internet.
- Fran-Garcia Linares – Gitlab CI, replacing Drupal CI. Compared to Drupal CI, Gitlab CI is easier to use, offers many useful features, and is much easier to maintain.
- Ted Bowman - Automatic Updates is almost ready for release. It has been in use in over 300 sites for a year. They’ve begun expanded testing and hope to get this into core soon.
- Jürgen Haas – ECA and BPMN, Automation API. Powerful toolkit that enables automation of Drupal tasks, similar in some ways to a low-code/no-code approach to Drupal's "Actions" facility.
- Mateu Aguiló Bosch - Single Directory Components. This project gives site builders and themers a lot of power to control the presentation of Drupal sites. It integrates with UI Suite, Storybook, Experience Builder, and other exciting developments.
- Christina Chumalas – New Navigation. A new vertical/collapsible menu system is available now as an experimental module in Drupal core. It incorporates many exciting features, including easier customization of menus, a "drawer" feature, a new design system, and much more.
For more information about any of these initiatives (including information about how to get involved with any of them), be sure to watch the action-packed video: Drupal Initiatives Keynote.
Drupal Project Initiatives Keynote
Following the keynote, attendees could participate in various sessions tailored to different interests and skill levels. The Drupal Branding Panel provided a comprehensive overview of efforts to modernize and enhance the Drupal brand, while the First-Time Contributor Workshop welcomed newcomers to learn about contributing to Drupal, fostering a welcoming environment for fresh talent. Simultaneously, the Mentored Contribution session offered hands-on guidance for participants to navigate the contribution process with the help of experienced mentors.
In the Marketing Contribution room, marketing professionals explored strategies to effectively promote Drupal, emphasizing the crucial role of marketing in expanding and sustaining the Drupal community. This not only provided valuable insights but also encouraged active participation and collaboration among attendees.
The day concluded with the "Unofficial Official DrupalCon24 Party" at the Oregon Museum of Science and Industry (OMSI), where attendees had the opportunity to unwind, network, and celebrate the successful conclusion of DrupalCon Portland 2024.
Overall, day three was a testament to the vibrant and collaborative spirit of the Drupal community, highlighting innovative developments, strategic goals, and the importance of community involvement. The event set a positive tone for future DrupalCons, showcasing the dedication and enthusiasm of Drupal enthusiasts worldwide.
Day FourFinally, the conference’s fourth and final day was jam-packed with a day full of trainings and summits. From the insightful Nonprofit Summit to the community-driven Community Summit, attendees of the summits enjoyed guest panels and learned from each other during roundtable discussions. You can watch sessions from some of the summits and trainings on the Drupal Association YouTube channel.
The Nonprofit Summit at DrupalCon Portland
After four days of collaborating and learning with the community, DrupalCon Portland 2024 came to an end. From the sessions to the social events each day after the conference, we enjoyed every bit of it! Don’t forget that you can watch session recordings now on the Drupal Association YouTube channel.
As always, it was an incredible event, and we cannot wait to get together at the next DrupalCon – DrupalCon Barcelona, which will be held in Barcelona, Spain, from 24-27 September 2024. Don’t forget to also mark your calendars for DrupalCon Singapore (9-11 December 2024) and DrupalCon Atlanta (24-27 March 2025)! By visiting each conference’s official website, you can sign up to stay up to date with the latest news and updates from the conference.
The Python Show: 41 - Python Packaging and FOSS with Armin Ronacher
In this episode, I chatted with Armin Ronacher about his many amazing Python packages, such as pygments, flask, Jinja, Rye, and Click!
Specifically, we talked about the following:
How Flask came about
Favorite Python packages
Python packaging
and much more!
Tag1 Consulting: Migrating Your Data from Drupal 7 to Drupal 10: Known issues
Series Overview & ToC | Previous Article | Next Article (coming May 29th) In the previous article, we talked about avoiding entity ID conflicts which is one of the primary known issues when migrating to Drupal 10. In this section, we will discuss other issues that might arise and some limitations of the API. As time passes, issues are fixed and new ones might get discovered. While we strive to keep this series up to date, refer to the official documentation for the latest community aggregated resources. Contact us to learn how we can help you with your migration. Schedule a Free Consultation ## Migrating Views The migration of views is not supported by the core Migrate API. Among other reasons, changes to the site architecture and views plugins not being available in Drupal 10 are some of the reasons behind this decision. Outside of what is provided by Drupal core, multiple contributed modules were created to attempt an automated upgrade path. As of this writing, the only supported one is the Views Migration module. It takes a best-effort approach to performing an automated migration. A few things to consider: * There are many modules that integrate...
Read more mauricio Wed, 05/22/2024 - 06:00Django Weblog: Django 5.1 alpha 1 released
Django 5.1 alpha 1 is now available. It represents the first stage in the 5.1 release cycle and is an opportunity for you to try out the changes coming in Django 5.1.
Django 5.1 brings a kaleidoscope of improvements which you can read about in the in-development 5.1 release notes.
This alpha milestone marks the feature freeze. The current release schedule calls for a beta release in about a month and a release candidate about a month from then. We'll only be able to keep this schedule if we get early and often testing from the community. Updates on the release schedule are available on the Django forum.
As with all alpha and beta packages, this is not for production use. But if you'd like to take some of the new features for a spin, or to help find and fix bugs (which should be reported to the issue tracker), you can grab a copy of the alpha package from our downloads page or on PyPI.
The PGP key ID used for this release is Natalia Bidart: 2EE82A8D9470983E.
ThinkDrop Consulting: A new way to Multisite: migrating Aegir to GitHub for WSU Vancouver
About 7 years ago, Washington State University, Vancouver set up their 11 websites on Aegir using a single Drupal 8 codebase. Thanks to Aegir, our client and friend Aaron Thorne was able to maintain all 11 websites by himself, despite not being a Drupal developer. Eventually, though, it was time for something new.
Last year, they contacted me to upgrade their sites and the hosting platform, but keep it inside their own private server infrastructure.
We took our time to figure out how we could design a new model for a multisite codebase, hosting, testing.
How can we implement reliable quality controls and automated delivery across all 11 sites? How can we make it as easy as possible for developers and system administrators to maintain? How can we leave WSU Vancouver with a system that they can use long term, so that they can update their codebase... forever?
The answer? A new self-contained system using DDEV, GitHub Actions, and clever usage of settings.php and Drush aliases.
I gotta be honest: as a developer, working this way has been a dream.
Golems GABB: Simplifying Form Work in Drupal 10: Best Practices and Plugins
Whether it comes to e-commerce stores, blogs, or standard landing pages, using web forms for Drupal 10 is a traditional practice for many. Their purpose is to add more functionality to your system — you will need a separate form to let end users register on your platform, delete accounts, add data, and much more.
Your task is to create a sitemap and understand what business services you are going to offer. Then, you will find the target form in Drupal 10 and make things work innovatively, smoothly, and straightforwardly — no old-school static pages.
The Drop Times: DrupalCon Barcelona 2024 for Inclusion: Apply for Grants and Scholarships
The Drop Times: DrupalCon Asia 2024: New Dates Revealed for Singapore Event
Drupal Core News: Coding standards proposals for final discussion on 5 June 2024
The Technical Working Group (TWG) is announcing one coding standards change for final discussion. Feedback will be reviewed at the meeting scheduled for Wednesday 5 June 2024 UTC.
Issues for discussionThe Coding Standards project page outlines the process for changing Drupal coding standards. Changes to the Drupal Coding Standards are announced via Coding Standard changes records.
Join the team working on Coding StandardsJoin #coding-standards in Drupal Slack to meet and work with others on improving the Drupal coding standards. We work on improving our standards as well as implementing them in the core software.
Spinning Code: Tool Building Mindset
Earlier this month, at Mid Atlantic Dreamin’ in Philadelphia, I gave a talk titled Software Super Heroes: Building the tools you wish you had. My goal with the talk was to convince people that should, can, and in fact do, built tools for themselves. If you work with technology, and your job involves repetitive tasks the same applies to you too.
What do I mean by “Tool” and “Tool builder’s mindset”?I like to use a very expansive definition of tool: “A tool is anything that makes a task easier which would be repetitive, hard, or impossible without it.” In that sense just about anything you make that simplifies you work can be considered a tool: a project estimation spread sheet, a good set of directions for a complex task, a flow for a Salesforce admin, a piece of code to normalize a large collection of files, and more.
My intention with that expansive view is to help encourage people to take on a tool builder’s mindset.
To be a digital tool builder does not require knowing how to write complex software, it just requires you to do what you already do now, but with intention. When we use a broad definition of tools, it’s easier to see ourselves as tool builders, even if we’re just talking about a spreadsheet or a Salesforce flow meant to handle an administrator’s daily tasks. When we see ourselves as tool builders we are more likely to make something worth using more than once.
Why does this matter?When we approach problems with a tool building mind set, instead of insurmountable challenges caused by gaps in our tooling, we see opportunity to create something new to make the impossible possible. Instead of facing hours of boring repetitive tasks, we have chance to build a more interesting special purpose solution.
Fight the Tool Building ExcusesThere are several excuses I commonly hear from people when I encourage them to build their own tools. They range from concerns about not having the right skills, to assuming someone else already built that tool or that the time required isn’t worth the effort.
My general response to these concerns is that while people should indeed look around for tools that already solve their problem, and that some problems are very hard to solve completely, if you start to chip away at a complex problem you often will find that you can create tools that are good enough to save you time and effort.
Don’t try to build the perfect tool that solves all possible edge cases on your first go. Create a tool that takes out some annoying and repetitive task. Then create a tool that solves for another task, or builds on your first time. Chip away.
I often tell developers who are early in their career that I should never see them doing rote repetitive tasks for hours on end. Instead once they understand how a repetitive task is done, they should start thinking about how to build a tool to take over. But that’s not just advice for developers: we invented computers to do repetitive asks (calculating artillery firing tables and cracking codes), let them do that.
Pick Your Tool Building PathWhen you set out to create a tool you have two main options: use something you already know, or use tool building as a chance to learn something new. I’ve used tool building as was to teach myself new features of Excel, Google Sheets, Salesforce Flows, Git, and several programming languages. This can be a great way to learn how to use the tool that’s just right for the job. But learning a new tool or technique takes time, and if you have a deadline you may need to move faster.
Personally I try to take both paths from time to time. I use things I know when: they are exactly the right tool, I am under time pressure, or I want to keep my skills sharp. I will take the time to learn something new when: it’s something I need to learn anyway, I am building on my own time, or it’s exactly the right tool for what I need to do.
Neither path is correct 100% of the time. By using them both I am able to create the tools I need, and broaden my skills over time.
Just Start BuildingThe next time you’re faced with a task that is repetitive or hard with the tools you have: create yourself something new. Don’t get hung up on being perfect, just create something that’s better than what you have at the start.
Then save your tool to use again later. Share it with colleagues, friends, or as an open source project.
When in doubt, just start building.
The post Tool Building Mindset appeared first on Spinning Code.
Greg Boggs: Transitioning from Drupal 7 to Backdrop CMS
This is a guest post by Kana Patrick who is a world-class Drupal migration expert.
As the impending end of life for Drupal 7 draws near, the necessity for website owners to consider their migration options becomes increasingly urgent. While the prevailing trend in the Drupal community leans towards transitioning to Drupal 10 to leverage its modern features, some are hesitant due to the associated costs.
In this discourse, we advocate for a different approach by presenting compelling reasons to shift your website from Drupal 7 to Backdrop CMS if you have not already done so.
Embracing Backdrop CMSBackdrop CMS emerges as a noteworthy contender in the realm of content management systems, originating as a fork from Drupal 7. Conceived in 2013 by Nate Lampton and Jen Lampton, this platform sought to streamline and enhance the foundational code of Drupal 7 while maintaining cost-effectiveness for users.
The reluctance of many website owners to depart from Drupal 7 may stem from financial constraints, sentimental attachment to the platform, or various other factors. However, the looming conclusion of Drupal 7’s lifecycle, coupled with the cessation of community support, prompts a reevaluation of alternatives.
A viable solution lies in transitioning directly to Backdrop CMS, offering a cost-effective migration path that preserves much of the original project’s structure since both systems share a common API rooted in Drupal 7.
Despite its nascent community, the Backdrop project signifies a supportive ecosystem that can aid in the growth of your endeavors, a valuable asset for those seeking assistance and collaboration.
Advantages of Migrating to Backdrop CMS- Backdrop CMS inherits the strengths of Drupal 7 while introducing distinct features.
- It boasts modest system requirements, translating to affordable hosting solutions.
- Unique functionalities absent in Drupal core are seamlessly integrated into Backdrop’s core framework.
- Backdrop furnishes a robust foundation with extensive extensibility through contributed modules, harnessing the full capabilities of Drupal.
- Scheduled updates and version releases provide a predictable timeline, mitigating uncertainties surrounding module updates.
In conclusion, Backdrop CMS emerges as a compelling alternative for Drupal 7 projects facing obsolescence. Evaluating the migration effort from Drupal 7 to 10 against a transition to Backdrop CMS presents an intriguing comparison. Should you require guidance or support in your migration journey to Backdrop CMS, do not hesitate to reach out for assistance.
ListenData: 4 Ways to Correct Grammar with Python
This tutorial explains various methods for checking and correcting grammar using Python. Automatic grammar correction helps students, professionals and content creators to make sure their writing follows proper grammar rules.
To read this article in full, please click hereThis post appeared first on ListenData