FAQ Database Discussion Community

## pyinstaller with namespace packages

python,namespaces,package,pyinstaller
I have a module/package structure where I am using namespace packages, I have multiple user made libraries which I keep in separate repositories, and they have fairly generic names like db, io, utils and so on. To avoid conflict with other packages I have a top level/namespace package named acme,...

## How do I access DbContext.Entry Method (TEntity) in my generic repository class?

c#,entity-framework,namespaces,dbcontext
This should be really obvious but for some reason I can't figure it out. So in my generic repository class I have an update method to update an entity: public void Update<TEntity>(TEntity entity) where TEntity : class, IBusinessEntity { try { if (entity == null) { throw new ArgumentNullException("entity"); }...

## Namespace for (DDD) entities cutting across domains

namespaces,domain-driven-design,modeling
I have a couple of business-related domains like Purchase, Marketing and Economy. Having the models arranged into a namespace* for each domain would be nice, but there are some entities cutting across domains, like an Item. How to organize those cross-cutting objects? * = As in C#/Java/Python namespaces....

## Ruby namespacing

ruby-on-rails,ruby,namespaces
I'm pretty new to ruby, coming from a php background, but something is not clicking with me. So, let's say I have a Ruby on Rails application and I am versioning my API like so: app |_controllers |_api | |_v1 | | |_application_controller.rb | | |_user_controller.rb | |_application_controller.rb |_application_controller.rb With...

php,laravel,namespaces,laravel-excel
In my controller I have the code as below: Excel::create('Laravel Excel', function($excel) {$excel->sheet('Excel sheet', function($sheet) {$sheet->setOrientation('landscape'); }); })->export('xls'); In config/app.php in aliases array i have defined this: 'Excel' => 'Maatwebsite\Excel\ExcelServiceProvider', I dont know why i cant make it work this library... Any idea?...

## friendship and namespace issue

c++,namespaces
I'm having troubles with friendship between a class of a namespace and a function as below: How to tell that the friend function is outside of the namespace? Thanks namespace NS { class Class { public: Class(); virtual ~Class(); private: void Foo(); friend void Bar(Class&); }; } void Bar(NS::Class& c)...

## Include ggplot2 function in package

r,plot,ggplot2,namespaces,r-package
I am trying to include the following ggplot2 helper function in a package [it wraps labels in grid_facet(.~variable, labeller = "plot.label.wrap")]: #' Label wrapper for ggplot #' #' Include in the facet_grid option of ggplot. #' @param variable #' @param value #' @return wrapper #' @export plot.label.wrap <- function(variable, value)...

## Support namespaces/references Java to C# equivalent in Android-Visual Studio

java,c#,android,namespaces
I am working on a application where I am translating code from Java to C# to create a custom MapView in offline mode on android. I am using this tutorial that is written in Java and there are a few namespaces that I am unable to comprehend where the creator...

php,namespaces

## Python: is there a way to use “unimported” objects in function definitions?

python,function,namespaces,python-module
I'm modifying a simple recursive function to draw a dragon curve using turtle: def draw_dragon(t, order, size, L=turtle.left, R=turtle.right): """ Draw a dragon curve """ if not order: t.forward(size) return size /= 1.41421 t.R(45) draw_dragon(t, order-1, size, L, R) t.L(90) draw_dragon(t, order-1, size, R, L) t.R(45) if __name__=="__main__": import turtle...

## XML, XSL namespaces

xml,xslt,namespaces
I'm new to XML especially namespaces. I made all the documents and everything seems to work fine, but I don't know whether I'm really using namespaces (which is requirement). Except that my html file are not valid because off this: "Attribute xmlns:xsi not allowed here." and "Attribute xmlns:xslformatting not allowed...

php,namespaces

## C++ header-only library avoid “using namespace” pollution

c++,c++11,namespaces
I have a header-only C++ library with sevaral namespaces. For example one header file may contain //header1.h namespace library{ namespace componentA{ template<typename T> class Someclass{}; } } And another one //header2.h namespace library{ namespace componentB{ template<typename T> class SomeOtherClass{ void Foo(const componentA::Someclass<T>& reference); void Bar(const componentA::Someclass<T>& reference); }; } }...

## Accessing PHP classes outside of namespace

