namespaces

Address a Package name by a shorter name

房东的猫 提交于 2020-01-06 15:08:10
问题 I have arranged my .java files in a folder-subfolder-* structure. My initial package name is (e.g) com.company.app Therefore the .java files in a would have a namespace / package of com.company.app.folder1.folder2 And to access any of the classes from the com.company.app I have to prefix the class name with the package name. com.company.app.Game I was wondering if there is a way to set an alias or a pointer to a package(name) and then be able to just use the pointer ? like so app.Game Is this

Does Ruby provide the namespace path, e.g. something like [:A,:B] for class A::B::C?

醉酒当歌 提交于 2020-01-06 14:57:19
问题 Is the following possible? puts A::B::C.new.namespace_path # => [:A,:B], or even [A,B] 回答1: I think maybe #ancestors is what you're looking for. So A::B::C.ancestors or you may just want to self.class.to_s.split("::") 来源: https://stackoverflow.com/questions/3313473/does-ruby-provide-the-namespace-path-e-g-something-like-a-b-for-class-ab

XSLT Can't match element with specific namespace

杀马特。学长 韩版系。学妹 提交于 2020-01-06 13:09:43
问题 I have this XML source file: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="c:\ISO19139_rve.xsl"?> <MD_Metadata xmlns="http://www.isotc211.org/schemas/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/schemas/2005/gco" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.isotc211.org/schemas/2005/gmd/gmd.xsd"> <identificationInfo> <MD_DataIdentification> <extent> <EX

How can I make the namespace locally match what is listed on MSDN?

China☆狼群 提交于 2020-01-06 12:52:31
问题 I'm using Microsoft Visual Studio 2013 Premium. When I consult MSDN, it lists the classes available for the Microsoft.VisualStudio.TestTools.UITesting namespace. However when I view that namespace through the Object Browser, it doesn't list all of the classes. This is further evidenced when I try to use the ImageComparer class. How can I get all of the classes? MSDN: http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.uitesting.aspx Local Object Browser: 回答1: It's

PrestaShop module classes not found (namespaces)

旧街凉风 提交于 2020-01-06 12:33:34
问题 This is my PrestaShop module file structure: -mymodule/ --src/ --mymodule.php ---Presta/ ---Webhooks.php ----Controller/ -----MyPrestaController.php mymodule.php cannot find Webhooks.php class, I've tried use in mymodule.php, but still it provides errors: ClassNotFoundException in mymodule.php line 55: Attempted to load class "Webhooks" from namespace "src\Presta". Did you forget a "use" statement for another namespace? When I try to use autoload/include/require in mymodule.php it throws

PrestaShop module classes not found (namespaces)

僤鯓⒐⒋嵵緔 提交于 2020-01-06 12:33:04
问题 This is my PrestaShop module file structure: -mymodule/ --src/ --mymodule.php ---Presta/ ---Webhooks.php ----Controller/ -----MyPrestaController.php mymodule.php cannot find Webhooks.php class, I've tried use in mymodule.php, but still it provides errors: ClassNotFoundException in mymodule.php line 55: Attempted to load class "Webhooks" from namespace "src\Presta". Did you forget a "use" statement for another namespace? When I try to use autoload/include/require in mymodule.php it throws

PrestaShop module classes not found (namespaces)

大憨熊 提交于 2020-01-06 12:32:28
问题 This is my PrestaShop module file structure: -mymodule/ --src/ --mymodule.php ---Presta/ ---Webhooks.php ----Controller/ -----MyPrestaController.php mymodule.php cannot find Webhooks.php class, I've tried use in mymodule.php, but still it provides errors: ClassNotFoundException in mymodule.php line 55: Attempted to load class "Webhooks" from namespace "src\Presta". Did you forget a "use" statement for another namespace? When I try to use autoload/include/require in mymodule.php it throws

Accessing private class in operator<< in namespace

喜夏-厌秋 提交于 2020-01-06 06:28:08
问题 I have a class CFoo with a private inner class CBar. I want to implement a stream ouput operator for CFoo, which in turn uses a stream output for CBar in it's implementation. I can get this working when CFoo is in the common namespace, but when i place it in a new namespace (namespace foobar), the operator can no longer access the private inner class. I suspect this has something to do with the full signature of the operator, but I can't figure out the correct way to specify the friend

PHP Namespaces Override Use Statement

跟風遠走 提交于 2020-01-06 04:39:46
问题 Can anyone tell me if it's possible to override a use statement? My example is having an MVC setup where there is core code with the ability to override each Controller / Model with a custom version that extends the core version. The issue I face is that my core controller has a use statement telling it to use the core model, so if I extend the model, I'm not sure how to tell it to use the custom model rather than the core one I could obviously update the core controller use statement to

How to use class defined in a separate header within a namespace

一曲冷凌霜 提交于 2020-01-06 04:04:10
问题 I have a namespace in which I'd like to define a class. The class is rather complex so I'd rather define it in a separate header file, but even the simplest code gives me an "undefined reference" error. main.cpp #include <iostream> namespace A { #include "C.hpp" } int main() { A::C foo; std::cout << foo.member << std::endl; return 0; } C.hpp class C { public: C(); int member; } C.cpp C::C() { this->member = 10; } When I run g++ C.cpp main.cpp I get "main.cpp:(.text+0x10): undefined reference