namespaces

the compiler doesn't seem to accept Agent class

Hey, probably the answer is quite silly but I need a pair fresh of eyes to spot the problem, if you will. this is the excerpt from _tmain: Agent theAgent(void); int m = theAgent.loadSAG(); and this is agent.h, which I included in _tmain: #ifndef AGENT_H #define AGENT_H class Agent { public: Agent(void); int loadSAG(void); ~Agent(voi...

(Conventions) C# Class names

Hello, I'm not too quite sure about what i should do about a grouped set of classes. My situation: I have 11 classes that relate only to the class Character.cs, but all of those classes (including Character.cs and CharacterManager.cs) are within the namespace Models.Characters. Which is the more "proper" or preferred way of naming ...

Namespace convention for Objetive-C

I'd like to group classes so they must be referenced like this: Root.Web Root.Mail Root.Audio Each of the above classes corresponds to a file: Web.h Mail.h Audio.h The goal is to use the above "Root" syntax rather than just: Audio myAudio = [[Audio alloc] init]; Instead, it should look like: Root.Audio myAudio = [[Root.Audio ...

Detect stage of static initialization?

What I really want is, how do I know when each stage of C++ initialization is truly DONE? There is static initialization where simple things get assigned. Then there's dynamic static initialization where more complicated statics get assigned, which is not defined across 'translation units'. This is kind of horrible, and there are not ma...

C#.NET Namespace name does not exist in namespace error - only when using is outside local namespace directive - why?

Using .NET 2.0, C#, Windows Forms development, Enterprise Library 3.1. We have a project namespace (call it Project). We also have several sub-namespaces inside of that project, for example Project.Namespace1, Project.Namespace2, etc. In one class, we define enums and such to be used with the Enterprise Library Logging block, like thi...

SelectSingleNode always returns null?

Taking this simplifed example of my XML: <?xml version="1.0"?> <message xmlns="http://www.mydomain.com/MyDataFeed" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mydomain.com/MyDataFeed https://secure.mydomain/MyDataFeed/myDataFeed.xsd" requestId="13898" status="1"> <error>Invalid Login</error> </me...

C#: transcribe WAV file to text (speech-to-text) with System.Speech namespaces

How do you use the .NET speech namespace classes to convert audio in a WAV file to textual form which I can display on the screen or save to file? I am looking for some tutorial samples. UPDATE Found a code sample here. But when I tried it it gives incorrect results. Below is the vb code sample I've adopted. (Actually I don't mind the...

How to share constant values in .net namespaces?

I'm trying to port some code into .net which has a load of #define'd values e.g. #define MY_CONSTANT (512) #define MY_VERSION_STRING "v42.2" When I import a cli library the #define's are lost. Is there a way of defining constants in the scope of a namespace. I was thinking something like this: namespace MyNamespace { const ...

Naming the Namespace

I am having an issue trying to figure out how to appropriately name my namespace. My namespace is currently: <CompanyName>.<ProductName>.Configuration However, using "Configuration" conflicts with: System.Configuration To make matters worse, I also have a class called ConfigurationManager. I know I could change it to something li...

xml element name with colon

I'm working against a 3rd party xml api. They have defined a required xml structure similar to the following. <ns1:E xmlns:ns1="schema"> <ns1:B> <ns2:S> <ns2:V> <ns2:Bl /> </ns2:V> </ns2:S> </ns1:B> </ns1:E> There is a SQL table with the information that I need to put into this xml format. I have a LINQ to SQL adapter to ge...

change xml namespace

Hi, I have an xml file as following: <?xml version="1.0" encoding="utf-8"?> <ABC version="1" xmlns="urn:Company"> </ABC> I am releasing version 2 and the namespace changed to "NewCompany". How do you update the namespace? I tried XmlDocument xmlDocument = new XmlDocument(); using (XmlReader xmlReader = XmlReader.Cr...

alias a namespace globaly for the entire project

is it possible to create a new alias for a given namespace for the entire project? that is i dont want to write a "using DO = App.Do.App33;" in each cs file of the project. but i want to do it one time in some configuration or maybe in some cs file. and then simply DO will refer to App.Do.App33 in the entire Application. ...

Namespace Class clash in csharp - looking for suggestions

Hi, im building a generic articles framework and my namespace names are clashing with my entities: Namespace: MyCompany.Articles.Modules Class: Articles, Article Any suggestions to how this can be avoided? According to MS I should use the following format: <Company>.(<Product>|<Technology>)[.<Feature>][.<Subnamespace>]. Thanks. ...

Namespaces, aliases and Visual Studio Forms Designer

Hi. I'm having a problem with conflicting namespaces and code that gets autogenerated by the forms designer in Visual Studio 2008. I have search many forums and different documentation, but have not been able to find any solution to this problem. I have one assembly called Foo.dll with the following namespace/code: namespace Foobar.Sy...

PHP Doctrine relationship with namespaces

Hello, i just started using PHP namespaces. I have two models classes in separate files In both files first i declare namespace namespace eu\ed\sixImport\importViewer\models; first class: class Log extends \Doctrine_Record $this->hasMany('eu\ed\sixImport\importViewer\models\DataSource as DataSource', array( 'local' => '...

Should a class have the same name as the namespace?

I'm designing a namespace to hold a set of classes that will handle user related tasks for a several different applications. (Log-in, authenticate etc) The problem is the namespace will be called Fusion.User but then it requires a class in that namespace that makes sense to call User. Should you have a class with the same name as the n...

Namespace and classes in php

Why i receive error? the class in the same namespace.. php 5.3.0 namespace ExampleSystem\Core; class Test { public function __construct() { print 'Test ok'; } } // Fatal error: Class 'Test' not found in ... $class_name = 'Test'; $obj = new $class_name; // Ok $class_name = 'ExampleSystem\Core\Test'; $obj = new $class_name...

Should I put custom code inside Microsoft's BCL/FCL namespaces?

A .NET programmer is allowed to wrap code inside namespaces and also to use a namespace already defined, even those defined by Microsoft in the Framework or Base Class Library. For example if I were to use System.Windows.Forms to outline this idea: Reference in assembly System.Windows.Forms.dll // This is my own C# source code file. u...

Is there a well-established naming convention for PHP namespaces?

So far, I've seen many different naming conventions used for PHP namespaces. Some people use PascalCase\Just\Like\For\Classes, some use underscored\lower_case\names, some even use the Java convention for package names: com\domain\project\package. The question is very simple -- can any of these (or other) conventions be called well-establ...

vb.net external-only properties or methods

Is there a simple way in vb.net to mask a public property or method from the internal namespace? It would be helpful as a refactoring tool to isolate internal dependencies and perhaps to enforce a non-recursion policy for external services. ...