Skip to main content

All Questions

Tagged with
0 votes
1 answer
91 views

Accessing a boolean field outside of a namespace

I am reading the book of the art of assembly language to learn assembly language. In the topic of namespaces, it is mentioned that to access the names outside of a namespace, we can use e @global: ...
ahs's user avatar
  • 43
0 votes
2 answers
102 views

No naming conflict from two functions in global namespace (C++)?

I created two files, Linkage.cpp and External.cpp. Linkage.cpp: #include <iostream> void Log(int x = 5) { std::cout << x << "\n"; } int main() { Log(); return ...
Abhinav Jha's user avatar
1 vote
1 answer
271 views

what is difference between scope and namespace in javascript

hi everyone . actually I'm newly learning Javascript . I read about scopes in javascript . then I read somewhere about namespace in Js and i was wondered if namespace is exactly the same as scope , so ...
Mahdi zarepoor's user avatar
1 vote
0 answers
507 views

Using global function with imported namespace

So recently my colleague suggested prefixing global PHP functions with \ or importing them via use function. He suggested some performance improvements as prefixing the function will tell PHP to ...
Tomasz Kardas's user avatar
0 votes
0 answers
455 views

How to create and update a global variable in Jinja?

I'd like to create a global (boolean) variable with Jinja and update it in an if-statement. I try to do this as follows: {% set variable = true %} {% if True %} {% set variable = false %} {% ...
Laura's user avatar
  • 1
0 votes
1 answer
987 views

Sitcone in c# could not be found in etc

i get sitcon cant be foundt Warning MSB3245 Could not resolve this reference. Could not locate the assembly "Siticone.UI". Check to make sure the assembly exists on disk. If this reference ...
Rusty's user avatar
  • 1
0 votes
0 answers
25 views

Namespace vs global in PHP Functions? [duplicate]

I've got a $db variable (and others) in my global config and I've seen some sample code recently like: function getInfo(\My\Namespace\DB $db) {...} and then calling getInfo($db); but I'm used to just ...
Andrew T's user avatar
  • 357
-1 votes
1 answer
56 views

Is the global name 'a' in the same namespace as the module?

import math a = 1 def my_func(): print('don\'t downvote') my_func() I believe that the function invocation my_func( ) lies in the local namespace created for the function my_func( ) - ready ...
user avatar
1 vote
0 answers
19 views

python: manipulating the global name space vs explicit assignment of object reference

I've been reading plenty of posts here stating that one should never manipulate the global namespace. I understand the concerns WRT good coding practice (I.e., keep things localized where you can, ...
Uliw's user avatar
  • 69
0 votes
1 answer
64 views

Keyword to specify ambiguous/global namespace?

In this code snippet, found here. void f() { d1++; // error: ambiguous ::d1 or D::d1? ::d1++; // OK <----**This one** D::d1++; // OK d2++; // OK, d2 is D::d2 e++; // OK: e is E:...
Cryptic Slug's user avatar
1 vote
0 answers
357 views

Changing a global variable value inside a php namespace

I need to change a global variable inside a namespace in PHP. I'm currently refactoring some legacy code and a section of the code relies on the use of a global variable, which used to be configured ...
Matheus Patrick's user avatar
2 votes
1 answer
2k views

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 ...
osdiab's user avatar
  • 2,120
1 vote
1 answer
86 views

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): ...
user3015347's user avatar
0 votes
1 answer
582 views

Accessing Python namespace from other Python process

Let's that I have the following Python script script.py: a = 1 b = 10 for i in range(b): a += 1 print(a) I know that I can use globals() inside this script.py in order to show the namespace: {...
balkon16's user avatar
  • 1,408
1 vote
0 answers
46 views

Confusion about global namespaces in modules

I wanted to explore what the global namespace looks like in different modules. I came up with the following simple test: in a file called test_module.py: def test1(): return globals() in a ...
Yakov Dan's user avatar
  • 3,242

15 30 50 per page
1
2 3 4 5 6