namespaces

ASP.NET Namespace

What is the namespace the Default.aspx page resides in when I create an ASP.NET project? And how to find the namespace of any other ASP.NET page in the project? I am using VS2005. I first created a blank solution and then added a webSite to it. When I click right-button and go to 'Add New Web Site' - menu I find the following template...

CLSCompliant(true) drags in unused references

Can anyone explain the following behavior? In summary, if you create multiple CLS compliant libraries in Visual Studio 2008 and have them share a common namespace root, a library referencing another library will require references to that library's references even though it doesn't consume them. It's pretty difficult to explain in a si...

Resetting a namespace in PHP?

How can I "reset" a namespace to the global one? Given the following code: namespace foo; include 'myfile.php'; myfile.php will now try to load all of its classes in the foo namespace, even though its classes are in the global namespace. Now it wouldn't be a big deal to swap the order of those lines, but how would I deal with myfile.p...

Python: How can I choose which module to import when they are named the same

Lets say I'm in a file called openid.py and I do : from openid.consumer.discover import discover, DiscoveryFailure I have the openid module on my pythonpath but the interpreter seems to be trying to use my openid.py file. How can I get the library version? (Of course, something other than the obvious 'rename your file' answer would b...

SubSonic Generates Namespace, but my website doesn't recognize it.

Hey there, I've got a pretty basic setup in Visual Studio 2008 - Website project referencing my Class library project. SubSonic 3 is referenced from both projects, but the Template has been modified for my MySQL db. It connects and generates the most of code (Accept for StoreProcs for some reason), and the namespace is there, and my ...

PHP namespaces and the implements keyword

use MyNamespace; class NonPersistentStorage implements StorageInterface Both are in MyNamespace. Yet PHP looks for MyNamespace\NonPersistentStorage and StorageInterface (instead of MyNamespace\StorageInterface). Am I missing something? ...

PHPUnit getMock() with namespace

My quest of starting to use namespaces in PHP keeps continuing. This time PHPUnit gives me problems. My setup() method is like this: $test = new \MyNamespace\NonPersistentStorage(); // works $mock = $this->getMock('\\MyNamespace\\NonPersistentStorage'); // doesn't work The getMock() method only results in PHP looking for a NonPersiste...

EJB JNDI lookup on different WebSphere servers

I have two separate installs of WebSphere. (Actually one is WebSphere Application Server V6.1 with EJB 3.0 and Web Services feature packs, and the other server is WebSphere ESB Server V6.2). However, I know that ESB is really built on top of WAS, so it has all the configuration settings that a regualr WAS server has. In my ESB server,...

Using std Namespace

There seem to be different views on using 'using' with respect to the std namespace. Some say use ' using namespace std', other say don't but rather prefix std functions that are to be used with ' std::' whilst others say use something like this: using std::string; using std::cout; using std::cin; using std::endl; using std::vector; ...

jQuery and Plugin Namespacing and Inheritance

Hey guys. There has been a lot of activity lately on the jQuery Dev Group about prototypal inheritance and plugin namespacing, and I want to see who has the best answer for it. Group link: http://groups.google.com/group/jquery-dev/browse_thread/thread/620c6a18a16d9665 Questions: What do you guys think should be done about this and why...

Is 'using namespace' inside another namespace equivalent to an alias?

Consider the following two statements: namespace foo = bar; and namespace foo { using namespace bar; } Are those two statements equivalent, or are there some subtle differences I'm not aware of? (Please note that this is not a question about coding style - I'm just interested in C++ parsing). ...

VCCodeModel not in VCCodeModel namespace?

I am working with VCCodeModel in both C# and C++ CLR and I am having trouble getting the VCCodeModel type in to the CLR project. I have added Microsoft.VisualStudio.VCCodemodel as a reference, but when I type: Microsoft::VisualStudio::VCCodeModel::VCCodeModel Visual Studio cannot see the code model. All the other objects in the name...

Should I stop fighting Visual Studio's default namespace naming convention?

I'm working on an MVVM project, so I have folders in my project like Models, ViewModels, Windows, etc. Whenever I create a new class, Visual Studio automatically adds the folder name to the namespace designation instead of just keeping the project-level namespace. So, adding a new class to the ViewModels folder would result in the namesp...

OS X 10.5 SDK deprecated getAttributeNS; what should I use instead?

I'm upgrading a project to use the 10.5 SDK. I'm getting warnings of this form: warning: 'getAttributeNS::' is deprecated (declared at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/WebKit.framework/Headers/DOMElement.h:74) ...for getAttributeNS, hasAttributeNS, removeAttributeNS, replaceChild, and getElementsByTagNa...

Existing class name clash in PHP, need a creative solution

I realize that you cannot "undeclare" or "redeclare" a class in PHP, nor can I use extension methods as in C# > 3.0. So, here's my situation. I'm working with someone else's code base. They must have been using a slightly older version of PHP where a DateTime class did not exist, so they included an open source library that adds Time...

What are the C# namespace and class/sub-class naming conventions when the top namespace contains the base class and inner namespaces contain sub-classes?

I'm trying to design a class library for a particular engineering application and I'm trying to ensure that my class & namespace naming conventions make sense. I have the following situation: namespace Vehicle{ class Wheel{...} //base class for Wheel objects class Engine{...} //base class for Engine objects ... namesp...

Generate XML with namespace URI in PHP

Ho to make this "simple" xml with php using DOM? Full code will be welcomed. <rss version="2.0" xmlns:wp="http://url.com" xmlns:dc="http://url2.com" > <channel> <items> <sometags></sometags> <wp:status></wp:status> </items> </channel> </rss> i'm so lost. Code will help me more than any explanation. ...

explicit and implicit XML name spaces

My question is how to set values to two attributes that have the same name but different namespaces. Using C#, in an XML document, I need to assign two attributes to an element. It should look like doc xmlns:xmi="uriaddress" element xsi:type="xsitype1" type="type1" I tried xElement.SetAttribute("type","uriaddress","xsitype1") this w...

Accessing private class in operator<< in namespace

Hi, I have a class CFoo with a private inner class CBar. I want to implement a stream ouput operator for CFoo, which in turn uses a stream output for CBar in it's implementation. I can get this working when CFoo is in the common namespace, but when i place it in a new namespace (namespace foobar), the operator can no longer access the pr...

Is there a way to escape root namespace in VB?

namespace ConsoleApplication1 { class Program { static void Main(string[] args) { System.Text.MyCustom mc = new System.Text.MyCustom(); } } } namespace System.Text { public class MyCustom { } } How do I do this in VB, while having a root namespace in the application, is this possib...