php,mysqli,namespaces
I'm trying to extend mysqli outside of my namespace. Whenever I run it it can't find mysqli inside the namespace. How can I access mysqli outside of the namespace? Here is my code: <?php namespace xBell\Database; class Database extends mysqli { public function __construct() { $hostname = \eBot\Config\Config::getInstance()->getMySQLIP();$username =...

## Disabling default namespaces

namespaces,rust
Rust seems to use some namespaces by default. For example, I don't have to use std::string::String and can simply type String. How can I define my own struct String without clashing with std::string::String? And where can I find a list of the namespaces that are included by default?

## C# Obtaining Namespace Based on CSProj settings

c#,.net,c#-4.0,visual-studio-2013,namespaces
Is there a way to obtain the .csproj Default Namespace and Visual Studios understanding it without using preprocessor directives? For example: CS Project 1 has a Default Namespace of SomeCompany.ProductA CS Project 2 has a Default Namesapce of SomeCompany.ProductB CS Project 1 has a cs file that exists in BaseClasses/MySpecialBase.cs...

## R cannot load package forecast due to namespace error

r,namespaces,packages
I tried installing all the dependant packages and also tried another repo source as recommended in another post here. R version 3.2.0 x64 install.packages("fracdiff") install.packages("Rcpp") install.packages("RcppArmadillo") install.packages("colorspace") install.packages("forecast", dep=T) install.packages("forecast", repos=c("http://cran.rstudio.com"),dep=T) library("forecast") then I get Loading required package: zoo Attaching package: ‘zoo’ The following objects are masked from ‘package:base’: as.Date,...

## Why no namespace prepended for function when using namespace directive?

This c++ file... namespace foo { class C { void m(); }; void f(); } using namespace foo; void C::m() {} void f() {} ..Compiles to an object file with these symbols: $g++ foo.cpp -c$ nm foo.o -C 000000000000000a T f() 0000000000000000 T foo::C::m() Why does C::m()? get...

## Namespace, class and compiler order…

I'm experiencing with OpenGL and I built and edit a Vector3 header that works perfectly that works with struct Vector3 but the problem starts when I tried create a Vector3 zero = Vector3(0,0,0) variable, the compiler doesn't let me build due to the compiling order so I copied a new...

## Zend 1 3d party NameSpaces autoload don't working

I'm trying to implement Amazon WebServices PHP SDK into my Zend 1 project, but it seems to fail loading the classes. I have got the library into library/Eplan/AmazonCloudSearch and after investigation it seems that in order to be able to load the namespace I need to call the registerNamespace method...

## XSLT- Pre Define NameSpace

parsing,xslt,namespaces
Hi I have an XML that upon each delivery has a different unique named Namespace that I cannot pre determine with standard processes. <ABC xmlns:this="urn:uuid:9b1f15a9-69de-11d2-b6bc-fcab70ff7331" version="1.1"> <Extensions> <Identification>urn:uuid:9b1f15a9-69de-11d2-b6bc-fcab70ff7331</Identification> <Extension> <SrcPackage> <this:ABDList> <TaggedValue>111</TaggedValue> </this:ABDList> <this:SubBegin>0</this:SubBegin> </SrcPackage> <MatPackage>...

## Adding default namespace conditionally using xslt

xml,xslt,namespaces,xml-namespaces,ibm-datapower
Requirement: Check whether a default namespace declaration xmlns="http://www.origoservices.com present in the request xml. If not, add the default namespace declaration. Sample Request xml 1: <message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <m_control> <control_timestamp>2014-11-05T09:30:38.308</control_timestamp> <retry_number>0</retry_number> <expected_response_type>synchronous</expected_response_type> <responder_id>Exchange Life 1</responder_id>...

## Safely creating namespaces in JavaScript

javascript,namespaces
I understand why namespaces are good - to prevent too many global definitions and to prevent code from being overwritten, but i'm trying to dig a bit further into the following syntax: // not safe, if there's another object with this name we will overwrite it var MYAPPLICATION = {};...

## TYPO3-Upgrade 4.5 to 6.2: namespaces

namespaces,typo3,typo3-6.2.x
I'm updating an old TYPO3 to latest verison 6.2.12. As I do so I replace deprecated classes with the proper namespaces. E.g. t3lib_div to \TYPO3\CMS\Core\Utility\GeneralUtility or t3lib_extmgm to \TYPO3\CMS\Core\Utility\ExtensionManagementUtility. But I cant find the proper namespaced class for t3lib_svbase. Any suggestions? . And I absolutely have no clue what I...

## Get rid of Visual Studio Namespace error message

c#,.net,wpf,xaml,namespaces
this is unfortunately a very beginner question: I am doing the very simple WPF tutorials and I am stuck on a namespace problem. I want to do a simple hierarchical treeview binding on a custom object according to the tutorial. I put the object into a custom namespace "MyNameSpace" and...

## how to solve the type and namespace could not be found

c#,namespaces,mono
I am trying to make a cross platform application using MONO. i developed the project into c#(windows) and I want to run that project into Linux. For that purpose i am using MONO.But when i am running my project then I am getting error that the type and namespace could...

## KDB+ / Q Accessing root namespace from namespace

namespaces,q,kdb
how can I access functions/variables in the root namespace once I jumped into another namespace. Example like this: q)\d .cfg q)domIV:1000 q)\d . q)n:1000 And then later on I know how to access the variable domIV from the other namespace, but I dont know how to access the variable n...

