Random snippets of all sorts of code, mixed with a selection of help and advice.
How to convert from "HTML parsed into a list" back to HTML? [closed]
2 June 2026 @ 1:03 pm
I need to do some work with webpages; I want to convert the HTML into a list, operate on the list, then convert it back to HTML.
I'm using cl-html5-parser for the first step, which seems to work well.
Naively, I assumed the library would include a function that would let me "get back" to HTML.
I have tried a few libraries, including XMLS, which throws an error when I try it; see a trivial test below:
(xmls:write-xml ;take the parsed html and convert back to html
(html5-parser:parse-html5 ;parse the html into a list
(dex:get "https://example.com/") :dom :xmls) ;get the html
(open "text2.txt") ; stream, required by xmls
)
This gives me the following error:
debugger invoked on a SB-KERNEL:CASE-FAILURE @B8012CA9EA in thread
#<THREAD tid=
Redmi 12 flashed and currently only available fastboot text
2 June 2026 @ 12:58 pm
Need help with a Redmi 12 5G that appears to be stuck in a locked-bootloader Fastboot state.
What happened:
Flashed official firmware (matching device variant as far as I know).
After flashing, the bootloader became locked.
Phone briefly shows the Redmi logo on power-on, then immediately goes to Fastboot.
Hardware key combinations are not getting me into recovery.
An authorized Xiaomi service center was unable to fix it and returned the device.
Fastboot information:
fastboot devices detects the phone.
fastboot getvar product returns river.
fastboot getvar unlocked returns no.
fastboot oem device-info shows:
Device unlocked: false
Device critical unlocked: false
Verity mode: true
Is there any way to redeem in-app purchases in iOS apps as the developer of the app?
2 June 2026 @ 12:57 pm
I recently released an iOS app that includes banner ads through Google AdMob, and an in-app purchase to remove those ads. I created 500 offer codes in App Store Connect to be able to give out to people to get the in-app purchase for free. And I of course tried using one myself.
However, it didn't work. At first, clicking on the offer code link failed to redeem anything. Eventually I was able to enter an offer code manually by going to App Store > My Photo > Redeem Code. But even after doing so, the ads weren't actually removed from my app.
Now when I click the "Restore Purchases" link in my app, it says, "No Purchases Found. No previous ad removal purchase was found." But when I click the button to remove ads it says "Purchase Failed. The purchase could not be completed. Please try again." And if I try and redeem another code, it says, "Your code limit has been reached. You have already redeemed the maximum number of these codes
.htaccess error 500 : </ifmodule> duplicated when using Elementor page editor
2 June 2026 @ 12:55 pm
I'm having issue when editing pages of my Wordpress website with Elementor. Randomly but very frequently, sometimes even before publishing the changes, my website is facing a 500 error issue due to two lignes duplicated at the end of my .htaccess :
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
</IfModule>
# END WordPress
If i delete the duplicated lines, my website is back but the error inevitably returns when i do more changes. For information, I use WP Fatest Cache.
I saw a similar problem on another question, from 2020, but the author never posted an update. Thanks.
PostgreSQL: How to Show Whether a Task Row Is Currently Locked by a Worker
2 June 2026 @ 12:24 pm
I am building a worker system where idle hardware is expensive, so machines need to pick up new tasks as quickly as possible.
Task durations vary significantly: some take a few seconds, others several minutes, and some may take half an hour. Because of that, a fixed lease timeout is difficult to choose. A short lease could cause duplicate processing for valid long-running tasks, while a long lease could leave hardware idle after a crashed worker.
My idea is to keep the database transaction open while the worker processes the task:
The worker starts a transaction.
It claims a task using SELECT ... FOR UPDATE SKIP LOCKED.
Other workers skip the locked row and process other tasks.
The worker commits the transaction only after the task finishes or fails.
This avoids a two-transaction approach where the first transaction marks the task as running and a later transaction updates it to finis
Confused between gRPC and Rabbitmq for nodejs and python AI microservices
2 June 2026 @ 10:58 am
I am building an AI platform where:
nodejs is the main backend or gateway.
Python handles AI/LLM processing services include chat, OCR, resume analysis, document AI, etc.
Initially i was planning to use gRPC to use between nodejs and python services. but now i am thinking rabbitmq make more sense.
My current thought is to use the nodejs as a Publisher and python as a subscriber.
Does this architecture makes sense for AI workloads and streaming system.
Would really appreciate advice from people who have built similar polyglot AI systems.
Technical vs. Innovational
2 June 2026 @ 10:22 am
I can code but not without help, or a blueprint on a project. Not very good at initation but I'm above average in bug spoting & troubleshooting.
Should I be concerned? I get the job done but, I can't really give the best answers to theoreticals unless I look at the code or be in it practical.
How does this affect my job interviews?
StackOverflowError during mvn clean install on Jenkins
2 June 2026 @ 10:16 am
I have a Spring Boot artifact that builds perfectly fine via maven on developer machines, however on our Jenkins server the build fails with a StackOverflowError (stack trace below).
This is the only artifact of ours that runs into this error.
If I increase the stack size with -Xss2M the problem is resolved, however I don't understand why this is needed if it works fine on dev machines. Additionally I'm wondering if this is the correct solution or if it just hides an underlying problem that should be addressed (other than architecturally overhauling the artifact so the call stack isn't as large).
Maven version: 3.8.7
Java version: 21.0.10, but I did try with 17 as well.
Stack trace:
[[1;34mINFO[m] Compiling 698 source files to /var/lib/jenkins/workspace/artifact/target/classes
An exception has occurred in the compiler (21.0.10). Please file a bug against the Java compiler via the Ja
Limit amount of extracted subranges made by std::views::split
2 June 2026 @ 8:13 am
#include <iomanip>
#include <iostream>
#include <ranges>
#include <string_view>
int main()
{
using std::operator""sv;
constexpr auto words{"Hello C++ 20!"sv};
for (const auto word : std::views::split(words, ' '))
std::cout << std::quoted(std::string_view(word)) << ' ';
std::cout << '\n';
}
This code outputs "Hello" "C++" "20!".
How to limit the split amount with n and get the output: "Hello" "C++ 20!" (with n = 1, single split from the beginning, the first subrange is Hello, the second subrange is all chars after the first space.)
This can be achieved in C++26 like below, but I'm limited with C++20.
auto split = std::views::split(words, ' ');
auto first = spli
Code Review: Object-Oriented C# Console Application for a Knight Tournament
2 June 2026 @ 7:28 am
I am currently practicing Object-Oriented Programming in C# and built a small console application simulating a Knight Tournament (KnightTournament).
The program includes base and derived classes for weapons (Sword, Lance, Club), a Knight class, a Squire class, and a custom exception for duplicate names. I also implemented a custom node-based structure for the participants. (Note: The ParticipantList class implementation is omitted here for brevity).
Could you please review my code? I am specifically looking for feedback on:
General OOP design and class structure
Proper use of inheritance and virtual/override methods
C# best practices and naming conventions
Here is my code:
using System;
namespace KnightTournament
{
public abstract class Weapon
{
private string _designation;
public Weapon(string design