global-variables Questions

3

Solved

I want to set some variables by getting the values from a pom.xml file. These variables need to be global because they will be used in multiple stages and jobs. According to the gitlab-ci document...
Ineducable asked 13/3, 2020 at 14:20

8

I know that in general, global-variables are to be avoided. Nevertheless, I think in a practical sense, it is sometimes desirable (in situations where the variable is integral to the program) to us...
Tiffany asked 26/10, 2013 at 9:39

7

I do already have SCSS variables defined in src/styles/settings/_variables.scss and I am importing them into src/styles.scss, but still these variables aren't available for every single component. ...
Wot asked 12/3, 2019 at 22:7

1

Solved

I am having a class to send notifications. When being initialised, it involves making a connection to a notification server, which is time-consuming. I use a background task in FastAPI to send noti...
Dunnage asked 24/5, 2023 at 10:20

6

Solved

Working on an idea for a simple HTMLElement wrapper I stumbled upon the following for Internet Explorer and Chrome: For a given HTMLElement with an id in the DOM tree, it is possible to retrieve th...
Annabell asked 8/8, 2010 at 12:24

21

Solved

I have a function that creates an array and I want to return the array to the caller: create_array() { local my_list=("a", "b", "c") echo "${my_list[@]}" } my_algorithm() { local result=$(crea...
Avila asked 14/5, 2012 at 11:49

16

I'm trying to pass a variable into an include file. My host changed PHP version and now whatever solution I try doesn't work. I think I've tried every option I could find. I'm sure it's the simple...
Katheryn asked 10/8, 2012 at 15:50

8

Solved

I just want to use a $variable at several places: not only views and controllers, but also in the routes.php and other configuration files. I don't want things like: use the Config class to load c...
Renettarenew asked 9/6, 2013 at 19:36

7

Solved

I want to declare a global property in a config file and use it in other files. for example declare mainbg in: Style.qml: property color mainbg: 'red' and use it in other QML files (like view.q...
Cori asked 6/3, 2013 at 21:0

10

Solved

What is the reason of having globals() function in Python? It only returns dictionary of global variables, which are already global, so they can be used anywhere... I'm asking only out of curiosity...
Bayard asked 2/10, 2012 at 15:39

9

I am trying to use globalThis in TypeScript and I would like some suggestions on how to write it in a better way. Current implementation is like this: Create a file types/global.d.ts and add inside...
Mistrust asked 23/12, 2019 at 17:43

6

Solved

I am using postgresql 9.4 and while writing functions I want to use self-defined error_codes (int). However I may want to change the exact numeric values later. For instance -1 means USER_NOT_FOUND...
Kellikellia asked 9/7, 2015 at 11:25

9

Solved

I keep seeing warnings not to use global variables in JavaScript, but it seems that the only reason people say that is because the clogs up the global namespace. I can imagine this being easily fix...
Frum asked 9/5, 2012 at 23:31

10

Solved

I'm using static initialisation to ease the process of registering some classes with a factory in C++. Unfortunately, I think the compiler is optimising out the 'unused' objects which are meant to ...
Busman asked 4/8, 2009 at 19:26

1

Solved

I try to do a simple uni-directional communication between a CPU and a K80 GPU using CUDA. I want to have a bool cancel flag that resides in global memory and is polled by all running GPU/kernel th...
Penetrance asked 8/2, 2023 at 12:2

16

Solved

It seems that I may have inadvertently loaded the password validation plugin in MySQL 5.7. This plugin seems to force all passwords to comply to certain rules. I would like to turn this off. I've...

11

Solved

Based on my reference, primitive types have default values and Objects are null. I tested a piece of code. public class Main { public static void main(String[] args) { int a; System.out.println(...

14

Solved

When I try this code: a, b, c = (1, 2, 3) def test(): print(a) print(b) print(c) c += 1 test() I get an error from the print(c) line that says: UnboundLocalError: local variable 'c' reference...
Staffer asked 16/12, 2008 at 3:6

2

Solved

In my home page in build widget before return statement I use below code. If I create an another widget in my home page I have to copy below code before each return statement. If you create another...
Irrationality asked 11/2, 2021 at 7:47

17

Solved

In Laravel I have a table settings and i have fetched complete data from the table in the BaseController, as following public function __construct() { // Fetch the Site Settings object $site_s...
Mosul asked 7/8, 2014 at 18:19

6

Solved

I was wondering why this won't work? I'm fairly new to programming and I'm learning Python. def convert(x,y): while True: try: global x x = int(input("Number: ")) except ValueError: print("...
Delaney asked 15/9, 2013 at 0:29

2

In python, is it possible to declare a global variable with a type? I know this is fine to declare a local variable like this. student: Student Or global student But I'm looking for something...
Breger asked 13/9, 2019 at 18:35

19

I know that global variables in C sometimes have the extern keyword. What is an extern variable? What is the declaration like? What is its scope? This is related to sharing variables across source...
Eleonoreleonora asked 16/9, 2009 at 14:8

2

Solved

I did run into the situation, that I declared two (separate) global variables with the same name in two separate files, but without using static, volatile nor extern on them. One file was a .c and ...
Expulsive asked 12/11, 2022 at 10:49

7

Solved

How can I create global variables that are shared in C? If I put it in a header file, then the linker complains that the variables are already defined. Is the only way to declare the variable in on...
Nothing asked 9/6, 2010 at 23:12

© 2022 - 2024 — McMap. All rights reserved.