Skip to content

Tuesday, 6 February 2024

In the last post I talked about making things like detachable tabs or widgets work in a Wayland work. The protocol I submitted has now been merged into wayland-protocols!

Following I quickly switched Qt and KWin to use the now standardized protocol. KWin will support it with the initial 6.0 release. The Qt patch has been picked all the way down to the 6.6 branch which means it should be in the 6.6.3 release.

I am also happy to see that Robert Mader is working on making Chrome use the standard protocol, picking up my proof-of-concept level patch. Thank you!

Happy dragging!

Friday, 2 February 2024

Let’s go for my web review for the week 2024-05.


This Web Page is Best Viewed in the EU

Tags: tech, vendor-lockin, apple

A little victory for European users trapped in the iOS ecosystem… still more needs to be done though.

https://cloudfour.com/thinks/this-web-page-is-best-viewed-in-the-eu/


Announcing Interop 2024 – Mozilla Hacks - the Web developer blog

Tags: tech, standard, web, browser

It’s good to see this initiative keeps thriving. It’s the best way to ensure the standard is well implemented everywhere.

https://hacks.mozilla.org/2024/02/announcing-interop-2024/


Disney Unveils the HoloTile Floor

Tags: tech, VR, hardware

Interesting technology. Could have a real impact regarding VR applications.

https://www.ign.com/articles/disney-unveils-the-holotile-floor-inching-us-closer-to-a-real-life-holodeck


New GitHub Copilot Research Finds ‘Downward Pressure on Code Quality’

Tags: tech, ai, copilot, programming, quality

Faster with less effort doesn’t seem to lead to quality code overall.

https://visualstudiomagazine.com/articles/2024/01/25/copilot-research.aspx


🦅 Eagle 7B : Soaring past Transformers with 1 Trillion Tokens Across 100+ Languages (RWKV-v5)

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

Very nice progress on this type of architecture. It’s definitely needed in part because it lowers the inference cost quite a lot. It’s also nice to see it released with under the Apache 2 license and the training set be documented.

https://blog.rwkv.com/p/eagle-7b-soaring-past-transformers


Process spawning performance in Rust | Kobzol’s blog

Tags: tech, linux, rust, processes, system

I like this kind of rabbit holes. This gives a few interesting information on how forking processes behaves on Linux.

https://kobzol.github.io/rust/2024/01/28/process-spawning-performance-in-rust.html


On-demand-fork: A Microsecond Fork for Memory-Intensive and Latency-Sensitive Applications

Tags: tech, linux, system, kernel

Interesting paper for a new fork implementation in Linux.

https://www.cs.purdue.edu/homes/pfonseca/papers/eurosys21-odf.pdf


How I Learned to Stop Worrying and Love Juggling C++ Atomics | brilliantsugar

Tags: tech, c++, multithreading, atomics, tests

Very interesting tools for testing and verifying concurrent code.

https://brilliantsugar.github.io/posts/how-i-learned-to-stop-worrying-and-love-juggling-c++-atomics/


Microdot: a web framework for microcontrollers [LWN.net]

Tags: tech, embedded, python

Interesting little web framework to run on MicroPython. Clearly could make some IoT project more accessible.

https://lwn.net//Articles/959067/


High performance vector graphic video games | Spencer C. Imbleau’s blog

Tags: tech, rust, 2d, vector, game

Interesting tricks for having good vector graphic based animations and collision detection.

https://simbleau.github.io/rust/graphics/2023/11/20/using-vello-for-video-games.html


In Loving Memory of Square Checkbox @ tonsky.me

Tags: tech, gui, ux

This introduced lack on consistency and predictability in how you can interact with a GUI component is a problem, this will also reduce accessibility. There was value in this “tradition” of the square checkbox vs round radio button.

https://tonsky.me/blog/checkbox/


My favourite Git commit

Tags: tech, version-control, craftsmanship

Indeed the example is a bit extreme. Still it illustrate quite well what should be found in a commit message. It needs to tell a story and motivate the reasons behind a change.

https://dhwthompson.com/2019/my-favourite-git-commit


The art of good code review

Tags: tech, codereview, craftsmanship

Excellent post about code reviews. I particularly like the introduction about the motivations, it’s often forgotten.

https://philbooth.me/blog/the-art-of-good-code-review


Long Term Refactors

Tags: tech, engineering, refactoring

Interesting idea on how to schedule large refactorings and make sure they happen over time.

https://max.engineer/long-term-refactors


A Plea for more Mikado - Software Engineering and Stuff

Tags: tech, refactoring

