Search Results

Search found 37415 results on 1497 pages for 'attribute id'.

Page 52/1497 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • Database design - alternatives for Entity Attribute Value (AEV)

    - by Bob
    Hi, see http://stackoverflow.com/questions/695752/product-table-many-kinds-of-product-each-product-has-many-parameters for similar topic. My question: i want to design a database, that will be used for a production facility of different types of products where each product has its own (number of) parameters. because i want the serial numbers to be in one tabel for overview purposes i have a problem with these different paraeters . One solution could be AEV, but it has its downsides, certainly because we have +- 5 products with every product +- 20.000 serial numbers (records). it looks a bit overkill to me... I just don't know how one could design a database so that you have an attribute in a mastertable that says: 'hey, you could find details of this record in THAT detail-table". 'in a way that you qould easely query the results) currenty i am using Visual Basic & Acces 2007. but i'm going to Visual Basic & MySQL. thanks for your help. Bob

    Read the article

  • How to dynamically set validation messages on properties with a class validation attribute

    - by Dan
    I'm writing Validation attribute that sits on the class but inspects the properties of the class. I want it to set a validation message on each of the properties it finds to be invalid. How do I do this? This is what I have got so far: [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public class LinkedFieldValidationAttribute : ValidationAttribute { private readonly string[] _properiesToValidate; public LinkedFieldValidationAttribute(params string[] properiesToValidate) { _properiesToValidate = properiesToValidate; } public override bool IsValid(object value) { PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value); foreach (var propertyName in _properiesToValidate) { var propertyValue = properties.Find(propertyName, false).GetValue(value); //if value is invalid add message from base } //return validity } }

    Read the article

  • Find Elements by Attribute using XDocument

    - by Ignacio
    This query seems to be valid, but I have 0 results. IEnumerable<XElement> users = (from el in XMLDoc.Elements("Users") where (string)el.Attribute("GUID") == userGUID.ToString() select el); My XML is as follows: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <Users> <User GUID="68327fe2-d6f0-403b-a7b6-51860fbf0b2f"> <Key ID="F7000012ECEAD101"> ... </Key> </User> </Users> Do you have any clues to shed some light onto this?

    Read the article

  • How to later assign value to optional attribute of NSManagedObject in a NSManagedObjectModel having

    - by Kundan
    I am using coredata framework. In my NSManagedObjectModel i am using three entities that are Class, Student and Score where class and student have one-to-many & inverse relationship and Student and Score have also inverse but one-one relationship. Score entity has all optional attributes and having default '0' decimalVaue, which is not assigned at the time new Student is added. But later i want to assign them score individually and also to particular attribute not all of score attributes in a go. I am able to create and add Students to particular Class but dont have any idea how to call particular student and assign them score. For example I want to assign Score'attribute "dribbling" [there are many attributes like "tackling"] a decimal value to Student "David" of Class "Soccer" ,how i can do that? Thanks in advance for any suggestion.

    Read the article

  • Alter a single attribute with XSLT

    - by Pete Montgomery
    Hello! <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation debug="true" defaultLanguage="C#"> <!-- this is a comment --> </compilation> </system.web> </configuration> What's the simplest XSLT you can think of to transform the value of the first, in this case only, /configuration/system.web/compilation/@debug attribute from true to false?

    Read the article

  • Stored procedure call in method with OperationBehavior attribute: problems with transactions

    - by Gerrie Schenck
    I'm using ADO.Net's ExecuteNonQuery to call a stored procedure, works like a charm stand-alone but when implementing it where it should be called I'm running into problems concerning transactions. For example System.Data.SqlClient.SqlException: Transaction count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0. and also a timeout right after that. I've just found out the method which calls the stored procedure is marked with the following WCF attribute: [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] How will this influence the call my stored procedure? How can I tell .Net to execute the stored procedure outside this transaction? The stored procedure contains insert statements and also a transaction, but removing them doesn't change the behavior...

    Read the article

  • Unknown attribute xsi:type in XmlSerializer

    - by vanccoon
    I am learning XML Serialization and meet an issue, I have two claess [System.Xml.Serialization.XmlInclude(typeof(SubClass))] public class BaseClass { } public class SubClass : BaseClass { } I am trying to serialize a SubClass object into XML file, I use blow code XmlSerializer xs = new XmlSerializer(typeof(Base)); xs.Serialize(fs, SubClassObject); I noticed Serialization succeed, but the XML file is kind of like ... If I use XmlSerializer xs = new XmlSerializer(typeof(Base)); SubClassObject = xs.Deserialize(fs) as SubClass; I noticed it will complain xsi:type is unknown attribute(I registered an event), although all information embedded in the XML was parsed successfully and members in SubClassObject was restored correctly. Anyone has any idea why there is error in parsing xsi:type and anything I did wrong? Thanks

    Read the article

  • Modifying annotation attribute value at runtime in java

    - by Lici
    Hi folks: some methods in our model pojos have been annotated like this: @Column(name="cli_clipping_id", updatable=false, columnDefinition = "varchar(" + ModelUtils.ID_LENGTH + ") COLLATE utf8_bin") columnDefinition attribute is database vendor dependant, so when trying to drop schema in HSQLDB using Hibernate it fails: [ERROR] 16 jun 12:58:42.480 PM main [org.hibernate.tool.hbm2ddl.SchemaExport] Unexpected token: COLLATE in statement [create table cms.edi_editorial_obj (edi_uuid varchar(23) COLLATE ] To fix this, i'm thinking on this solution (but don't want to spend time if it isn't possible) , at runtime, for each method column annotated: Get @Column annotation Create a copy of the column annotation, setting columnDefinition null using javaassist. set column method annotation to the copy column annotation object overriding the old one (i don't know it this is possible) Is it possible to "hack" these methods this way? Any help would be much appreciated ...

    Read the article

  • yet another confusion with multiprocessing error, 'module' object has no attribute 'f'

    - by gatoatigrado
    I know this has been answered before, but it seems that executing the script directly "python filename.py" does not work. I have Python 2.6.2 on SuSE Linux. Code: #!/usr/bin/python # -*- coding: utf-8 -*- from multiprocessing import Pool p = Pool(1) def f(x): return x*x p.map(f, [1, 2, 3]) Command line: > python example.py Process PoolWorker-1: Traceback (most recent call last): File "/usr/lib/python2.6/multiprocessing/process.py", line 231, in _bootstrap self.run() File "/usr/lib/python2.6/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python2.6/multiprocessing/pool.py", line 57, in worker task = get() File "/usr/lib/python2.6/multiprocessing/queues.py", line 339, in get return recv() AttributeError: 'module' object has no attribute 'f'

    Read the article

  • Add the "selected" attribute to a drop down option with jQuery

    - by gaoshan88
    How do I add the attribute "selected" to a drop down menu option based on that option matching some variable? Here is how the dropdown is populated... loginOptions = ["First", "Second", "Third]; var Login = $( '#Login' ); for ( var i = 0; i < loginOptions.length; i++ ) { Login.append('<option value="'+ loginOptions[i] +'">'+ loginOptions[i] +'</option>'); } I want to mark one option as "selected" based on whether or not its value matches another variable. so if loginOption[i] is equal to var existingLoginValue then set that option to 'selected' Something that would do if(loginOptions[i] === existingLoginValue){ print 'selected'; }; Thanks!

    Read the article

  • pyramid traversal resource url no attribute __name__

    - by Santana
    So I have: resources.py: def _add(obj, name, parent): obj.__name__ = name obj.__parent__ = parent return obj class Root(object): __parent__ = __name__ = None def __init__(self, request): super(Root, self).__init__() self.request = request self.collection = request.db.post def __getitem__(self, key): if u'profile' in key: return Profile(self.request) class Profile(dict): def __init__(self, request): super(Profile, self).__init__() self.__name__ = u'profile' self.__parent__ = Root self.collection = request.db.posts def __getitem__(self, name): post = Dummy(self.collection.find_one(dict(username=name))) return _add(post, name, self) and I'm using MongoDB and pyramid_mongodb views.py: @view_config(context = Profile, renderer = 'templates/mytemplate.pt') def test_view(request): return {} and in mytemplate.pt: <p tal:repeat='item request.context'> ${item} </p> I can echo what's in the database (I'm using mongodb), but when I provided a URL for each item using resource_url() <p tal:repeat='item request.context'> <a href='${request.resource_url(item)}'>${item}</a> </p> I got an error: 'dict' object has no attribute '__name__', can someone help me?

    Read the article

  • Using NSPredicate to filter on both Core attribute and entity

    - by Ben Thompson
    I have two entities in core data (call them entityOne and entityTwo). I have a entityOne<---entityTwo relationship between them. I am now trying to code an NSPredicate to fetch entityTwo objects on the following basis: Fetch entityTwo objects that have a relationship with a specified entityOne object. Filter out those entityTwo objects which have no value for one of their attributes. I am best doing both of these in an NSPredicate or is there a better way? I am trying the following: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(attribute <> "") AND (relationship == entityOne"]; [request setPredicate:predicate]; Any pointers on coding great fully received.

    Read the article

  • Problem with dynamically added script element - attribute src is empty

    - by Stazh
    Hi there, I have a problem with dynamically added script element (using jQuery). Code for adding new script element to DOM is this: var pScript = document.createElement("script"); pScript.type = "text/javascript"; pScript.src = sFile; // Add element to the end of head element $("head").append(pScript); The script is added with no problem, and the code runs perfectly. But, the problem occurs when I try to find the newly added script. I use this code to iterate through all script elements: var bAdd = true; $("script").each(function() { if(this.src == sFile) bAdd = false; }); (I need this code to prevent adding script that is already loaded) Problem is that all other script elements have src attribute set, but the newly added (dynamically) has not... Any idea?

    Read the article

  • .NET DefaultValue attribute

    - by Aaron
    I've heard people say a few different things about the DefaultValue attribute including: "It sets the value of the property before anything else uses it." "It doesn't work for autoproperties." "It's only for decoration. You must manually set actual default values." Which (if any) is right? Does DefaultValue actually set default values? Are there cases where it doesn't work? Is it best just not to use it?

    Read the article

  • jQuery text attribute selector

    - by Shagglez
    I am trying to use the text attribute as a selector, but I can't quite grasp the behaviour, would really appreciate if someone could explain. For example given <span class="span_class"><a class="a_class">text</a></span>, $('a.a_class').text() gives "text" as expected. However $('a.a_class[text]') wouldn't match any elements, and neither would $('span.span_class > a.a_class[text]'), but $('span.span_class* > a.a_class[text]') would (although not in IE). The only workaround I can think of for IE, is loop through all anchors contained in a span, use .text() on each and match it against a certain criteria, but it seems slower than using in-built selectors. Anyone have better ideas?

    Read the article

  • Conditional Required Attribute for validation

    - by jeriley
    We're trying to get a conditional attribute to work, case in point, there's a boolean (checkbox) that if checked, its related text is required. So, ideally we'd have something like ... public bool Provision { get; set; } [ConditionalRequirement(IsNeededWhenTrue = Provision)] public string ProvisionText { get; set; } Is this even possible? Alternate idea (not as elegant?) public bool Provision2 { get; set; } [PropertyRequired(RequiredBooleanPropertyName = "Provision2")] public string Provision2Text { get; set; } I'd hate to use the magic string method ... but any other ideas?

    Read the article

  • Updating XML using attribute to identify value in SQL server

    - by Tadhg
    I have a XML structure in a XML column on a SQL Server table as follows: <Customizations> <Customization name="OtherValue"> <value>Test</value> </Customization> . . . . <Customization name="Year"> <value>2009</value> </Customization> </Customizations> and I'm looking to update the value of Customization with the element with the attribute Year. Been looking at this for a while and best attempt is: UPDATE TestTable SET XmlColumn.modify( ' replace value of (/Customizations/Customization/@name[.="Year"]/value)[1] with ( "2010" ) ') Can someone help point out where I'm going wrong?

    Read the article

  • Scala: XML Attribute parsing

    - by Chris
    I'm trying to parse a rss feed that looks like this for the attribute "date": <rss version="2.0"> <channel> <item> <y:c date="AA"></y:c> </item> </channel> </rss> I tried several different versions of this: (rssFeed contains the RSS data) println(((rssFeed \\ "channel" \\ "item" \ "y:c" \"date").toString)) But nothing seems to work. What am I missing? Any help would really be appreciated!

    Read the article

  • Using xsl param (if exists) to replcae attribute value

    - by Assaf
    I would like an xsl that replaces the value attribute of the data elements only if the relevant param names are passed. Input <applicationVariables applicationServer="tomcat"> <data name="HOST" value="localhost"/> <data name="PORT" value="8080"/> <data name="SIZE" value="1000"/> </applicationVariables> So for example if passing in a param HOST1=myHost and PORT=9080 the output should be: <applicationVariables applicationServer="tomcat"> <data name="HOST" value="myHost"/> <data name="PORT" value="9080"/> <data name="SIZE" value="1000"/> </applicationVariables> Note that HOST and PORT where replaced but SIZE was not replaced because there was no parameter with name SIZE Since the list of data elements is long (and may change), i would like a generic way of doing this with xsl

    Read the article

  • Take <span> class and put in <a> attribute jquery

    - by Toktik
    Hello, I have html like this. <span class="gallery-open-item year-icon-Yes 2010"> <a href="/year/none"> </a> </span> I need to check by jquery if span.gallery-open-item have year-icon-Yes class take next(for this example is 2010) class and place it in a href attribute like this All this I need in jQuery or JavaScript. I have done some experiments but I can't take 2010 to normal javascript variable. Any ideas? Sorry for my english.

    Read the article

  • VisualStudio: Toggle Archive Attribute When Saving File?

    - by John Dibling
    We use Tortoise CVS in out shop, but in my last job we used Visual SourceSafe. VSS is generally a pile, but it did have one nice feature. You could right-click on a branch and ask it for a list of all the files you had checked-out. As far as I can tell there is no similar feature in CVS. So what I'm looking for is some kind of VS plusgin that will automatically reset (turn off) the archive attribute when saving a file. Then I can recursively dir to find the files I have checked-out. Does anyone know of a VS plugin or something I can do to get this behavior? Or is there something else I can do in CVS to get my ultimately desired result?

    Read the article

  • NoneType has no attribute Append

    - by Rosarch
    I'm new to Python. I can't understand why a variable is None at a certain point in my code: class UsersInRoom(webapp.RequestHandler): def get(self): room_id = self.request.get("room_id") username = self.request.get("username") UserInRoom_entities = UserInRoom.gql("WHERE room = :1", room_id).get() if UserInRoom_entities: for user_in_room in UserInRoom_entities: if user_in_room.username == username: user_in_room.put() # last_poll auto updates to now whenenever user_in_room is saved else: user_in_room = UserInRoom() user_in_room.username = username user_in_room.put() UserInRoom_entities = [] UserInRoom_entities.append(user_in_room) // error here # name is `user_at_room` intead of `user_in_room` to avoid confusion usernames = [user_at_room.username for user_at_room in UserInRoom_entities] self.response.out.write(json.dumps(usernames)) The error is: Traceback (most recent call last): File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 507, in __call__ handler.get(*groups) File "path\to\chat.py", line 160, in get AttributeError: 'NoneType' object has no attribute 'append' How is this possible? I'm setting UserInRoom_entities = [] immediately before that call. Or is something else the None in question?

    Read the article

  • Alt attribute encoding with JavaScript

    - by MainMa
    Hi, Html entities must be encoded in alt attribute of an image in HTML page. So <img id="formula" alt="A &rarr; B" src="formula.png" /> will work well. On the other hand, the same JavaScript code will not work document.getElementById('formula').alt = 'A &rarr; B'; and will produce A &rarr; B instead of A → B. How to do it through JavaScript, when it is not possible to put the special (unencoded) characters in the source code?

    Read the article

  • Set the mouseover Attribute of a div using JQuery

    - by Abs
    Hello all, I would like to set an attribute for a div. I have done this: $('#row-img_1').onmouseover = function (){ alert('foo'); }; $('#row-img_2').onmouseout = function (){ alert('foo2'); }; However, the above has not worked, it does not alert when mouse is over or when it moves out. I have also tried the $('#row-img_1').attr(); and I could not get this to work either. I am aware that I should be using a more effective event handling system but my divs are dynamically generated. Plus this is a small project. ;) Thanks all for any help.

    Read the article

  • Defining xml in an xsd where an attribute determines the possible contents

    - by SeanJA
    How would one go about defining something like this in an xsd? <start> <request type="typeA"> <elementOnlyFoundInA /> </request> <request type="typeB"> <elementOnlyFoundInB /> </request> </start> I ran xsd.exe just to get an idea of what it might look like, but it does not appear recognize the relationships between the value of type and the contents of the request. Is it even possible to define contents based on an attribute like this in an xsd file?

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >