Skip to main content

Questions tagged [global]

Refers to a space where variables and other items may be accessed from any scope.

0 votes
1 answer
15 views

Modify the values in a (global) list of dictionary without reference

I'm new to python - being an educator trying to write to python script to score student's performance downloaded from an online polling platform. I've solved most problems until something like this: I'...
205 votes
10 answers
521k views

How to declare a global variable in php?

I have code something like this: <? $a="localhost"; function body(){ global $a; echo $a; } function head(){ global $a; echo $a; } function ...
5 votes
2 answers
12k views

How To Set Global Random Seed in Python

Like in R, I would like to set a random seed globally for the entire script/session, instead of having to call the random seed function every time I execute a function or run a model. I am aware that ...
1 vote
1 answer
23 views

React Native trying to use same array globally

I am trying to learn React Native and am wondering if there is a way to store an array, say in a constant file or something, and reuse it in different components. States will be one, as an example. I ...
0 votes
1 answer
55 views

Why I didnot get Multiple definition Error?

#include <stdio.h> #define MAX 5 static int data = 10; int increment(void *); int increment(void *ptr) { int *p = ptr; static int data =15; for (int loop=0; loop < MAX; loop++...
0 votes
0 answers
42 views

Global CSS cannot be imported from files other than Custom <App>

My React App works fine on my friends computer using global CSS, however, I've been having this issue since I opened on my VSCode. ⨯ ./styles/globals.css Global CSS cannot be imported from files other ...
2 votes
1 answer
34 views

xlwings not updating global variable correctly when using threading

Here is my logic that I am trying to understand. import xlwings as xw import threading workbook = "" def function1(): t1 = threading.Thread(target=function2) t1.start() t1.join()...
18 votes
7 answers
30k views

TypeScript: serialize BigInt in JSON

I'm looking for a way to force JSON.stringify to always print BigInts without complaining. I know it's non-standard, I know there's a package for that in pure JavaScript; but it doesn't fit my needs. ...
1 vote
2 answers
39 views

Defining global lists in Stata if elements consist of several words

I need to make some operations with many Excel files with long names of the type "Saratov Region.xls" (I mean that names of these files contain one or more blank spaces). I tried to write ...
1 vote
1 answer
140 views

Need more understanding of PHP Float CONSTANTS

So, I just came across these PHP float Constants: PHP_FLOAT_DIG and PHP_FLOAT_EPSILON, and I don't understand both constants (even after studying the official documentation https://www.php.net/manual/...
-2 votes
0 answers
50 views

i want to acsess the global variables from a function body in python [duplicate]

I have a very long program and I want to implement a method to access the global variables present in the main program ( main.py ) from within a function called from a library ( file.py ). main.py : ...
-1 votes
0 answers
11 views

What is the use of Project -> Settings -> Deployments -> Globals in jBPM?

In jBPM, under the Project settings, there is a section called Deployments. Inside this section, there is a tab called "Global". Is this for defining global variables? How is it used in ...
1 vote
1 answer
212 views

Script Scope in JS

I was going through Lexical environment and environment record / scope in JS. I know difference (partly) between var and let (one being block scoped, while one being functional scope) and also the let ...
0 votes
0 answers
24 views

How can i list root objects JavaScript [duplicate]

So I have several objects and classes in my script tag const Main = {} const App = {} class Game {} let state = 777 etc. I'd like to list them. I've tried Object.keys(Object.getOwnPropertyDescriptors(...
-1 votes
1 answer
74 views

var vs let for *globals*... what practical difference does "a property on the global object" make?

I have seen this (or similar): At the top level, let, unlike var, does not create a property on the global object. many times. My question is: what practical difference does this make ? Or, to put ...

15 30 50 per page
1
2 3 4 5
315