Questions tagged [global]

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

4669 questions
1
vote
1 answer

Access dynamically changing variable across modules

TL;DR: A separate process calls a function whenever data is available and provides that data as the input to the called function In the function I process the data, and want to make results of it globally available (i.e., a globally available…
S.A.
  • 1,819
  • 1
  • 24
  • 39
1
vote
2 answers

Global reference to global objects

I have some immutable global objects like so: const Vehicle Car = ...; const Vehicle Truck = ...; ... I need to make "aliases" to these objects, i.e., additional names which refer to the same object. This seems to work: const Vehicle& Camion =…
BeeOnRope
  • 60,350
  • 16
  • 207
  • 386
1
vote
1 answer

Refer to global declared namespace type in custom definition

There is a past question on this topic, but no answer was posted: How do you import a Typescript type definition file whose top level element is a non-exported namespace? I want to make a type for testdouble-jest, but the second argument in its…
osdiab
  • 1,972
  • 3
  • 26
  • 37
1
vote
1 answer

Python: Search function in GUI with regex requires global variables, but UnboundLocal Error

This is my first project I am a complete beginner, so my apologies. I am attempting to create a inventory system with a GUI. Where I ran into issues was handling all the data, I thought before learning SQLite I should attempt my own crappy data…
timf135
  • 21
  • 3
1
vote
1 answer

Opening new Window having grid layout in Pyqt5

I know this question has been asked many times but every time i see different case . 1st problem: I can't open new window (Window2) having grid layout. I am trying to open a new window (Window2) in pyqt , this window(Window2) has grid layout . To…
Girl
  • 49
  • 12
1
vote
1 answer

Is there a way to tick the "Use global Veracode user credentials" checkbox using a DSL groovy script?

I am creating a Jenkins job with a DSL Groovy script to add the Veracode plugin. I am looking for a way to tick the "Use global Veracode user credentials" check box. It works fine with the code I have and adds the checkbox but doesn't check it for…
Dante
  • 548
  • 1
  • 7
  • 19
1
vote
0 answers

Convert grid in data to distance on a globe

I want to try and calculate the distance between two grids (which might have some values in them (not important for now). Suppose I have divided the entire globe into a grid size of 0.5 degree x 0.5 degree. I want to calculate the distance between…
Ep1c1aN
  • 683
  • 9
  • 25
1
vote
1 answer

referencing variable from function outside of the function

I am having trouble assigning a variable as global (i think this is my problem, at least). Heres a representation of my code: def get_alert(): global subject # ...code ... subject = # unread email's subject line while True: …
GSatterwhite
  • 301
  • 1
  • 3
  • 12
1
vote
1 answer

Why does this function run as a global variable, but not as a local one?

Defining 'eventHandlers.key_up' as global works, but defining it as local does not. local event = require "event" local running = true local function unknownEvent() -- end local eventHandlers = setmetatable({}, { __index = function () return…
Matthew B
  • 13
  • 3
1
vote
1 answer

python global namespace not accessible

I can run API.py, but not the APP.py in the same directory. The error is "NameError: name 'a' is not defined". Is global() really global? API.py: class Entity(): def __init__(self,name,value): globals()[name]=value if __name__ ==…
user3015347
  • 503
  • 3
  • 12
1
vote
0 answers

Need Share Taxonomies Across a Network all sites

I used Wordpress Multisite Network concept in site. But I need Product category share across a Network all sites. Means I will add category in main site only and I can use main site category in all sub-sites. so is this possible? I already used…
Chetan Kanani
  • 308
  • 1
  • 9
1
vote
1 answer

Share global variables between two @app.route

I am going to set some data in a global variable once "/setvalue" route is called. Then whoever wants to retrieve this data(even from outside of the web app, browser) can access it. The problem is the call for retrieving the data comes from outside,…
1
vote
0 answers

Undefined index:Type with $GLOBAL variable

I set a Super global variable $GLOBALS['Type']="JobSeeker" but in another file that variable is not accessed While Running Program am getting Undefined Index:Type. Page1.php: $con = mysqli_connect("localhost","root","","job1"); // Specify the query…
shiva7890
  • 41
  • 1
  • 7
1
vote
0 answers

Laravel 5.7 global functions handle ajax in every controllers

I have a couple of functions which i use in all controllers like this: //ajax public function region() { return Region::all(); } //ajax public function provinces(Request $request) { if(!empty($request->input('region_select'))) { …
mavors
  • 21
  • 1
1
vote
2 answers

Calculating weighted spatial global annual averages across grid cells using netcdf dataset in R

I am currently working on a project that involves climate model data stored in a NetCDF file. I am currently trying to calculate "weighted" spatial annual "global" averages for precipitation. I need to do this for each of the 95 years of global…
Android17
  • 93
  • 1
  • 12
1 2 3
99
100