8,879 questions
0
votes
0
answers
75
views
How to save global variable in Spring application
I need to integrate with a third-party system. I need to authenticate there and obtain a sessionId. So, my application will have a URL, login, and password to obtain a sessionId. But to avoid having ...
1
vote
0
answers
25
views
Using SASS partials in a multi-client setup
Since @import will be deprecated in Dart SASS, I've tried to find a solution for the following problem. I want to use the same partials for different clients which have different, colors, fonts, font ...
1
vote
1
answer
158
views
Sharing constants between CPU and GPU in CUDA
I'd like to share some constants between CPU and GPU in order to allow for execution of the same code (wrapped in between) on either. That includes some compile-time parameters which are most ...
-1
votes
1
answer
117
views
I am trying to call a function in thonny and then printing the variable changed by the function. Why isn't it working? [duplicate]
i define the function "player" and inside, assign the variable "health".
def player():
health = 100
player()
print(health)
but when i try to run the program, i recieve this
...
0
votes
0
answers
42
views
About defining spreadsheet object in onOpen script file [duplicate]
I am new to Google Apps Script platform. So I am having difficulty about defining variables in the most suitible place. I have many sheets and script files in a spreadsheet. I am using ss variable ...
1
vote
1
answer
90
views
Python global variable changes depending on how script is run
I have a short example python script that I'm calling glbltest.py:
a = []
def fun():
global a
a = [20,30,40]
print("before ",a)
fun()
print("after ",a)
If I run it from ...
0
votes
0
answers
55
views
Global variables not showing up while debugging with VS code cppdebug extension
My setup:
I am using C/C++ for Visual Studio Code (version 1.25.3) and OpenOCD (0.12.0) and JLink for debugging and am enabling the debugging using launch configs and setup commands.
My configs:
...
0
votes
0
answers
52
views
How do I change a global constant of a loaded module so that other global variables of the loaded module that depend on it reflect the change?
This question may have a simple answer. I have a near-trivial module0.py:
a = 1
b = a + 3
I import this module into a script and redefine module0's global constant a:
import module0 as m0
m0.a = 2
...
1
vote
4
answers
148
views
Why doesn't JavaScript's garbage collector clean up global variables? [closed]
I've been reading an article about memory management in JavaScript, and it says that the global scope objects don't get cleaned from the memory.
If a global variable is not being referenced anywhere ...
0
votes
2
answers
98
views
application helper understanding global
I know there are religious wars fought over part of what I'm about to ask. I'm not here for any of that. I'm just curious why in my rails application helper I cannot have a global level variable ...
-4
votes
1
answer
163
views
Unexpected behavior of Global Scope Variable in C#
I have been trying to understand two code blocks.
The first code block:
string status = "Healthy";
Console.WriteLine($"Start: {status}");
SetHealth(status, false);
Console....
0
votes
1
answer
327
views
Laravel Livewire VOLT, I get undefined variable name error
I am trying to develop a page in which available appointments are listed. So the students will be able to choose one for foreign language talking exercise. Everything is fine. I get
Undefined ...
0
votes
0
answers
51
views
Understanding a Formula using Global Variables PowerApp created from Dataverse
I have a PowerApp that was created using a Dataverse table. many, many years ago. I did not create this app nor the dataverse and its contents. I am trying to decipher what this formula using global ...
-1
votes
1
answer
320
views
What happens to the variables stored in the lifecycle state in FastAPI?
I have a FastAPI app with MongoDB connected via Motor. I open a MongoDB connection at the beginning of an app and close it at the end using lifespan:
from contextlib import asynccontextmanager
from ...
-1
votes
3
answers
104
views
Can I call an anonymous function inside a <scrip> tag linked to an external js file? [duplicate]
HTML File(firstHTML.html)
<!DOCTYPE html>
<html>
<body>
<h2>My First Web Page</h2>
<p id="demo">First Paragraph</p>
<p id="demo2">...
1
vote
4
answers
88
views
Make constant array visible to different source file
Is it possible to make contents of constant array be visible across multiple other source files so that compiler can optimize access to the array.
I have an array const int myTable[10]; and in ...
0
votes
1
answer
29
views
Python - SyntaxError: name 'point_to_managedDB' is assigned to before global declaration
point_to_managedDB = None
def _get_correct_DB_flag():
if ENV == "dev":
global point_to_managedDB
point_to_managedDB = os.environ.get("OIA_POINT_TO_MANAGED_DB_DEV&...
4
votes
2
answers
272
views
How do I call a global C function pointer in NASM without warnings?
Given main.c:
#include <stdio.h>
void (*fn_ptr)(void);
void foo(void);
void bar(void) {
printf("bar\n");
}
int main(void) {
fn_ptr = bar;
foo();
}
and foo.s:
extern ...
1
vote
1
answer
120
views
How to make a shared library's global object survive exit() function?
I have a problem with a shared library's global object getting destroyed before it is used. I do not know all details nor do I have control over an application that uses the library but my assumption ...
2
votes
1
answer
160
views
How to fix NetLogo error “There is already a global variable called [ ]"
I keep getting the error There is already a global variable called “DOTTED-LINE-VISIBLE” but when I change the name it gives me the same error but with the new name. How to fix it? The global variable ...
0
votes
0
answers
25
views
how to implement a global shared resource within the scope of a class [duplicate]
This question is not about the difference between class and instance variables.
I want to design my program in such a way that my main class provides global resources to modules for them to use but ...
-4
votes
1
answer
98
views
How can I assign to a global variable from inside a function? How do I reset a painted-over image with CV2?
I'm working on a small program that open an image and lets the user click on points to draw lines.
import datetime
import cv2
import numpy
clicked = False
path = "files/file1.png"
...
1
vote
1
answer
131
views
Why the value of the global variable does not change when modified within function
I am programming a Raspberry Pi Pico in C. I have this MWE:
#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#include "hardware/uart.h"
#define UART_ID uart0
#...
-2
votes
1
answer
98
views
Declaring Global variable inside of a function in C++ [duplicate]
I have a function inside a class. I want to declare about 10 global variables of different types: vector, queue, int, 2d-vector etc., How do I do this?
Also I just cant declare the variables outside ...
0
votes
1
answer
321
views
FreeRTOS event-task architecture to handle different flags around the code
I'm working on a FreeRTOS project in C/C++ that has about 10 tasks for gpios, displays, wifi, and so on.
These tasks are only triggered by events. For example, the user chooses an option on the menu &...