Questions tagged [global-namespace]

54 questions
3
votes
2 answers

Disadvantage of using a struct as a c "namespace"

I will often wrap a group of related global functions and variables in a struct that makes a kind of "namespace" for them, for example extern struct foo_namespace { int (* const foo)(int a); int (* const bar)(void); const int a; …
rtpax
  • 1,687
  • 1
  • 18
  • 32
3
votes
1 answer

Enforce Global Namespace in XAML

In XAML, a custom namespace can be imported with an xmlns directive: xmlns:custom="clr-namespace:GreatStuff" In C#, that namespace can be imported with using GreatStuff; Moreover, evaluation of that namespace based on the global (root) namespace…
O. R. Mapper
  • 20,083
  • 9
  • 69
  • 114
3
votes
1 answer

called php functions from a namespace

It seems I found a error when calling some php functions from a namespace that I can't understand it: let\'s call…
centurian
  • 1,168
  • 13
  • 25
2
votes
1 answer

Check if string is type

I wish to parse keyword arguments to determine if they also refer to types, such as in the case below: from inspect import isclass def convert(converting, **kwargs): for key, value in kwargs.items(): if value and isclass(eval(key[1:])): …
ShadowRylander
  • 361
  • 2
  • 8
2
votes
0 answers

CreateMutex() returns ERROR_ACCESS_DENIED on Win 10 but not on Win 7

I have 2 windows programs one that runs at Session 0 and another at Session 1. Both programs creates the same named mutex with the 'Global\' namespace prefix, Session 0 creates first and when Session 1 tries to createMutex, I get ERROR_ACCESS_DENIED…
IdolAdmin
  • 61
  • 1
  • 5
2
votes
1 answer

Qt Creator IDE appears to be falsely marking reinterpret_cast<::GlobalType> as invalid

I am currently in the process of moving a number of class files from our Visual Studio source environment into Qt Creator (version 3.4.2). I have made several changes to cater for the differences in the compiler (into MinGW). One thing that is…
Class Skeleton
  • 2,913
  • 6
  • 31
  • 51
2
votes
2 answers

How can I create my own namespace for global variables in Meteor?

I'm running into difficulty with understanding the scope of a variable that I thought would be global. Rather than figuring it all out, I thought maybe it would be better to declare my own global namespace and keep my stuff in there. Is this the way…
tadasajon
  • 14,276
  • 29
  • 92
  • 144
2
votes
1 answer

PHP Global namespace aliases

Here is the scenario. I am implementing namespaces into my projects. I have my own custom bridge library that calls other libraries like Zend to do the heavy lifting. I have no problem using fully qualified namespaces in my custom bridge library but…
Dieter Gribnitz
  • 5,062
  • 2
  • 41
  • 38
2
votes
2 answers

Ruby (/rails?) top level namespace

I'm in the following situation: I'm building a site in rails. I have two classes with the name User. One is an ActiveRecord, the other is a custom class that I'd like to use for seeding my database. Question: Can I refer to the ActiveRecord class…
Peter Berg
  • 6,006
  • 8
  • 37
  • 51
1
vote
2 answers

Visual Studio 2022 file-scoped namespace issue

So I have VS 2022 and am trying to learn C#. I am getting an error of Feature 'file-scoped namespace' is not available in C# 7.3 Please use language 10.0 or greater. I found where one goes to Options>Code Style> Text Editor and change to…
WinginSue
  • 60
  • 6
1
vote
2 answers

Conditional Namespace in Winform application

I want to know better way to define name-spaces in my projects. We have 2 different winform projects and there are certain code files and forms which we use in both project. So the structure of project 1 and 2 is below: //Project…
Shah
  • 1,319
  • 1
  • 13
  • 18
1
vote
1 answer

Global Namespace Alias (double colon) with curly brackets in comment - C#

I want to call some method in curly brackets in a comment, for example like this: $"{global::Company.Company.Helpers.Method()}_{Parameters.ProcessName}"; But in this situation everything behind the colon become a comment. Is there a way to use…
1
vote
1 answer

How can I make an object callable as an instance and a function

I'm working on building a collection of prototype helper methods inside a wrapper. However for ease of use, I'd like to be able to call the object as both a new instance and single global instance under the same call. For example, with jQuery, you…
user3143218
  • 1,738
  • 5
  • 32
  • 48
1
vote
1 answer

Is there any difference between qualified ::toplevel_namespace and unqualified toplevel_namespace?

Generally, the difference between ::any_name and any_name should be clear. If preceded by :: the name is always and only looked up in the global namespace. I was wondering however whether there is an technical(*) difference, given a namespace that I…
Martin Ba
  • 37,187
  • 33
  • 183
  • 337
1
vote
1 answer

glMatrix 2.2.0 with RequireJS

All definitions of glMatrix 2.2.0 seem to be undefined when included with RequireJS. However, on page inspection, it is being included in the HTML as a script tag. However the same setup does work with glMatrix 1.3.7. The require configuration is as…
Dan0
  • 459
  • 3
  • 16