22,711 questions
-2
votes
1
answer
62
views
ESM & CommonJS Dual Support in an Existing Node.js Project [duplicate]
I'm updating a Node.js project to support both CommonJS and ES Modules (Dual Package).
My current issue appears when trying to load the module from the project root using exports field instead of main....
3
votes
1
answer
116
views
When is the definition of an exported function available to an importing TU?
Consider the following translation unit:
export module Example;
export inline void fn1();
export void fn2();
export void fn3();
void fn1() {}
void fn2() {}
module :private;
void fn3() {}
Firstly, ...
1
vote
0
answers
93
views
Run JavaScript in Python wrapper: problem by module calling [closed]
I try to execute the follow code fragment (actually the calling of JavaScript module inside of the python code):
from py_mini_racer import MiniRacer
ctx = MiniRacer()
ctx.eval("""
...
1
vote
2
answers
126
views
pytorch Module B=A, A.to('cpu'), but the tensor in B is still in GPU, why?
After converting module A to CPU, the origin parameter tensor still stays on the GPU? When it is released? Is it wrong if I reuse the parameter?
My code:
import torch.nn as nn
class A(nn.Module):
...
-2
votes
2
answers
80
views
Change in module behavior for clang in GitHub
I've inherited a GitHub job I don't understand well and that has stopped compiling.
It creates a .a library for iOS.
The source consists of a set of modules, each declared thus:
export module x;
...
0
votes
2
answers
72
views
python: vscode doesnt highlight direct import from module
When I attempt to import a module from a local package (from core import config), VSCode's syntax highlighting isn't working. When hovering over config, it shows "config: Any" (the editor ...
1
vote
1
answer
46
views
Trying to build Python extension (module) with Dlang and pyd with dub + ldc2
I am trying to build a Python extension (module) with D and the pyd (https://github.com/ariovistus/pyd) and dub and ldc2 compiler on Windows.
I have the following dub.sdl:
name "hello"
...
0
votes
0
answers
87
views
Why does Visual Studio mention the symbol loading to be disabled by Include/Exclude setting? [duplicate]
I'm debugging a C++ program, and in order to do that, I'd like to have a look at objects, defined in imported libraries. However, the "Modules" window mentions some symbols not to be loaded ...
1
vote
1
answer
124
views
How do I convert a JavaFX application into an executable .jar file with all dependencies included?
I’ve built a modular JavaFX application using JDK 21 and JavaFX SDK 21.0.1. The project runs perfectly inside my IDE (IntelliJ IDEA), but when I try to export it as a .jar file and run it outside the ...
1
vote
1
answer
75
views
Ray: Resource request cannot be scheduled — using offline data and enabled the RL module
I tried training a BC algorithm using offline data and enabled the RL module in the algorithm configuration. I ran the code on Google Colab, which only provides 2 CPUs, and encountered the following ...
7
votes
1
answer
101
views
Detect leaking of private types which are only public in their module
Suppose I have a Rust crate mycrate with lib.rs:
mod internal {
pub struct X();
pub fn x() -> X {
X()
}
}
pub use internal::x;
This works fine on Rust 2024 and any consumer ...
0
votes
0
answers
29
views
Wordpress assets loading. Uncaught TypeError: Failed to resolve module specifier
I hope you can help me with one, it's drivinig me crazy :(
I recently splitted a giant file called admin.js into many modules, using these two WordPress functions:
wp_register_script_module
...
3
votes
1
answer
136
views
pycharm seems to load some modules BEFORE my own code
In a blank new PyCharm Project I create a file "runner.py" with following code:
import random
print(random.random())
Next to this file I create a file "random.py" which stays ...
1
vote
0
answers
119
views
How to make #[cfg(test)] gated code in one module, visible to #[cfg(test)] code in another module in Rust?
I have some code I am working on that has a certain struct object Permissions:-
// Stores permissions with a bit flag
/// 1 << ? - Vote - Anyone with a weight > 0 can vote.
/// 1 << ? -...
0
votes
1
answer
110
views
Why does Streamlit throw "ImportError: cannot import name 'get_all_transactions_by_user' from 'db'" even though the function exists?
I’m building a personal finance management app in Streamlit with multiple pages (dashboard.py, transactions.py, budget.py, export.py). I have a db.py file that contains all database functions, ...