Search Results

Search found 763 results on 31 pages for 'namespaces'.

Page 9/31 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • WPF XAML Namespace import

    - by Andrey Khataev
    I've found that in order to use PRISM's classes in XAML you need to import namespace in that way: xmlns:cal="http://www.codeplex.com/CompositeWPF" this way is new to me, so I wanted to know, how hyperlink could be alias of usual notation of namespace import? so the intellisence knows in which assembly it should search this component? Thanks!

    Read the article

  • Nested resources in namespace form_for

    - by Nelson LaQuet
    Problem The form_for helper incorrectly determines the path to my nested resource inside of a namespace. The models in question are: Forum::Thread and Forum::Reply respectively, located in a subfolder called "forum" under my models directory. This is in Rails 3 BETA 3. routes.rb namespace :forum do root :to => 'threads#index' resources :threads do resources :replies end end app/views/forum/replies/_form.html.haml ... - form_for [@thread, @reply] do |f| ... app/controllers/forum/replies_controller.rb ... def new @reply = Forum::Reply.new end ... Error undefined method `forum_thread_forum_replies_path' In reference to the line outlined above in _form.html.haml

    Read the article

  • Why can you reference an imported module using the importing module in python

    - by noam
    I am trying to understand why any import can be referenced using the importing module, e.g #module master.py import slave and then >>>import master >>>print master.slave gives <module 'slave' from 'C:\Documents and Settings....'> What is the purpose of the feature? I can see how it can be helpful in a package's __init__.py file, but nothing else. Is it a side effect of the fact that every import is added to the module's namespace and that the module's namespace is visible from the outside? If so, why didn't they make an exception with data imported from other modules (e.g don't show it as part of the module's namespace for other modules)?

    Read the article

  • Accessing a class's containing namespace from within a module

    - by SFEley
    I'm working on a module that, among other things, will add some generic 'finder' type functionality to the class you mix it into. The problem: for reasons of convenience and aesthetics, I want to include some functionality outside the class, in the same scope as the class itself. For example: class User include MyMagicMixin end # Should automagically enable: User.name('Bob') # Returns first user named Bob Users.name('Bob') # Returns ALL users named Bob User(5) # Returns the user with an ID of 5 Users # Returns all users I can do the functionality within these methods, no problem. And case 1 (User.name('Bob')) is easy. Cases 2–4, however, require being able to create new classes and methods outside User. The Module.included method gives me access to the class, but not to its containing scope. There is no simple "parent" type method that I can see on Class nor Module. (For namespace, I mean, not superclass nor nested modules.) The best way I can think to do this is with some string parsing on the class's #name to break out its namespace, and then turn the string back into a constant. But that seems clumsy, and given that this is Ruby, I feel like there should be a more elegant way. Does anyone have ideas? Or am I just being too clever for my own good?

    Read the article

  • C# ASP.Net The type or namespace name 'Secure' does not exist in the namespace 'source_extranet'

    - by Louis Russell
    Afternoon all, I really need your help as this is a Nightmare! I was earlier having a problem with referencing a 3rd Party Dll (Here) but have overcome this problem and am now having a problem referencing my own classes! Everything seems fine at build with no errors at all but when I go to run the application it comes up with the following Compilation Error: Compiler Error Message: CS0234: The type or namespace name 'Secure' does not exist in the namespace 'source_extranet' (are you missing an assembly reference?) The line that the Error points to this line in the class: source_extranet.Secure.BackendCustomData newdata = new source_extranet.Secure.BackendCustomData(); This line of code points to a class in the same folder as the calling code class. I have scoured Google looking for an answer and haven't found anything that points me to an answer to my problem. Any help would be AMAZING!

    Read the article

  • Placing custom code in a System namespace

    - by David Brown
    Are there any best-practices that state custom code shouldn't be placed in a System namespace? Should System and its children be reserved for Microsoft code? I ask because I'm writing a class library that will be used across many projects and I'd like to keep things consistent by placing it in System.InteropServices (since it deals with P/Invoke).

    Read the article

  • Devise within namespace

    - by Harm de Wit
    Hey, I'm trying to split my rails project in a front-end for regular users and a back-end for admins. Therefore i have created a namespace 'admin' so that i can easily control admin specific controller methods/layouts/authentication in the map admin. I'm using Devise to register/authenticate my admins only. Because it is only used for admins only i'm trying to move Devise to the admin namespace. I could not find exactly what i was looking for in the documentation of Devise but i tried something like this in routes.rb: namespace 'admin'do devise_for :admins end I also tried to make a custom Devise::Sessions controller but that too didn't seem to work out. Does anyone know how to do this? Should i just use the regular routes for devise with a custom(admin) layout?

    Read the article

  • How do I add a default namespace with no prefix using XMLSerializer

    - by OldBob
    Hi Using C# and .Net 3.5; I am trying to generate an XML document that contains the default namespace without a prefix using XMLSerializer. eg. <?xml version="1.0" encoding="utf-8" ?> <MyRecord ID="9266" xmlns="http://www.website.com/MyRecord"> <List> <SpecificItem> using the following code string xmlizedString = null; MemoryStream memoryStream = new MemoryStream(); XmlSerializer xs = new XmlSerializer(typeof(ExportMyRecord)); XmlSerializerNamespaces xmlnsEmpty = new XmlSerializerNamespaces(); xmlnsEmpty.Add(string.Empty, string.Empty); XmlTextWriter xmlTextWriter = new XmlTextWriter(memoryStream, Encoding.UTF8); xs.Serialize(xmlTextWriter, myRecord, xmlnsEmpty); memoryStream = (MemoryStream)xmlTextWriter.BaseStream; xmlizedString = this.UTF8ByteArrayToString(memoryStream.ToArray()); and class structure [Serializable] [XmlRoot("MyRecord")] public class ExportMyRecord { [XmlAttribute("ID")] public int ID { get; set; } Now, I've tried various options XmlSerializer xs = new XmlSerializer(typeof(ExportMyRecord),"http://www.website.com/MyRecord"); or [XmlRoot(Namespace = "http://www.website.com/MyRecord", ElementName="MyRecord")] gives me <?xml version="1.0" encoding="utf-8"?> <q1:MylRecord ID="9266" xmlns:q1="http://www.website.com/MyRecord"> <q1:List> <q1:SpecificItem> I need the XML to have the namespace without the prefix as it's going to a third party provider and they reject all other alternatives. Any suggestions? No responses so far. Has anyone experienced this or know how to solve it?

    Read the article

  • Why am I getting the extra xmlns="" using LinqToXML?

    - by Hcabnettek
    Hello all, I'm using LinqToXML to generate a piece of XML. Everything works great except I'm throwing in some empty namespace declarations somehow. Does anyone out there know what I'm doing incorrectly? Here is my code private string SerializeInventory(IEnumerable<InventoryInformation> inventory) { var zones = inventory.Select(c => new { c.ZoneId , c.ZoneName , c.Direction }).Distinct(); XNamespace ns = "http://www.dummy-tmdd-address"; XNamespace xsi = "http://www.w3.org/2001/XMLSchema-instance"; var xml = new XElement(ns + "InventoryList" , new XAttribute(XNamespace.Xmlns + "xsi", xsi) , zones.Select(station => new XElement("StationInventory" , new XElement("station-id", station.ZoneId) , new XElement("station-name", station.ZoneName) , new XElement("station-travel-direction", station.Direction) , new XElement("detector-list" , inventory.Where(p => p.ZoneId == station.ZoneId).Select(plaza => new XElement("detector" , new XElement("detector-id", plaza.PlazaId))))))); xml.Save(@"c:\tmpXml\myXmlDoc.xml"); return xml.ToString(); } And here is the resulting xml. I hope it renders correctly? The browser may hide the tags. - <InventoryList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.dummy-tmdd-address"> <StationInventory xmlns=""> <station-id>999</station-id> <station-name>Zone 999-SEB</station-name> <station-travel-direction>SEB</station-travel-direction> <detector-list> <detector> <detector-id>7503</detector-id> </detector> <detector> <detector-id>2705</detector-id> </detector> </detector-list> </StationInventory> </InventoryList> Notice the empty namespace declaration in the first child element. Any ideas how I can remedy this? Any tips are of course appreciated. Thanks All, ~ck

    Read the article

  • Call function from GridView source html

    - by Steven
    Here's my GridView HTML: <asp:GridView ID="gvPortfolioImages" runat="server" AutoGenerateColumns="False" DataSourceID="ldsPortfolioImages"> <Columns> <asp:TemplateField HeaderText="Image" SortExpression="Filename"> <ItemTemplate> <img src='<%# Portfolio.GetImageURL(Eval("Thumbnail").ToString()) %>' alt='<%# Eval("Thumbnail") %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> I'm get the following error where I'm trying to call Portfolio.GetImageURL(): The name 'Portfolio' does not exist in the current context I've seen functions called like this before, but it doesn't seem to be working for me. Can anyone tell me what the problem is?

    Read the article

  • System.Windows.Forms.DataVisualization Namespace Fine in One Class but Not in Another

    - by jxpx777
    Hi. I'm getting this error The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Windows.Forms' (are you missing an assembly reference?) Here is my using section of the class: using System; using System.Collections; using System.Collections.Generic; using System.Windows.Forms.DataVisualization.Charting; using System.Windows.Forms.DataVisualization.Charting.Borders3D; using System.Windows.Forms.DataVisualization.Charting.ChartTypes; using System.Windows.Forms.DataVisualization.Charting.Data; using System.Windows.Forms.DataVisualization.Charting.Formulas; using System.Windows.Forms.DataVisualization.Charting.Utilities; namespace myNamespace { public class myClass { // Usual class stuff } } The thing is that I am using the same DataVisualization includes in another class. The only thing that I can think that is different is that the classes that are giving this missing namespace error are Solution Items rather than specific to a project. The projects reference them by link. Anyone have thoughts on what the problem is? I've installed the chart component, .Net 3.5 SP1, and the Chart Add-in for Visual Studio 2008. UPDATE: I moved the items from Solution Items to be regular members of my project and I'm still seeing the same behavior. UPDATE 2: Removing the items from the Solution Items and placing them under my project worked. Another project was still referencing the files which is why I didn't think it worked previously. I'm still curious, though, why I couldn't use the namespace when the classes were Solution Items but moving them underneath a project (with no modifications, mind you) instantly made them recognizable. :\

    Read the article

  • Client no longer getting data from Web Service after introducing targetNamespace in XSD

    - by Laurence
    Sorry if there is way too much info in this post – there’s a load of story before I get to the actual problem. I thought I‘d include everything that might be relevant as I don’t have much clue what is wrong. I had a working web service and client (both written with VS 2008 in C#) for passing product data to an e-commerce site. The XSD started like this: <xs:schema id="Ecommerce" elementFormDefault="qualified" xmlns:mstns="http://tempuri.org/Ecommerce.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="eur"> <xs:complexType> <xs:sequence> <xs:element ref="sec" minOccurs="1" maxOccurs="1"/> </xs:sequence> etc Here’s a sample document sent from client to service: <eur xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T17:16:34.523" version="1.1"> <sec guid="BFBACB3C-4C17-4786-ACCF-96BFDBF32DA5" company_name="Company" version="1.1"> <data /> </sec> </eur> Then, I had to give the service a targetNamespace. Actually I don’t know if I “had” to set it, but I added (to the same VS project) some code to act as a client to a completely unrelated service (which also had no namespace), and the project would not build until I gave my service a namespace. Now the XSD starts like this: <xs:schema id="Ecommerce" elementFormDefault="qualified" xmlns:mstns="http://tempuri.org/Ecommerce.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.company.com/ecommerce" xmlns:ecom="http://www. company.com/ecommerce"> <xs:element name="eur"> <xs:complexType> <xs:sequence> <xs:element ref="ecom:sec" minOccurs="1" maxOccurs="1" /> </xs:sequence> etc As you can see above I also updated all the xs:element ref attributes to give them the “ecom” prefix. Now the project builds again. I found the client needed some modification after this. The client uses a SQL stored procedure to generate the XML. This is then de-serialised into an object of the correct type for the service’s “get_data” method. The object’s type used to be “eur” but after updating the web reference to the service, it became “get_dataEur”. And sure enough the parent element in the XML had to be changed to “get_dataEur” to be accepted. Then bizarrely I also had to put the xmlns attribute containing my namespace on the “sec” element (the immediate child of the parent element) rather than the parent element. Here’s a sample document now sent from client to service: <get_dataEur xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:23:20.653" version="1.1"> <sec xmlns="http://www.company.com/ecommerce" guid="BFBACB3C-4C17-4786-ACCF-96BFDBF32DA5" company_name="Company" version="1.1"> <data /> </sec> </get_dataEur> If in the service’s get_data method I then serialize the incoming object I see this (the parent element is “eur” and the xmlns attribute is on the parent element): <eur xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.company.com/ecommerce" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:23:20.653" version="1.1"> <sec guid="BFBACB3C-4C17-4786-ACCF-96BFDBF32DA5" company_name="Company" version="1.1"> <data /> </sec> </eur> The service then prepares a reply to go back to the client. The XML looks like this (the important data being sent back is the date_stamp attribute in the last_sent element): <eur xmlns="http://www.company.com/ecommerce" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:22:57.530" version="1.1"> <sec version="1.1" xmlns=""> <data> <last_sent date_stamp="2010-02-25T15:15:10.193" /> </data> </sec> </eur> Now finally, here’s the problem!!! The client does not see any data – all it sees is the parent element with nothing inside it. If I serialize the reply object in the client code it looks like this: <get_dataResponseEur xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" class="ECommerce_WebService" type="product" method="GetLastDateSent" chunk_no="1" total_chunks="1" date_stamp="2010-03-10T18:22:57.53" version="1.1" /> So, my questions are: why isn’t my client seeing the contents of the reply document? how do I fix it? why do I have to put the xmlns attribute on a child element rather than the parent element in the outgoing document? Here’s a bit more possibly relevant info: The client code (pre-namespace) called the service method like this: XmlSerializer serializer = new XmlSerializer(typeof(eur)); XmlReader reader = xml.CreateReader(); eur eur = (eur)serializer.Deserialize(reader); service.Credentials = new NetworkCredential(login, pwd); service.Url = url; rc = service.get_data(ref eur); After the namespace was added I had to change it to this: XmlSerializer serializer = new XmlSerializer(typeof(get_dataEur)); XmlReader reader = xml.CreateReader(); get_dataEur eur = (get_dataEur)serializer.Deserialize(reader); get_dataResponseEur eur1 = new get_dataResponseEur(); service.Credentials = new NetworkCredential(login, pwd); service.Url = url; rc = service.get_data(eur, out eur1);

    Read the article

  • strange behavior in python

    - by fsm
    The tags might not be accurate since I am not sure where the problem is. I have a module where I am trying to read some data from a socket, and write the results into a file (append) It looks something like this, (only relevant parts included) if __name__ == "__main__": <some init code> for line in file: t = Thread(target=foo, args=(line,)) t.start() while nThreads > 0: time.sleep(1) Here are the other modules, def foo(text): global countLock, nThreads countLock.acquire() nThreads += 1 countLock.release() """connect to socket, send data, read response""" writeResults(text, result) countLock.acquire() nThreads -= 1 countLock.release() def writeResults(text, result): """acquire file lock""" """append to file""" """release file lock""" Now here's the problem. Initially, I had a typo in the function 'foo', where I was passing the variable 'line' to writeResults instead of 'text'. 'line' is not defined in the function foo, it's defined in the main block, so I should have seen an error, but instead, it worked fine, except that the data was appended to the file multiple times, instead of being written just once, which is the required behavior, which I got when I fixed the typo. My question is, 1) Why didn't I get an error? 2) Why was the writeResults function being called multiple times?

    Read the article

  • .net Class "is not a member of" Class .. even though it is?

    - by Matt Thrower
    Hi, Looking over some older code, I've run into a strange namespace error. Let's say I have two projects, HelperProject and WebProject. The full namespace of each - as given in application properties - is myEmployer.HelperProject and myEmployer.Web.WebProject. The pages in the web project are full of statements that use classes from the helper project. There are no imports/using statements but there is a reference to the helper project added in the bin. A few example lines might be: myEmployer.HelperProject.StringHelper.GetFixedLengthText(Text, "", Me.Width, 11) myEmploter.HelperProject.Utils.StringHelper.EstimatePixelLength(Text, 11) However every line that is written in this manner is throwing the error 'HelperProject' is not a member of 'myEmployer'. If you declare the statements like this: HelperProject.StringHelper.GetFixedLengthText(Text, "", Me.Width, 11) HelperProject.Utils.StringHelper.EstimatePixelLength(Text, 11) Everything seems fine. In the solution object browser and the bin folder, HelperProject appears with its full namespace, myEmployer.HelperProject. I don't want to have to change all the statements, and besides I suspect this is masking a more fundamental problem here. But I have no idea what's going on. Can anyone offer any pointers please? Cheers, Matt

    Read the article

  • Scope of object properties & methods

    - by Anish
    In the article Show love to the object literal, it's said: When we have several scripts in a page, the global variables & functions will get overwritten if their name repeats. One solution is to make the variables as properties & functions as methods of an object, and access them via the object name. But will this prevent the issue of variables getting into the global namespace? <script> var movie = { name: "a", trailer: function(){ //code } }; </script> In the above code which elements gets added to the global namespace? a) Just the object name - movie b) Object name as well as the properties and methods inside it – movie, movie.name, movie.trailer()

    Read the article

  • What's the best way to change the namespace of a highly referenced class?

    - by vanslly
    I am attempting to move a highly referenced class from one namespace to another. Simply moving the file into the new project which has a different root namespace results in over 1100 errors throughout my solution. Some references to the class involve fully qualified namescape referencing and others involve the importing of the namespace. I have tried using a refactoring tool (Refactor Pro) to rename the namespace, in the hope all references to the class would change, but this resulted in the aforementioned problem. Anyone have ideas of how to tackle this challenge without needing to drill into every file manually and changing the fully qualified namespace or importing the new one if it doesn't exist already? Thanks.

    Read the article

  • Viewing namespaced global variables in Visual Studio debugger?

    - by Chris
    When debugging a non-managed C++ project in Visual Studio 2008, I occasionally want to see the value of a global variable. We don't have a lot of these but those that are there all declared within a namespace called 'global'. e.g. namespace global { int foo; bool bar; ... } The problem is that when the code is stopped at a breakpoint, the default debugging tooltip (from pointing at the variable name) and quickwatch (shift-f9 on the variable name) don't take the namespace into consideration and hence won't work. So for example I can point at 'foo' and nothing comes up. If I shift-f9 on foo, it will bring up the quickwatch, which then says 'CXX0017: Error: symbol "foo" not found'. I can get around that by manually editing the variable name in the quickwatch window to prefix it with "global::" (which is cumbersome considering you have to do it each time you want to quickwatch), but there is no fix for the tooltip that I can work out. Setting the 'default namespace' of the project properties doesn't help. How can I tell the VS debugger to use the namespace that it already knows the variable is declared in (since it has the declaration right there), or, alternatively, tell it a default namespace to look for variables in if it doesn't find them? My google-fu has failed to find an answer. This report lists the same problem, with MS saying it's "by design", but even so I am hoping there is some way to work around it (perhaps with clever use of autoexp.dat?)

    Read the article

  • No whitespace between a cast and a namespace operator?

    - by Pod
    Hello. Could anyone please explain the following line of code, found on http://docs.openttd.org/ai__cargo_8cpp_source.html return (AICargo::TownEffect)::CargoSpec::Get(cargo_type)->town_effect; If this line was: return (AICargo::TownEffect) ::CargoSpec::Get(cargo_type)->town_effect; (note the space between TownEffect) and the ::) then I would understand it fine. However there is no whitespace in that document*, which would mean (AICargo::TownEffect) is the left operand of the :: operator. How does this code work/compile? Or are the two things equivilent due to some obscure C++ rule? *It's the same in the cpp file as well.

    Read the article

  • XML fix namespace declaration

    - by er4z0r
    Hi all, I am trying to detetct/work around this bug in RSS elements. That means I have to find a wrong namespace-declaration and change its value to the correct namespace. E.g: xmlns:media="http://search.yahoo.com/mrss" must be: xmlns:media="http://search.yahoo.com/mrss/" How can I achive that using the standard java XML APIs?

    Read the article

  • How do I implement multiple kinds of an object in OOP?

    - by Jeremy Rudd
    I have multiple kinds of an object, say Car for example. Do I have each kind in an inherited class/subclass of Car? Do I place these under a cartype namespace so as not to mess up the main namespace? Then later when I need an array of cars, should I declare it as var currentCars():Car or var currentCars():Object? Would the former support any subclass of Car?

    Read the article

  • References between Spring beans when using a NameSpaceHandler

    - by teabot
    I'm trying to use a Spring context namespace to build some existing configuration objects in an application. I have defined a context and pretty much have if working satisfactorily - however, I'd like one bean defined by my namespace to implicitly reference another: Consider the class named 'Node': public Class Node { private String aField; private Node nextNode; public Node(String aField, Node nextNode) { ... } Now in my Spring context I have something like so: <myns:container> <myns:node aField="nodeOne"/> <myns:node aField="nodeTwo"/> </myns:container> Now I'd like nodeOne.getNode() == nodeTwo to be true. So that nodeOne.getNode() and nodeTwo refer to the same bean instance. These are pretty much the relevant parts I have in my AbstractBeanDefinitionParser: public AbstractBeanDefinition parseInternal(Element element, ParserContext parserContext) { ... BeanDefinitionBuilder containerFactory = BeanDefinitionBuilder.rootBeanDefinition(ContainerFactoryBean.class); List<BeanDefinition> containerNodes = Lists.newArrayList(); String previousNodeBeanName; // iterate backwards over the 'node' elements for (int i = nodeElements.size() - 1; i >= 0; --i) { BeanDefinitionBuilder node = BeanDefinitionBuilder.rootBeanDefinition(Node.class); node.setScope(BeanDefinition.SCOPE_SINGLETON); String nodeField = nodeElements.getAttribute("aField"); node.addConstructorArgValue(nodeField); if (previousNodeBeanName != null) { node.addConstructorArgValue(new RuntimeBeanReference(previousNodeBeanName)); } else { node.addConstructorArgValue(null); } BeanDefinition nodeDefinition = node.getBeanDefinition(); previousNodeBeanName = "inner-node-" + nodeField; parserContext.getRegistry().registerBeanDefinition(previousNodeBeanName, nodeDefinition); containerNodes.add(node); } containerFactory.addPropertyValue("nodes", containerNodes); } When the application context is created my Node instances are created and recognized as singletons. Furthermore, the nextNode property is populated with a Node instance with the previous nodes configuration - however, it isn't the same instance. If I output a log message in Node's constructor I see two instances created for each node bean definition. I can think of a few workarounds myself but I'm keen to use the existing model. So can anyone tell me how I can pass these runtime bean references so that I get the correct singleton behaviour for my Node instances?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >