Feeds

Golems GABB: How to Leverage Drupal's Layout Builder to Create Complex Pages

Planet Drupal - Fri, 2024-01-05 08:42
How to Leverage Drupal's Layout Builder to Create Complex Pages Editor Fri, 01/05/2024 - 15:42

Sometimes, creating a modern design with high functionality is problematic. Especially when it comes to large-scale and complex projects. There are various solutions to make the process of creating layouts easier and more convenient. One of the most influential and popular is Drupal Layout Builder.

Categories: FLOSS Project Planets

TechBeamers Python: Comparing Two Lists in Python

Planet Python - Fri, 2024-01-05 07:21

Comparing two lists is a common task in programming, and it becomes crucial when you need to find differences, and intersections, or validate data consistency. In this tutorial, we will explore various methods to compare two lists in Python. We’ll cover simple equality checks, membership testing, element-wise comparisons, and advanced techniques using built-in functions and […]

The post Comparing Two Lists in Python appeared first on TechBeamers.

Categories: FLOSS Project Planets

Web Review, Week 2024-01

Planet KDE - Fri, 2024-01-05 07:02

Let’s go for my web review for the week 2024-01. First one of 2024, Happy New Year to all!

In 2024, please switch to Firefox – Roy Tanck

Tags: tech, mozilla, foss, web

Alright, it’s 2024… Looking for a New Year Resolution? This is definitely the one you should contemplate! Maybe also prepare your switch to Plasma 6, but different story. 😉

https://roytanck.com/2023/12/23/in-2024-please-switch-to-firefox/


 The Internet Is About to Get Weird Again

Tags: tech, web, culture, social-media

Very inspiring article. I really wish we’ll indeed see more and more weird and creative websites. People apparently feels uneasy in their current social media jails, the time is ripe to leap in the unknown again.

https://www.rollingstone.com/culture/culture-commentary/internet-future-about-to-get-weird-1234938403/


EU CRA: What does it mean for open source? - Bert Hubert’s writings

Tags: tech, foss, law

The current compromise might not be as bad as anticipated. Some things could be improved still. The community needs to be involved in the process.

https://berthub.eu/articles/posts/eu-cra-what-does-it-mean-for-open-source/


Birb + Fossil: An RSS Revival? - Tim Kellogg

Tags: tech, fediverse, rss, ai, nlp

Indeed there are a few trends at play right now which lead to RSS being in use again. I can only hope it’ll keep growing.

https://timkellogg.me/blog/2024/01/03/birb


How bad are search results? Let’s compare Google, Bing, Marginalia, Kagi, Mwmbl, and ChatGPT

Tags: tech, search, web

This looks like now is the time for smaller search engines to shine. Clearly the dominant ones are not doing a really good job anymore.

https://danluu.com/seo-spam/


Tesla blamed drivers for failures of parts it long knew were defective

Tags: tech, tesla, automotive, safety

The results of this investigation are actually super scary… Even if you don’t own one, those are in our streets. In any case it is a clear statement that you can’t and shall not run an automotive company like a startup…

https://www.reuters.com/investigates/special-report/tesla-musk-steering-suspension/


The I in LLM stands for intelligence | daniel.haxx.se

Tags: tech, ai, machine-learning, gpt, security

When bug bounty programs meet LLM hallucinations… developer time is wasted.

https://daniel.haxx.se/blog/2024/01/02/the-i-in-llm-stands-for-intelligence/


How I forked SteamOS for my living room PC — iliana.fyi

Tags: tech, valve, foss, linux, system

Funny reverse engineering of the latest SteamOS to use it in a different context. Give some information on their system design.

https://iliana.fyi/blog/build-your-own-steamos-updates/


Why I’m skeptical of low-code - Nick Scialli | Senior Software Engineer

Tags: tech, low-code

Proper word of caution. Those tools ain’t necessarily bad… but know what the limits will be.

https://nick.scialli.me/blog/why-im-skeptical-of-low-code/


How Standard Ebooks serves millions of requests per month with a 2GB VPS; or, a paean to the classic web - Alex Cabal

Tags: tech, complexity, craftsmanship, dependencies, php, web

Nice ode to simplifying web projects, to great effects. You can go a long way serving millions of requests if you choose your tools properly.

https://alexcabal.com/posts/standard-ebooks-and-classic-web-tech


A Closer Look to a Key-Value Storage Engine | Yihang’s Blog

Tags: tech, system, design, architecture, databases

Very interesting exploration of the design choices behind the creation of a key value storage engine.

https://silhding.github.io/2021/08/20/A-Closer-Look-to-a-Key-Value-Storage-Engine/


SQLALchemy vs Django ORM | Alexey Evseev

Tags: tech, databases, python, orm, django

Overview of the differences in behavior between the two most popular ORMs in the Python ecosystem. This shows interesting different design options for such things.

https://st4lk.github.io/en/blog/2023/12/09/sqlalchemy-vs-django-orm/


The ugrep file pattern searcher

Tags: tech, tools, command-line

Looks like another nice grep alternative. This one keeps its command line interface compatible with grep which is nice, not the case for other alternatives and that turns out to be my main gripe with them.

https://ugrep.com/


Container to WASM converter

Tags: tech, docker, webassembly

This makes for quite a few emulation layers stacked on each other. Still this is an interesting experiment.

https://github.com/ktock/container2wasm


Profilerpedia

Tags: tech, profiling

Nice reference for the tools available to profile software.

https://profilerpedia.markhansen.co.nz/


Occupancy explained

Tags: tech, amd, gpu, shader, performance

A very precise and thorough article about GPU occupancy. What it is, how it relates to perceived performances, it’s potentisl relationship with cache thrashing and the tools you can use to measure it on AMD GPUs.

https://gpuopen.com/learn/occupancy-explained/


Speed up your code: don’t pass structs bigger than 16 bytes on AMD64 · GitHub

Tags: tech, c++, assembly, performance

Not necessarily a practical advice in most of our daily code. Still this exhibits interesting low level details about argument passing. Might come in handy in a few cases, to be kept in mind.

https://gist.github.com/FeepingCreature/5dff669aad380a123b15659e195fb96c


Ambient Co-presence

Tags: tech, web, design

Good food for thought regarding shared presence on the web. A few good ideas in the design space. Obviously very web centric, I wonder what we could do on the desktop with shared documents for instance.

https://maggieappleton.com/ambient-copresence


The value of canonicity - Building Nubank

Tags: tech, engineering, management, developer-experience

Nice writeup about the benefits of homogeneity in an engineering organization. It also shows how it is a balancing act though, since you need experiments to happen in a controlled way for evolution to still happen.

https://building.nubank.com.br/the-value-of-canonicity/


Bye for now!

Categories: FLOSS Project Planets

Real Python: The Real Python Podcast – Episode #186: Exploring Python in Excel

Planet Python - Fri, 2024-01-05 07:00

Are you interested in using your Python skills within Excel? Would you like to share a data science project or visualization as a single Office file? This week on the show, we speak with Principal Architect John Lam and Sr. Cloud Developer Advocate Sarah Kaiser from Microsoft about Python in Excel.