## Parsing XML with undeclared prefixes in Python

python,xml,parsing,namespaces,xml-namespaces
I am trying to parse XML data with Python that uses prefixes, but not every file has the declaration of the prefix. Example XML: <?xml version="1.0" encoding="UTF-8"?> <item subtype="bla"> <thing>Word</thing> <abc:thing2>Another Word</abc:thing2> </item> I have been using xml.etree.ElementTree to parse these files, but whenever the prefix is not properly declared,...

## Rails namespaced models give uninitialized constant errors

ruby-on-rails,ruby,namespaces
I have two models in namespace project like this: class Project::Foo and class Project::Bar They have this relationship in app/models/project/foo.rb has_many :bars in app/models/project/bar.rb belongs_to :foo However when I want to call Project::Foo.create(...) or even Project::Bar.create(...) I get a NameError with uninitialized constant Foo or Bar respectively. Do I need...

## Are namespaces in PHP “inherited”?

php,drupal-7,namespaces
EDIT: Yes the problem was using \ at the beginning of the use statement. As M1ke pointed out, use goes from the root element. Original post I think is a PHP question but it may be Drupal. I'm working on a headless Drupal project where is using a class (which...

## Displaying XML nodes with XSL but keeping the order on XML - With multiple namespaces

html,xml,xslt,dom,namespaces
I have the following multi namespaces XML file: objects.xml <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="objects.xsl"?> <objects xmlns:objA="http://www.mywebsite.com/objectA" xmlns:objB="http://www.mywebsite.com/objectB" > <objA:objectA> <objA:attrA1>Instance 1 Value 1</objA:attrA1> <objA:attrA2>Instance 1 Value 2</objA:attrA2> </objA:objectA> <objB:objectB> <objB:attrB1>Instance 2 Value 1</objB:attrB1>...

## how to use class of other project in a solution (internal)? [duplicate]

c#,namespaces
This question already has an answer here: How to use a Class from one C# project with another C# project 7 answers Environment : In C#, I have a solution with many project. They were added with *.csproj files. Problem : In a project, you can use classes of...

## Rails: Rendering a template in a different namespace

ruby-on-rails,namespaces
How can I render an action of a controller which is in a different namespace? For example, if I have a login controller in a Webapp namespace Webapp::LoginController and I want to render the index action (not a partial!) in an events controller in the API namespace API::EventsController if the...

## ExtJS5 Namespace Confusion

extjs,namespaces
I am completely confused on the namespaces in ExtJS5 application. I am using a common folder under the sencha workspace where I keep code I will be using for multiple pages (multiple SPA's). In one application definition I have the following snippet: Ext.define('Admin.Application', { extend: 'Ext.app.Application', name: 'Admin', namespaces: ['ALT'],...

## Where is the Conversion Namespace in Windows Store Apps

.net,namespaces,windows-store-apps,windows-8.1
I am trying to write my first Windows Store App and am using some code from an old project. I am developing on a Windows 8.1 Pro machine with Visual Studio 2013 Express. I have no idea what people are calling the version of .NET I'm targeting and therefore, cannot...