Refers to a space where variables and other items may be accessed from any scope.
Questions tagged [global]
4669 questions
1
vote
1 answer
split electron main process in multiple file : can't use same `global`
I need some explanation about main and renderer processes. I though that I understood, but I'm in doubt now (and I also need help to debug the main process...)
If I understood this :
The main process is all js files that are required by the main js…

Firlfire
- 413
- 1
- 6
- 14
1
vote
2 answers
whlie loop never exiting even though variable updated
I have created a nested class that extends the AsyncTask to extract data from a database.
When the extraction is completed, it sets a global variable ("notificationsExtracted") to true, to say that the process is complete.
In the main calling code,…

Shamusvw
- 35
- 1
- 6
1
vote
2 answers
Use variable through multiple frames in java
I am creating a project that with be using multiple jFrames. There is one important variable I have that every frame needs access to. Is there a way to use this variable through all of the frames?

willkara
- 177
- 3
- 7
- 16
1
vote
0 answers
PageSpeed Insights for Global Scores
We are in the US and using PageSpeed Insights, but really wanting to know how our website performs for our Chinese (and other global customers). We don't have a specific URL to pass in - localization is IP/cookie based. Is there a solution that…

Bill
- 11
- 1
1
vote
1 answer
calling a function which shows sub category list in a select box using observe function is working only first time
I have simple df have main category and its sub items. I made two select boxes to select main category and it automatically shows belonged items at the other select box using 'observe'
But it works only at the first time category selection and…

Jeongwung Jeong
- 17
- 4
1
vote
0 answers
Laravel 6.x - Cannot use session() global helper on public folder
I'm working on a custom login controller that saves some query results on session using the global helper session() and then redirects to a page in the public folder to retrieve the session data, validate and display info.
I can set the variables…

Lucania
- 11
- 2
1
vote
1 answer
Globals and when they need to be declared
In the following code:
>>> import time
>>> cache = {}
>>>
>>> def squared(num):
... if num in cache: return cache[num]
... print ("Calculating...")
... time.sleep(1) # fake a calculation
... result = num * num
... cache[num] =…
user10870615
1
vote
2 answers
Php get value of global var outside function
I have this test function in php:
funtion drop() {
global $test_end;
if(file_exists("test.php")) {
$ddr="ok";
}
$test_end="ready";
}
I know if I call drop() it gives me "ok", as an example.
My question is this: if I define…
1
vote
1 answer
How to redefine a varying variable in a function from outside?
Editted to take into account initial feedback
To do a sensitivity-analsysis on some of the parameters in my model, I want to overwrite and redefine a single variable. This variable can be handpicked by the user. I cannot get the overwriting to…

The Olegrod
- 21
- 2
1
vote
2 answers
How to access class method from another class in flutter?
Hi guys im flutter and dart new-be
i make photoupload function
But I got into trouble while I was making it.
'class pictureBox()' can't recognize 'getImage()' ,,
Its my whole code :
class writeprofile extends StatefulWidget {
@override
…

killer whale
- 397
- 2
- 8
- 15
1
vote
1 answer
Global variables that mix between servers, python discord
I have a game that is basically two commands, test and test2.
test makes you generate a word that you have to guess in test2, and if you miss the word 6 times you lose.
from collections import defaultdict
word = ""
guessesLeft = 6
blanks =…

Lucas Tesch
- 137
- 1
- 10
1
vote
0 answers
Changing a global variable value inside a php namespace
I need to change a global variable inside a namespace in PHP.
I'm currently refactoring some legacy code and a section of the code relies on the use of a global variable, which used to be configured in the code I'm refactoring.
I'm now trying to…

Matheus Patrick
- 11
- 2
1
vote
1 answer
Global array vs local array with global pointer
I have a coding style/code optimisation related question. I need to declare an array which will contain some sensor data. This array needs to be available in two scopes measurement.c and communication.c.
Can you tell me what option in your opinion…

Mateusz Paczyński
- 31
- 2
1
vote
0 answers
Memory increases in threads with global variables and loops in use python
Essentially, I have a GUI based program (Tkinter) and I am using multiple threads to update the values and do other stuff. With this, I have a global variable I want to share between threads, as one will update the changing value (thread1) and the…

user255580
- 49
- 4
1
vote
1 answer
Cypress get global variable from window
Why can't I get the content of a global variable (attached to the window object?) with Cypress?
I've tried many different things and ended up with this, which still doesn't work:
it('blabla', () => {...
var arr = [];
cy.window()
.then((win)…

3x071c
- 955
- 10
- 40