How can I modify the local namespace of a function in python? I know that locals() returns the local namespace of the function when called inside it, but I want to do something like this (I have a reason why I want to do this where g is not accessible to f, but it's quicker to give a trivial, stupid example to illustrate the problem):
...
Are there any benefits to using the 'window' prefix when calling javascript variables or methods in the window object? For example, would calling 'window.alert' have an advantage over simply calling 'alert'?
I can imagine using the prefix could give a small performance boost when the call is made from inside some function/object, however...
If I have XML like this:
<sample>
<a:element1 xmlns:a="..." />
<b:element2 xmlns:b="..." />
</sample>
it seems that XSL can't find the two child nodes of <sample> due to the prefixes a: and b:.
If I eliminate the two prefixes as well as the namespace declaration, then they are found.
The problem is that I can't do any...
I was looking over some (C++) code and found something like this:
//Foo.cpp
namespace
{
void SomeHelperFunctionA() {}
void SomeHelperFunctionB() {}
void SomeHelperFunctionC() {}
//etc...
class SomeClass //<---
{
//Impl
};
}
SomeHelperFunction[A-Z] are functions that are only needed in that tra...
Hi guys,
Prior to PHP 5.3 I used to name interfaces/abstract classes like this:
abstract class Framework_Package_Subpackage_Abstract {}
Framework/Package/Subpackage/Abstract.php
interface Framework_Package_Subpackage_Interface {}
Framework/Package/Subpackage/Interface.php
Now with PHP 5.3 and using namespaces I can't use my conventi...
This is a question about what defining a class as public or private does.
Right now, I have various classes defined inside of a namespace and I only want some of those classes to be visible/usable to the outside world.
So, for example, if the classes below were the only ones in the program, I would want main.cpp to only be able to see/...
If I have a namespace like:
namespace MyApp.Providers
{
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
}
Does this mean that if I create other files and classes with the same namespace, the using statements are shared, and I don't need to include them again?
...
I am currently moving code from my app_code folder to a class library. I have tagged several methods with [System.Web.Script.Serialization.ScriptIgnore] attributes. My class library cannot see this namespace. My add references dialog cannot see this namespace. How do I properly use this tag from a class library?
The type or namespac...
I have to write a generic template for finding an operation name and the namespace for that from a soap response. Generic i mean, that is applicable to any operation. So I don't know the operation name and the name space name but want to get them and modify back when I am sending the response.
Here is the structure of the response:
Typ...
I wanna create an element in my XSL 1.0 with some namespace Just like this:
<element xmlns:a = '...' xmlns:b = '...' xmlns = '...' >
For some reason I can't use XSL 2.0, with <xsl:namespace> extension, there is only one allowed namespace declared for each element in XSL 1.0,how should I do?
Regards,
...
I am frequently having naming conflicts between a namespace and a class within that namespace and would like to know a best practice for handling this when it seems to make sense to use these names in the first place, besides adding random prefixes.
It seemed to make sense to have a Models.Technology namespace, with dozens of technology...
ASP.NET has a feature that allows you to declare implicitly used namespaces in the web.config.
<configuration>
<system.web>
<pages>
<namespaces>
<add namespace="System.Web.Mvc"/>
</namespaces>
</pages>
</system.web>
</configuration>
I'm curious to know if configuration for other .net environments (like winforms, consol...
When you create a new class in visual studio it includes a namespace definition which is pulled from the default namespace set in the project properties. However if you remove the namespace definition it picks up the default namespace anyway. Is it safe to remove and is there any benefit to leaving it there?
...
What methods, practices and conventions do you know of to modularize C code as a project grows in size?
...
I am invoking a service through WCF and has encountered a problem with non-matching namespaces.
The object that is beeing sent though the service is in the namespace MyProject.Commons.BuisnessObjects, and I have verified this through WcfTestClient.
When I invoke a method clientside on the service (after initiated this with new MyServ...
Hi there,
I've have been using Visual Studio 2005, alongside Visual Web Developer 2008 to create asp.net web-apps in vb. I recently installed Visual Studio 2008 alongside these, along with AnkhSVN - and have noticed a few changes which are causing issues!
The most noticable is that in my solution explorer (I'm creating asp.net apps i...
For example, if this code were contained in a module called some_module
class C:
class C2:
def g(self):
@printNamespaceAbove
def f():
pass
then printNamespaceAbove would be defined so that this code would output something like
[some_module,C,C2,g]
...
I always had the idea that the root namespace in .NET, "System", was mainly for stuff that didn't depend too much on a particular platform.
I was wondering if anyone had any ideas or insight as to why the Windows.Forms namespace is in System and not Microsoft since it seems to be fairly entrenched in one platform.
(No flame wars or un...
I created a new ASP.NET MVC application with a Project Name of "HelloWorld", and did some basic testing. I then did a global rename of "HelloWorld" to "ApplicationName", but when I create a new controller, it still puts it into the "HelloWorld" namespace.
How do I fix this?
...
I am implementing a relatively simple thread pool with Python's Queue.Queue class. I have one producer class that contains the Queue instance along with some convenience methods, along with a consumer class that subclasses threading.Thread. I instantiate that object for every thread I want in my pool ("worker threads," I think they're ...