FAQ Database Discussion Community

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...

Constructor function - in simple namespace - Javascript

javascript,object,namespaces,prototype
In want to define a function-constructor inside a namespace. The way in which I defined the constructor till now was a simple constructor function without NS, combined with prototypal inheritance. The code looked kind of like: function mySuperObject() { var self = this; self.p1 = ""; self.p2 = "jkejie"; //...

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>...

Subroutines defined in required file assigned to wrong namespace after use of custom module

perl,module,namespaces
In a script I am working on, I have something similar to the following: require "environment.pm"; # Various definitions, including subroutine get_coll() use Custom::Module; In the Custom::Module file, I start with package Custom::Module; and end with 1; When I try to call get_coll() I get an error about it: (...

Usage of enum name as value identifier in Objective-C

objective-c,enums,namespaces,declaration,redefinition
Referring to this post it seems that there is no possibility in Objective-C to define two enums with the same value as in this example: enum AnEnum { AnyValue }; enum AnotherEnum { AnyValue // Error: Redefinition of enumerator 'AnyValue' }; I would like to understand the backgrounds why an...

How to use namespace System; in MFC application with VC++

c++,sql,visual-c++,mfc,namespaces
help me,am new, I want to use some features(i don't know the specific word to use) present in System namespace, but when i try to add it to my project by "using namespace System",i want this to use SQLCLIENT ,i saw below link giving answer but dont have a clue...

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...

C++11 cannot resolve nested namespace

c++,namespaces,nested
say I create a class Foo in foo.h under namespace Fooo like follows: foo.h: namespace Fooo { class Foo { }; } and its corresponding source file: foo.cpp: namespace Fooo { Foo::Foo() { } } I write another source file util.cpp to create some utility functions for the Foo class...

The name 'Thread' does not exist in the current context

c#,visual-studio-2013,namespaces
When I put this code Thread.Sleep(2000); it gives me the error: The name 'Thread' does not exist in the current context`. I already included the namespace using System.Threading;. See System.Threading.Thread.Sleep() on MSDN....

Leiningen REPL not autoloading project.core namespace [duplicate]

This question already has an answer here: how to load ns by default when starting repl 2 answers I'm new to Clojure so this could very well be an easy question. I'm having an issue with the REPL while using Leiningen. Previously, I had created an app project while...

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"); }...

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...

how to add new account in outlook with Name Space C#2003

c#,outlook,namespaces
public void sendEMailThroughOUTLOOK() { if(MessageBox.Show(PublicFunction.L_Get_Msg("msg",28),"MessageBox",MessageBoxButtons.OKCancel)== DialogResult.OK) { try { // Create the Outlook application. Outlook.Application oApp = new Outlook.Application(); //set default account send mail Outlook.Account account = GetAccountForEmailAddress(oApp,"[email protected]"); // Create a new mail item. Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem); // Set HTMLBody. //oMsg.HTMLBody= "<html> <p...

C++ Unable to overload function in class (and namespace) [duplicate]

c++,function,class,compilation,namespaces
This question already has an answer here: How come a non-const reference cannot bind to a temporary object? 11 answers I just created a cool class in a namespace and therefore I wanted to create 2 functions. They should have the same name, but different parameters. But every time...

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...

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'],...

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...

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?

How to specify module in namespace?

ruby-on-rails,module,routing,namespaces
I want to do something like: namespace :dashboard do get 'speed' get 'engine' get 'oil' get 'errors', :to => 'warn_system#errors', :module => false end Only errors link to another controller. dashboard_speed GET /dashboard/speed(.:format) dashboard#speed dashboard_oil GET /dashboard/oil(.:format) dashboard#oil dashboard_engine GET /dashboard/engine(.:format) dashboard#engine dashboard_errors GET /dashboard/errors(.:format) dashboard/warn_system#errors {:module=>false} For the last...

The type or namespace name could not be found Master Page

c#,namespaces
I am using this tutorial for getting the content of Masterpage to content page. http://stackoverflow.com/a/13620436/4725592 But when I try to get the content of the master page with this syntax, I gets the following error The type or namespace name could not be found The syntax : string getProcess =...

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)...

Namespace keyword in TypeScript

c#,namespaces,typescript,keyword
Trying to find out what does namespace keyword mean in TypeScript? Here's some reshuffle they've done recently to use namespace instead of module: https://github.com/Microsoft/TypeScript/commit/224e7630ea17c4547e97f85634f446b877955a67 In the absence of namespace spec, it looks like a rather pointless rename to make the language look C#-like. Or is there an obscure little difference...

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 =...

silex file structure for custom service providers

php,namespaces,silex
I am working on a Silex project which requires some custom service providers and their related classes to be written. I am aware of the preferred file structure of silex projects but cannot anywhere find information on where custom classes should fit into this structure. All composer supplied libraries are...

How to Move a class to another dll and change the namespace without altering the method usage

c#,.net,namespaces,refactoring
I have a dll where I have one class which logs to a "channel", another Program listens to the "channel" and writes the logs to the screen. The problem with the dll is that its grown over time and now there are many dependecies in it. I want to remove...

Does it matter how many models are in a single namespace?

asp.net-mvc,model,namespaces
In an MVC app, does it matter how many models are in the MyApp.Models namespace? I have just enough models to make it worthwhile splitting them into separate folders (e.g. /Models/Users, /Models/Emails, /Models/Messages, etc). MVC by default gives new models a namespace corresponding to the folder structure (e.g. MyApp.Models.Users, MyApp.Models.Emails,...

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>...

Javascript namespacing and OO organization

javascript,oop,namespaces,code-organization
I have my javascript code as follow: $(document).ready(function () { //call of global functions globalFunction1(); globalFunction2(); //create a new object inside globalFunction3(); } function globalFunction1() { // do something directly with jquery selectors var testObj1 = new object1($('#tree')); // this is called later in the function testObj.doSomething(); } function globalFunction2()...

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?...

Should one forward declare classes from a namespaced library?

c++,design,namespaces,forward-declaration
I'm designing a C++ library that will be placed inside a namespace. If the users of my library only need a forward declaration of one of my classes and since you can't do forward declarations of things inside a namespace, e.g. class ns_name::class_name;, should I tell them to include the...

How to use namespaces properly in vb.net

vb.net,namespaces
I have a WebApplication project called WebApp and I have a Library Project called LibProj where I define a namespace like Namespace LibProj Public Class Employee Public Property Name As String End Class End Namespace Now I add the reference to WebApp and try to use the namespace with Imports...

Read from xml files with or without a namespace using XmlDocument

c#,xml,namespaces
I have some code that reads from xml files with a namespace using XmlDocument.My challenge is that i have the namespace of the file i'm reading hard coded for now and i pass that to the XmlNamespaceManager.I would like for my approach to be a little more flexible.To read from...

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....

php,namespaces

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...

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,...