StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

Angular onChange programmatically triggered does not work

26 April 2026 @ 9:51 am

I have a component with an input and some extra and if I edit the input field and leave it by tabbing or clicking outside my change work however if I call onChange via code then nothing happens. Here comes a dumbed down version. Parent: <mycomponent [(ngModel)]="mydata" (change)="onChange"> Child: <div> <input [(ngModel)]="data" (change)="onInputChange()"> //I edit this input and leave it will call onchange in parent component <button (click)="onClick>Click</button> // If I click this parent onChange will not coll onChange in parent <div> export class mycomponent { @input data; private onChange: (_: any) => void = noop; registerOnChange(fn: any): void { console.log('Register on

Angular application has two files main.ts and index.html

26 April 2026 @ 9:02 am

angular application has two files Main.ts and index.html which one to use.i recently encountered a tutorial called w3schools.com where it contained two files Main.ts and Index.html.can you suggest which file to use.thanks in advance.

Can't execute script in GitLab CI/CD

26 April 2026 @ 8:58 am

Because some scripts are complex, I prefer creating external Bash scripts and then use it in gitlab-ci.yml. I have a little script that lists all compiled scripts and make a release with them. Only, when I try to execute it (with ./release_bin), I get this error: 2026-04-26T08:22:56.104620Z 01O $ ./release_bin 2026-04-26T08:22:56.104946Z 01E /bin/sh: eval: line 180: ./release_bin: not found I also don't understand that: When I run ls ., the file appears correctly: $ ls . LICENSE README.md bin build_all build_only cmd flags go.mod go.sum internal main.go release_bin When I change its attributes (using chmod +x release_bin), there isn't any error. In the other job, all wor

My firefox extension does NOT automatically start when I start my browser, don't know why

26 April 2026 @ 8:50 am

The title basically. I have a extension called NoClanker which blocks out AI websites automatically. It's been a while since I updated it since life got busy. The extension does not automatically start when I start my browser. https://addons.mozilla.org/en-US/firefox/addon/noclanker/ <-link fetch(chrome.runtime.getURL("blocked.txt")) .then(res => res.text()) .then(text => { const blockedSites = text .split(";") .map(s => s.trim().toLowerCase()) .filter(Boolean); chrome.webRequest.onBeforeRequest.addListener( details => { let url; try { url = new URL(details.url); } catch { return; } const host = url.hostname.toLowerCase(); if (blockedSites.some(site => host === site || host.endsWith("

Laravel 11 + Nginx: 403 Request Timeout/Forbidden when using Xinax/laravel-gettext (works with artisan serve)

26 April 2026 @ 8:34 am

The Problem I am running a Laravel 11 project with a Vue.js frontend on Fedora 43. The application runs perfectly when using 'php artisan serve'. However, when switching to a local Nginx + PHP-FPM setup, I encounter a 403 Forbidden error which eventually results in a request timeout. Context Based on my logs, the error appears to be specifically linked to the Xinax/laravel-gettext package functionality. When the application attempts to initialize or fetch translations via gettext, the request hangs or is denied. Environment OS: Fedora 43 Web Server: Nginx PHP Version: 8.x (PHP-FPM) Laravel Version: 11 Relevant Package: xinax/laravel-gettext

How to include h1, h2, and h3 all on a hero image without them stacking?

26 April 2026 @ 7:21 am

I got the text and image to work how I wanted when I defined h1 class="hero-text" but when I want to add h2 and h3 below it (also on top of the hero image) I couldn't get it to work. They either stacked on top of each other or was spaced out a huge amount when I tried to put them in their own divs. How do I fix this? .hero-image{ background-image:linear-gradient(to bottom, transparent, black), url(img-2.png); width: 100%; height: 70vh; background-size: cover; position: relative; border: 1 px solid black; background-attachment: fixed; } .hero-text{ color: white; position: absolute; bottom: 5px; left: 2%; flex-wrap: none; }

What can be considered as a best practice for manipulating values inside a vector in C++

26 April 2026 @ 5:34 am

Suppose I have to manipulate the values inside a vector defined in C++ and the manipulation operation is to obtain the square of each value inside the vector #include<vector> #include<iostream> void printVector(std::vector<int> v){ std::cout << "[ "; for(const auto& value : v) std::cout<<value<<" "; std::cout << "]"; } int main(){ std::vector v{1,2,3,4,5}; std::size_t size_of_vector{v.size()}; printVector(v); for(std::size_t index{0}; index < size_of_vector; ++index){ v[index]=v[index]*v[index]; } printVector(v); } This block of code does the operation. But are there any other efficient methods to do this ?

When will there be, if it even happens, telethon v2?

26 April 2026 @ 3:46 am

I've tried telethon v2 and oh my god – it's nice and feels much fresher than v1. But it seems like the v2 has been losing steam ever since. Why is that? Did the v2 just pretty much get orphaned? Or is there something wrong with it on a deep level?

VS Code theme changed, text colors disappeared

25 April 2026 @ 11:28 pm

After the newest VS Code update, my style automatically changed and many things that were labelled with their own text color aren't any more. I relied on the text colors to identify what something was quickly, so I had to waste minimal time. I looked through all themes to use (through ctrl+k + ctrl+t) and none were like the old one. How to get the old style back?

Vlookup function syntax between two sheets

25 April 2026 @ 9:24 pm

Using lookup function on Google sheet, I always run into an error message after typing the syntax of what I want to do. Can anyone please tell me what is wrong. I have check my settings and everything thing is in order, yet I keep receiving the error message. I am stuck please and need help