Random snippets of all sorts of code, mixed with a selection of help and advice.
Laravel api and kliens application
25 May 2026 @ 7:19 pm
Open a terminal and create the API project using the required naming convention:
Bash
composer create-project laravel/laravel vizsga20260525api
cd vizsga20260525api
In phpMyAdmin, create an empty database named vizsga20260525 (preferably with the utf8mb4_hungarian_ci collation). Configure the .env file in the root of your project:
Kódrészlet
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=vizsga20260525
DB_USERNAME=root
DB_PASSWORD=
3-5. Creating Tables, Models, and Relationships
Run the following commands to generate the models and their corresponding migration files:
Bash
php artisan make:model Invoice -m
php artisan make:model InvoiceDetail -m
database/migrations/xxxx_xx_xx_xxxxxx_create_invoices_table.php
PHP
public function up(): void
{
Schema:
Unity: Character Shakes When Rotating Camera While Moving
25 May 2026 @ 7:09 pm
Problem: When holding forward movement button and rotating the camera simultaneously, the character noticeably shakes/trembles. Attempted fixes through MoveRotation, RotateTowards, changing update methods (FixedUpdate/LateUpdate), and adding angle deadzone thresholds have not resolved the issue.
Setup:
Movement: direct linearVelocity application
Rotation fully frozen in Rigidbody constraints
Camera smoothly follows character using lerp
Movement adapts to surface through NormalComparer component, which projects the movement vector onto the surface normal beneath the character
Video demonstration
PlayerMovement.cs:
using System;
using UnityEngine;
using UnityEngine.InputSystem;
How to orient a subset of undirected edges in a mixed graph to make it strongly connected (SCC)?
25 May 2026 @ 7:09 pm
I am working on a competitive programming problem where I am given a mixed graph with N vertices and M edges. Some edges are fixed (directed), while other edges are free (undirected) and can be oriented in either direction.
Through binary search on a weight threshold and using Tarjan's SCC algorithm, I can successfully find a valid state where a solution is guaranteed to exist. That is, if I treat all free edges as bidirectional, the entire mixed graph forms a single Strongly Connected Component (SCC).
Now, I am struggling with the constructive part: how to actually assign a single direction to each free edge such that the final, fully directed graph remains a single SCC.
My Approach & Where I'm Stuck
I am trying to implement an $O(N + M)$ orientation pass using a DFS traversal based on Robbins' Theorem (and its extension to mixed graphs by Boesch and Tindell).
My core idea is to traverse the
'unresolved token' error for get_Thing and set_Thing methods for properties in C++/CLI code
25 May 2026 @ 7:09 pm
I have a C++ library named Stuff and I have a DLL wrapper for it in C++/CLI named StuffWrapper and a GUI that uses the wrapper named StuffDialog, also C++/CLI. The Stuff class has a member, 'thing', and the ManagedStuff class in StuffWrapper class has a property, 'Thing' with get and set methods. Now when I try to build the GUI I have errors regarding 'unresolved token' ManagedStuff::get_Thing and ManagedStuff::set_Thing.
Using VS2026 community
how can i use multiple arguments in a python multiprocessing pool
25 May 2026 @ 6:29 pm
i made a program that compiles data through web scraping
how i usually call it is through a single argument and the function does the rest
example
import multiprocessing
Links = [
"https://www.[example].com",
"https://www.[example2].com"
]
def extract_and_compile(link:str, compile_amount:int = 5):
#because its just an example it doesnt reflect an actual program
for x in range(compile_amount):
print(f"compiled data {x+1} from {link}")
if __name__ == "__main__":
with multiprocessing.Pool() as pool:
pool.map(extract_and_compile, Links)
this setup (above) worked. as it gives an "proper" output
compiled data 1 from https://www.[example].com
...
compiled data 5 from https://www.[example].com
compiled data 1 from https://www.[example2].com
...
com
Determine target platform without installing Rust
25 May 2026 @ 6:18 pm
TL;DR: how can I determine the Rust target platform triple without installing Rust or Cargo?
I would like to download the appropriate pre-compiled binary program file. The pre-compiled binary program files are named with the target platform, e.g. s4_aarch64-unknown-linux-gnu_v0.8.80, s4_armv7-unknown-linux-gnueabihf_v0.8.80, etc.
Currently, the only way I know how to determine the target platform triple is to install Rust using rustup and then install and run default-target.
For resource constrained systems, Rust cannot be installed and thus I cannot run default-target.
So I would like to determine the
Code rendering of Mandelbrot set doesn't match instructor image, and I can't understand why
25 May 2026 @ 6:14 pm
This post is a direct continuation of this post from a few days ago.
I'll quickly explain the premise:
We're using DOSBox with the 8086 package and MASM, and we have a small exercise in assembly language. We were supposed to print to the screen (of the DOSBox) an approximation of the Mandelbrot set with the following instructions:
We're not allowed to use the stack, using fixed point with scale=64, each cell in the screen (25 rows x 80 columns) is given the complex point c = c_x + i * c_y such that c_x = -144 + col * 3 where 0 <= col <= 79, and c_y = -72 + row * 6 where 0 <= row <= 24.
For each cell in the screen, we recursively calculate
z_{n+1} = z_{n} ^ 2 + c
which can be simplified to:
x_new =
How do I host a website on Kubernetes with a custom domain name and SSL?
25 May 2026 @ 5:59 pm
How do I host a website on Kubernetes with a custom domain name and SSL certificate for secure HTTPS access, including the complete process of deploying the application, configuring services and ingress controllers, setting up DNS records, and automating SSL using tools like cert-manager, for a production-ready deployment?
AWS Lambda / LibreOffice threads and processes issue
25 May 2026 @ 4:15 pm
I have an issue with an AWS Lambda function running as a Docker image (public.ecr.aws/lambda/nodejs:16-x86_64) that includes LibreOffice installed inside the container.
The function converts .DOCX files to .PDF and uploads them to a S3 bucket. It works correctly at first, but after many warm invocations (around 200), the number of processes and threads starts to increase steadily. It seems to grow by about 6 with almost every invocation.
Eventually, it reaches the Lambda limit of 1024 processes/threads, and the function fails with the following error:
Error: Command failed: libreoffice7.2 -env:UserInstallation=file:///tmp/lo-profile-... --headless --convert-to pdf --outdir /tmp/ /tmp/test1.docx
/usr/bin/libreoffice7.2: fork: retry: Resource temporarily unavailable
/usr/bin/libreoffice7.2: fork: retry: No child processes
javaldx: Could not find a Java Runtime Environment!
Warning: failed
Architecture to retry as root on Linux in C
25 May 2026 @ 2:21 pm
I want to load a kernel module on Linux. I am creating a nice userspace wrapper for it which will load the module. I check for the CAP_SYS_MODULE capability. If set, load the kernel module. If not and if the user is already a root, then fail, else try to gain root access (and indirectly check for the capability again as our program is run again).
I thought requesting to elevate privileges would be just straightforward. You call an API, and it gives you success or fail, and your privileges are elevated seamlessly at runtime. That does not exist, and the only way to elevate privileges is to re-run the same program as root. I could just ask the user to do it, but I am trying to create a seamless UX where the user is just prompted to enter the password and not to run pkexec or sudo by themselves.
This is harder because our parent has to do all the error handling. I want it to ultimately verify if the child (trying as root) successfully launched and with root privileges or