Most voted "namespace" questions
A namespace is a grouping that provides context for the items it contains (names, concepts, etc.), allowing the coexistence of items with an equal name in separate namespaces. Use this tag for questions about namespace problems, but not just because your code uses namespaces.
Learn more…110 questions
Sort by count of
-
43
votes5
answers2270
viewsUsing unused affect performance?
While I was developing, I saw that in most of my classes contained a certain amount of using that were not being used and came to me the doubt of the title. Using unused affects the performance of…
-
42
votes4
answers6910
viewsHow does namespaces work in C#?
I’m studying C# and I came across namespaces. How it works and when it’s applied? If possible some basic example.
-
25
votes2
answers1684
viewsHow does namespaces work in PHP?
The namespaces were implemented from PHP version 5.3.0 as a form of "encapsulating items". I never really understood his real concept, and I always get confused with autoload of classes. Could…
-
20
votes3
answers10053
viewsWhy is it not good practice to use namespace "Std" in C++?
I was using using namespace (nomeDaBiblioteca); in my code and ended up having some conflicts with another library. Why these conflicts happen and what is the best solution?…
-
12
votes1
answer267
viewsHow to unify redundant XML namespaces?
I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <DataTable> <Columns> <DataColumn xmlns:i="http://www.w3.org/2001/XMLSchema-instance">…
-
12
votes2
answers949
views -
10
votes2
answers470
viewsIs it necessary to bar " " at the beginning of native functions when using namespace?
I noticed that some libraries use in functions native of PHP the \, for example: echo \str_replace('foo', 'test', $string); I’ve been testing within a class just with namespace this: public function…
-
10
votes1
answer451
viewsWhat is Std in C++?
I’m learning C++ and I see std being using everywhere. What is this std? He’s like a library or something different than that?
-
9
votes1
answer2567
views -
9
votes1
answer585
viewsWhat are namespaces in XML?
Well, I understand the concept of namespaces in C#, C++, etc. But I don’t understand the concept of namespaces in WPF (XAML). I’ve been trying to understand the parameters xmlns in a XAML code. I…
-
9
votes1
answer151
viewsWhat is "global::" in C#?
I was editing a source code for an application I’m writing in C#, which uses GTK+. I have some knowledge of C#, but did not understand why some variables were written when I mounted the UI in "drag…
-
9
votes1
answer298
viewsReserved word include or "use" in PHP?
I saw somewhere that word reserved include in PHP should be used only in procedural programming, and that in object-oriented programming the word reserved should be chosen use. I haven’t found…
-
8
votes3
answers224
viewsUse of using versus full name
I’ve been following many projects open source and I realized that there’s a really big alternation between using using (Imports in VB.NET) and use direct reference to the namespace. Example: void…
-
8
votes2
answers653
viewsName collision between class and namespace
It’s wrong, bad practice or I might have problems with class like namespace? Example: namespace Cielo { public class Cielo { ... } } It’s been working, in some places it gets a little strange to…
-
7
votes4
answers492
viewsIn C# is it possible to use a local alias for class or namespace?
In languages like Python or PHP it is possible to use a local alias for classes or namespaces. PHP example: use Vendor\Package\ClassName as C; use Vendor\Package as P; $class = new C; $class = new…
-
7
votes1
answer514
viewsIs there any project organization standard for C++?
In Java and Actionscript3.0 we use namespaces based by directory path, I see much use of namespace, but are not based on the "location" path of the class in the folder. I searched a lot if there was…
-
7
votes1
answer1877
viewsWhat is using namespace?
Since the beginning of my C++ learning I have been told to use the namespace std, not to spend all the time using the std::cout. But after studying more about language, I learned that :: is a target…
-
6
votes1
answer296
viewsDifferences between traits and namespace for loading
Using namespace the file is uploaded at the time when some method is used say, If you do not invoke anything from class the file will not be loaded. use World; class Hello { World::say() } Using…
-
6
votes1
answer1099
viewsWhat are the advantages of using namespaces in Delphi?
From the 2009 version of Delphi (if I’m not mistaken) came the namespaces. I would like to know, in a simple example if possible that illustrates a case of advantage, what would be the advantages of…
-
6
votes1
answer99
viewsHow to automatically add namespaces in Visual Basic?
When creating any class in C#, using Visual Studio, it automatically adds the namespace, as can be seen below: namespace Aplicacao.Modelo { class Cliente { } } In Visual Basic, he doesn’t do the…
-
6
votes1
answer302
viewsDo you have anything like the C# namespaces in Java?
I noticed the size of the command to put a message on the screen in Java, wanted to know if it has how to decrease? As in C# that the programmer puts the word using "namespace"; and you can use the…
-
5
votes1
answer148
viewsImport is not working
Imports System.DirectoryServices ERROR MESSAGE: "Warning 1 Namespace or type specified in the Imports 'System.Directory.Services' doesn’t contain any public Member or cannot be found. Make sure the…
-
5
votes2
answers11677
viewsNamespaces and Use when to use and for what purpose?
What are namespaces and use and when it is recommended to use them in an application ?
-
5
votes2
answers12195
viewsDifference between Std::Cout and Cout?
In C++ because some use std::cout and others use only cout is just what the programmer thinks best?
-
5
votes1
answer743
viewsWhat is namespace really for?
I would like to understand the great need and usefulness of namespaces in MVC architecture. In what circumstances the use of namespaces becomes indispensable? Give an example of a specific case if…
-
5
votes1
answer69
viewsDoes using multiple namespaces weigh more?
Let’s say I have these namespaces: use DataTables\Editor, DataTables\Editor\Field; DataTables\Editor\Format, DataTables\Editor\Mjoin, DataTables\Editor\Options, DataTables\Editor\Upload,…
-
4
votes1
answer763
viewsChange namespace automatically when changing folder file
I need to restructure the folders of a project, only that there are many files and their respective namespaces need to be changed. Is there any way to change the namespace automatically when moving…
-
4
votes1
answer1217
viewsWhat problems can occur when using the "http://tempuri.org/" namespace on our webservices?
When creating a webservice, in my case using ASP.NET, I always change the default namespace to something related to my project, usually using the website URL for this. But lately I have had the need…
asp.net web-service soap namespace xml-namespacesasked 10 years, 1 month ago Guilherme de Jesus Santos 6,566 -
4
votes1
answer1345
viewsNamespace and PDO = Error
I am making a Framework using namespaces. However in PDO connection file there is a strange error for me: Fatal error: Uncaught Exception 'Pdoexception' with message 'could not find driver' in C:…
-
4
votes2
answers1770
viewsReferencing folders created in the project
After I go to Project > Add > New Folder, rename the folder and put classes inside it I can no longer reference it in another file, for example if I would use in one controller, I would use as…
-
4
votes2
answers102
viewsProtect Class for namespace c#
I am developing a C# application for Unity 3D where it will manage several types of database (Mysql, Postgress...), the problem is that I have classes that manipulate each type of database within my…
-
4
votes1
answer501
viewsnamespace com php
I’m looking to dig deeper into namespace, but the ways I’m trying, it’s giving error. Follows below the two forms: My class inside the directory classes/class.php namespace minhaClasse; class classe…
-
4
votes1
answer64
viewsCompiler indicates non-existent Enum that exists
I’m using the Mono compiler. When I tried to compile this: using static System.Globalization.CharUnicodeInfo; using static System.Globalization.UnicodeCategory; namespace AS3Kit.Lexical { static…
-
3
votes2
answers99
viewsEvents with namespace
I am studying about events in javascript, without using jQuery, and I came up with a question: how can I add / remove events with namespace?
-
3
votes1
answer275
viewsGeneral namespace for mapped class
Could someone help me with that question? Based on a Webservice result XML (OBIEE) I generated an XSD in a online converter and with this XSD I managed the class mapped through the command xjc. When…
-
3
votes0
answers33
viewsNamespace function beyond C#grouping
Hello I was here thinking a little bit and I came up with a little doubt regarding the use of namespace in C#, it would have some function other than the grouping of "similar objects" ? And in a…
-
3
votes1
answer84
viewsAsp.Net 5(Core 1.0) Class Library System.Text.Regularexpression
How to use the namespace System.Text.Regularexpression in Asp.Net 5, I’m with a project and went to upgrade it to Asp.net 5, my problem was that I can’t use regular expressions in it and n can…
-
3
votes1
answer33
viewsCan I put namespace in old classes?
Good people, I work in a company that has a huge system, and we used the Doctrine to do the Mapping of our tables, however this is very old we used the Doctrine a long time and at the time we had no…
-
3
votes1
answer64
viewsConflict of reference Google.api
I have a reference conflict problem in the Google API. In my API classes I always rename as follows: SiteTeste.APIS.Google.<Servico>, where service is, Gmail, Translate, Drive or whatever.…
-
2
votes1
answer71
viewsDoctrine2 using namespace error Composer
Hello I am creating a file that serves as base class in Basetable.php Entities as follows: <?php namespace Entidades; use Doctrine\Common\Collections\ArrayCollection; /** * @MappedSuperclass */…
-
2
votes1
answer547
viewsInstantiate class outside namespace
I have a class with the namespace defined: namespace App; class AppSessionHandler { private $db; //... $this->db = Utils::ZendDB(); >>>>>> LINHA 12 } The following error occurs:…
-
2
votes1
answer70
viewsResolve Undefined namespace Mailer Cakephp 3.0.3
I’m trying to create a Email Reusable provided by Cakephp 3 but still following the documentation but I have the following error: use Cake\Mailer\Mailer; Error: Undefined namespace Mailer Referenced…
-
2
votes1
answer40
viewsHow to get the namespace where the function is called?
Is there any way to do that? <?php namespace Bar { class test { public function test($action) { call_user_func($action); // must call \Foo\Action } } } namespace Foo { $test = new \Bar\Test;…
-
2
votes1
answer118
viewsUse include namespace
I am using namespace to use classes in PHP, there is a part where I do use StatusCorrida\StatusCorrida; include('arquivo.php'); The arquivo.php ago $var = new StatusCorrida(); this file makes use of…
-
2
votes1
answer217
viewsNamespace does not work correctly / BC30002: Type 'Prod' is not set
I was invited to solve a problem in a client’s system in Asp.net (Language in which I do not dominate). Without further ado... My.aspx product file has the following directive <%@ Import…
-
2
votes0
answers219
viewsHow to parse XML with namespace and prefix in PHP using Simplexml?
The.xml data file: <?xml version="1.0" encoding="utf-8" ?> <rsp status="ok"> <ArrayOfContact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"…
-
2
votes1
answer244
viewsIs it possible to make a Class accessible in all namespaces?
The question is similar to this Instantiate class outside namespace and has a good answer /a/68198/3635 However I would like to do this automatically. For example: It is possible to make a Class be…
-
2
votes1
answer246
viewsIs there any way to configure Laravel 4 to use namespaces?
In the Laravel 5, I noticed that they have now added namespaces in the application folder. But things weren’t like that in the version Laravel 4. In the Laravel 5, for example the Controllers would…
-
2
votes2
answers69
views -
2
votes1
answer674
viewsNode JS, Socket.IO Rooms and namespaces
I’m developing a map-based android app, which will create chat rooms in some predetermined places and places where users need them. I did some research with mechanisms that I could use in my…