8,879 questions
0 votes
0 answers
79 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
1 answer
616 views
Codex with API key on Macbook not working
I had codex originally authenticate via openAI web. Since i hit my limit i would now want to upgrade to the "pay per use" via api key. After following all the steps on https://github.com/...
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 ...
0 votes
0 answers
51 views
Escaping strings using mysqli without passing a connection parameter in PHP to function [duplicate]
I am updating some legacy PHP code that makes use of mysql_escape_string to escape strings. The web host has not included the PDO module in their latest upgrade (I have spent hours in pointless chat ...
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 ...
0 votes
0 answers
34 views
How to define a global helper (e.g. getUserFromToken like console.log()) for all Next.js API routes without importing it in every file?
I'm building a Next.js app and I have a helper function called getUserFromToken(token) which extracts and verifies user info from a JWT. I'd like to use this helper in all my API routes without ...
-1 votes
1 answer
119 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 ...
-1 votes
1 answer
62 views
Why is global not incrementing in functions (Python)?
This code does not work properly: def anyFunction(var): for i in range(3): try: exec(var+"+=1") except NameError: exec("global "+var+"\n"+var+"=...
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 ...
4 votes
1 answer
216 views
How are constexpr device variables accessible from host?
My colleague came across this situation where global __device__ constexpr variables are accessible from both the host and the device. #include <array> #include <cstdio> __device__ ...
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 ...
1 vote
1 answer
33 views
Does file_obj.close() nicely close file objects in other modules that have been set equal to file_obj?
I have a file main_file.py that creates a global variable file_obj by opening a text file and imports a module imported_module.py which has functions that write to this file and therefore also has a ...
0 votes
0 answers
58 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: ...
-6 votes
2 answers
103 views
Looking for ideas on efficient ways to transfer random variables between functions [closed]
I have been experimenting with code structures and in this case I am not sure that I can figure out a better way to make the second example more efficient. This code works: A_list = [ # item,...
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 ...