12,475 questions
2
votes
1
answer
201
views
Is it idiomatic, or reasonable, to use ::std rather than std:: in library code? [closed]
Suppose I'm writing or maintaining a C++ library. The library code is all available within some namespace, say namespace mylib. Also, some of the library code uses standard library constructs.
In ...
4
votes
2
answers
199
views
Sort of reverse Argument Dependent Lookup in C++
I am pretty sure the feature I am looking for doesn't exist in C++, but maybe there are smart alternatives that do something similar.
In C++, we have Argument Dependent Lookup (ADL) feature, also ...
1
vote
1
answer
114
views
xhr poll error while connecting on socket server using socket.io with nginx proxy
My server with socket.io is running fine without nginx proxy, but when I use nginx proxy, its getting an xhr poll error when trying to connect
Here's the server block of my nginx looks like
location /...
Advice
0
votes
2
replies
102
views
What is the meaning of scope in programming?
The term 'scope' in the context of python programming feels very loosely defined to me and i am having trouble understanding it.
Some definitions use the phrase 'variable scope'/'scope of a variable), ...
9
votes
1
answer
651
views
Do different name lookup trajectories violate ODR?
Assume there are two translation units that differ only in the name of one namespace: aggregator_1 vs. aggregator_2:
// Translation unit 1
namespace a {
struct Point
{
int x;
int ...
0
votes
1
answer
144
views
Why is the namespace not needed in "friend class" for the base class? [duplicate]
I have this demo. I am confused why I don't have to provide the name of the namespace tn for friend class InnerClass for the base class. Marked in the below code.
I would expect to use friend class tn:...
Best practices
1
vote
2
replies
58
views
How do I properly import a self-written module which depends on a third-party module within a program?
I am writing (in Python) a function for import and use in another program. This function takes standard Python data structures as input, e.g., list of strings, and outputs a numpy array based on the ...
0
votes
0
answers
56
views
VS Code - .NET Console Project - Invoking Code in Another File From Main() in Program.cs
I am trying to get a basic console app with multiple files working in Visual Studio Code (macOS, version 1.108).
I created a new .NET project, specified a console project, and got the Program.cs file. ...
17
votes
1
answer
753
views
Should a friend function in a namespace different from the class be found by argument-dependent lookup?
Consider
struct A;
namespace ns { int f(A&&); }
struct A {
friend int ns::f(A&&);
};
int x = f(A{});
GCC trunk translates the last line into a call to ns::f(A&&) in C++20 ...
0
votes
1
answer
94
views
postgres "<schema.function>" does not exist
I have a script in postgres to create test data and error Error: relation "schema" does not exist is being thrown. I have verified that the schema and function exists and that I can run the ...
1
vote
1
answer
139
views
How can I programmatically determine the imports for an R function?
Suppose I have a function like the below in a large R script, and I am trying to refactor it into a package to make it re-usable in other scripts:
mymean <- function(x) {
assert_that(is.numeric(...
1
vote
1
answer
147
views
Unallowed GRANT does not raise an exception and doesn't grant the privilege either, if user already has other privileges on the object
I have a regression test for a PostgreSQL database that checks to make sure a particular user cannot self-assign additional privileges to a particular schema. I do this by logging in as the user "...
0
votes
1
answer
111
views
Is there a way to import internally defined functions in an R package into the main working environment?
I need to create a modified version of a function found within a package namespace to perform a specific statistical calculation. E.g., say I have a function function and save the modified version as ...
0
votes
0
answers
89
views
XDP Program on veth Host-side Blocking Inter-Namespace Communication
I have two namespaces, ns1 and ns2. I created two veth pairs and connected the namespaces to the host via these veth pairs. Now, I want to enable these two namespaces to ping each other using a very ...
2
votes
0
answers
29
views
Merge namespace in two different files typescript [duplicate]
In file1.ts I have:
export namespace MyGlobal {
export namespace File1 {
export const X = 2
}
}
In file2.ts I have:
export namespace MyGlobal {
export namespace File2 {
export const X = ...