Search Results

Search found 10804 results on 433 pages for 'attribute keys'.

Page 26/433 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Find XmlNode where attribute value is contained in string

    - by bflemi3
    I have an xml file... <?xml version="1.0" encoding="UTF-8"?> <items defaultNode="1"> <default contentPlaceholderName="pageContent" template="" genericContentItemName="" /> <item urlSearchPattern="connections-learning" contentPlaceholderName="pageContent" template="Connections Learning Content Page" genericContentItemName="" /> <item urlSearchPattern="online-high-school" contentPlaceholderName="pageContent" template="" genericContentItemName="" /> </items> I am trying to find the first node where the urlSearchPattern attribute is contained in the string urlSearchPattern. Where I'm having trouble is finding the nodes where the attribute is contained in the string value instead of the string value be contained in the attribute. Here's my attempt so far. This will find the firstOrDefault node where the string value is contained in the attribute (I need the opposite)... string urlSearchPattern = Request.QueryString["aspxerrorpath"]; MissingPageSettingsXmlDocument missingPageSettingsXmlDocument = new MissingPageSettingsXmlDocument(); XmlNode missingPageItem = missingPageSettingsXmlDocument.SelectNodes(ITEM_XML_PATH).Cast<XmlNode>().Where(item => item.Attributes["urlSearchPattern"].ToString().ToLower().Contains(urlSearchPattern)).FirstOrDefault();

    Read the article

  • Initialize virtual attributes

    - by Horace Loeb
    I have an IncomingEmail model with an attachments virtual attribute: class IncomingEmail < ActiveRecord::Base attr_accessor :attachments end I want the attachments virtual attribute to be initialized to [] rather than nil so that I can do: >> i = IncomingEmail.new => #<IncomingEmail id: nil,...) >> i.attachments << "whatever" Without first setting i.attachments to [] (put another way, I want this virtual attribute to default to an empty array rather than nil)

    Read the article

  • Setting html attribute that is reserved keyword in Html.CheckBoxFor in ASP.NET MVC

    - by dormisher
    Hi, I am using the HtmlHelper to create a checkbox in my view like so: <%= Html.CheckBoxFor(model = model.SeatOnly, new { checked = "checked" })% However, an error is being thrown as checked is a reserved keyword. I have found a couple of people saying that you must use the 'reserved word prefix' and simply put an uderscore in front of the attribute like so: <%= Html.CheckBoxFor(model = model.SeatOnly, new { _checked = "checked" })% This does not generate an error but in the generated html the attribute is actually '_checked' which means it doesn't work (if I use firebug and remove the underscore the attribute then takes effect). Does anyone know a way around this while still using CheckBoxFor? Thanks

    Read the article

  • Use javac fork attribute with IBM JDK

    - by avjaz
    Hi - I have a large ant build that I'm working on, that is currently running out of memory. One ways I've read that can help mitigate this problem is to use javac fork="true" to run javac in a separate jvm. My problem is that I need to compile the project with the IBM JDK (this is not the JDK referenced by JAVA_HOME, and I would prefer it not to be). I tried setting the executable attribute of Ant's javac, to the path to IBM's javac but no joy (the project still won't compile). Ant's docs for the executable attribute state: Complete path to the javac executable to use in case of fork="yes". Defaults to the compiler of the Java version that is currently running Ant. Ignored if fork="no". Since Ant 1.6 this attribute can also be used to specify the path to the executable when using jikes, jvc, gcj or sj. Does anyone have any ideas? Thanks -

    Read the article

  • .NET WebService Custom Attribute

    - by DownChapel
    I would like to add a custom attribute to a asmx web service to determine if the request is valid based on the client IP address. This is a similar idea to the AuthorizeAttribute in ASP.NET MVC. Is there anywhere (e.g. a HTTP module) I can put the code to look at the attribute on the webservice and decide whether to allow the request or not? In my web.config the handler for asmx is the ScriptHandlerFactory from the System.Web.Extensions dll. I have already implemented the functionality with a HTTP module and a config file with a list of allowed URLs, but I would prefer to get rid of the config file and just add an attribute to the webservice class. Thanks

    Read the article

  • Proper usage (best practices) of Browsable attribute in .NET for runtime grid component behavior

    - by Dan
    I understand how Browsable attribute is supposed to work. It's supposed to hide a property from showing up in a PropertyGrid in design time. It also has another effect in that it will stop a Property from showing up in components such as Grids, or specifically Infragistics WinGrid. I am not sure if it has this behaviour on regular Windows Forms grids. This works, but it doesn't sound like Browsable is being use as intended when being used for 'Run time' displaying of a property on a grid component. Any literature from Microsoft on proper use. Even though it works, I don't want to use this attribute to hide columns on a grid bound to a business object if it's not indeed the correct usage of the attribute, but rather something some grid vendors decided to use to determine property visibility on their grids.

    Read the article

  • Keycodes of function keys with F-lock off?

    - by ak
    Many recent keyboard from Microsoft and Logitech have a so-called F-Lock key, which toggles the function keys F1 to F12 between their traditional keycodes and new meanings that are printed onto the keys: F1=Help F2=Undo F3=Redo F4=Open ... . (See also http://en.wikipedia.org/wiki/F-Lock.) This means that long-established shortcuts such as Alt+F4 no longer work if the F-lock is off, and googling shows that quite a few people are unhappy about this. So I'm wondering, what virtual key (VK) codes do the function keys send when F-lock is off? VK_F13 to VK_F24 perhaps? Or do they not trigger standard keyboard events at all? (I haven't got such a keyboard to try and find out myself, and didn't manage to dig up anything on MSDN about this.)

    Read the article

  • XPATH - Select all child nodes with a specific attribute

    - by David
    Hi, what would be the xpath for the following: Find all child nodes with a specific attibute value but starting from a node with a specific attribute value. This is kind of related to a question I posted earlier about parsing and rdf xml file - I thought I had solved it but not quite yet. For example I am trying to parse and grab all of the rdf:about attribute values. I have this working fine. I need to add the following condition though - parsing needs to start after a specific rdf:about value is found. I am working in php and and using DomDocument and am using the following xpath query: $xpath-query('//@rdf:about') - it is finding all rdf:about attributes fine. I need to extend this to only find thos attributes that come after the node who rdf:about attribute is equal to something. Hope this makes sense.

    Read the article

  • XPath select an attribute based on value

    - by Apeksha
    Using VB.Net, I have an XmlNode object, xNode. I need to select an attribute of this node if it has a particular value. e.g. xNode.SelectSingleNode(".[@attr1='1']") I would expect this statement to return the attribute "attr1", only if it has a value of "1". However, I get an error - Expression must evaluate to a node-set. When I tried this - xNode.SelectSingleNode("@attr1[@attr1='1']") It always returns Nothing, even if the attribute has a value of 1. I have tried a lot of different things, but no luck yet. Please help. Thanks.

    Read the article

  • ActiveRecord fundamentally incompatible with composite keys?

    - by stimms
    I have been attempting to use subsonic for a project on which I'm working. All was going quite well until I encountered a link table with a composite primary key. That is a key made up of the primary keys of the two tables it joins. Subsonic failed to recognize both keys which was problematic. I was going to adjust subsonic to support compound keys but I stopped and though "Maybe there is a reason for this". Normally active record relies on a single primary key field for every record, even in link tables. But is this necessary? Should I just give up on active record for this project or continue with my modifications?

    Read the article

  • python object AttributeError: type object 'Track' has no attribute 'title'

    - by ccwhite1
    I apologize if this is a noob question, but I can't seem to figure this one out. I have defined an object that defines a music track (NOTE: originally had the just ATTRIBUTE vs self.ATTRIBUTE. I edited those values in to help remove confusion. They had no affect on the problem) class Track(object): def __init__(self, title, artist, album, source, dest): """ Model of the Track Object Contains the followign attributes: 'Title', 'Artist', 'Album', 'Source', 'Dest' """ self.atrTitle = title self.atrArtist = artist self.atrAlbum = album self.atrSource = source self.atrDest = dest I use ObjectListView to create a list of tracks in a specific directory ....other code.... self.aTrack = [Track(sTitle,sArtist,sAlbum,sSource, sDestDir)] self.TrackOlv.AddObjects(self.aTrack) ....other code.... Now I want to iterate the list and print out a single value of each item list = self.TrackOlv.GetObjects() for item in list: print item.atrTitle This fails with the error AttributeError: type object 'Track' has no attribute 'atrTitle' What really confuses me is if I highlight a single item in the Object List View display and use the following code, it will correctly print out the single value for the highlighted item list = self.TrackOlv.GetSelectedObject() print list.atrTitle

    Read the article

  • ASP MVC: Custom Validation Attribute

    - by user323395
    I'm trying to write my own Custom Validation attribute but i'm having some problems. The attribute i'm trying to write is that when a user logs in, the password will be compared against the confirmation password. namespace EventCompanion.Data.Attributes { public class ComparePassword : ValidationAttribute { public string PasswordToCompareWith { get; set; } public override bool IsValid(object value) { if (PasswordToCompareWith == (string)value) { return true; } return false; } } Now my problem is when i'm trying to set the attribute like this in the model file: [Required] [ComparePassword(PasswordToCompareWith=ConfirmPassword)] public string Password { get; set; } [Required] public string ConfirmPassword { get; set; } } I get the following error: Error 1 An object reference is required for the non-static field, method, or property 'Project.Data.Models.GebruikerRegistreerModel.ConfirmPassword.get' It seems that VS is not accepting the confirmpassword in the "PasswordToCompareWith=ConfirmPassword" part Now my question: What am i doing wrong? Thanks in advance!!!

    Read the article

  • Attribute lost with yield

    - by Nelson
    Here's an interesting one... There is some code that I'm trying to convert from IList to IEnumerable: [Something(123)] public IEnumerable<Foo> GetAllFoos() { SetupSomething(); DataReader dr = RunSomething(); while (dr.Read()) { yield return Factory.Create(dr); } } The problem is, SetupSomething() comes from the base class and uses: Attribute.GetCustomAttribute(new StackTrace().GetFrame(1).GetMethod(), typeof(Something)) Yield ends up creating MoveNext(), MoveNext() calls SetupSomething(), and MoveNext() does not have the [Something(123)] attribute. I can't change the base class, so it appears I am forced to stay with IList or implement IEnumerable manually (and add the attribute to MoveNext()). Is there any other way to make yield work in this scenario?

    Read the article

  • SQL multiple primary keys - localization

    - by Max Malmgren
    I am trying to implement some localization in my database. It looks something like this (prefixes only for clarification) tbl-Categories ID Language Name tbl-Articles ID CategoryID Now, in my tbl-Categories, I want to have primary keys spanning ID and language, so that every combination of ID and language is unique. In tbl-Articles I would like a foreign key to reference ID in categories, but not Language, since I do not want to bind an article to a certain language, only category. Of course, I cannot add a foreign key to part of the primary key. I also cannot have the primary key only on the ID of categories, since then there can only be one language. Having no primary keys disables foreign keys altogether, and that is also not a great solution. Do you have any ideas how I can solve this in an elegant fashion? Thanks.

    Read the article

  • DebuggerDisplay attribute does not work as expected!

    - by mark
    Dear ladies and sirs. I know that this attribute should work in C# and yet, in my case it does not. I have a class with a lazy property Children. Accessing this property may have a side effect of roundtripping to the server. So, naturally, I do not want this to happen when I just watch it in the debugger watch window. Omitting all the irrelevant details the source looks pretty ordinary: [DebuggerDisplay("(Frozen) {m_children}")] public IList<IEntityBase> Children { get { if (m_children == null) { m_children = FetchChildrenFromDB(this); } return m_children; } } And yet, when I watch the object and expand this in the watch window I do not see (Frozen) in the display, meaning the debugger simply ignores the attribute. Provided the image link is still valid it should be visible below: http://i28.tinypic.com/2zxo9s5.jpg The attribute is really there, according to Reflector. I use VS2008. Any ideas?

    Read the article

  • MySQL: Changing order of auto-incremented primary keys?

    - by Tom
    Hi, I have a table with a auto-incremented primary key: user_id. For a currently theoretical reason, I might need to change a user_id to be something else than it was when originally created through auto-incrementation. This means there's a possibility that the keys will not be in incremental order anymore: PK: 1 2 3 952 // changed key 4 5 6 7 I'm wondering whether this will cause problems, and whether MySQL reads something special to the incremental order of the keys, given that they should have come to existence in incremental order (which persists even when some rows are deleted). Assuming there are no associated foreignkey issues, or that these are under control, is there a problem with "messing with" the order of MySQL's autoincremented keys? Thank you.

    Read the article

  • Find HTML based on partial attribute

    - by Kirean
    Is there a way with javascript (particularly jQuery) to find an element based on a partial attribute name? I am not looking for any of the selectors that find partial attribute values as referenced in these links: starts with [name^="value"] contains prefix [name|="value"] contains [name*="value"] contains word [name~="value"] ends with [name$="value"] equals [name="value"] not equal [name!="value"] starts with [name^="value"] but more something along the lines of <div data-api-src="some value"></div> <div data-api-myattr="foobar"></div> and $("[^data-api]").doSomething() to find any element that has an attribute that starts with "data-api".

    Read the article

  • JDO in Google App Engine: order of keys in unowned one-to-many relationship

    - by Kel
    I'm implementing web application with JDO in Google App Engine. According to documentation, in owned one-to-many relationships, order of elements in "owner" object collection is determined either by automatically created index field, or by information given in explicit ordering clause. For example: @PersistenceCapable public class Person { // ... @Order(extensions = @Extension(vendorName="datanucleus", key="list-ordering", value="country asc, city asc")) private List<ContactInfo> contacts = new List<ContactInfo>(); In unowned relationships, "owner" object contains collection of keys of "nested" objects, for example: @PersistenceCapable public class Author { // ... @Persistent private List<Key> books; Is order of keys preserved, if I use List<Key> collection in "owner" object for storing keys of "nested" elements? I could not find answer neither in JDO relationships article, nor in Data Classes article :(

    Read the article

  • CoreData could not fulfill a fault when adding new attribute

    - by cagreen
    I am receiving a "CoreData could not fulfill a fault for ..." error message when trying to access a new attribute in a new data model. If I work with new data I'm ok, but when I attempt to read existing data I get the error. Do I need to handle the entity differently myself if the attribute isn't in my original data? I was under the impression that Core Data could handle this for me. My new attribute is marked as optional with a default value. I have created a new .xcdatamodel (and set it to be the current version) and updated my NSPersistentStoreCoordinator initialization to take advantage of the lightweight migration as follows: NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil]; NSError *error = nil; persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:options error:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } Any help is appreciated.

    Read the article

  • Make Arrow and delete keys work in Korn shell Command line

    - by user66854
    Hi all, I am new to unix and am using sun solaris (v10 i think) . I have my shell set as korn shell . i am wondering how to make the arrow keys and delete key work in the command line . I have done set -o emacs and the backspace works , but not the arrow keys and the delete keys . Also is it possible to set the up and down arrow key to cycle through the command line history ? . any help is appreciated .

    Read the article

  • Creating an Attribute to check for Exceptions

    - by BiffBaffBoff
    I'm creating an attribute so that whenever an exception occurs on my site, I'll receive an email detailing the exception. I've got so far but my Attribute code doesn't seem to fire if an exception occurs: public class ReportingAttribute : FilterAttribute, IExceptionFilter { public void OnException(ExceptionContext filterContext) { // This will generate an email to me ErrorReporting.GenerateEmail(filterContext.Exception); } } Then above my Controller I'm doing: [ReportingAttribute] public class AccountController : Controller The other way to do it is ofcourse putting ErrorReporting.GenerateEmail(ex) inside my catch blocks? There must be a simpler way? Thats why I thought of creating the Attribute to handle this

    Read the article

  • Need to get to the foreign keys of an entity marked as "Deleted" for auditing

    - by Abhijeet Patel
    I'm using v1 of EF(.NET 3.5 SP1). I'm subscribing to the SavingChanges event of the ObjectContext wherein I audit deletes for a particular entity type. I need to get to the foreign keys of the entity being deleted i.e EntityKeys of the related entities (RelatedEnds) but the EntityKeys of the related entities are nulls. Is there any way to get to the foreign keys of an entity which has been marked for deletion? Does EF null out the EntityKeys of all RelatedEnds for an entity which has been marked for deletion? If so, is there a way I can get hold of the foreign keys?

    Read the article

  • AngularJS Bind Attribute Presence

    - by Chuck
    I want to bind the presence of an attribute to a variable in AngularJS. Specifically, sandbox for an iframe. Say I have $myCtrl.allowJavascript as a variable, I want to do: <iframe src="..." sandbox /> Where the sandbox attribute is present when allowJavascript == false, and I want the sandbox attribute to disappear when allowJavascript == true. Does AngularJS have a mechanism for this? The closest thing I could find was here, which basically says "it will just work for certain attributes"--but not for sandbox.

    Read the article

  • Enum : get the keys list

    - by Damien MATHIEU
    Hello, I'm not a java developer. But I'm currently taking a look at Android applications development so I'm doing a bit of nostalgy, doing some java again after not touching it for three years. I'm looking forward using the "google-api-translate-java" library. In which there is a Language class. It's an enum allowing to provide the language name and to get it's value for Google Translate. I can easily get all the values with : for (Language l : values()) { // Here I loop on one value } But what I'd want to get is a list of all the keys names (FRENCH, ENGLISH, ...). Is there something like a "keys()" method that'd allow me to loop through all the enum's keys ?

    Read the article

  • Obtain all keys of a Neo4j index

    - by MattiSG
    I have a Neo4j database whose content is generated dynamically from a big dataset. All “entry points” nodes are indexed on a named index (IndexManager.forNodes(…)). I can therefore look up a particular “entry point” node. However, I would now like to enumerate all those specific nodes, but I can't know on which key they were indexed. Is there any way to enumerate all keys of a Neo4j Index? If not, what would be the best way to store those keys, a data type that is eminently non-graph-oriented? UPDATE (thanks for asking details :) ): the list would be more than 2 million entries. The main use case would be to never update it after an initialization step, but other use cases might need it, so it has to be somewhat scalable. Also, I would really prefer avoiding killing my current resilience abilities, so storing all keys at once, as opposed to adding them incrementally, would be a last-resort solution.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >