namespaces

Accessing Plist items in a dict

I have a class in a module I that reads a plist (XML) file and returns a dict. This is extremely convenient because I can say something like: Data.ServerNow.Property().DefaultChart This returns a property dictionary, specifically the value for DefaultChart. Very elegant. However, assembling a dictionary this way fails: dict={'Data': ...

How to stop a new form from using namespace System::Collections

If I create a new form called myForm, the top of myForm.h looks like this: #pragma once using namespace System; using namespace System::ComponentModel; using namespace System::Collections; //<<<< THIS ONE using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; None of these are even ...

Namespace + functions versus static methods on a class

Let's say I have, or am going to write, a set of related functions. Let's say they're math-related. Organizationally, should I: Write these functions and put them in my MyMath namespace and refer to them via MyMath::XYZ() Create a class called MyMath and make these methods static and refer to the similarly MyMath::XYZ() Why would I c...

Use multiple namespaces when deserializing with .NET XmlSerializer

I'm trying to deserialize XML with two namespaces, like this <records xmlns="http://www.foo.com/xml/records/1.1"&gt; <record xmlns="http://www.foo.com/xml/record/1.1"&gt; and sometimes an older version <records xmlns="http://www.foo.com/xml/records/1.1"&gt; <record xmlns="http://www.foo.com/xml/record/1.0"&gt; My Records.cs...

Multiple name spaces in a soap fault message causing FaultException deserialization to fail

We're connecting to a web service and the fault message we're getting back isn't deserializing (at all), and no version of class that I can make will deserialize correctly. We have no control over the server side of things. The server does not allow for discovery, so adding ?WSDL to the end of the URL of the endpoint results in an error,...

How to assign a user control to a namespace without having code-behind?

In a normal user control, we have .cs.ascx (code-behind) to assign the namespace we want our control to be in. But what if we don't have this code-behind to assign the namespace? Can we maybe assign the namespace of a user control in the headers? EDIT I was hoping I can do somthing like this: <%@ Control Language="C#" AutoEventWireup="...

Can you create a web user control in a application project outside of the project's default namespace?

I have a web user control (ascx) in my project and I would like to move it to a more general namespace that makes it easier to share the control across projects. The problem is, it seems that web user controls like to stay in a namespace named after the web application they're in. Is there some way to break out of the web app namespace...

In Clojure, Is it idiomatically correct to use require ... as rather than use... in the ns macro

I'm writing a clojure application which is growing from small to medium sized. We're currently importing modules using (ns foo (:use bar)) (fn-in-bar) but I think that switching to (ns foo (:require [bar :as b])) (b/fn-in-bar) would help with clarity and code comprehension. Is this a good way to do things? Is there a better w...

.NET Framework Namespaces?

What is a really good book that lists and explains all the namespaces of the .NET framework. version 2 (3/3.5 is a plus)? ...

Why is 'using namespace std;' considered a bad practice in C++?

Okay, sorry for the simplistic question, but this has been bugging me ever since I finished high school C++ last year. I've been told by others on numerous occasions that my teacher was wrong in saying that we should have "using namespace std;" in our programs, and that std::cout and std::cin are more proper. However, they would always b...

Is there an C++ equivalent to Python's "import bigname as b"?

I've always liked Python's import big_honkin_name as bhn so you can then just use bhn.thing rather than the considerably more verbose big_honkin_name.thing in your source. I've seen two type of namespace use in C++ code, either: using namespace big_honkin_name; // includes fn(). int a = fn (27); (which I'm assured is a bad thing) ...

how to add(or ignore) XML namespace when using XElement.Load

I am creating XML using Linq to XML and C#. It all works great except when I need to manually add in a row in the XML. This row is only added if I have a value to pass through to it, otherwise I just ignore the entire tag. I use XElement.Load to load in the string of text that I store in a string but when I attach it to the XML it alway...

Include view file within same namespace in PHP 5.3.0

Hi, I started developing sort of a mvc framweork on PHP5.3.0 for the static keyword, but since I'm here I said I should take advantage of the namespaces as well. So I have something like this for the view: namespace view { function load($filepath) { include($filepath); } function helper() { echo 'lo...

What does elementFormDefault do for XML/When is it used?

So I found some definitions for elementFormQualifed values: qualified - elements and attributes are in the targetNamespace of the schema unqualified - elements and attributes do not have a namespace So from that definition I would think that if a schema is set to qualified then why must you prefix the type with the name...

Classes in different sub-namespaces all appear at top level in WSDL

I'm creating a web service with a variety of classes, many of which can contain references to other classes. Sometimes these "sub classes" have the same name (e.g. Customer and Customer), but are actually different, so I've placed these in different namespaces (e.g. MyRoot.Sub1, MyRoot.Sub2, etc.) When I build the service, the generate...

Define a symbol in another namespace

Here is my problem: in a header I define a structure template type_to_string, which aims at defining a string corresponding to a given type argument: namespace foo { template <typename T> struct type_to_string { static const char * value; }; } template <typename T> const char * foo::type_to_string<T>::value = "...

Objective-C function dispatch collisions; Or, how to achieve "namespaces"?

I have an application for Mac OS X that supports plugins that are intended to be loaded at the same time. Some of these plugins are built on top of a Cocoa framework that may receive updates in one plugin but not another. Given Objective-C's current method for function dispatching, any call from any plugin to a given Objective-C routine ...

phpdoc datatype and namespaces

What is the current status of using namespaces in phpdocs datatypes. eg: * @param string|Vendor\SomeClass $parameter ...

What namespace must be used to get a DataGridComboBoxColumn?

I am writing an app in C# 3.5 in WPF. I want to programmatically add a DataGridComboBoxColumn in C# to a WPF toolkit DataGrid. The problem is that the control itself seems to not exist because I am missing either a directive or an assembly. I thought that System.Windows.Controls and by adding a reference to the WPFToolkit would handle th...

how to draw namespace/package scope method/variable in UML?

I'm currently trying to draw a class diagram of a couple of namespaces in C++. Right now, some variables and methods inside the namespace(free, not part of classes) are part of the namespace API, others are the external part of some classes API (like operator<< and those). I'm only willing to represent those methods/vars that expose na...