Search Results

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

Page 96/433 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • How to check if a node's value in one XML is present in another XML with a specific attribute?

    - by Manish
    The question seems to be little confusing. So let me describe my situation through an example: Suppose I have an XML: A.xml <Cakes> <Cake>Egg</Cake> <Cake>Banana</Cake> </Cakes> Another XML: B.xml <Cakes> <Cake show="true">Egg</Cake> <Cake show="true">Strawberry</Cake> <Cake show="false">Banana</Cake> </Cakes> Now I want to show some text say "TRUE" if all the Cake in A.xml have show="true" in B.xml else "FALSE". In the above case, it will print FALSE. I need to develop an XSL for that. I can loop through all the Cake in A.xml and check if that cake has show="true" in B.xml but I don't know how to break in between (and set a variable) if a show="false" is found. Is it possible? Any help/comments appreciated.

    Read the article

  • Why do you have to mark a class with the attribute [serializable] ?

    - by Blankman
    Seeing as you can convert any document to a byte array and save it to disk, and then rebuild the file to its original form (as long as you have meta data for its filename etc.). Why do you have to mark a class with [Serializable] etc? Is that just the same idea, "meta data" type information so when you cast the object to its class things are mapped properly?

    Read the article

  • Can I load the max value of the range attribute in CFINPUT using and AJAX call?

    - by Eric Belair
    I have a CFINPUT tag in a CFFORM: <cfinput type="text" id="itemInput" name="itemInput" /> I want to set the range dynamically without posting the page. I have several AJAX calls throughout the page to dynamically load form fields on the fly: <cfselect id="this" name="this" bind="cfc:Data.getThis()" bindonload="true" /> <cfselect id="that" name="that" bind="cfc:Data.getThat({p1})" /> <cfselect id="theOther" name="theOther" bind="cfc:Data.getTheOther({p1}, {p2})" /> <cfdiv id="maxQty" bind="cfc:Data.getMaxQty({itemId})" /> <cfinput type="text" id="qty" name="qty" /> <cfdiv id="itemId" bind="cfc:Data.getItemId({this}, {that}, {theOther})" /> In the above CFFORM, I basically want to set the minValue of the range to "1" and the maxValue of the range to the value of cfc:Data.getMaxQty({itemId}). Is this possible? How can I do it?

    Read the article

  • How to append to an XML response an error attribute using Ruby on Rails 3?

    - by user502052
    I am trying to implement REST APIs, so in my RoR3 application I have XML responses. Before to pass to a consumer the XML, I wuold like to check if there are errors and, if so, send back a response with error messages. I read "Active Record Validations and Callbacks" guides on the RoR website, but it seems not work in my case. I extract from the database a resource doing @response = User.find_by_id(1) and I wuold like, if possible, to add error to it. Seeing some examples I have seen how to report errors in an XML file format.xml { render :xml => @response.errors } but how I can add append new errors to the @response? Maybe something like this: errors.add(:password, "is invalid")

    Read the article

  • How to call a specific, unknown Python object attribute?

    - by Michael Morisy
    I'm working to create a simple Python script that will ultimately tell you how many blog entries were posted in a given month, and the pyblog app is proving very helpful. However, when I create the blog object, I don't know how to access it's various attributes. I can print them all out by printing one item from the dictionary, as shown (in excerpts) below: print blog.get_recent_posts(1) 'post_status': 'publish', 'date_created_gmt': <DateTime '20100601T19:27:17' at 2853300>, 'mt_excerpt': '', 'userid': '288', 'dateCreated': <DateTime '20100601T14:27:17' at 2853350>, 'custom_fields': [{'value': '', 'id': '1317', 'key': 'brightcove_code'}, {'value': 'http://bit.ly/d0Rywl', 'id': '1403', But how can I just get it to provide that DateTime information?

    Read the article

  • IF I have multiple candidate keys which one is a primary key and justify your choice ??

    - by zahrani
    Given R = { Account , Analyst , Assets, Broker, Client, Commission, Company, Dividend, Exchange, Investment, Office, Profile, Return, Risk_profile, Stock, Volume} and a set of functional dependencies F{fd1, fd2,fd3, fd4, fd5,fd6, fd7, fd8, fd9, fd10, fd11} where: fd1: Client - Office fd2: Stock - Exchange, Dividend fd3: Broker - Profile fd4: Company - Stock fd5: Client - Risk_profile, Analyst fd6: Analyst - Broker fd7: Stock, Broker - Invenstment, Volume fd8: Stock - Company fd9: Investment,Commission - Return fd10: Stock, Broker - Client fd11: Account - Assests these are candidate key(s) : (Account, Commission,Analyst ,Company) (Account, Commission,Analyst ,Stock) (Account ,Commission,Broker ,Company) (Account ,Commission,Broker ,Stock) (Account ,Commission,Client, Company) (Account ,Commission,Client ,Stock) (Q) Select a primary key and justify your choice ? I was select (Account ,Commission,Broker ,Stock) as a primary key ??? I chose that because it has the most direct dependencies compared to other ones. e.g. more attributes are functionally dependent on this primary key. please check if my answer is it true ? or Not I'm waiting your answer asap thank you

    Read the article

  • How do you assign a JavaScript 'onclick' attribute dynamically?

    - by Jack Roscoe
    Hi, I'm creating a button dynamically using JavaScript and at the same time assigning attributes such as 'ID', 'type' etc and also 'onclick' in order to trigger a function. All works fine apart from the assignment of the 'onclick'. When clicked, the button is not triggering the function as it is supposed to. the function I'm trying to run is 'navigate(-1)' as seen below. Where am I going wrong? Here's my code: function loadNavigation() { var backButton; backButton = document.createElement('input'); backButton.ID = 'backButton'; backButton.type = 'button'; backButton.value='Back'; backButton.onclick = 'navigate(-1)'; document.body.appendChild(backButton); }

    Read the article

  • Howw to add new value with generic Repository if there are foreign keys (EF-4)?

    - by Phsika
    i try to write a kind of generic repository to add method. Everything is ok to add but I have table which is related with two tables with FOREIGN KEY.But Not working because of foreign key public class DomainRepository<TModel> : IDomainRepository<TModel> where TModel : class { #region IDomainRepository<T> Members private ObjectContext _context; private IObjectSet<TModel> _objectSet; public DomainRepository() { } public DomainRepository(ObjectContext context) { _context = context; _objectSet = _context.CreateObjectSet<TModel>(); } //do something..... public TModel Add<TModel>(TModel entity) where TModel : IEntityWithKey { EntityKey key; object originalItem; key = _context.CreateEntityKey(entity.GetType().Name, entity); _context.AddObject(key.EntitySetName, entity); _context.SaveChanges(); return entity; } //do something..... } Calling REPOSITORY: //insert-update-delete public partial class AddtoTables { public table3 Add(int TaskId, int RefAircraftsId) { using (DomainRepository<table3> repTask = new DomainRepository<table3>(new TaskEntities())) { return repTask.Add<table3>(new table3() { TaskId = TaskId, TaskRefAircraftsID = RefAircraftsId }); } } } How to add a new value if this table includes foreign key relation

    Read the article

  • How do I Order on common attribute of two models in the DB?

    - by Will
    If i have two tables Books, CDs with corresponding models. I want to display to the user a list of books and CDs. I also want to be able to sort this list on common attributes (release date, genre, price, etc.). I also have basic filtering on the common attributes. The list will be large so I will be using pagination in manage the load. items = [] items << CD.all(:limit => 20, :page => params[:page], :order => "genre ASC") items << Book.all(:limit => 20, :page => params[:page], :order => "genre ASC") re_sort(items,"genre ASC") Right now I am doing two queries concatenating them and then sorting them. This is very inefficient. Also this breaks down when I use paging and filtering. If I am on page 2 of how do I know what page of each table individual table I am really on? There is no way to determine this information without getting all items from each table. I have though that if I create a new Class called items that has a one to one relationship with either a Book or CD and do something like Item.all(:limit => 20, :page => params[:page], :include => [:books, :cds], :order => "genre ASC") However this gives back an ambiguous error. So can only be refined as Item.all(:limit => 20, :page => params[:page], :include => [:books, :cds], :order => "books.genre ASC") And does not interleave the books and CDs in a way that I want. Any suggestions.

    Read the article

  • Is there a JUnit equivalent to NUnit's testcase attribute?

    - by Steph
    I've googled for JUnit test case, and it comes up with something that looks a lot more complicated to implement - where you have to create a new class that extends test case which you then call: public class MathTest extends TestCase { protected double fValue1; protected double fValue2; protected void setUp() { fValue1= 2.0; fValue2= 3.0; } } public void testAdd() { double result= fValue1 + fValue2; assertTrue(result == 5.0); } but what I want is something really simple, like the NUnit test cases [TestCase(1,2)] [TestCase(3,4)] public void testAdd(int fValue1, int fValue2) { double result= fValue1 + fValue2; assertIsTrue(result == 5.0); } Is there any way to do this in JUnit?

    Read the article

  • How to insert an n:m-relationship with technical primary keys generated by a sequence?

    - by bitschnau
    Let's say I have two tables with several fields and in every table there is a primary key which is a technical id generated by a database sequence: table1 table2 ------------- ------------- field11 <pk> field21 <pk> field12 field22 field11 and field21 are generated by sequences. Also there is a n:m-relationship between table1 und table2, designed in table3: table3 ------------- field11 <fk> field21 <fk> The ids in table1 und table2 are generated during the insert statement: INSERT INTO table1 VALUES (table1_seq1.NEXTVAL, ... INSERT INTO table2 VALUES (table2_seq1.NEXTVAL, ... Therefore I don't know the primary key of the added row in the data-access-layer of my program, because the generation of the pk happens completely in the database. What's the best practice to update table3 now? How can I gain access to the primary key of the rows I just inserted?

    Read the article

  • Why do I need to give my options a value attribute in my dropdown? JQuery.

    - by Alex
    So far in my web developing experiences, I've noticed that almost all web developers/designers choose to give their options in a select a value like so: <select name="foo"> <option value="bar">BarCheese</option> // etc. // etc. </select> Is this because it is best practice to do so? I ask this because I have done a lot of work with jQuery and dropdown's lately, and sometimes I get really annoyed when I have to check something like: $('select[name=foo]').val() == "bar"); To me, many times that seems less clear than just being able to check the val() against BarCheese. So why is it that most web developers/designers specify a value paramater instead of just letting the options actual value be its value?

    Read the article

  • Use variables to decide which object in an array gets an attribute?

    - by DavidR
    I have a web app which has two text areas. When one text area receives a mousedown event, a variable "side" is set, either "left" or "right." When a user selects some text in a text area, three strings are made. One for the text before the beginning of the selection, the selection itself, and the text after the selection to the end. A function is set to return these like this: return { head: head_text, tail: tail_text, sel: sel_text, side: text_side } Now, I have created an array, and I want it to appear in such a way that we get, text.left({"head":"four score", "selection":"and seven", "tail":"years ago."}) I am assuming I would do this by text.side = getSelection(), but how do I get it to evaluate the variable "side" instead of thinking of it as an object within "text"? EDIT: Ok, just to clarify, I might be completely wrong in my ideas in how this works, but here it goes. I want to make it so that a function can look at "text" see within text two objects, "left" and "right," and then evaluate the head, sel, and tail of each object. Would it be easier for me to use two objects?

    Read the article

  • Why does cisco IOS require domain-name to be set before SSH keys can be generated?

    - by Daniel Papasian
    Is there a technical reason why IOS requires the device's domain-name to be set (via ip domain-name) before an SSH key can be generated? Is the domain-name used in any way in the generation of the key? Is there any way to force the generation of a key before the domain name is set? UPDATE: Myself (before I posted this question) and others in your answer seem to think it may be used as either a salt or a source of entropy for the key. Wouldn't the domain-name be very predictable? This doesn't seem like a suitable source of entropy.

    Read the article

  • How can I tell if a <script> tag with a given src attribute is present on the page in ASP.net?

    - by Chris McCall
    Like the title says, I'm trying to find out if I need to include a script library that my ASP.net UserControl needs to work. I don't want to include it multiple times per page, but I want my control to be able to be used multiple times on the same page. How can I, in the codebehind of my control, check to see if a given <script/> tag is present? This is .Net 2.0, no LINQ.

    Read the article

  • Xpath problem, getting the id(attribute) of a element, if you know the title of the element.

    - by user577823
    Hi guys, My question is, is it possible to get the Article ID, when you have the title of the article?(via xpath) Articles Article ID="1" title crack /title content blablabalbal /content /Article /Articles Because i am using this right now, it isnt working though. $xml = simplexml_load_file("Articles.xml"); $XElement = new SimpleXMLElement($xml-asXML()); $Articles = $XElement-xpath("Article"); $title = "crack"; $elements = count($Articles); for($i = 0; $i title; if($Titles == $title) //This is not working? i dont know why? { $AID = (string)$Articles[$i][@"ID"]; } }

    Read the article

  • How to set an onClick attribute that would load dynamic content?

    - by konzepz
    This code is suppose to add an onClick event to each of the a elements, so that clicking on the element would load the content of the page dynamically into a DIV. Now, I got this far - It will add the onClick event, but how can I load the dynamic content? $(document.body).ready(function () { $("li.cat-item a").each(function (i) { this.setAttribute('onclick','alert("[load content dynamically into #preview]")'); }); }); Thank you.

    Read the article

  • How do I order by foreign attribute for belongs_to reference where there are 2 keys to foreign table

    - by Will
    I have a Model which has a belongs_to association with another Model as follows class Article belongs_to :author, :class_name => "User" end If I wanted to find all articles for a particular genre ordered by author I would do something like the following articles = Article.all(:includes => [:author], :order => "users.name") However if Article happens to have two references to User how can I sort on :author? class Article belongs_to :editor, :class_name => "User" belongs_to :author, :class_name => "User" end I have tried articles = Article.all(:includes => [:author], :order => "users.name") #=> incorrect results articles = Article.all(:includes => [:author], :order => "authors.name") #=> Exception Thrown

    Read the article

  • Find messages from certain key till certain key while being able to remove stale keys.

    - by Alfred
    My problem Let's say I add messages to some sort of datastructure: 1. "dude" 2. "where" 3. "is" 4. "my" 5. "car" Asking for messages from index[4,5] should return: "my","car". Next let's assume that after a while I would like to purge old messages because they aren't useful anymore and I want to save memory. Let's say at time x messages[1-3] became stale. I assume that it would be most efficient to just do the deletion once every x seconds. Next my datastructure should contain: 4. "my" 5. "car" My solution? I was thinking of using a concurrentskiplistset or concurrentskiplist map. Also I was thinking of deleting the old messages from inside a newSingleThreadScheduledExecutor. I would like to know how you would implement(efficiently/thread-safe) this or maybe use a library?

    Read the article

  • Percentage difference between different values in the same keys of two different arrays.

    - by Paul
    Hey. I'm looking for a solution to this problem. I got 2 arrays, like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "19088" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "15566" } } array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "12043" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "11953" } } Now I'd like to create a new array, with the % difference between the values per key. Would be something like this: array(2) { [20100526]=> array(1) { ["ga:pageviews"]=> string(5) "88,23" } [20100527]=> array(1) { ["ga:pageviews"]=> string(5) "74,54" } } Can anyone help me how to create that array?

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >