namespaces

No member named 'begin' in namespace 'std'

。_饼干妹妹 提交于 2020-01-11 09:25:30
问题 I successfully compiled on Windows a code that should be crossplatform. Now when compiling it in Xcode with Mac OS X, I get: std::valarray<float> v(32); ... std::sort(begin(v), end(v)); # Use of undeclared identifier 'begin' std::sort(std::begin(v), std::end(v)); # No member named 'begin' in namespace 'std' std::sort(std::valarray::begin(v), std::valarray::end(v)); # Idem, error as well Why does the error No member named 'begin' in namespace 'std' happen? 回答1: std::begin was introduced with C

WebForms and ASP.NET MVC co-existence

心不动则不痛 提交于 2020-01-11 09:16:18
问题 I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I've done to make that happen is that I added a namespaces node to the WebForms web.config : <pages styleSheetTheme="Default"> ... <namespaces> <add namespace="System.Web.Mvc"/> <add namespace="System.Web.Mvc.Ajax"/> <add namespace="System.Web.Mvc.Html"/> <add namespace="System.Web.Routing"/> </namespaces> </pages> However, when I try to start the project, I get an error stating: " Compiler Error

Weird compatibility problem with .Net 3.5 and 4.0 assemblies (NATUPnPLib)

本小妞迷上赌 提交于 2020-01-11 08:43:19
问题 I'm having trouble getting NATUPnP 1.0 Type Library to work with Framework 3.5 in Visual Studio 2010. If I use .Net 4.0, it works just fine, but with .Net 3.5, NATUPNPLib's namespace looks excactly like NETCONLib's. For example this Port Forwarding Management Application sample from this site: http://pietschsoft.com/post/2009/02/05/NET-Framework-Communicate-through-NAT-Router-via-UPnP.aspx ..is using .Net 3.5, but I can't get it to compile in Visual Studio 2010 unless I change it to .Net 4.0.

Can a namespace start with a number in PHP?

浪尽此生 提交于 2020-01-11 06:15:12
问题 When declaring the following namespace: <?php namespace Example\3000; I got this error: Parse error: syntax error, unexpected '3000' (T_LNUMBER), expecting identifier (T_STRING) in [...] So I wondered whether a namespace in PHP may start with a number? 回答1: No, it must not. It must start with a letter. It took me a while to find this in a comment on PHP.net. To use numbers e.g. for versioning it is necessary to prepend letters, e.g. like in the following: <?php namespace Example\V_3000; 回答2:

How to dynamically modify a function's local namespace?

不打扰是莪最后的温柔 提交于 2020-01-11 06:00:26
问题 NB: This question assumes Python 2.7.3. I'm looking for a sane approach to dynamically modify a function's local namespace, preferably in a way that adds the least clutter to the body function. What I have in mind would look something like this: import os from namespace_updater import update_locals def somefunc(x, y, z): # ... # ... # this and that # ... # ... if os.environ.get('FROBNICATE'): from frobnitz import frobnicate update_locals(frobnicate(locals())) # # life goes on, possibly with

How to dynamically modify a function's local namespace?

我只是一个虾纸丫 提交于 2020-01-11 06:00:25
问题 NB: This question assumes Python 2.7.3. I'm looking for a sane approach to dynamically modify a function's local namespace, preferably in a way that adds the least clutter to the body function. What I have in mind would look something like this: import os from namespace_updater import update_locals def somefunc(x, y, z): # ... # ... # this and that # ... # ... if os.environ.get('FROBNICATE'): from frobnitz import frobnicate update_locals(frobnicate(locals())) # # life goes on, possibly with

Ruby is already using the class name of my model

☆樱花仙子☆ 提交于 2020-01-11 03:50:28
问题 I'm making a forum application with various levels of authorization, one of which is a Monitor. I am doing this by extending my User class, and I plan on fine tuning this with "-ship" classes (e.g. administratorship, authorship, moderatorship, etc.). Apparently the Monitor class is part of ruby mixin. How do I keep my resource name without the collisions? 回答1: Some possibilities: avoid the require 'monitor.rb' call which is pulling in the standard Monitor instance do some runtime magic to

Namespacing technique in JavaScript, recommended? performant? issues to be aware of?

人走茶凉 提交于 2020-01-11 03:19:06
问题 In a project I am working on I am structuring my code as follows MyLib = { AField:0, ASubNamespace:{ AnotherField:"value", AClass:function(param) { this.classField = param; this.classFunction = function(){ // stuff } } }, AnotherClass:function(param) { this.classField = param; this.classFunction = function(){ // stuff } } } and so on like that to do stuff like: var anInstance = new MyLib.ASubNamespace.AClass("A parameter."); Is this the right way to go about achieving namespacing? Are there

xPath XML file with namespaces using Javascript

折月煮酒 提交于 2020-01-10 04:38:44
问题 I have done a TONE of research and still have just hit a dead end :( Heres my XML file (test.xml): <bookstore> <book genre="autobiography"> <title>The Autobiography of Benjamin Franklin</title> <author> <first-name>Benjamin</first-name> <last-name>Franklin</last-name> </author> <price>8.99</price> </book> <bk:book genre="novel" bk:genre="fiction" xmlns:bk="http://purl.org/dc/elements/1.1/"> <bk:title>The Confidence Man</bk:title> <bk:author> <bk:first-name>Herman</bk:first-name> <bk:last-name

Is it possible use multiple classes under the same namespace, in the same file

痞子三分冷 提交于 2020-01-10 01:02:28
问题 Is it possible use multiple classes under the same namespace, in the same file? I want to do something like this: <?php namespace MyNamespace\Helpers\Exceptions use Exception; class CustomException1 extends Exception{} class CustomException2 extends Exception{} class CustomException3 extends Exception{} to avoid using one single file for each custom exception class. The problem is, when I try to use, in another class, one of the custom exceptions, use MyNamespace\Helpers\Exceptions