Definitely a good approach for larger refactorings or preparing major upgrades.

https://dmathieu.com/articles/opinions/mikado/


Manage like an engineer | Ben Balter

Tags: tech, software, engineering, management

Interesting idea, why not use similar workflows than to develop software? For sure this would bring more transparency and automation, should help focusing on higher value tasks.

https://ben.balter.com/2023/01/10/manage-like-an-engineer/



Bye for now!

Wednesday, 31 January 2024

Now it’s full circle, a whole year of KDE has started again! This is a bit of a smaller post, for two reasons. First I have begun stripping out of the less interesting stuff I do - like really boring bugfixes, whoop. Secondly, I’ll be busy at $work for the next few months and I don’t know what my schedule is going to look like yet.

Plasma

[Bugfix] Finished up Aleix’s QML API for Layer Shell Qt, and exposing it via a proper installable QML module. This is only useful for developers. [6.0]

[Feature] Working on adding a simple tablet tester to the Drawing Tablet KCM, modeled after a certain KDE application’s own. [6.1]

The new Tablet Tester

[Feature] Also working on adding a configurable pen pressure curve, allowing artists to tweak the pen pressure curve of their pen or eraser. It will have two fully-controllable points of articulation and two partially-fixed points for adjusting the thresholds. [6.1]

What configuring your pen pressure curves could look like!

[Bugfix] Fix camera-video-symbolic being coloured wrong, when using dark color schemes like Breeze Dark. I also fixed document-send-symbolic using the wrong icon at 16x size. [6.0]

The fixed camera icon The fixed send icon

[Bugfix] I added more common keywords for Screen Locking settings. [6.1]

[Bugfix] Removed some Wayland-techno terminology from Drawing Tablet settings, “Pen buttons” should be called that. [6.1]

KWin

[Feature] I opened a merge request for the necessary things on the KWin side needed for configuring pen pressure. [6.1]

Tokodon

The next major release is upon us, so I started doing some last-minute bugfixing. This is also when we branch, so I can start breaking strings again! I hope to start adding new features next month.

[Feature] There has been an excess of bug reports of people using Tokodon without a way to store passwords. And if you use Tokodon on Android, it would be helpful to enable notifications but we have no way to ask you yet. To solve both of these problems (and possibly more in the future) I added a new initial setup flow. Said system will also prevent you from starting Tokodon without a way to save account data, hopefully preventing more of these bug reports in the future! [28.04?]

Part of the new initial setup flow, UI to be improved on in the future of course.

[Feature] Tokodon now warns you when you’re viewing a private post, noting that this affects replies in an unusual way. I want to add more tips about Mastodon and ActivityPub-isms to work around these issues that are out of our hands. [28.04?]

What the tip looks like in Tokodon

And now some smaller stuff:

PlasmaTube

Same as Tokodon, I’ve been doing some more bug-fixing in preparation for the February mega-release and will continue to do so.

Kongress

[Bugfix] Fixed two instances of broken section headers. [24.02]

NeoChat

[Bugfix] The room list now hides subtitle text when there is none, slightly improving the alignment. [24.02]

The fixed alignment for rooms

[Bugfix] Improved the look of the search message dialog, like I did for the Explore Rooms dialog before. [24.02]

The header is now properly coloured and separated

Frameworks

[Bugfix] Fixed symbolic icons being wrongly matched with a non-symbolic fallback, even if a symbolic version of said icon exists. This notably will fix lots of wrongly coloured icons in the system tray. [6.0]

[Bugfix] Small improvements to the Kirigami platform plugin error message. This means that it’s easier to debug this issue when you give us logs. [6.0]

Websites

I spent some time trying to put in some small improvements to our Human Interface Guidelines, many of them are merged now but still need to take care of the rest.

Smaller stuff

  • Updated Konvex to Qt6, I still plan on sitting down with it and getting it ready for review.
  • Participated in the AMA today.
  • Rebased and integrated lots of fixes that were stalling due to lack of an author around to rebase.

I hope to see you next month with more KDE stuff!

Tuesday, 30 January 2024

This is the final update on the migration of the Craft jobs from Binary Factory to KDE's GitLab. Since the last blog the last missing pieces have been put in place.

We now build a KF6 runtime which is used for the nightly flatpaks of many of the apps that will be part of KDE's Megarelease 6.

Moreover, additionally to signing the sideload APPX packages (see previous blog) the Windows Craft jobs now also sign the NSIS (.exe) installers and all binaries included in the installers. This completes the port of the Windows Craft jobs from Binary Factory to KDE's GitLab.

Now is the time to add GitLab jobs to your project for builds previously run on Binary Factory. The 24.02 release branch has been cleared for using our signing and publishing services, so that you can prepare builds of AppImages, Flatpaks, Android packages, macOS installers, and Windows installers for the 24.02 release of your project, or any other release if you release independent of KDE Gear. To enable those builds add one or more of the following GitLab templates to your project's .gitlab-ci.yml.

  • craft-appimage.yml (Qt 5), craft-appimage-qt6.yml (Qt 6)
  • flatpak.yml
  • craft-android-apks.yml (Qt 5), craft-android-qt6-apks.yml (Qt 6)
  • craft-macos-arm64.yml (Qt 5), craft-macos-arm64-qt6.yml (Qt 6)
  • craft-macos-x86-64.yml (Qt 5), craft-macos-x86-64-qt6.yml (Qt 6)
  • craft-windows-x86-64.yml (Qt 5), craft-windows-x86-64-qt6.yml (Qt 6)
  • craft-windows-mingw64.yml (Qt 5), craft-windows-mingw64-qt6.yml (Qt 6)
All jobs except for the Flatpak job use Craft for building and packaging your app. You may have to add a .craft.ini file to your project's root folder for overriding the defaults of Craft and the Craft blueprints of your project or your project's dependencies.

What's Next

Next I'll work on making it possible to create and publish Android Application Bundles (AAB) additionally to APKs for your Android apps. Application Bundles contain the binaries for all supported architectures in a single package (instead of multiple different APKs for each architecture). This packaging format is required for new applications published on Google Play.

Monday, 29 January 2024

This a lazy and anti-rant post… I want to shine a light on the fantastic KDE software that I use daily. You can do similar things with GNOME and whatever else, but that’s for someone else to write. I have some bias because I have contributed to several of these applications, but that doesn’t detract from the point that I depend on them daily.

Screenshot of KMail from kde.org

I check my work and personal mail using KMail. I’m one of those lucky few that checks my mail from two IMAP-compliant servers, so I steer clear from Outlook/GMail. I keep track of tasks, events and meetings using Merkuro. I can keep tabs on my calendar since the time applet is synced thanks to Akonadi. I really enjoy and use the integration between these Akonadi applications, such as accepting invitations to meetings which are automatically recorded into my calendar.

My work uses Rocket.Chat, and I use Ruqola for interacting with that:

Screenshot of Ruqola from kde.org

Even when not working, I still use KDE software! One of them is drawing, and I use Krita for that (which is a great application in general, you should use it!) It’s completely replaced Procreate and Clip Studio Paint which I used before. I really like it’s integrated brush engines and default brush set, along with all of it’s built-in functionality like animation support. I even use Krita when sketching on-the-go or in bed now instead of Procreate, since my Lenovo Yoga runs Linux and KDE Plasma. When I edit videos, my program of choice is Kdenlive (which is a great application in general, you should use it!) It does everything I want it to do, honestly I have very little trouble with it but my needs are minimal.

Screenshot of Kdenlive from kde.org

My primary chat platform is Matrix, so of course I use NeoChat as my preferred client everywhere I can. I chose Mastodon as my Twitter-replacement, and I use Tokodon so much that I don’t even open up their web interface anymore! The less I have to run in the browser the better, in my opinion.

Screenshot of Tokodon from kde.org

There’s also lots of small utilities that I use, such as Spectacle for screenshots and quick screen recordings. I use Kate for all of my text editing, such as this post right now! Gwenview is my image viewer of choice too. Of course I use Okular for reading the occasional PDF. Can’t forget about Okteta when I’m trying to dissect some binary file.

Screenshot of Kasts from kde.org

I even use KDE applications for consuming media, too. I use PlasmaTube to feed my YouTube addiction. I like to put videos in picture-in-picture and even added that to the next release, meaning I can stop using the web interface for Invidious. I have started listening to some podcasts, and have been using Kasts for those. I elarned recently that it even can sync via NextCloud!

Upcoming

Here’s some software I recently learned about, and want to start using soon:

  • Accessibility Inspector, which is a KDE-based alternative to GNOME’s Accerciser.
  • Codevis, a code visualization program, I used it once before but I need to try it again.
  • Fielding, a REST API client. I plan to expand it’s features further so I don’t have to depend on Insomina.
  • Powerplant, something to help keep your plants. I only have one plant to keep right now, so this is the perfect time to learn how to use it!

Hope this sheds some light on my favorite applications, and gives you ideas for using them! I enjoy how fast these applications are, and how integrated and nice they all look together. I couldn’t go over every single one, but maybe I can expand in the future.

Friday, 26 January 2024

Let’s go for my web review for the week 2024-04.


Where have all the flowers gone? | daverupert.com

Tags: tech, web, blog, culture

Good continuation of “where have all the websites gone?”. They’re still here but we changed, all the more reason for curating.

https://daverupert.com/2024/01/where-have-all-the-websites-gone/


The Open Source Sustainability Crisis

Tags: tech, foss, sustainability

Yes, there’s something to do in this space. More funding is necessary, some form of platform might help… but it definitely won’t be enough.

https://openpath.chadwhitacre.com/2024/the-open-source-sustainability-crisis/


Platform Tilt: Documenting the Uneven Playing Field for an Independent Browser Like Firefox - Open Policy & Advocacy

Tags: tech, firefox, web, browser, google, apple, microsoft

Nice call from Mozilla to make this public. This way it is very obvious where the blockers are on some platforms.

https://blog.mozilla.org/netpolicy/2024/01/19/platform-tilt/


Victory! Ring Announces It Will No Longer Facilitate Police Requests for Footage from Users | Electronic Frontier Foundation

Tags: tech, surveillance

Still a long way to go but definitely a move in the right direction.

https://www.eff.org/deeplinks/2024/01/ring-announces-it-will-no-longer-facilitate-police-requests-footage-users


Fairly Trained launches certification for generative AI models that respect creators’ rights

Tags: tech, ai, machine-learning, gpt, copyright, licensing

This is an interesting move, we’ll see if this certification gets any traction.

https://www.fairlytrained.org/blog/fairly-trained-launches-certification-for-generative-ai-models-that-respect-creators-rights


Tags: tech, ai, machine-learning, copyright

The tooling to protect against the copyright theft of image generator models training is making progress. This will clearly turn into an arm race.

https://nightshade.cs.uchicago.edu/whatis.html


Reading QR codes without a computer!

Tags: tech, barcode, qrcode

Another great way to understand how QR codes work.

https://qr.blinry.org/


Journey to the Centre of the JVM — Daniel Spiewak

Tags: tech, java, multithreading, memory

Very interesting talk. It gives a good idea of some properties of the JVM memory model. It also shows how the CPU architecture properties can leak all the way through changing some of the behavior of JVM code. Too bad this particular thing seems badly documented on the JDK side.

https://www.youtube.com/watch?v=EFkpmFt61Jo


That’s it! I’m making my own C++ package manager…

Tags: tech, c++, dependencies, buildsystems

Clearly I can understand the feeling. That’s yet another attempt at a solution for this… it’s young, will it get traction? Has the benefit of being kind of simple, too simplistic maybe?

https://david-delassus.medium.com/thats-it-i-m-making-my-own-c-package-manager-555eecbf7d2e


Re: The Case for Rust (in the base system)

Tags: tech, rust, c++, safety, system

Very interesting contribution to the FreeBSD hackers mailing list. Gives quite a good background about Rust, C++ and safety. Debunks a few claims you can easily hear in many places as if they were common knowledge.

https://lists.freebsd.org/archives/freebsd-hackers/2024-January/002876.html


On‐demand JSON: A better way to parse documents? - Keiser - Software: Practice and Experience - Wiley Online Library

Tags: tech, json, parsing, performance, c++

Very interesting approach to JSON parsing. Comes with a very thorough performance analysis.

https://onlinelibrary.wiley.com/doi/10.1002/spe.3313


Handling external API errors: A resumable approach

Tags: tech, api, services, consistency

On the difficulties of dealing with third party APIs. How to handle failures and reach eventual consistency? A few good solutions and patterns are proposed here.

https://thoughtbot.com/blog/handling-errors-when-working-with-external-apis


The most important goal in designing software is understandability | nicole@web

Tags: tech engineering, craftsmanship, quality

Understandability is indeed a very important goal. There are easy ways to improve it in a system.

https://ntietz.com/blog/the-most-important-goal-in-designing-software-is-understandability/


TDD Revisited - Ian Cooper - NDC Porto 2023 - YouTube

Tags: tech, tdd, tests

Nice talks, debunks very well quite a bit of the fallacies around people wrongly practicing TDD. I never realized how the root cause of those fallacies was the misusing of the “unit tests” term instead of “developers test”. This was indeed the wrong term, knew it, but first time I realize how profound the effects were.

https://www.youtube.com/watch?v=IN9lftH0cJc


Trunk Based Development

Tags: tech, version-control

A nice knowledge base about what is probably my favorite branching model. Goes in the variations you can have, the trade-offs and the other techniques you need to bring in for it to work well.

https://trunkbaseddevelopment.com/


On “owning” software - avdi.codes

Tags: tech, economics, cost, licensing, services, foss

Good exploration on how the total cost of ownership is spread depending on how is licensed the software you use and where you get your support from. I think there’s one point a bit too glanced over in the analysis of the cost for the proprietary SaaS case: what’s the cost of fixing a bug that affect your team? You might be a tiny fish in a large pond, good luck getting attention from support in this case.

https://avdi.codes/on-owning-software/


Lessons learned: 1,000 days of distributed at Atlassian

Tags: tech, atlassian, remote-working

Interesting report about distributed and remote work at Atlassian. They really did their homework. I recommend reading the whole report, they came up with a few original ideas.

https://www.atlassian.com/blog/distributed-work/distributed-work-report


Cancel your meetings if you can live with the outcome - Andy Grunwald

Tags: tech, meetings

Interesting approach to handling meetings. Start thinking about what happens if you’re not there.

https://andygrunwald.com/blog/cancel-your-meetings-if-you-can-live-with-the-outcome/



Bye for now!

Sunday, 21 January 2024

When running Linux software and encountering a crash, and you make a bug report about it (thank you!), you may be asked for backtraces and debug symbols.

And if you're not developer you may wonder what in the heck are those?

I wanted to open up this topic a bit, but if you want more technical in-depth look into these things, internet is full of info. :)

This is more a guide for any common user who encounters this situation and what they can do to get these mystical backtraces and symbols and magic to the devs.

Backtrace

When developers ask for a backtrace, they're basically asking "what are the steps that caused this crash to happen?" Debugger software can show this really nicely, line by line. However without correct debug symbols, the backtrace can be meaningless.

But first, how do you get a backtrace of something?

On systems with systemd installed, you often have a terminal tool called coredumpctl. This tool can list many crashes you have had with software. When you see something say "segmentation fault, core dumped", this is the tool that can show you those core dumps.

So, here's a few ways to use it!

How to see all my crashes (coredumps)

Just type coredumpctl in terminal and a list opens. It shows you a lot of information and last the app name.

How to open a specific coredump in a debugger

First, check from the plain coredumpctl list the coredump you want to check out. Easiest way to deduce it is to check the date and time. After that, there's something called PID number, for example 12345. You can close the list by pressing q and then type coredumpctl debug 12345.

This will often open GDB, where you can type bt for it to start printing the backtrace. You can then copy that backtrace. But there's IMO easier way.

Can I just get the backtrace automatically in a file..?

If you only want the latest coredump of the app that crashed on you, then print the backtrace in a text file that you can just send to devs, here's a oneliner to run in terminal:

coredumpctl debug APP_NAME_HERE -A "-ex bt -ex quit" |& tee backtrace.txt

You can also use the PID shown earlier in place of the app name, if you want some specific coredump.

The above command will open the coredump in a debugger, then run bt command, then quit, and it will write it all down in a file called backtrace.txt that you can share with developers.

As always when using debugging and logging features, check the file for possible personal data! It's very unlikely to have anything personal data, BUT it's still a good practice to check it!

Here's a small snippet from a backtrace I have for Kate text editor:

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)
    at pthread_kill.c:44
...
#18 0x00007f5653fbcdb9 in parse_file
    (table=table@entry=0x19d5a60, file=file@entry=0x19c8590, file_name=file_name@entry=0x7f5618001590 "/usr/share/X11/locale/en_US.UTF-8/Compose") at ../src/compose/parser.c:749
#19 0x00007f5653fc5ce0 in xkb_compose_table_new_from_locale
    (ctx=0x1b0cc80, locale=0x18773d0 "en_IE.UTF-8", flags=<optimized out>) at ../src/compose/table.c:217
#20 0x00007f565138a506 in QtWaylandClient::QWaylandInputContext::ensureInitialized (this=0x36e63c0)
    at /usr/src/debug/qt6-qtwayland-6.6.0-1.fc39.x86_64/src/client/qwaylandinputcontext.cpp:228
#21 QtWaylandClient::QWaylandInputContext::ensureInitialized (this=0x36e63c0)
    at /usr/src/debug/qt6-qtwayland-6.6.0-1.fc39.x86_64/src/client/qwaylandinputcontext.cpp:214
#22 QtWaylandClient::QWaylandInputContext::filterEvent (this=0x36e63c0, event=0x7ffd27940c50)
    at /usr/src/debug/qt6-qtwayland-6.6.0-1.fc39.x86_64/src/client/qwaylandinputcontext.cpp:252
...

The first number is the step where we are. Step #0 is where the app crashes. The last step is where the application starts running. Keep in mind though that even the app crashes at #0 that may be just the computer handling the crash, instead of the actual culprit. The culprit for the crash can be anywhere in the backtrace. So you have to do some detective work if you want to figure it out. Often crashes happen when some code execution path goes in unexpected route, and the program is not prepared for that.

Remember that you will, however, need proper debug symbols for this to be useful! We'll check that out in the next chapter.

Debug symbols

Debug symbols are something that tells the developer using debugger software, like GDB, what is going on and where. Without debugging symbols the debugger can only show the developer more obfuscated data.

I find this easier to show with an example:

Without debug symbols, this is what the developer sees when reading the backtrace:

0x00007f7e9e29d4e8 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5

Or even worse case scenario, where the debugger can't read what's going on but only can see the "mangled" names, it can look like this:

_ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE

Now, those are not very helpful. At least the first example tells what file the error is happening in, but it doesn't really tell where. And the second example is just very difficult to understand what's going on. You don't even see what file it is.

With correct debug symbols installed however, this is what the developer sees:

QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x7fe88c001620, event=0x7fe888002c20) at kernel/qcoreapplication.cpp:1064

As you can see, it shows the file and line. This is super helpful since developers can just open the file in this location and start mulling it over. No need to guess what line it may have happened, it's right there!

So, where to get the debug symbols?

Every distro has it's own way, but KDE wiki has an excellent list of most common operating systems and how to get debug symbols for them: https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports

As always, double check with your distros official documentation how to proceed. But the above link is a good starting point!

But basically, your package manager should have them. If not, you will have to build the app yourself with debug symbols enabled, which is definitely not ideal.. If the above list does not have your distro/OS, you may have to ask the maintainers of your distro/OS for help with getting the debug symbols installed.

Wait, which ones do I download?!

Usually the ones for the app that is crashing. Sometimes you may also need include the libraries the app is using.

There is no real direct answer this, but at the very least, get debug symbols for the app. If developers need more, they will ask you to install the other ones too.

You can uninstall the debug symbols after you're done, but that's up to you.

Thanks for reading!

I hope this has been useful! I especially hope the terminal "oneliner" command mentioned above for printing backtraces quickly into a file is useful for you!

Happy backtracing! :)

Saturday, 20 January 2024

Improving the qcolor-from-literal Clazy check

For all of you who don’t know, Clazy is a clang compiler plugin that adds checks for Qt semantics. I have it as my default compiler, because it gives me useful hints when writing or working with preexisting code. Recently, I decided to give working on the project a try! One bigger contribution of mine was to the qcolor-from-literal check, which is a performance optimization. A QColor object has different constructors, this check is about the string constructor. It may accept standardized colors like “lightblue”, but also color patterns. Those can have different formats, but all provide an RGB value and optionally transparency. Having Qt parse this as a string causes performance overhead compared to alternatives.

Fixits for RGB/RGBA patterns

When using a color pattern like “#123” or “#112233”, you may simply replace the string parameter with an integer providing the same value. Rather than getting a generic warning about using this other constructor, a more specific warning with a replacement text (called fixit) is emitted.

testf4ile.cpp:92:16: warning: The QColor ctor taking RGB int value is cheaper than one taking string literals [-Wclazy-qcolor-from-literal]
        QColor("#123");
               ^~~~~~
               0x112233
testfile.cpp:93:16: warning: The QColor ctor taking RGB int value is cheaper than one taking string literals [-Wclazy-qcolor-from-lite
        QColor("#112233");
               ^~~~~~~~~
               0x112233

In case a transparency parameter is specified, the fixit and message are adjusted:

testfile.cpp:92:16: warning: The QColor ctor taking ints is cheaper than one taking string literals [-Wclazy-qcolor-from-literal]
        QColor("#9931363b");
               ^~~~~~~~~~~
               0x31, 0x36, 0x3b, 0x99

Warnings for invalid color patterns

Next to providing fixits for more optimized code, the check now verifies that the provided pattern is valid regarding the length and contained characters. Without this addition, an invalid pattern would be silently ignored or cause an improper fixit to be suggested.

.../qcolor-from-literal/main.cpp:21:28: warning: Pattern length does not match any supported one by QColor, check the documentation [-Wclazy-qcolor-from-literal]
    QColor invalidPattern1("#0000011112222");
                           ^
.../qcolor-from-literal/main.cpp:22:28: warning: QColor pattern may only contain hexadecimal digits [-Wclazy-qcolor-from-literal]
    QColor invalidPattern2("#G00011112222");

Fixing a misleading warning for more precise patterns

In case a “#RRRGGGBBB” or “#RRRRGGGGBBBB” pattern is used, the message would previously suggest using the constructor taking ints. This would however result in an invalid QColor, because the range from 0-255 is exceeded. QRgba64 should be used instead, which provides higher precision.


I hope you find this new or rather improved feature of Clazy useful! I utilized the fixits in Kirigami, see https://invent.kde.org/frameworks/kirigami/-/commit/8e4a5fb30cc014cfc7abd9c58bf3b5f27f468168. Doing the change manually in Kirigami would have been way faster, but less fun. Also, we wouldn’t have ended up with better tooling :)

Why KMines? #

Minesweeper is a tragically underrated puzzle game. While I recall examining the mysterious array of gray squares as a child, it wasn’t until adulthood that I took the time to learn the rules of the game. Despite my late start, however, I still count minesweeper as a classic. These days, good minesweeper clones are hard to come by. I settled on GNOME’s Mines for a while, but as the look of GTK applications on my QT-based KDE Plasma Desktop sets my teeth on edge, I ditched it for KMines in short order. While I enjoyed the game, I found the themes shipped with KMines a bit dated, so I thought I’d make my own.

A screenshot of the KMines game window showing a new dark theme.
The Clean Blue Dark KMines theme

The Drama #

I didn’t quite know what I was getting into when I started working on my themes. I had expected there’d be a simple way to add themes through the KMines settings menu, or by dropping an SVG somewhere in your file-system. If only it were so simple. Adding a theme to KMines requires setting up a full-on KDE development environment, re-compiling KMines from source each time you want to test it, and then, of course, submitting a merge request to the git repository. Thanks to the help of some very patient souls in various KDE Matrix channels, I was able to work through all of this, but I found the process so tricky that I submited a second merge request, this time to the repository for develop.kde.org, for a page documenting the process. Now I realise that some developers out there are going to read through this and wonder if I was dropped on my head as an infant, but in my defense, when it comes to software development, I’m a humble designer and Jamstack web developer. This is all very new to me, and I was expecting a much more streamlined process for what I saw as simple visual tweaks.

A screenshot of the KMines game window showing a new light theme.
The Clean Blue Light KMines theme

Why High Contrast #

When submitting my initial design, a KDE contributor who had been helping me via Matrix pointed out that they found the theme difficult to parse visually as the contrast was quite low. I hadn’t considered contrast ratios here, my thinking being that I didn’t need to; I was just making one theme among many, after all, and users could choose any theme that worked best for them. After some consideration, however, it dawned on me that my theme would likely be the only modern-looking theme in the release, so it would be ideal if it were as accessible as possible. With this in mind, thanks to the feedback of one helpful individual, instead of one pretty but low contrast theme, I decided to make two modern high contrast themes, one light and one dark, targeting the WCAG AAA standard for contrast.

Coming in Plasma 6! #

With thanks to those KDE contributors who helped make it happen, the merge request containing these two themes scraped by the skin of its teeth past the closing door of a feature-freeze and will be available with Plasma 6 this February!

Friday, 19 January 2024

Let’s go for my web review for the week 2024-03.


Cat and Girl - 4000 of My Closest Friends

Tags: tech, copyright, law, art, ethics

How does it feel to just want to put something creative out there without being exploited? Very touching comic on the topic.

https://catandgirl.com/4000-of-my-closest-friends/


AI: the not-so-good parts - Xe Iaso

Tags: tech, ai, ethics

As an industry we definitely should think more often about the consequences of our actions. The incentives are indeed pushing us to go faster without much critical thinking.

https://xeiaso.net/talks/2024/prepare-unforeseen-consequences/


OpenAI Quietly Deletes Ban on Using ChatGPT for “Military and Warfare”

Tags: tech, gpt, war, ethics, business

Unsurprising move, they claim it’s for the betterment of mankind but in practice it’s mostly about capturing as much market share as possible.

https://theintercept.com/2024/01/12/open-ai-military-ban-chatgpt/


AI poisoning could turn open models into destructive “sleeper agents,” says Anthropic

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

The tone pointing at “open models” is wrong but the research is interesting. It still proves models can be poisoned (open or not) so traceability and secured supply-chains will become very important when using large language models.

https://arstechnica.com/information-technology/2024/01/ai-poisoning-could-turn-open-models-into-destructive-sleeper-agents-says-anthropic/


Will the new judicial ruling in the Vizio lawsuit strengthen the GPL?

Tags: tech, foss, law

Very interesting ruling, this opens the door to more parties being able to sue to enforce the GPL not just the authors.

https://blog.tidelift.com/will-the-new-judicial-ruling-in-the-vizio-lawsuit-strengthen-the-gpl


Unity’s Open-Source Double Standard: the ban of VLC - mfkl

Tags: tech, vlc, 3d, foss, business

This is a stupid move on Unity’s part… they’re built on LGPL but ban others in their store to have LGPL dependencies. Shame on them. Good move from Videolabs though, wish them lots of success.

https://mfkl.github.io/2024/01/10/unity-double-oss-standards.html


Pluralistic: The Cult of Mac

Tags: tech, apple, interoperability, security

Apple keep indeed attracting a bunch of cultists… and this allows them to keep abusing their other customers.

https://pluralistic.net/2024/01/12/youre-holding-it-wrong/#if-dishwashers-were-iphones


Each Facebook User is Monitored by Thousands of Companies – The Markup

Tags: tech, facebook, attention-economy, surveillance

Some more insights on the extent of the companies snitching to Facebook.

https://themarkup.org/privacy/2024/01/17/each-facebook-user-is-monitored-by-thousands-of-companies-study-indicates


Meta/Threads Interoperating in the Fediverse Data Dialogue Meeting yesterday

Tags: tech, fediverse, facebook

Interesting notes, there seems to be good faith on the Meta side for now… but this leaves more questions than answers still.

https://reb00ted.org/tech/20231208-meta-threads-data-dialogue/


Where is all of the fediverse?

Tags: tech, fediverse, self-hosting, infrastructure

Interesting stats, not that easy to gather. This gives a good overview of where the fediverse instances are hosted though.

https://blog.benjojo.co.uk/post/who-hosts-the-fediverse-instances


Making my website faster - Cliffle

Tags: tech, web, fonts, css, optimization

Nice set of tricks to optimize load and render time of webpages.

https://cliffle.com/blog/making-website-faster/


LeftoverLocals: Listening to LLM responses through leaked GPU local memory | Trail of Bits Blog

Tags: tech, gpu, machine-learning, security

Interesting vulnerability, not all vendors are impacted though. GPU memory leaks can have unforeseen impacts.

https://blog.trailofbits.com/2024/01/16/leftoverlocals-listening-to-llm-responses-through-leaked-gpu-local-memory/


Speedbump: TCP proxy for simulating variable, yet predictable network latency

Tags: tech, networking, tools

Looks like an interesting tool to simulate difficult network conditions.

https://github.com/kffl/speedbump


Willow Specifications

Tags: tech, protocols, data, networking, p2p

Looks like an interesting protocol for resilient peer to peer data stores. Let’s see how it spreads.

https://willowprotocol.org/


Beware of misleading GPU vs CPU benchmarks

Tags: tech, cpu, gpu, computation, economics

A good reminder that even though GPU tend to be faster, the added complexity and price might not be worth it in the end.

https://pythonspeed.com/articles/gpu-vs-cpu/


Using pre-commit hooks makes software development life easier

Tags: tech, git, craftsmanship, tools

Can definitely recommend. The pre-commit project also make managing those a breeze.

https://itnext.io/using-pre-commit-hooks-makes-software-development-life-easier-ef962827aa96


Using “will” and “should” in technical writing | James’ Coffee Blog

Tags: tech, documentation, writing

Pick your words wisely. If it does happen every time use “will”.

https://jamesg.blog/2024/01/17/will-should/


Everyday storytelling for engineers. The CAO Method.

Tags: tech, engineering, communication

Nice suggestion for talking about your work in various type of situations. Definitely worth trying to frame it like this.

https://tonyfreed.substack.com/p/everyday-storytelling-for-engineers


Does Working from Home Boost Productivity Growth? | San Francisco Fed

Tags: tech, remote-working, economics

Interesting report. Apparently so far a more widespread use of remote work doesn’t seem to boost of hinder productivity growth at large scale.

https://www.frbsf.org/economic-research/publications/economic-letter/2024/january/does-working-from-home-boost-productivity-growth/


The warrior culture of ancient Sparta did some weird things to their society.

Tags: history, politics

Or why nationalism and war mongering are unwelcome dead ends. I never understood this fascination for Sparta by some people… if you look at what it was without some misplaced romanticism, it definitely looked like an horrible and paranoid environment to live in.

https://slate.com/news-and-politics/2024/01/sparta-300-warriors-history-slavery.html



Bye for now!