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.

uv authentication fails with Azure DevOps Artifacts using environment variables, but works with inline URL token

14 January 2026 @ 5:12 pm

I am migrating a Python project from pip to uv on Windows 11. I need to install packages from a private Azure DevOps Artifacts feed. I am facing a strange issue where authentication works perfectly if I embed the token in the URL via CLI, but fails with 401 Unauthorized when trying to use Environment Variables (which is the recommended secure way). What WORKS (Proof that Token and URL are valid): If I bypass the config and pass the token directly in the command line, it installs correctly: uv add my-package --index-url https://python-internal:[email protected]/my-org/Assets/_packaging/python-internal/pypi/simple/ Result: Success, package installed. What FAILS (The Configuration approach): I want to configure this in pyproject.toml and use environment variables for the credentials. 1. pyproject.toml: [project] name = "my-

If Aryabhata is credited with inventing zero, how were calculations done before zero existed?

14 January 2026 @ 5:01 pm

Aryabhata is often credited with developing and introducing the concept of zero into Indian mathematics. However, long before zero was formally recognized as a number, ancient civilizations such as the Babylonians, Greeks, Egyptians, and Romans were already performing sophisticated mathematical calculations. This raises several important questions: How were mathematical calculations carried out in ancient number systems that did not include a symbol for zero? How did these civilizations represent the idea of “nothing” or an absence of quantity, if at all? Did they rely on positional placeholders rather than a numerical zero, as seen in the Babylonian numeral system? In what ways did the formal introduction of zero transform mathematics compared to the mathematical practices of earlier civilizations? More broadly, I am trying to understand the

How can I find out which API parameters are supported by each of OpenAI's models?

14 January 2026 @ 4:58 pm

How can I find out which API parameters are supported by each of OpenAI's models?** For example, some models support reasoning_effort while others don't, and some support tools like web search or code interpreter while others do not.**

Cannot build and debug because the active file is not a C, or C++ file [closed]

14 January 2026 @ 4:55 pm

I encounter this error where I try to compile any C++ file, but I encounter the program crashing and not compiling, and I am not entirely sure what to fix in tasks.json. This is my tasks.json, and the terminal says the file isn't in C or C++, even though it has the extension of .cpp {"tasks": [ { "type": "cppbuild", "label": "C/C++: gcc.exe build active file", "command": "C:/Strawberry/c/bin/gcc.exe", "args": [ "-fdiagnostics-color=always", "-g", "${file}", "-o", "${fileDirname}\\${fileBasenameNoExtension}.exe" ], "options": { "cwd": "C:/Strawberry/c/bin" }, "problemMatcher": [ "$

Correct dependency for @AutoConfigureMetrics and @AutoConfigureTracing (Spring Boot 4.0.1)

14 January 2026 @ 4:53 pm

I am upgrading my Spring Boot app to Spring Boot 4.0.1. However, I can not figure out the correct dependency to add to my pom.xml for the following annotations in my @SpringBootTest annotated integration test base class: @AutoConfigureMetrics @AutoConfigureTracing I already added the dependencies below, but without result yet: the compiler can't resolve these annotations. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-actuator-autoconfigure</artifactId> <scope>compile</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-test-autoconfigure</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spri

UML diagram problems

14 January 2026 @ 4:51 pm

I am struggling to understand a specific UML Use Case Diagram (version 2.0) problem regarding actors and relationships. The scenario is: A mother cooks dinner together with her daughter. In the course of that, the mother always has to mix the cocktail. I'm debating between the provided options. Specifically, I'm wondering if answer D is correct because: It uses an abstract actor "both" to represent the joint action of cooking dinner. It uses an include relationship for "mix cocktails", but only connects it to the "mother" actor's path (since only she performs this task). Could someone please explain why D is the most appropriate choice compared to others? Is the multiplicity "2" on the association line in option D a standard way to represent "together"? enter

Unwanted cell selection in DataGridView when closing ContexMenuStrip

14 January 2026 @ 4:48 pm

I'm having a problem with an application I'm working on. I've been trying to fix it for a while, but I can't seem to find a solution. The app I'm working on searches the PC and places the results in a DataGridView called Dgv_Trovati. When I right-click on Dgv_Trovati, the CMStrip_Search context menu appears, and then I click on a cell in Dgv_Trovati without selecting any menu item, the menu is hidden. When I then move the mouse, the cells the cursor passes through are selected. To stop this annoying behavior, simply click on any cell in Dgv_Trovati. Why does this happen? And how can I fix it? ---------------------------------------------- I can't reproduce the problem with the minimum code you requested. It seems like the entire project is needed to enable the behavior. However, I worked on it and solved it. I've posted the code below that solved the problem. Maybe it can help someone with the same problem. P

How do i call lists by their ID?

14 January 2026 @ 4:48 pm

i have 3 lists from a dataset, animalId, commonName, and conservationStatus, all the same length. how would i call the commonName variable and the conservationStatus variable by their ID number in my program?

Salesforce CLI access-token fails due to token SF_ACCESS_TOKEN format

14 January 2026 @ 4:27 pm

I set my access token (which I just generated) and set it like this export SF_ACCESS_TOKEN="00D00SOMEID!theAccessToken" cmd: sf org login access-token --instance-url https://<My-Domain>.salesforce.com Which results in the following error: Error (SfError): The access token isn't in the correct format. It should follow this pattern: "<org id>!<accesstoken>". Does anyone know what is missing?

How can I dynamically lazy-load images added to the DOM after page load?

14 January 2026 @ 4:15 pm

I’m dynamically injecting images into the DOM after page load and trying to lazy-load them using IntersectionObserver. This works fine for images that exist on initial page load, but images added later are never observed and therefore never loaded. Here is a simplified version of what I’m doing. HTML <div id="content"></div> JavaScript const observer = new IntersectionObserver((entries, obs) => { entries.forEach(entry => { if (entry.isIntersecting) { const img = entry.target; img.src = img.dataset.src; obs.unobserve(img); } }); }); function addImage() { const img = document.createElement('img'); img.dataset.src = 'https://via.placeholder.com/600x400'; img.alt = 'Test image'; document.getElementById('content').appendChild(img); observer.observe(img); } // Simulate async content load setTi