Questions tagged [namespaces]
A namespace is a container that provides context for identifiers, within which names are unique.
12,004
questions
0
votes
2
answers
17
views
How to include functions in namespace when don't have module?
How to include functions in namespace / module when don't have module?
example: I have a namespace:
namespace Java {}
in typescript, usually when we need a function in namespace or module, we add '...
0
votes
0
answers
12
views
Issue related to strongswan running in network namespace
I want to run the strongswan in the namespace
(https://docs.strongswan.org/docs/5.9/howtos/nameSpaces.html)
In configure gave options as below
./configure --sysconfdir=/etc --with-piddir=/etc/run
...
0
votes
1
answer
39
views
JavaScript nested namespaces and state variables
I am trying to implement nested namespaces using the modules pattern with anonymous functions and closure. I am missing something when it comes to changes in state variables. For example, here is a ...
1
vote
0
answers
47
views
C++ 17: Can I use inline for global variables? [duplicate]
In C I used to declare global variables like this:
my_C_header.h:
#ifdef my_C_file_C
#define extint
#else
#define extint extern
#endif
extint int32_t my_variable;
I had to include this in my_C_file....
0
votes
1
answer
51
views
Can I use strings within an array to name struct variables using concatenation, macros, or similar?
I have an array of animal names in the order that I intend to create each struct 'animal' and store it in farm_animals, a struct of animals.
typedef struct ani animal;
animal* farm_animals[128] = {0};
...
0
votes
0
answers
22
views
Attributes vs variables namespace
confusions in OOPs
why 'var' is not taking the global value in function as it is taking in class
can i create a local variable like 'a' in classes (say,c)?
why cant define class's attribute inside ...
0
votes
0
answers
51
views
iterate over namespace in c++ language [closed]
I am coding in c++ language. I have a namespace that include of many struct. The number of struct can be decrease or increase during the time, therefore i don't know the number of struct absolutely.
I ...
-1
votes
0
answers
14
views
What is the issue with the namespace because of getting a null result from XML code using the JAXB library in Java?
The below code works well and I got results from this code like the below picture
my result
@XmlRootElement(name = "AssumeRoleResponse")
public class AssumeRoleResponse {
protected ...
0
votes
0
answers
15
views
Declaration on Extend Express Request Object with Typescript
My question is...
Is possible use more than one object inside interface Request or how must I do?
Ex:
folder: @types,
folder: express,
file: index.d.ts
declare namespace Express {
export ...
-3
votes
1
answer
22
views
How to create namespace in existing azure Kubernetes cluster
There is no document to create namespace in existing kubernetes cluster
2
votes
2
answers
43
views
Remove Namespace from child Element XML PHP
I am trying to create a xml file using simpleXML.
This is the output that I need:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss xmlns:g="http:...
1
vote
0
answers
40
views
How to resolve ambiguity when using namespaces within inline namespaces
I use inline namespace for versioning, but sometimes name conflicts arise because it exports all symbols into its parent scope. Is there a way around this? Except flattening namespaces of course. ...
0
votes
0
answers
8
views
When run Test for emulator in Appium, got java.lang.IllegalArgumentException: Namespace with prefix 'com.exam.scheduler' has not been declared
[WD Proxy] Got an unexpected response with status 500: {"sessionId":"684d8176-6ef3-4245-9f6b-2c2428c6a794","value":{"error":"unknown error","...
-1
votes
1
answer
35
views
Are PHP Namespaces dependent on path of file?
In YII2 Framework
Path of File is root\vendor\yiisoft\yii2-httpclient\Client.php
Namespace defined in above mentioned file is - namespace yii\httpclient;
Now when I use this namespace in other file ...
0
votes
0
answers
35
views
R parsing namespace for `match.fun()`
In R, suppose I want to use match.fun() to call a function from a specific package, for example, spam::eggs(). If I do
library(spam)
sapply(1, FUN = match.fun("eggs"))
Then the function ...
1
vote
1
answer
15
views
python namespaces: avoid forcing symbol into globals [duplicate]
Suppose I define a package mypkg.py as follows:
import logging
class A:
logger = logging.getLogger ('mylogger')
def __init__(self):
logger.warning ('initializing class A')
def ...
0
votes
1
answer
34
views
Is it posible to declare global function in namespace
I am making a resource system that similar to Qt's qrc.
The resource is automatically created to .c file contains byte array. And it compiled to static library.
And it has a header file looks like ...
0
votes
0
answers
28
views
Add Namepace to unity
I try to use the following class in Unity
https://docs.microsoft.com/de-de/dotnet/api/system.security.cryptography.ecdiffiehellmancng?view=net-6.0
So my Code is simply:
using System;
using System....
0
votes
0
answers
20
views
Assertions with Namespaces (xml/xsd)
Q: How will I validate namespaces and assertion using xml and xsd file?
The required vocabulary namespace is:
**http://www.NE-auto-insurance.com**
This is the xml document that needs to assessed as ...
0
votes
0
answers
25
views
How to import a single method form python library and still keep the namespace?
I want to import the random.sample() method, but I can either import the whole library by typing import random or lose the namespace by typing from random import sample.
How can I just import the ...
0
votes
0
answers
24
views
How do I get doxygen to list all namespace members on the namespace documentation page?
In a C++ project of mine, have a bunch of functions in some namespace; and both the functions and the namespace have doxygen comments. I can see the function documentation through the doxygen page ...
0
votes
1
answer
12
views
Kubernetes: Remove NetworkPolicies
I have been experimenting with network policies, and now pods can no longer communicate with each other though I have deleted all the policies.
Namespace
apiVersion: v1
kind: Namespace
metadata:
...
0
votes
0
answers
19
views
Esbuild & Typescript namespaces merge into bundle not working
I have following code. I want use single namespace Namespace1 for classes, but I don't know how to merge then without module imports. I think that if everything works in both the IDE and TS (npx tsc), ...
0
votes
3
answers
42
views
namespace dictionary confusion
I'm trying to understand why one of these fails and the other works.
my_prd = { 'server': 'prd.my.company.com' }
my_lab = { 'server': 'prd.my.company.com' }
my_srv = {}
def test_fails(which):
if ...
0
votes
0
answers
27
views
PHP referencing constant in a namespace not working "Undefined constant"
I've searched a lot of other similar Q/As but none of them seem to address this specific case:
There's a file with constants:
App/Core/SomeConstants.php which contains:
namespace App\Core\...
0
votes
2
answers
23
views
Python strange namespace bahavior for class factory
I tried to write simple class factory using the "type" method.
I called myclass_factory twice and It returned identical namespaces
(case1 and case2). But the values of myclass attribute in ...
0
votes
1
answer
33
views
Call a Function from a Class using Namespace
Sorry for my poor knowledge in PHP.
I have to call the prepareFiles() function from WordPress functions.php from class added by a plugin in WordPress. Here is the class (content of the file).
...
0
votes
0
answers
23
views
Network setup for multiple devices with the same IP in Debian
I'm trying to setup a Debian system to have several devices with the same IP connected at the same time through physical Ethernet adapters.
I'm using network namespaces and virtual Ethernet peers.
...
0
votes
0
answers
18
views
Namespace not finding function
I'm trying to run unit tests but it seems like all my functions can not be found. The IDE can travers the location of the function when I hover or control click on the function. Any ideas on where ...
0
votes
0
answers
20
views
This type or namespace 'InputController' could not be found (are you missing a using directive or and assembly reference?)
I'm Following a tutorial to try and make a character controller and I'm getting the error above. I'm really new to this so I have no idea what I'm doing or why I'm getting this error. The error also ...
0
votes
2
answers
48
views
How can I call a method of a variable, which contains in a namespace?
I've this C++ code in interface.h:
#include <iostream>
class A{
public:
void foo();
};
namespace interface{
...
namespace Sounds{
A val;
...
0
votes
1
answer
32
views
Unable to call scripts from another namespace?
I am using the Oculus Interaction SDK within the Oculus Unity Package. I am having a circular namespace situation wherein I am not able to call my own scripts within Oculus.Interaction because my ...
1
vote
1
answer
36
views
VBA namespace in createElement
Trying to add a namespace before the Element but getting the error "Only a default namespace can have an empty URI".
My code is quite simple:
nmsp = "http://test.com"
Set root =...
1
vote
0
answers
44
views
Should I use 'using namespace std' [duplicate]
Should I use using namespace std; ?
I saw some posts saying that using namespaces is a bad practice. So I just want to clarify this.
#include<iostream>
using namespace std;
int main()
{
...
0
votes
1
answer
55
views
Included function not found in PHP file
I have read a bunch of questions and answers (like this and this and even this which might be more relevant) on SO regarding this. They all deal with a file not being found due to a path incorrectly ...
0
votes
0
answers
25
views
Javascript xml namespaces disappear on import
I'm working on a javascript epub editor. I have an xml dom document object(xmlDoc) with the metadata element:
< metadata xmlns: opf = "http://www.idpf.org/2007/opf" xmlns: dcterms = "...
0
votes
0
answers
16
views
Where is torch::col2im defined in pytorch source code?
Recently, when I looked at the source code of pytorch and found that torch::col2im was used in fold.h(https://github.com/pytorch/pytorch/blob/a012216b960c5c31ca2a56a47da454d105764895/torch/csrc/api/...
3
votes
1
answer
69
views
What is the different of ::std::cout and std::cout [duplicate]
There is a simple code with the different aspects of usage of :: operation.
namespace test{
int add(int x, int y){
return x + y;
}
}
int main(){
int x=3, y=5;
int r = ::test:...
0
votes
1
answer
53
views
Function listing packages' namespaces
Could anyone change this function listing environments in the current session so that it would list packages' namespaces too?
env_list <- function(start_env) {
last <- function(s) { s[[length(...
-1
votes
0
answers
28
views
Namespaced class not found in PHP
I am working on a custom API in PHP, without any frameworks.
Here is the basic structure :
- front/
- ...
- back/
- controller/
- ApiController.php
- ...
- model/
- User.php
- ...
4
votes
1
answer
86
views
Why is a function from a Julia submodule being shadowed?
Consider the following code:
module Foo
export g, h
module Bar
export f
f(::Int) = 2
end
using .Bar
f(::String) = "abc"
g() = f("a")
h() = f(12)
end
When I run this,...
0
votes
1
answer
37
views
Creating a sub-namespace with the name of another namespace
I want to do something like this:
namespace someModule
{
int someInt = 4;
}
namespace test::someModule
{
void f()
{
someModule::someInt = 2;
}
}
But it looks like the ...
0
votes
0
answers
32
views
How to modify p5js code to work in instance mode
The following code works, but I want to be able to have multiple canvasses with different background colors and sizes etc. - how do I modify the code to turn it in to a p5 instance?- I can't get the ...
0
votes
0
answers
13
views
How are namespaces intended to be used when parsing XML? [duplicate]
I have been assigned a project to import data from an atom feed in PHP. I haven't worked too heavily with XML in the past so gave SimpleXML a shot, and quickly found that the word "Simple" ...
0
votes
1
answer
53
views
K8s namespace terminating for 2 days
I was attempting to remove fluxcd from a kubernetes cluster and it is stuck at deleting the namespace 'flux-system'. I've tried removing 'kubernetes' from the finalizers but getting a 404 when using ...
0
votes
2
answers
116
views
List all namespaces in k8s in Go
Can anyone tell me how to list all namespaces in k8s using Go? I have been referencing this link but couldn't find anything that can list all namespaces.
Link: https://pkg.go.dev/github.com/gruntwork-...
-1
votes
1
answer
24
views
Django orm is creating a copy of instance instead of accessing it
I have I think kind of a tricky question in Django and it's orm.
This does not work :
cartitemproduct_in_cart_session.get().quantity+=1
cartitemproduct_in_cart_session.get().save()
If I check just ...
0
votes
1
answer
151
views
gRPC C# Specifying the namespace for the generated .cs files
I've followed the gRPC C# tutorial to generate and use .cs files using a source .proto file. The tutorial example gives a namespace to the .cs files, but when I try for my .proto file, there is NO ...
1
vote
4
answers
56
views
Parametric function in namespaces (C++)
I need to define 3 functions that have the same goal, but whose behaviours changes slightly based on 3 sets of constant values; in other words, i could simply write a function that does that in all 3 ...
0
votes
0
answers
47
views
Terraform - Enable OIDC on HashiCorp Vault child namespace
I am able to provision an OIDC auth method on a HashiCorp vault Root namespace, using the below Terraform resource block.
resource "vault_jwt_auth_backend" "oidc" {
description ...