StackOverflow.com

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

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

how to make assistant technologies announce changes of a switch button acting as an expandable too

27 June 2025 @ 12:03 am

I have an element acting both like a switch and a header of an accordion at the same time: <button role="switch" aria-checked="true" aria-expanded="true" aria-controls="widget1" > Switch button label </button> <div id="widget1" role="group"> stuff </div> when switching on->off or the other way round, assistant technologies like voice over aren't performing really well, dropping the whole change announcement. I'm wondering if this this use is legit and what's the best practice on this. Axe tool does not complain about this, but it's not performing well on the battlefield.

CSS How all elements with inline-block be overflow scroll after it exceeds width

27 June 2025 @ 12:01 am

The last Element with inline-block will be show in the bottom after it exceed width How can i make all elements will be in same row but has overflow scroll if it exceeds the width of the box? Here's my code .button {border: none;padding: 12px;text-align: center;text-decoration: none;display: inline-block;margin: 8px;cursor: pointer} .box{border-bottom: 8px solid silver;overflow: auto;max-width: 700px}

In node.js and npm, how can I prevent environment configs being passed on to required files?

27 June 2025 @ 12:01 am

I have a series of JS files in my node application that both perform a function (in this case Cypress tests) and export an object that can be used in other JS files. I want to send an environment config variable when I run each file, eg npm run main-tests --test=home-banner The idea is that I can run a whole suite of tests by running npm run main-tests or just one test that belongs to that suite by running npm run main-tests --test=test-name. In my main-tests.js file I have something like: //main-tests.js const homePageTests = require('./homePage/homePageTests.js'); const prodPageTest = require('./prodPages/prodPageTest.js'); const files = {...homePageTests.files, ...prodPageTest.files}; // <-all .spec.js file paths from subtests let specs = Object.values(files); if (process.env.npm_config_test) { const testSpec = files[process.env.npm_config_test]; if (testSpec) { specs = testSpec;

How to correctly call on the meta tag condition on package.json to run selected tests

26 June 2025 @ 11:58 pm

I'm using a meta tab for my fixture but when I call on the command from package.json, it runs all the fixtures and not that specific fixture. How do I correctly set the meta tag condition in package.json? It's for when I run "ci:release:xxx" "ci:xxx": "start-server-and-test start-server http://localhost:xxx/mgmt/health 'SUITE=XXX/XXX TESTS=tests/xxx*.test.ts CONCURRENCY=1 node test-runner.js'", "ci:release:xxx": "yarn run ci:xxx --meta release-test=true", fixture`Test Fixture` .meta('release-test', 'true')

Vertex AI TEI Deployment Fails for Private Hugging Face Model - "Could not download model artifacts"

26 June 2025 @ 11:56 pm

I'm trying to deploy a Hugging Face model to Vertex AI using the Text Embeddings Inference (TEI) workflow, but I'm getting consistent errors during deployment. This same deployment approach worked for me 3 days ago with a different model, so I suspect something changed on the backend or I'm missing a new requirement. Setup Details: Notebook Used: https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/model_garden/model_garden_huggingface_tei_deployment.ipynb GCP Docs Reference: https://cloud.google.com/vertex-ai/generative-ai/docs/open-models/use-hugging-face-models#what_are_your_options

Cannot mute microphone on Twilio call

26 June 2025 @ 11:53 pm

I'm implementing a screen to make calls from the Twilio service: At the moment, calls connect and I can hang up. The problem is that I can't mute the microphone or the call (the button does nothing), and the "Status (Estado)" text only updates from "Disconnected (Desconectado)" to "On Call (En llamada.)". Here's the front-end code: <?php include 'php/conexion.php'; /**Validacion de Session**/ session_start(); if(!isset($_SESSION['user']['ID_Usuario'])){ header("Location: ../"); } ?> <!DOCTYPE html> <html lang="en"> <head> <?php include_once 'include/head.php';?> <!--<script src="js/funciones.js"></script>--> <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script src="js/toast.js"></script> <script src="https://cdn.jsdelivr.net/npm/chart.js@4.

Remove Jpanel from jframe

26 June 2025 @ 11:49 pm

I'm working on a basic Hidden object game for fun. Im not a professional coder by any means. At the main menu of the game (where you select start game, exit, resume, or how to play) I have 4 Jbuttons The button we are looking at is the how to play button. It makes a JPanel which displays a picture and some text (Explaining how to play the game etc) Now when you are done viewing that and you want to go back to the main menu to lets say start the game. The picture and text goes away but the custom cursors I was using for the buttons (You know when you hover the button the mouse cursor changes to my custom icons) stops working and its just the default arrow pointing thing. I've ruled out 2 possible problems, #1 is that the JPanel isn't being removed properly or #2 The cursors are not being set up properly after the JPanel is removed. Here is the code I use to remove the JPanel: JButton nextPage = new JButton("Next Page"); HP.add(nextPage);

How to build an auto email responder based on historical replies, using T5/BART/ GPT+RAG?

26 June 2025 @ 11:39 pm

Our team needs to build an auto customer responder based on historical email responses. Given a new customer email, the model will output a response that mimic the historical response. The problem is, what's the best way to build the model? Is it using T5/BART/ or GPT+RAG? Our historical emails are only ~2 thousands. Since they are customer support emails, the responses include many urls to the doc and screenshot.

Throwing an IDE error from validating an object

26 June 2025 @ 11:37 pm

I was working on a project recently, where I have come across a task to build a custom radio input component in React. My idea was that the options for those radios would be assigned as an object and then mapped in the following way: type OptionLiteral = { label: string; value: string; selected?: true; }; const options = [ { label: "A", value: "a", selected: true }, { label: "B", value: "b" }, { label: "C", value: "c" }, ]; I thought it would be smart to also implement a check for the amount of options set as 'selected' that would throw an error directly into their IDE (with a red wavy line, and so on), because in a radio component there is only one selectable option. This is meant to help future developers deal with issues that may arise from implementing this radio input component on their pages. To do this, I have built a dummy type

How to Represent a Chessboard with 64-bit Numbers in C? [closed]

26 June 2025 @ 11:34 pm

White pawns How do I convert the bitboard of the white pawns' arrangement into C code? I want to learn how to convert images into C . I want to learn and lay the foundation by making a bitboard. How to write the 64-bit number in c code this picture? how to use FirstBit and LastBit in 64 bit number and how to write this in c?