Skip to main content
Filter by
Sorted by
Tagged with
5 votes
0 answers
227 views

I am writing an embedded OS to run on Risc-V. As part of that, I'm implementing a FIFO for UART buffering using the classic single consumer/single producer module. The class looks like this: template &...
Shachar Shemesh's user avatar
0 votes
0 answers
79 views

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 ...
Aliaksei's user avatar
  • 1,449
1 vote
1 answer
637 views

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/...
Marlon Berdefy's user avatar
1 vote
0 answers
25 views

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 ...
GuidoP's user avatar
  • 11
0 votes
0 answers
51 views

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 ...
user6631314's user avatar
  • 2,050
1 vote
1 answer
160 views

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 ...
niemc's user avatar
  • 112
0 votes
0 answers
34 views

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 ...
mishaj ada's user avatar
-1 votes
1 answer
122 views

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 ...
tpmam's user avatar
  • 52
-1 votes
1 answer
62 views

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+"=...
agyu's user avatar
  • 1
0 votes
0 answers
43 views

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 ...
UncleJoe's user avatar
4 votes
1 answer
216 views

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__ ...
Hari's user avatar
  • 1,985
1 vote
1 answer
90 views

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 ...
bob.sacamento's user avatar
1 vote
1 answer
36 views

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 ...
SapereAude's user avatar
0 votes
0 answers
61 views

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: ...
Priyadharshini N's user avatar
-6 votes
2 answers
103 views

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,...
Bob Burley's user avatar
0 votes
0 answers
52 views

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 ...
SapereAude's user avatar
0 votes
0 answers
60 views

My question is related to In the ARM ABI, how are global variables accessed? but is somewhat different. I'm trying to debug an issue and for that I went looking in the build outputs of my project. I ...
Yair M's user avatar
  • 499
1 vote
4 answers
149 views

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 ...
Abdulrahman Ismael's user avatar
0 votes
0 answers
44 views

I am converting a script module to a manifest module. In the script module I do the below at the end # # Whole module Verbose output # # We will output verbose "Continue" # We will NOT ...
deetle's user avatar
  • 437
0 votes
2 answers
100 views

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 ...
Michael K Madison's user avatar
2 votes
1 answer
177 views

This is one question encountered while reading the answer of this QA (as ikegami's comment says, how subroutine foo works is complicated. IMHO that may be due to using one outside variable): sub foo { ...
An5Drama's user avatar
  • 774
-4 votes
1 answer
165 views

I have been trying to understand two code blocks. The first code block: string status = "Healthy"; Console.WriteLine($"Start: {status}"); SetHealth(status, false); Console....
bibashmanjusubedi's user avatar
-1 votes
1 answer
119 views

In my code, I have a combobox on a userform. The user selects an option from the drop down and the userform sets the selected value to a global variable "monthYearEntered". Then i have a sub ...
SamB's user avatar
  • 37
0 votes
1 answer
330 views

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 ...
zkanoca's user avatar
  • 10k
3 votes
2 answers
92 views

I have an interest in cryptography and have decided to try and write an AES library. However it has been a long time since I have programmed cpp and I'm a bit rusty. I have this code in my AES.cpp ...
MsFormula's user avatar
  • 175
0 votes
0 answers
53 views

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 ...
Angela Hill's user avatar
1 vote
1 answer
64 views

How to defer the name variable in our Bash script so that it expands correctly within quotes in the loop, in such e.g: name='*' curate() { local e= for e in $(export HOME='/home/me'; echo /home/me/...
user17227456's user avatar
  • 1,331
-1 votes
1 answer
332 views

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 ...
Ravshan S.K.'s user avatar
-1 votes
1 answer
66 views

I am trying to instantiate a class using a constantly updating global variable as an argument. But what is happening is the class (which runs in its own thread) won't recognise the global variable ...
Nita Suos's user avatar
-1 votes
3 answers
106 views

HTML File(firstHTML.html) <!DOCTYPE html> <html> <body> <h2>My First Web Page</h2> <p id="demo">First Paragraph</p> <p id="demo2">...
Yahya Hassan's user avatar
-1 votes
1 answer
104 views

How do you create a global variable that is a HashMap and is populated with data directly? The code below has a local variable 'e' that works as intended. However, I am struggling to make it a global ...
Fred's user avatar
  • 579
1 vote
4 answers
94 views

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 ...
user1806687's user avatar
1 vote
1 answer
55 views

I'm writing a function to check if a table on the page is empty and insert rows with or without a header as appropriate. The code on the page itself is: <div id='uncoveredServices' style='display:...
Chris C's user avatar
  • 13
0 votes
1 answer
33 views

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&...
PAMPA ROY's user avatar
1 vote
1 answer
77 views

I have the following code and the objective is to make use of the colour variable as a binary flag in the code. main.cpp #include "turn.h" #include <stdio.h> void subfunc(Turns t) { ...
Marcus's user avatar
  • 353
4 votes
2 answers
275 views

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 ...
MyNameIsTrez's user avatar
1 vote
2 answers
62 views

count = 0 def merge(L1,L2): m = len(L1) n = len(L2) i = 0 j = 0 c = [] k = 0 while i<m and j<n: if L1[i]<=L2[j]: c.append(L1[i]) ...
Ravi Teja Avasarala's user avatar
1 vote
1 answer
122 views

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 ...
user77777777's user avatar
0 votes
0 answers
70 views

I want to pass values of variable with the same name (say "bindings") between procedures, but have problems with it. For example, I have several procedures like the one below, they all have ...
QianruZhou's user avatar
2 votes
1 answer
163 views

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 ...
user27912404's user avatar
2 votes
2 answers
102 views

My project consists in: Using a 4 digit 7-segment display to show certain numbers, representing the amount of cash stored in a moneybox. I am using both .c and .S files. To rotate between the 4 digits ...
lachoprime's user avatar
0 votes
0 answers
25 views

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 ...
iamthebull's user avatar
0 votes
1 answer
67 views

Of course there should be no global variables - vars should be passed with function calls. My actual implementation needs lots of variables which are used in different "xxx.py" modules. So I ...
peets's user avatar
  • 441
-4 votes
1 answer
101 views

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" ...
Larrea's user avatar
  • 21
0 votes
1 answer
46 views

I am running a regression on var_x versus var_y in a calibration step. In a later step I want to use the outcome of this regression as a variable in my code. For now I am running the regression and ...
Lanox's user avatar
  • 11
1 vote
1 answer
135 views

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 #...
user171780's user avatar
  • 3,245
4 votes
1 answer
115 views

In Python, the global declaration is used inside function definitions to specify that assigning the variable will create/update a global variable, rather than the default local variable. Python also ...
Barmar's user avatar
  • 789k
-2 votes
1 answer
98 views

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 ...
Harsith R's user avatar
0 votes
0 answers
46 views

I have a problem with eslint when building my docker containers, but for some reason when I want to create it it gives me an error in a global variable, which I use in the same component but it only ...
Vicio028's user avatar
0 votes
1 answer
329 views

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 &...
JuanGomez's user avatar

1
2 3 4 5
178