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.

Unsure about Weapon System Scope

11 January 2026 @ 2:47 am

I am making a small game, will take roughly 3 weeks to make. I am making a weapons system but I'm afraid is far too complicated and the scope is unnecessary for this game. However, it is modular and reusable, but will take me too long too make. Shall I make a more simpler, less advanced and reusable system. Note: The entire game will only have 2 simple weapons.

SVG Adding to Attribute using JS only appends the addition, doesn't add it

11 January 2026 @ 2:47 am

My issue is when I try to change an attribute like this: document.getElementsByTagNameNS('http://www.w3.org/2000/svg', "rect")[0].setAttribute("width", document.getElementsByTagNameNS('http://www.w3.org/2000/svg', "rect")[0].getAttribute("width") + 50); (or simplified) rect.setAttribute("attribute", rect.getAttribute("attribute") + 50); it appends what I want to add onto the excising value so if the width was 100, adding 50 would result in 10050, not the desired 150. What should I do to actually change the attribute, not append to it? Here's the full code if you need to mess around with it <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> &

Taking a server id, and resulting all channel id's in discord using python

11 January 2026 @ 2:43 am

I have some code, its main purpose was to take in a server id, and give me all the channel id's; i want to not have to add a bot to the server, and i have been struggling for like 4 days. Here is my code import requests import json import sys BOT_TOKEN = "not today you aint getting this" API_BASE = "https://discord.com/api/v10" def get_channels(server_id): headers = { 'Authorization': f'Bot {BOT_TOKEN}' } channels_url = f'https://discord.com/api/v10/guilds/{server_id}/channels' response = requests.get(channels_url, headers=headers) print(response.json()) # {'message': '401: Unauthorized', 'code': 0} get_channels(1454583875786506444)

java.lang.NoSuchMethodError: No such DSL method 'withAWS' found among steps

11 January 2026 @ 2:40 am

I want to create a Jenkins job which cleans all images from a list of defined repositories. I tried this: pipeline { agent any environment { AWS_DEFAULT_REGION = 'us-east-1' REPOS = '123456.dkr.ecr.us-east-1.amazonaws.com/service1' } stages { stage('Delete All ECR Images') { steps { withAWS(credentials: 'aws_credentials', region: 'us-east-1') { sh ''' set -e for REPO in $REPOS; do echo "Processing repository: $REPO" IMAGE_IDS=$(aws ecr list-images \ --repository-name "$REPO" \ --query 'imageIds[*]' \ --output json) if [ "$IMAGE_IDS" = "[]" ]; then echo "No images found in $

AWS Identity Center (SSO) 403 "No access" on SAML Assertion for Amazon OpenSearch Dashboards

11 January 2026 @ 2:10 am

Note: The question was generated by LLM, I double-checked it to make sure its good. I am unable to get SAML SSO working between AWS IAM Identity Center (IdC) and an Amazon OpenSearch Service domain (Dashboards). Despite aligning the Entity IDs and ACS URLs, I am getting a persistent 403 "No access" error from the AWS SSO portal immediately after logging in. Environment Details: Region: eu-west-3 OpenSearch Domain: company-it-logs (Public endpoint) Dashboards URL: https://search-company-it-logs-xxx.eu-west-3.es.amazonaws.com/_dashboards OpenSearch Version: 3.3 Current Configuration:

Operation is not allowed - firebase phone verification code

11 January 2026 @ 1:35 am

I'm trying to build a phone number OTP verification system using Firebase and Android studio java. I've set up the things in firebase, the SHA-1 and SHA-256, and the phone sign in method is Enabled. the error message is: This operation is not allowed. This may be due to the given sign-in provider being disabled of this Firebase project. I've tried talking to AI but with no luck. Here's the full code of the Java activity, note that the signIn() method is not finished yet: package com.example.mechat; import android.annotation.SuppressLint; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import androidx.activity.EdgeToEdge; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity;

How to delete a Git repository from C#? [duplicate]

10 January 2026 @ 8:55 pm

I have a simple Git repository: git init test cd test echo > file git add file git commit -m "test" I can't delete that Git repository from C# code. I tried a simple recursive delete: Directory.Delete(@"X:\test\.git", true); Where X: is the drive I ran above commands on. The error is: UnauthorizedAccessException: Access to the path '<some GUID of Git>' is denied. However, I can easily delete the .git folder from Windows Explorer (with or without recycle bin), so obviously I have enough permissions. The security tab says that I am the owner. When I check effective access for the .git folder with my user, I get a green checkmark on every item.

Why this code doesn't generate circles but instead does this?

10 January 2026 @ 8:35 pm

I was playing with this library, to try draw some 2d renders, and I decided to try to render the cosine of the distance, as a color. What I expected from this, was some concentric circles, with the color oscillating once, but this does not do that. Shouldn't the distance on the dots on the same circle be the same? What am I missing? Here is the code, and the file generated from it: #include <math.h> #include <stdint.h> #define STB_IMAGE_WRITE_IMPLEMENTATION #include "stb_image_write.h" #define PIXEL_ROWS 400 #define PIXEL_COLS 640 uint32_t pixels[PIXEL_ROWS * PIXEL_COLS]; void render(uint32_t *data, int rows, int cols) { // Calculate middle row and column double midr = (double)rows/2, midc = (double)cols/2; // Calculate the maximum distance avaliable (from the first pixel, (0, 0)) double maxdistance = sqrt(midr * midr + midc * midc); for(int i = 0; i < rows; i+

SumIfs Spill Dynamic 3 Criteria. Issue SPILL 1st Criteria & 2nd Criteria refer to same SORT UNIQUE FILTER spill of 2 Columns

10 January 2026 @ 7:46 pm

UPDATE SOLUTION WAS THIS with extra SPILL & INDEX to it: SNAPSHOT 3D SUMIFS of SAME SPILL MULTIPLE COLUMNS FILE LINK, 3RD TAB: Perhaps someone can suggest a solution. I am trying to use SUMIFS with spill ranges and three criteria, where all criteria are dynamic spill references or named ranges. Issue in Excel 2021 The problem occurs when SUMIFS refers to the same spill range, but the first criteria uses column 1 and the second criteria uses column 2. Spill references N2# and O2# behave unexpectedly. N2# refers to the full spill range, but

what's going on with this circuit can someone tell me about this circuit [closed]

10 January 2026 @ 3:54 pm

I've made this circuit for jk flipflop's clock circuit this works well but I didn't get it how its working The led turns on for half of a second and turns off Can please someone describe me what's going on enter image description here This is the circuit I've made in both real life and in kicad