namespaces

Do you know of any projects in PHP that use namespaces that I could study?

I know namespaces are new in PHP but have been around for a long time in other languages. I started out in PHP so I really have no experience using them, I have read many articles and post on here about namespace in PHP and I get thebasic idea of how to use it but it is still something that will probably take me a while for it to really...

ASP.NET MVC 2 area namespace assignment

Suppose the root project has My.Root.Project namespace. I wonder what namespace should be assigned to an area classes? Possible alternatives: My.Root.Project.Areas.Area1 My.Root.Project.Area1 Esthetically, I prefer second one. However, since I use a single-project areas, all the classes created within Areas\Area1\... folder are given...

ReadAsDataContract exception while reading namespace

I'm trying to consume twitter's REST api mentioned at this link using WCF REST starter kit mentioned at this link. I'm using the same objects in DataContract as mentioned in the article - statusList and status. [assembly: ContractNamespace("", ClrNamespace = "TwitterShell")] [CollectionDataContract(Name = "statuses", ItemName = "statu...

Structuring RSpec file structure and code for tests with very large coverage?

I've just started looking at a project that has >20k unit tests written in Rspec (the project itself isn't written in Ruby; just the test cases). The current number of test cases is expected to grow dramatically in the future, as more functionality is added. What's already happened (over an extended period) is that RSpec started out be...

Does using a C++ namespace increase coupling?

I understand that a C++ library should use a namespace to avoid name collisions, but since I already have to: #include the correct header (or forward declare the classes I intend to use) Use those classes by name Don't these two parameters infer the same information conveyed by a namespace. Using a namespace now introduces a third p...

NameSpaces When, Where, Why!

Hi All, I have code that uses namespaces, a few of them and I am having some confusion in my brain. If I have something like: #include <vector> protected: vector<registeredObject> mRegistryList; The compiler complains that vector has 'no type' Can't I just do this: #include <vector> protected: std::vector<registeredObject...

Assembly name from namespace string

Is there a way of getting the assembly name from a namespace string? Eg, get "mscorlib" from "System". The reason for my question is I'm creating Boo scripts method-by-method and am required to add namespaces programmatically. The resulting string in Boo would read: import System from mscorlib I could obviously pass in a collection...

How do I define friends in global namespace within another C++ namespace?

Hi, I'd like to define a binary operator on in the global namespace. The operator works on a class that is defined in another namespace and the operator should get access to the private members of that class. The problem I have is that I don't know how to scope that global operator when making it a friend in the class definition. I tri...

Ruby on Rails -Problem using subdirectories

Hi, I have tried to set up a separate section of my app using a subdirectory called controlpanel to manage various parts of the site. I've set up the namespace in my routes.rb map.namespace :controlpanel do |submap| submap.resources :pages # other controllers end And placed the controller and views into the relevant subdirect...

What requires me to declare "using namespace std;"?

This question may be a duplicate, but I can't find a good answer. Short and simple, what requires me to declare using namespace std; in C++ programs? ...

What are common conventions for using namespaces in Clojure?

I'm having trouble finding good advice and common practices for the use of namespaces in Clojure. I realize that namespaces are not the same as Java packages so I'm trying to tease out the conventions in Clojure, which seem surprisingly hard to determine. I think I have a pretty good idea how to split functions into clj files and eve...

Way to get VS 2008 to stop forcing indentation on namespaces?

I've never really been a big fan of the way most editors handle namespaces. They always force you to add an extra pointless level of indentation. For instance, I have a lot of code in a page that I would much rather prefer formatted as namespace mycode{ class myclass{ void function(){ foo(); } void foo(){ bar(); } v...

How to implement nested namespace in PHP?

use level1\level2\level3; Can someone explain with a simple demo ? ...

Dynamically requiring in ruby

All, I was wondering if anyone has an intermit enough knowledge of rubys 'require' to tell me if the following is valid ruby or not; class Something def initialize(mode) case mode when :one then require 'some_gem' when :two then require 'other_gem' end end end s = Something.new If so, would the require plac...

Calling a Namespaced JavaScript Function from Flash

Can I use ExternalInterface to call a namespaced JavaScript function? //JavaScript foo.bar = function(baz) {} // AS3 import flash.external.ExternalInterface; ExternalInterface.call('foo.bar', baz); ...

Separate projects or multiple class files ... namespace best practice in C#

I'm creating a library for use with an application that I am building. I am building a name space structure similar to below. MyNamespace.Validation MyNamespace.Reports MyNamespace.Transactions MyNamespace.DataImport etc... Would it be best practice to create a solution with multiple projects for each sub namespace or one project wit...

Is it wrong to use C++ 'using' keyword in a header file?

I've been told it's bad to have "using namespace ns123" in a header file, but I can't remember what the reason given was. Is it in fact a bad thing to do, and why? ...

Extract login user name from Filemaker-published XSLT pages

I have published a layout in XSLT format with Filemaker. When a user access this page, he will be prompted for his login details. I want to display his login details after he logged in successfully. How do I accomplish this? ...

How do I define a friend class from the global namespace in another namespace?

In a previous Q&A (How do I define friends in global namespace within another C++ namespace?), the solution was given for making a friend function definition within a namespace that refers to a function in the global namespace. I have the same question for classes. class CBaseSD; namespace cb { class CBase { friend class ::CBaseSD...

Why is it possible to change an XML document's namespace by setting the xmnls attribute in Java 5 but not in Java 6?

We have an XSD which validates an XML document with a namespace declared, but we would like to use it on a document without one. In Java 5, it looks like it's possible to call setAttribute() on the xmlns attribute of the root element, but this fails in Java 6 with an exception: Exception in thread "main" org.xml.sax.SAXParseException:...