namespaces

xpath selection on elements with namespaces

Here's a trivial but valid Docbook article: <?xml version="1.0" encoding="utf-8"?> <article xmlns="http://docbook.org/ns/docbook" version="5.0"> <title>I Am Title</title> <para>I am content.</para> </article> Here's a stylesheet that selects title if I remove the xmlns attribute above, and not if I leave it in: <?xml version="1.0" en...

When do you add a new project for a nested namespace?

I have many projects that are named after namespaces types are under When adding a new sub-namespace, how do you decide whether to • create a new folder in a project -- or -- • create a new project in a solution? What are some of dis/advantages I should consider for each scenario? ...

What's your typical structure of an ASP.NET solution?

As the title says, I'm interested to know how you typically structure your ASP.NET solutions. I'm especially interested in ASP.NET WebSite solutions, but information abut other types (WebApplication, MVC) might be interesting as well. Some specific questions: what/how many projects/assemblies does the solution contain how do you name...

C++ Using Namespaces to Avoid Long Paths

Hello! I am still learning C++ and I have never really created my own namespaces before. I was experimenting with them and while I got most things to work, there's one thing that I still can't seem to do. I would like to be able to call a static method within a class without typing something like "NameOfClass::method." Here is what I...

calling execfile() in custom namespace executes code in '__builtin__' namespace

When I call execfile without passing the globals or locals arguments it creates objects in the current namespace, but if I call execfile and specify a dict for globals (and/or locals), it creates objects in the __builtin__ namespace. Take the following example: # exec.py def myfunc(): print 'myfunc created in %s namespace' % __nam...

Why doesn't the "Namespace Provider" property get saved within a project file for a given subdirectory?

Sub directories within VS2008 projects are mainly used to physically represent on disk the namespace structure for the project. Each folder has a Boolean property called “Namespace Provider”, which when set to True causes ReSharper to validate that the physical location of a given class corresponds to the logical namespace location. Occ...

C++ namespaces advice

Just teaching myself c++ namespaces (coming from a c# background) and i'm really starting to think that all the things that c++ does better then most other languages, nested namespaces isn't one of them! Am i right in thinking that in order to declare nested namespaces i HAVE to do the following: namespace tier1 { namespace tier2...

What namespace are my classes in when I don't put a namespace?

Hi, if I don't put a namespace in my classes (vs.net 2008), which namespace do my classes get built under? update Its strange, when I add a namespace I can't seem to reference the classes methods from my user control. If I explicitly set a namespace, and add a 'using ...' in my control, I still can't see it! How can this be? usi...

Hiding namespaces containing only internal types in a class library?

I have a class library that has a couple of namespaces containing only internal types. However, when using the class library in an application project, the namespaces shows up in intellisense, but of course they are empty. Is there any way for me to hide the namespaces completely when using intellisense in other projects? I've tried to...

Inserting an element into xml produces an unnecessary propertry xmlns=

Whenever I insert an element into my xml document, the system adds an xmlns="" attribute to it. How do i get rid of it? Why is it there? Im using very simple linqtoxml. I've got a simple XML file (Note there is no Xml declaration line and it contains a namespace): <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/deve...

ASP.NET MVC: Namespaces in routes

Hello! I have a small problem, I can't find any documentation on the namespaces parameter for MapRoute. Can anyone explain how I should use that? I want to map ~/Controllers/Projects/ProjectController.cs to this url ~/Projects/ but I also have other controllers in ~/Controllers/Projects that I want to map to other URL's. So I need to a...

Namespace for Reverse Phone, Reverse Zip, and Reverse IP Lookup services

I'm looking for ideas/suggestions on a namespace. I have 3 objects that do the following: Object 1: Reverse Phone Lookups Object 2: Reverse Zip Code Lookups Object 3: Reverse IP Address Lookups Currently, they are in the following namespaces: (CompanyName).Utilities.PhoneTools (CompanyName).Utilities.AddressTools (CompanyName).Uti...

ASP.NET MVC Views don't see any classes after massive refactoring

My project went through a name change, which led to using ReSharper to change the name of namespaces throughout the solution. Everything compiles just fine, but my ASP.NET MVC views are no longer seeing any inherited classes. I've changed the namespace imports in web.config and everything, and I'm certain that the classes exist. They wor...

Good Nickname for Namespaces

I am a programmer who is still in high-school, which means I do this as a hobby (for now...). I love using C# and one good feature of C# is namespaces. But my namespaces names all suck (it's just my name). What would be a good nickname to use for my namespaces? P.S. One rule: DON'T USE AARDVARK (it's not my last name but it looks horri...

parse an XML with SimpleXML which has multiple namespaces

Hey there :) I have this ugly XML which has alot of namespaces on it, when I try to load it with simpleXML if i indicate the first namespace I'd get an xml object ,but following tags with other namespaces would not make it to the object. How can I parse this XML ? <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap-e...

C# Variables and Namespaces

Hello, I am new to C# and programming in general my question is how do you call a variable that is in a different namespace? if I have this code public void servicevalues(string _servicename) { string servicename = _servicename; string query = string.Format("SELECT * FROM Win32_Service WHERE Name ='{0}'", servicename); Management...

Linq to Entities System.data.Objects

I'm getting started on Linq to Entities and the example references a namespace called System.Data.Objects. My environment doesn't include this namespace and I can't find the DLL that contains it. Anywone know where I'd find it? ...

target namespace of schema

Hello everyone, I want to do XML validation to validate whether an input XML file conforming to a schema file (.xsd). My question is when do we need to specify the target namespace parameter and what is the function of the target namespace parameter? I got this question from the following MSDN pages, http://msdn.microsoft.com/en-us/li...

Templated namespaces and typedefs are illeagal -- workarounds?

I have a templated function fct that uses some complex data structure based on the template parameter. It also calls some helper functions (templated on the same type) that are in a separate helpers namespace and use the same complex data structure. Now it gets really ugly because we cannot make one typedef for the complex type that all ...

Separating jquery and creating classes / namespaces? (OOP)

Hi, I recently came across DUI (diggs user interface) which implements jquery and gives you the ability to create classes, with jquery etc. I can't seem to find any reviews.. i saw one comment to say it wasn't up to much. I was wondering what everyone else is using with regards to separation of concerns with jquery Do you use some ki...