2,525,720 questions
-3
votes
0
answers
12
views
Looking for Ideas [closed]
This is my first time using Stack Overflow. I am looking for revolutionary and impactful ideas. I need something that would attract people in large just like people can't live without instagram, ...
Best practices
0
votes
0
replies
3
views
How should I check if Huggingface model is already cached and ready to use?
I've built an app that use embedding model from Huggingface under the hood. It uses "@huggingface/transformers" package, version "^3.8.1".
The way I use it is that I call:
this....
Best practices
0
votes
0
replies
5
views
Can we meaningfully use `await` on the FuncUnit object
The FuncUnit object has a then method, so that the function you pass to it is only executed after all previous FuncUnit actions have completed. For example, the following snippet should guarantee that ...
0
votes
1
answer
33
views
CSS selectors with querySelector: Select only top level element(s) in shadow DOM
Assuming the following HTML content
<template>
<div>
an amount of unknown content
may contain: <div TAG>undesired node</div>
</div>
At the ...
Best practices
2
votes
0
replies
18
views
What would be the best way to manage separate processes in JavaScript
My project task is to query devices. I use JS and Bun as my API.
Example. On the site user add a device, lets's say over MQTT. He enters MQTT connection parameters and save device. I store in in DB. ...
-4
votes
0
answers
20
views
React state update not reflected immediately inside useEffect [duplicate]
I’m working on a React functional component where I fetch data from an API and then derive some state from that data. However, I’m seeing unexpected behavior where the derived state is always one step ...
0
votes
1
answer
37
views
Time complexity analysis for a leetcode question
While solving a question in LeetCode (Longest common prefix), I used the startsWith and slice operation of JavaScript both of which are o(N) operations. But LeetCode claims the solution I submitted is ...
-1
votes
0
answers
21
views
Rendering D3.js in 4k resolution crashes the Electron Vite desktop application
I have multiple adaptive spectrograms that renders in different sizes with D3 xScale and yScale set to state variables/numbers which changes when I detect a different screen size. Every time I change ...
0
votes
2
answers
53
views
How can I make a recursive function return an array of a given number set to zero?
I've been working on a JavaScript exercise involving recursion and I've run into a problem.
How can I make this code, according to the described exercise, work by returning the array of numbers or up ...
-5
votes
1
answer
74
views
Is there a better way to get the path name of a URI without any resource ids? [closed]
Most other questions I have found about this topic entail having GET parameters à la base-url.com/route?param=value. However, my application uses routes similar to
base-url.com/resources/1
base-url....
-1
votes
0
answers
34
views
Node.js async/await not waiting inside loop when calling database queries [duplicate]
I’m working on a Node.js + Express API and running into an issue with async/await not behaving the way I expect inside a loop.
I have a route that fetches a list of users and then, for each user, ...
2
votes
1
answer
41
views
Pixi.js project has two canvases on reload
I'm working on a geometry dash clone with pixi.js and Vite. Everything is working smoothly, except for one development issue. When I run npm run dev, the game starts up correctly. However, when I ...
-4
votes
0
answers
59
views
How to omit "prod" dependencies from package.json using bun? [closed]
I am setting up a DevContainer and want to install only devDependencies.
With npm, I would typically achieve this using:
npm install --omit=prod
However, I am switching to BunJS and looking for the ...
0
votes
0
answers
54
views
Embedded drawio does not export XML with icon metadata
I have embedded a Drawio editor inside my webpage.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, ...
-3
votes
0
answers
74
views
How to disable Windows 11 keyboard palm rejection using JavaScript [closed]
I'm building an FPS game in Three.js.
An annoying thing I noticed is that when you try to walk by holding down the W key, and look around at the same time using a touchpad, the cursor gets stuck and ...