[ 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

New Video: Krita 5.2 Features!

Planet KDE - Fri, 2024-01-05 06:13

Ramon Miranda has published a new video on the Krita channel: Krita 5.2 Features. Take a look and learn what’s new in our latest release:

 

 

The post New Video: Krita 5.2 Features! appeared first on Krita.

Categories: FLOSS Project Planets

PyCharm: New Low-Impact Monitoring API in Python 3.12

Planet Python - Fri, 2024-01-05 06:12
People love PyCharm’s debugger, and we work hard to make it both fast and easy to use. But what if it could be even faster and easier to use? Python 3.12 adds the new low-impact monitoring API described in PEP 669, enabling debuggers, profilers, and similar tools to run code at almost full speed. As […]
Categories: FLOSS Project Planets

Andy Wingo: v8's precise field-logging remembered set

GNU Planet! - Fri, 2024-01-05 04:44

A remembered set is used by a garbage collector to identify graph edges between partitioned sub-spaces of a heap. The canonical example is in generational collection, where you allocate new objects in newspace, and eventually promote survivor objects to oldspace. If most objects die young, we can focus GC effort on newspace, to avoid traversing all of oldspace all the time.

Collecting a subspace instead of the whole heap is sound if and only if we can identify all live objects in the subspace. We start with some set of roots that point into the subspace from outside, and then traverse all links in those objects, but only to other objects within the subspace.

The roots are, like, global variables, and the stack, and registers; and in the case of a partial collection in which we identify live objects only within newspace, also any link into newspace from other spaces (oldspace, in our case). This set of inbound links is a remembered set.

There are a few strategies for maintaining a remembered set. Generally speaking, you start by implementing a write barrier that intercepts all stores in a program. Instead of:

obj[slot] := val;

You might abstract this away:

write_slot(obj, sizeof obj, &obj[slot], val);

As you can see, it’s quite an annoying transformation to do by hand; typically you will want some sort of language-level abstraction that lets you keep the more natural syntax. C++ can do this pretty well, or if you are implementing a compiler, you just add this logic to the code generator.

Then the actual write barrier... well its implementation is twingled up with implementation of the remembered set. The simplest variant is a card-marking scheme, whereby the heap is divided into equal-sized power-of-two-sized cards, and each card has a bit. If the heap is also divided into blocks (say, 2 MB in size), then you might divide those blocks into 256-byte cards, yielding 8192 cards per block. A barrier might look like this:

void write_slot(ObjRef obj, size_t size, SlotAddr slot, ObjRef val) { obj[slot] := val; // Start with the store. uintptr_t block_size = 1<<21; uintptr_t card_size = 1<<8; uintptr_t cards_per_block = block_size / card_size; uintptr_t obj_addr = obj; uintptr_t card_idx = (obj_addr / card_size) % cards_per_block; // Assume remset allocated at block start. void *block_start = obj_addr & ~(block_size-1); uint32_t *cards = block_start; // Set the bit. cards[card_idx / 32] |= 1 << (card_idx % 32); }

Then when marking the new generation, you visit all cards, and for all marked cards, trace all outbound links in all live objects that begin on the card.

Card-marking is simple to implement and simple to statically allocate as part of the heap. Finding marked cards takes time proportional to the size of the heap, but you hope that the constant factors and SIMD minimize this cost. However iterating over objects within a card can be costly. You hope that there are few old-to-new links but what do you know?

In Whippet I have been struggling a bit with sticky-mark-bit generational marking, in which new and old objects are not spatially partitioned. Sometimes generational collection is a win, but in benchmarking I find that often it isn’t, and I think Whippet’s card-marking barrier is at fault: it is simply too imprecise. Consider firstly that our write barrier applies to stores to slots in all objects, not just those in oldspace; a store to a new object will mark a card, but that card may contain old objects which would then be re-scanned. Or consider a store to an old object in a more dense part of oldspace; scanning the card may incur more work than needed. It could also be that Whippet is being too aggressive at re-using blocks for new allocations, where it should be limiting itself to blocks that are very sparsely populated with old objects.

what v8 does

There is a tradeoff in write barriers between the overhead imposed on stores, the size of the remembered set, and the precision of the remembered set. Card-marking is relatively low-overhead and usually small as a fraction of the heap, but not very precise. It would be better if a remembered set recorded objects, not cards. And it would be even better if it recorded slots in objects, not just objects.

V8 takes this latter strategy: it has per-block remembered sets which record slots containing “interesting” links. All of the above words were to get here, to take a brief look at its remembered set.

The main operation is RememberedSet::Insert. It takes the MemoryChunk (a block, in our language from above) and the address of a slot in the block. Each block has a remembered set; in fact, six remembered sets for some reason. The remembered set itself is a SlotSet, whose interesting operations come from BasicSlotSet.

The structure of a slot set is a bitvector partitioned into equal-sized, possibly-empty buckets. There is one bit per slot in the block, so in the limit the size overhead for the remembered set may be 3% (1/32, assuming compressed pointers). Currently each bucket is 1024 bits (128 bytes), plus the 4 bytes for the bucket pointer itself.

Inserting into the slot set will first allocate a bucket (using C++ new) if needed, then load the “cell” (32-bit integer) containing the slot. There is a template parameter declaring whether this is an atomic or normal load. Finally, if the slot bit in the cell is not yet set, V8 will set the bit, possibly using atomic compare-and-swap.

In the language of Blackburn’s Design and analysis of field-logging write barriers, I believe this is a field-logging barrier, rather than the bit-stealing slot barrier described by Yang et al in the 2012 Barriers Reconsidered, Friendlier Still!. Unlike Blackburn’s field-logging barrier, however, this remembered set is implemented completely on the side: there is no in-object remembered bit, nor remembered bits for the fields.

On the one hand, V8’s remembered sets are precise. There are some tradeoffs, though: they require off-managed-heap dynamic allocation for the buckets, and traversing the remembered sets takes time proportional to the whole heap size. And, should V8 ever switch its minor mark-sweep generational collector to use sticky mark bits, the lack of a spatial partition could lead to similar problems as I am seeing in Whippet. I will be interested to see what they come up with in this regard.

Well, that’s all for today. Happy hacking in the new year!

Categories: FLOSS Project Planets

TechBeamers Python: How to Make a Unique List in Python

Planet Python - Fri, 2024-01-05 02:32

In the world of Python, handling data is a big deal. We often work with lists, and sometimes, we need to make sure they only have unique items. In this detailed guide, we’ll explore different ways to make a unique list in Python. From using sets to more advanced stuff like functools.reduce(), we’re going to […]

The post How to Make a Unique List in Python appeared first on TechBeamers.

Categories: FLOSS Project Planets

TechBeamers Python: 25 Sampling Interview Questions and Answers to Remember

Planet Python - Fri, 2024-01-05 02:07

Find out 25 commonly asked sampling interview questions distributed across different categories. These questions cover a range of topics related to sampling and can be used to assess the interviewee’s understanding of fundamental concepts, methods, and applications in various fields. 25 Sampling Interview Questions and Answers We have prepared this quick guide of sampling interview […]

The post 25 Sampling Interview Questions and Answers to Remember appeared first on TechBeamers.

Categories: FLOSS Project Planets

Nextide Blog: Oxford's Mathematical Institute: Streamlining Academic Visitor Applications with Maestro

Planet Drupal - Fri, 2024-01-05 00:24

In the dynamic world of academia, managing academic visitor applications efficiently is crucial. The University of Oxford Mathematical Institute has embraced the power of Drupal  and the Maestro module to streamline and enhance their academic visitor application process. Let's delve into the seamless workflow that facilitates this crucial task.

 

The General Design

Initiation: Academics or their assistants initiate the process by filling in a comprehensive multi-page webform tailored to their needs.

Confirmation and Workflow Trigger: Upon submission, a confirmation email is sent to the initiator by the webform email handler, and the workflow is triggered.

Categories: FLOSS Project Planets

TechBeamers Python: Python Syntax – Quick Start Guide

Planet Python - Fri, 2024-01-05 00:16

Python, the language known for its simplicity and friendliness, has a way of writing code called syntax. It’s like the grammar of Python, telling you how to structure your code so the computer can understand and execute it. In this guide, we’re going to break down different parts of Python syntax, with clear explanations and […]

The post Python Syntax – Quick Start Guide appeared first on TechBeamers.

Categories: FLOSS Project Planets

Two Breeze Icon Updates

Planet KDE - Thu, 2024-01-04 20:05

Hi all,

I made a couple of videos explaining more updates for Breeze icons. Enjoy!

Categories: FLOSS Project Planets

ImageX: Accessibility Elements, Part 4: Accessible Keyboard Navigation in Drupal

Planet Drupal - Thu, 2024-01-04 19:54

Authored by: Nadiia Nykolaichuk.

Since Douglas Engelbart invented the computer mouse in 1963, it has become a popular device that many people use for browsing the Internet today. However, there are still a great number of people who cannot afford the comfort of using a mouse. A wide range of temporary or permanent impairments make them rely on keyboard-only navigation.

Categories: FLOSS Project Planets

Valhalla's Things: Random Sashiko + Crazy Quilt Pocket

Planet Debian - Thu, 2024-01-04 19:00
Posted on January 5, 2024

Lately I’ve seen people on the internet talking about victorian crazy quilting. Years ago I had watched a Numberphile video about Hitomezashi Stitch Patterns based on numbers, words or randomness. Few weeks ago I had cut some fabric piece out of an old pair of jeans and I had a lot of scraps that were too small to do anything useful on their own. It easy to see where this can go, right?

I cut a pocket shape out of old garment mockups (this required some piecing), drew a square grid, arranged scraps of jeans to cover the other side, kept everything together with a lot of pins, carefully avoided basting anything, and started covering everything in sashiko / hitomezashi stitches, starting each line with a stitch on the front or the back of the work based on the result of:

import random random.choice(["front", "back"])

For the second piece I tried to use a piece of paper with the square grid instead of drawing it on the fabric: it worked, mostly, I would not do it again as removing the paper was more of a hassle than drawing the lines in the first place. I suspected it, but had to try it anyway.

Then I added a lining from some plain black cotton from the stash; for the slit I put the lining on the front right sides together, sewn at 2 mm from the marked slit, cut it, turned the lining to the back side, pressed and then topstitched as close as possible to the slit from the front.

I bound everything with bias tape, adding herringbone tape loops at the top to hang it from a belt (such as one made from the waistband of one of the donor pair of jeans) and that was it.

I like the way the result feels; maybe it’s a bit too stiff for a pocket, but I can see it work very well for a bigger bag, and maybe even a jacket or some other outer garment.

Categories: FLOSS Project Planets

Aigars Mahinovs: Figuring out finances part 5

Planet Debian - Thu, 2024-01-04 15:46

At the end of the last part of this, we got a Home Assistant OS installation that contains in itself a Firefly III instance and that contains all the current financial information. They are communicating and calculating predictions for me.

The only part that I was not 100% happy with was accounting of cash transactions. You see payments in cash are mostly made away from computer and sometimes even in areas without a mobile Internet connection. And all Firefly III apps that I tried failed at the task of creating a new transaction when offline. Even the one recommended Telegram bot from Firefly III page used a dialog-based approach for creating even a simplest transaction. Issue asking for a one-shot transaction creation option stands as unresolved.

Theoretically it would have been best if I could simply contribute that feature to that particular Telegram bot ... but it's written in Javascript. By mapping the API onto tasks somehow. After about 4 hours I still could not figure out where in the code anything actually happens. It all looked like just sugar or spagetty. Connectors on connectors on mappers.

So I did the real open-source thing and just wrote my own tool. firefly3_telegram_oneshot is a maximally simple Telegram bot based on python-telegram-bot library.

So what does it do? The primary usage for me is to simply send a message to the bot at any time with text like "23.2 coffee and cake" and when the message eventually reaches the bot, it then should create a new transaction from my "cash" account to "Unknown" account in amount of 23.20€ and description "coffee and cake".

That is the key. Everything else in the bot is comfort.

For example "/undo" command deletes the last transaction in cash account (presumably added by error) and "/last" shows which transaction the "/undo" would delete.

And to help with expense categorisation one can also do a message like "6.1 beer, dest=Edeka, cat=alcohol" that would search for a destination account that would fuzzy match to "Edeka" (a supermarket in Germany) and add the transation to the category fuzzy matched to "alcohol", like "Shopping - alcoholic drinks".

And to make that fuzzy matching more reliable I also added "/cat something" and "/dest something" commands that would show which category or destination account would be matched with a given string.

All of that in around 250 lines of Python code and executed by a 17 line Dockerfile (via the Portainer on my Home Assistant OS). One remaining function that could be nice is creating a category or destination account on request (for example when the first character of the supplied string is "+").

I am really plesantly surprised about how much can be done with how little code using the above Python library. And you never need to have any open incoming ports anywhere to runs such bots, so the attack surface for such bot-based service is much tighter.

All in all the system works and works well. The only exception is that for my particual bank there is still no automatic way of extracting data about credit card transactions. For those I still have to manually log into the Internet bank, export a CSV file and then feed that into the Firefly III importer. Annoying. And I am not really motivated to try to hack my bank :D

Has this been useful to any of you? Any ideas to expand or improve what I have? Just find me as "aigarius" on any social media and speak up :)

Categories: FLOSS Project Planets

TechBeamers Python: How to Achieve Python String indexOf Using Find() and Index()

Planet Python - Thu, 2024-01-04 12:10

The indexOf method helps locate a substring in a string, pointing to its first appearance. In Python, there isn’t a direct string indexOf method. But we can achieve the same functionality using various string indexing and search methods. In this tutorial, we’ll delve into these methods, providing multiple examples and additional information to help readers […]

The post How to Achieve Python String indexOf Using Find() and Index() appeared first on TechBeamers.

Categories: FLOSS Project Planets

Django Weblog: Unlock Early Savings: Early Bird Tickets for DjangoCon Europe 2024 Now Available!

Planet Python - Thu, 2024-01-04 11:52

You can take advantage of our Early Bird ticket sale for DjangoCon Europe 2024. By purchasing your tickets early, you not only guarantee your attendance at one of the most exciting Django events but also enjoy significant savings.

Buy tickets on the conference website

Why Go Early?

You can secure your tickets at a special Early Bird rate, providing exceptional value for your conference experience.

Also, your early commitment goes a long way in supporting the success of DjangoCon Europe 2024. It helps us plan better and ensure a seamless event.

Act now and secure your Early Bird tickets before the sale closes on April 31st. Don't miss out on the chance to save and be a part of this exciting event.

We can't wait to welcome you to DjangoCon Europe 2024!

Categories: FLOSS Project Planets

Matt Glaman: My Dependabot configuration for Drupal (and other PHP projects)

Planet Drupal - Thu, 2024-01-04 11:19

I use GitHub to host my repositories, such as this website. To keep my dependencies up-to-date, I leverage Dependabot. The product has matured a lot over the past few years. Before, it was a standalone service and then acquired by GitHub. It did not support dependencies managed by Composer. It was pretty spammy and very noisy. However, it has drastically improved over the past few years. Thanks to all of those at GitHub who have worked to improve it (that includes you, Mike Crittenden.)

My Dependabot configuration consists of a few items, nothing overly specific.

Categories: FLOSS Project Planets

Matt Glaman: PhpStorm live templates to automate the boring things

Planet Drupal - Thu, 2024-01-04 11:19

I finally took a look at writing a custom live template with PhpStorm. I've used them several times to automate scaffolding a foreach statement or other random suggestions that a Tab keypress leads to automated scaffolded code. But I never really dove in to see how they work or could be customized. Then, I had to fix some of my code to comply with Drupal's coding standards.

Drupal requires document comments for all methods, including a short comment. 

Categories: FLOSS Project Planets

Matt Glaman: How do theme template overrides in Drupal work?

Planet Drupal - Thu, 2024-01-04 11:19

In Drupal, with themes, you can override default template output by copying, pasting, and customizing those templates. It works, but how? I thought I always knew how this worked. But I realized I didn't when I dove into supporting Drupal 7 themes with Retrofit.

I know Drupal builds the theme registry and theme hook suggestions. In doing so, it scans templates, and part of that process includes scanning the active theme for template and theme hook template implementations. But when reading the \Drupal\Core\Theme\Registry code, I was coming up blank.

Categories: FLOSS Project Planets

Pages