Questions tagged [global]
Refers to a space where variables and other items may be accessed from any scope.
global
4,722
questions
0
votes
1
answer
17
views
Thymeleaf enums refactoring issues
I encountered difficulties while refactoring a template. I have many references to a limited number of enum values in one template. (in a code snippet i indicated only a short part for clarity)
<...
0
votes
0
answers
22
views
MKDocs - Global Variables Possible Within Page?
Regarding MKDocs, is it possible to set a global macro or variable from within a page? My intent is to have a start page with a drop down menu. The global variables would be set based on the user's ...
-1
votes
1
answer
34
views
difference between local and global dependencies in angular
What is the difference between downloading local and global dependencies? For example, if I run "npm i bootstrap" in the project folder, will I download it from the location?, and if I want ...
-1
votes
1
answer
90
views
Global file pointer in C
I'm having a problem with a global file pointer in C with Visual Studio 2022 in a solution involving a large number of files that are compiled and linked using the "Build" command.
Based on ...
1
vote
1
answer
47
views
Caching previous values in solve_ivp
I want to use the temperature at the previous timestep when evaluating the next timestep. I don't want to use global, because I think it slows down the code and it is not very clean.
I use scipy....
0
votes
0
answers
35
views
How to get position of a rectangle which I draw using Custom Paint in flutter
I am creating a waste management app where user can take image then this Image is shown in a screen where user can draw rectangles around trash. I am using Stack with Custom Paints for doing this. But ...
1
vote
1
answer
38
views
using eval() inside function with input of function as part of string
I have this code:
def system(into):
global sys
x = into
sis = [eval(i) for i in sys]
return sis
if __name__ == "__main__":
sys = ['x[0]+x[1]','2*x[0]-3*x[1]']
I would ...
-2
votes
2
answers
69
views
Shell script for finding global variables
How would one write a shell script that finds all the global variables in a given C program?
I don't need a long line like
global_vars=$(grep -E '^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*[[:space:]]+[a-zA-...
1
vote
1
answer
36
views
global variables get different values (web / terminal)
While learning php I came across the following problem.
I don’t understand why I get different values on my local site and in the terminal when I run the following code:
function scopeTest(): int
{...
0
votes
2
answers
40
views
How to solve this global is not defined problem?
This is the error image
I'm working on a project and suddenly caught this error , I don't know where the error came from and it didn't have any information, please help me
<script>
var ...
4
votes
2
answers
75
views
Python global variables in recursion get different result
I have this code, which prints 1:
s = 0
def dfs(n):
global s
if n > 10:
return 0
s += dfs(n + 1)
return n
dfs(0)
print(s)
If I modify dfs like this:
def dfs(n):
...
0
votes
1
answer
49
views
Why do different delivery methods have different results when applying PHP's global keyword?
PHP implements the static and global modifier for variables in terms of references. For example, a true global variable imported inside a function scope with the global statement actually creates a ...
1
vote
0
answers
34
views
Changing PHP code which uses PHPs $_REQUEST super global
New to php and have read up on $_REQUEST being strongly discouraged, due to the fact that it makes it nearly impossible to determine the source of the data, and also being a security risk as well.
Not ...
0
votes
1
answer
60
views
Global event monitoring with WPF
I would like to ask for help in this matter: in WPF, I would like to monitor the keydown, mousedown and mousewheel events even if the window is not currently active.I use c# with WPF. I tried many ...
-4
votes
1
answer
98
views
What functions can access a global variable that appears in the same file with them?
I asked ChatGPT and Google Bard a C++ question that "What functions can access a global variable that appears in the same file with them?"
They answered that "Any function within the ...