namespaces

in appengine how can i have namespace based url routing?

I'm trying to figure out how to change url routing based on namespace Say I have myapp.x.com/apage and myapp.y.com/apage, I tried the code below but it doesn't work because I presume the main.py is being cached ns = namespace_manager.google_apps_namespace() if ns == 'x.com' app = WSGIApplication([ (r'/apage', 'my.module.XHa...

Export part of the namespace of a class

I have a class that includes an enum: class appearance{ // ... stuff ... enum color {BLUE, RED, GREEN}; }; I would like to attach part of the namespace (with using) so that I can refer to the value of the BLUE simply as BLUE, rather than appearance::BLUE. At the same time, I would like to keep the enum within the class{}, since I ...

Cannot decide a proper namespace for 'Character'.

I am building a game engine, and I am actually having a very difficult time placing what kind of namespace to put Character under. This may be the single dumbest question I've ever posted on StackOverflow, but it's driving me nuts. What would you guys do? I don't really have any other namespaces yet defined. Characters have Sheets (La...

What is the proper C# namespace usage?

I come from a Java background, and I see a lot of people say namespaces = packages, but looking around at available code it doesn't seem to me that people use namespaces like they used packages. Currently I'm working on a DLL to manage all my data access to a database to be shared between two Windows Applications. So far I have been cr...

xpath expression from xml with namespace prefix

Hi, I could not get the following xpath expression to work when the xml path namespace prefix set. /bk:BookStore/bk:Books/bk:Book[text()='Time Machine'] XML is: <bk:BookStore xmlns:bk="http://www.bookstore.com/book#"&gt; <bk:Books> <bk:Book id="1">Time Machine</bk:Book> </bk:Books> </bk:BookStore> ...

Using statements before or after Namespace in C#

Possible Duplicate: Should Usings be inside or outside the namespace So there are two approaches to where you have your using statements in regard to the namespace. You can either have them outside the namespace declaration or inside. What is the pro/con between the two approaches and which is generally preferred. using Syste...

Storing complex XML values in PHP

Consider this hypothetical xml: <myApi xmlns="urn:something" xmlns:bla="urn:hello"> <argument1>foo</argument1> <argument2> <p xmlns="http://www.w3.org/1999/xhtml"&gt;Some paragraph of text. <img src="http://www.example.org/hello.png" bla:test="oi" /></p> </argument2> </myApi> What would be the best way in PHP to parse out t...

Map a class in XAML that isn't in a namespace

Yes I know this is considered bad practice, and for the most part I actually agree (i.e. no need to debate that point) but I'm wondering if it's possible to reference in XAML classes that aren't contained within a namespace. In other words, root-level classes. Again, I know this is bad practice, but I am curious. (BTW, yes I know abou...

Visual C++/CLI mutual access between two class objects?

Here is the problem: namespace Program1 { public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) {....} private: RunnableThread^ peerThread; private: System::Void loginButton_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) { String^ ip = this->ipTextFi...

Is it possible to have forms in sub-namespaces of a VB.NET WinForms project?

If I create a new class library project in VB.NET, I can create subfolders (a la C#), add WinForm objects to these subfolders, and then specify a namespace: Namespace Sub1.Sub2 Public Class SomeForm Public Sub New() InitializeComponent() End Sub End Class End Namespace This resolves as ProjectRootN...

LLVM Compiler 2.0: Warning with "using namespace std;"

In Xcode using LLVM 2.0, when I put the line using namespace std; in my C++ code, I get this warning: Semantic Issue Using directive refers to implicitly-defined namespace 'std' Is there a way to fix this? Why is it giving that warning? ...

main in namespace

Why doesn't this compile? The linker can't find main, but why is this the case? namespace somenamespace{ int main(void){ return 0; } } ...

'stdx’ is not a namespace-name error being shown for a ptr_vector program

I've been trying a program from codeproject, about ptr_vector, and while compiling, the above error is shown. Googling shows no hope to solve this problem. Could anyone here help out? Here's the entire code (am compiling with gcc 4.2.2) #include <iostream> #include <string> #include <boost/ptr_container/ptr_vector.hpp> using namespace ...

MVC 2 - How to set the namespace targeted by an actionlink

I have 2 namespaces for my controllers. One is the default MyProject.Controllers and the second is MyProject.Controllers.Framed. I am using namespaces so that I can have a url like /home/index serve up the normal home website and /framed/home/index serves up a version intended for use in an iframe. My problem is that when I put <%: Ht...

Strange compile error regarding overload resolution

This code fragment: namespace ns { struct last; struct first { typedef last next; }; template <typename T> struct chain { chain<typename T::next> next; }; template <> struct chain<last> { }; } using namespace ns; template <typename T> void f(const T& x) // #1 ...

I cann't access a namespaces in referenced assemblies in MVC Views

Some times there are an intellisense problem in the views, the namespaces in the referenced assemblies don't appear in the intellisense only in views but the do appear in .cs code files in the same project.. i've tried these ways: <pages> <namespaces> <add namespace="MyNameSpace" /> </namespaces> </pages> in the web.config fi...

XSLT : Cannot convert the operand to 'Result tree fragment'.

Hello, I work on an xslt stylesheet, and I should receive as parameter two additional XML. I get an error when I use the node-set() method (from namespace ms, microsoft). The contents of the XML is correct. The parameters are send with classic ASP. Here's the header and the call in xslt: <?xml version="1.0" encoding="utf-8"?> <xsl:styl...

NameError: global name is not defined

I'm using Python 2.6.1 on OS X. I have two simple python files (below) but when I run: python update_url.py I get on the terminal: Traceback (most recent call last): File "update_urls.py", line 7, in <module> main() File "update_urls.py", line 4, in main db = SqliteDBzz() NameError: global name 'SqliteDBzz' is not define...

XSLT namespace axis seems not to work

I have the following xslt: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:my="my_namespace"> <xsl:template match="/"> <xsl:value-of select="document('')/xsl:stylesheet/namespace::my"/> </xsl:template> </xsl:stylesheet> ant it always returns an empty...

How to correctly parse an XML document with arbitrary namespaces

I am trying to parse somewhat standard XML documents that use a schema called MARCXML from various sources. Here are the first few lines of an example XML file that needs to be handled... <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <marc:collection xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsi="http://www.w3.org/200...