namespaces Questions

15

Solved

I have been running StyleCop over some C# code, and it keeps reporting that my using directives should be inside the namespace. Is there a technical reason for putting the using directives inside ...
Bryantbryanty asked 24/9, 2008 at 3:49

3

Solved

What is the actual difference between class library and a namespace? I know both are used to group together classes, namespace etc. Can anyone tell in which scenario should I use a class library an...
Efflorescence asked 11/7, 2012 at 7:1

46

Solved

What does this do, and why should one include the if statement? if __name__ == "__main__": print("Hello, World!") If you are trying to close a question where someone should b...
Taskmaster asked 7/1, 2009 at 4:11

20

Solved

Is there a way to share secrets across namespaces in Kubernetes? My use case is: I have the same private registry for all my namespaces and I want to avoid creating the same secret for each.
Tsang asked 19/9, 2017 at 10:20

4

Not quite sure of the best title but I will explain what I am asking as best I can. Assume I have the following file: MyCustomClass.php <?php namespace MyNamespace; use FooNamespace\FooClas...
Tadeas asked 18/5, 2015 at 16:12

11

Solved

So I'm having to run someone else's excel app on my PC, and I'm getting "Can't find Project or Library" on standard functions such as date, format, hex, mid, etc. Some research indicates that if I...
Jameljamerson asked 3/2, 2009 at 14:5

7

Solved

With using namespace I make the whole contents of that namespace directly visible without using the namespace qualifier. This can cause problems if using namespace occurs in widely used headers - w...
Nonesuch asked 28/1, 2010 at 7:23

2

Solved

I can't for the life of me figure out why this error is being generated as I'm pretty sure the syntax is correct (obviously I'm wrong!). So I figured I'd see if anyone here could point it out for m...
Colter asked 9/11, 2014 at 3:9

7

Solved

Is there a way to import a package with another name in R, the way you might with import as in Python, e.g. import numpy as np? I've been starting to use package::function lately to avoid conflicts...
Omidyar asked 24/6, 2014 at 15:58

4

Solved

I'm given a xsd generated C# POCO object that I need to convert to xml. The expected payload however doesn't match the xsds I was given. Specifically, I need to omit the declaration and remove all ...
Eat asked 11/8, 2015 at 15:42

2

Solved

PhpStorm is highlighting the following namespace as an error. <?php namespace App\Http\Controllers\Public; Error: Expected: identifier In general. Are reserved keywords like public, functi...
Gravois asked 27/5, 2017 at 17:15

8

My client says he is getting this error using my script: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /path/to//header.php on line 34 Parse error: syntax error, unexpected T_S...
Gorge asked 17/6, 2013 at 20:27

5

Solved

I'm trying to install the 'lifecycle' package but rlangs is required. Upon typing install.packages('lifecyle') I get the error that I'm importing a rlangs package which is newer than required ('rla...
Phonetics asked 24/3, 2021 at 14:3

41

Solved

I have heard using namespace std; is wrong, and that I should use std::cout and std::cin directly instead. Why is this? Does it risk declaring variables that share the same name as something in the...
Wadley asked 21/9, 2009 at 3:8

6

Solved

I wrote a PowerShell script to deploy IIS Website automatically, but when I pass parameters to the script I get the following error: Cannot find the drive. The drive called 'IIS' does not exist....
Poachy asked 24/6, 2014 at 17:21

2

Solved

Environment: Swift >=2.3, Swift Framework in a Swift app SetUp: A Swift dynamic framework with module name, let's say APIService.framework. It has a public class APIService.swift and it has s...
Niersteiner asked 24/12, 2016 at 7:14

9

Solved

My understanding is that string is a member of the std namespace, so why does the following occur? #include <iostream> int main() { using namespace std; string myString = "Press ENTER to...
Acedia asked 2/6, 2012 at 21:7

19

Solved

I am using Snarl C# API to send notifications to snarl. Now I have saved the content of above url in a file named SnarlNetwork.cs and the content of my test.cs file are: using SnarlNetworkProtoco...
Convexoconcave asked 7/8, 2012 at 21:19

14

Solved

I'm writing a function that uses an external data as follow: First, it checks if the data is in the data/ folder, if it is not, it creates the data/ folder and then downloads the file from github; ...
Metrist asked 19/10, 2017 at 19:25

12

Hello guys I am so confused I dont know what I am doing wrong this told me Fatal error: Class 'Dotenv\Dotenv' not found in But I dont understand why.. $dotenv = new \Dotenv\Dotenv(dirname(dirnam...
Kenner asked 12/5, 2016 at 23:54

5

In TypeScript I can define a global/top-level namespace and use it in another file like so: namespace foo.blah { export function baz() { console.log('hello'); } } And in another file, this ...
Shorttempered asked 23/11, 2015 at 7:45

3

Solved

I read the following in the Python documentation: When a name is not found at all, a NameError exception is raised. If the current scope is a function scope, and the name refers to a local variabl...
Street asked 28/2, 2014 at 17:25

6

Solved

I renamed a folder and updated my namespace declarations, but ReSharper 6 claims that the namespace should be a reflection of how it was before the rename. Where is it storing the file location dat...
Infuriate asked 22/2, 2012 at 10:38

4

Solved

So far, I've seen many different naming conventions used for PHP namespaces. Some people use PascalCase\Just\Like\For\Classes, some use underscored\lower_case\names, some even use the Java conventi...
Swiger asked 30/11, 2009 at 15:5

3

Solved

I am currently moving code from my app_code folder to a class library. I have tagged several methods with [System.Web.Script.Serialization.ScriptIgnore] attributes. My class library cannot see this...
Concierge asked 20/7, 2009 at 22:27

© 2022 - 2024 — McMap. All rights reserved.