Search Results

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

Page 59/433 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • Type attribute for text_field

    - by Koning Baard XIV
    I have this code: <%= f.text_field :email, :type => "email", :placeholder => "[email protected]" %> So people can enter their email on an iPhone with the email keyboard instead of the ASCII keyboard. However, the output is: <input id="user_email" name="user[email]" placeholder="[email protected]" size="30" type="text" /> which should be: <input id="user_email" name="user[email]" placeholder="[email protected]" size="30" type="email" /> Is there a way to force Rails to use the email type instead of text, or must I use HTML directly? Thanks

    Read the article

  • Datamapper has n relationship with multiple keys

    - by jing
    I am working on a simple relationship with DataMapper, a ruby webapp to track games. A game belongs_to 4 players, and each player can have many games. When I call player.games.size, I seem to be getting back a result of 0, for players that I know have games associated with them. I am currently able to pull the player associations off of game, but can't figure out why player.games is empty. Do I need to define a parent_key on the has n association, or is there something else I'm missing? class Game belongs_to :t1_p1, :class_name => 'Player', :child_key => [:player1_id] belongs_to :t1_p2, :class_name => 'Player', :child_key => [:player2_id] belongs_to :t2_p1, :class_name => 'Player', :child_key => [:player3_id] belongs_to :t2_p2, :class_name => 'Player', :child_key => [:player4_id] ... end class Player has n, :games ... end

    Read the article

  • Keys and terminology

    - by nabbed
    I have a predicament related to terminology. Our system processes events. Events are dispatched to a node based on the value of some field (or set of fields). We call this set of fields the key. We call the value of that set of fields the key value. What adds confusion is that each event is essentially a bag of key-value pairs (i.e., a hash map). So the word key is used for two different purposes: 1) to describe the set of fields on which the event is dispatched, and 2) as a field name. So if you had a collection of key-value pairs, and a set of those key-value pairs made up a database-style key, what terminology would you use to distinguish those two? (One further complication is that the key on which the event is dispatched is not always unique. For instance, if we dispatch on userid, and that user performs multiple actions, we will process multiple events with the same userid value. So maybe key is the wrong word to describe the set of fields on which we dispatch an event).

    Read the article

  • Attribute References in Python

    - by Jeune
    I do Java programming and recently started learning Python via the official documentation. I see that we can dynamically add data attributes to an instance object unlike in Java: class House: pass my_house = House() my_house.number = 40 my_house.rooms = 8 my_house.garden = 1 My question is, in what situations is this feature used? What are the advantages and disadvantages compared to the way it is done in Java?

    Read the article

  • Java List with Objects - find and replace (delete) entry if Object with certain attribute already ex

    - by Sophomore
    Hi there I've been working all day and I somehow can't get this probably easy task figured out - probably a lack of coffee... I have a synchronizedList where some Objects are being stored. Those objects have a field which is something like an ID. These objects carry information about a user and his current state (simplified). The point is, that I only want one object for each user. So when the state of this user changes, I'd like to remove the "old" entry and store a new one in the List. protected static class Objects{ ... long time; Object ID; ... } ... if (Objects.contains(ID)) { Objects.remove(ID); Objects.add(newObject); } else { Objects.add(newObject); } Obviously this is not the way to go but should illustrate what I'm looking for... Maybe the data structure is not the best for this purpose but any help is welcome!

    Read the article

  • Extract <name> attribute from KML

    - by Ozaki
    I am using OpenLayers for a mapping service. In which I have several KML layers that are using KML feeds from server to populate data on the map. It currently plots: images / points / vector lines & shapes. But on these points it will not add a label with the value of the for the placemark in the KML. What I have currently tried is: ////////////////////KML Feed for * Layer// var surveylinelayer = new OpenLayers.Layer.Vector("First KML Layer", { projection: new OpenLayers.Projection("EPSG:4326"), strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.HTTP({ url: firstKMLURL, format: new OpenLayers.Format.KML({ extractStyles: true, extractAttributes: true }) }), styleMap: new OpenLayers.StyleMap({ "default": KMLStyle }) }); then the Style as follows: var KMLStyle = new OpenLayers.Style({ //label: "${name}", // This method will display nothing fillOpacity: 1, pointRadius: 10, fontColor: "#7E3C1C", fontSize: "13px", fontFamily: "Courier New, monospace", fontWeight: "strong", labelXOffset: "0", labelYOffset: "-15" }, { //dynamic label context: { label: function(feature) { return "Feature Name: " + feature.attributes.name; // also displays nothing } } }); Example of the KML: <Placemark> <name>POI1</name> <Style> <LabelStyle> <color>ffffffff</color> </LabelStyle> </Style> <Point> <coordinates>0.000,0.000</coordinates> </Point> </Placemark> When debugging I just hit "feature is undefined" and am unsure why it would be undefined in this instance?

    Read the article

  • Why does x86 WiX installer on Vista x64 not write keys to WOW6432Node in the registry

    - by Ryan Conrad
    I have an installer that writes to HKLM\Software\DroidExplorer\InstallPath. On any x86 machine it writes just fine to the expected location, on Windows XP x64 and Windows 7 x64 it also writes to the expected location, which is actually HKLM\Software\WOW6432Node\DroidExplorer\InstallPath. Later on during the install, my bootstrapper, which is also x86, attempts to read the value. On all x86 Windows machines it is successful, and on Windows XP x64 and Windows 7 x64, but Windows Vista x64 is unable to locate the key. If I look in the registry, it doesn't actually write it to WOW6432Node on Vista, it writes it to Software\DroidExplorer\InstallPath If I do not forcefully tell the installer to write to WOW6432Node, it writes the value to Software\DroidExplorer\InstallPath, but the bootstrapper still trys to look in WOW6432Node because of the Registry Reflection. This is on all x64 systems. Why is Vista x64 the only one I have this issue with? Is there a way around this?

    Read the article

  • Problem comparing keys in Appengine/Python

    - by ana
    I'm trying to create a relationship between "tables" with Appengine/Python. Imagine I have a "table" for items, and a table for colors. I save the color of an item by saving the color key as an atribute of the item. That's working well, but this particular piece of code is not working: <select id="colorKey" name="colorKey"> {% for color in colors %} <option value="{{ color.key }}"{% if color.key = item.colorKey %} selected="selected"{% endif %}> {{ color.name }} - {{ item.colorKey }} - {{ color.key }} </option> {% endfor %} </select> Since the {{ item.colorKey }} and {{ color.key }} variables are actually the same chain of characters, I only can think in a problem with the types. {{ item.colorKey }} is a string for sure. But maybe {{ color.key }} is not?

    Read the article

  • @OneToMany and composite primary keys?

    - by Kris Pruden
    Hi, I'm using Hibernate with annotations (in spring), and I have an object which has an ordered, many-to-one relationship which a child object which has a composite primary key, one component of which is a foreign key back to the id of the parent object. The structure looks something like this: +=============+ +================+ | ParentObj | | ObjectChild | +-------------+ 1 0..* +----------------+ | id (pk) |-----------------| parentId | | ... | | name | +=============+ | pos | | ... | +================+ I've tried a variety of combinations of annotations, none of which seem to work. This is the closest I've been able to come up with: @Entity public class ParentObject { @Column(nullable=false, updatable=false) private String id; @OneToMany(mappedBy="object", fetch=FetchType.EAGER) @IndexColumn(name = "pos", base=0) private List<ObjectChild> attrs; ... } @Entity public class ChildObject { @Embeddable public static class Pk implements Serializable { @Column(nullable=false, updatable=false) private String objectId; @Column(nullable=false, updatable=false) private String name; @Column(nullable=false, updatable=false) private int pos; ... } @EmbeddedId private Pk pk; @ManyToOne @JoinColumn(name="parentId") private ParentObject parent; ... } I arrived at this after a long bout of experimentation in which most of my other attempts yielded entities which hibernate couldn't even load for various reasons. The error I get when I try to read one of these objects (they seem to save OK), I get an error of this form: org.hibernate.exception.SQLGrammarException: could not initialize a collection: ... And the root cause is this: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'attrs0_.id' in 'field list' I'm sure I'm missing something simple, but the documentation is not clear on this matter, and I haven't been able to find any examples of this anywhere else. Thanks!

    Read the article

  • Changing input name attribute

    - by Parhs
    Hello! I have some hidden inputs like this <input name="exam.normals[1].blahblah" ..../> I would like somehow to replace the [1] with a number that I want (index). I aint lazy but I am trying to find a good way to do this... A solution would be a replace of exam.normals[1] with exam.normals[+ index +] but I should substr the whole string first.... With regexp I don’t know how to do the replace. good...

    Read the article

  • Domain Keys, DKIM and Sendmail

    - by Daniel
    When I am using DomainKeys and DKIM together on a linux system, do I run both of them on the same port? DomainKeys: /usr/bin/dk-filter -l -p inet:8891@localhost -d example.com -s /var/db/ domainkeys/default.key.pem -S default DKIM: /usr/bin/dkim-filter -l -p inet:8891@localhost -c simple -d example.com -k /var/db/dkim/mail.key.pem -s mail -S rsa-sha256 -u dkim -m MSA Or do I do something like this: DomainKeys: /usr/bin/dk-filter -l -p inet:8892@localhost -d example.com -s /var/db/ domainkeys/mail1.key.pem -S default DKIM: /usr/bin/dkim-filter -l -p inet:8891@localhost -c simple -d example.com -k /var/db/dkim/mail2.key.pem -s mail -S rsa-sha256 -u dkim -m MSA Just wondering since information about DomainKeys and DKIM tell you to run them on the same port: http://www.elandsys.com/resources/sendmail/domainkeys.html http://www.elandsys.com/resources/sendmail/dkim.html I want to run both of them together, is this a bad idea?

    Read the article

  • Invalidating Memcached Keys on save() in Django

    - by Zack
    I've got a view in Django that uses memcached to cache data for the more highly trafficked views that rely on a relatively static set of data. The key word is relatively: I need invalidate the memcached key for that particular URL's data when it's changed in the database. To be as clear as possible, here's the meat an' potatoes of the view (Person is a model, cache is django.core.cache.cache): def person_detail(request, slug): if request.is_ajax(): cache_key = "%s_ABOUT_%s" % settings.SITE_PREFIX, slug # Check the cache to see if we've already got this result made. json_dict = cache.get(cache_key) # Was it a cache hit? if json_dict is None: # That's a negative Ghost Rider person = get_object_or_404(Person, display = True, slug = slug) json_dict = { 'name' : person.name, 'bio' : person.bio_html, 'image' : person.image.extra_thumbnails['large'].absolute_url, } cache.set(cache_key) # json_dict will now exist, whether it's from the cache or not response = HttpResponse() response['Content-Type'] = 'text/javascript' response.write(simpljson.dumps(json_dict)) # Make sure it's all properly formatted for JS by using simplejson return response else: # This is where the fully templated response is generated What I want to do is get at that cache_key variable in it's "unformatted" form, but I'm not sure how to do this--if it can be done at all. Just in case there's already something to do this, here's what I want to do with it (this is from the Person model's hypothetical save method) def save(self): # If this is an update, the key will be cached, otherwise it won't, let's see if we can't find me try: old_self = Person.objects.get(pk=self.id) cache_key = # Voodoo magic to get that variable old_key = cache_key.format(settings.SITE_PREFIX, old_self.slug) # Generate the key currently cached cache.delete(old_key) # Hit it with both barrels of rock salt # Turns out this doesn't already exist, let's make that first request even faster by making this cache right now except DoesNotExist: # I haven't gotten to this yet. super(Person, self).save() I'm thinking about making a view class for this sorta stuff, and having functions in it like remove_cache or generate_cache since I do this sorta stuff a lot. Would that be a better idea? If so, how would I call the views in the URLconf if they're in a class?

    Read the article

  • using xml type attribute for derived complex types

    - by David Michel
    Hi All, I'm trying to get derived complex types from a base type in an xsd schema. it works well when I do this (inspired by this): xml file: <person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Employee"> <name>John</name> <height>59</height> <jobDescription>manager</jobDescription> </person> xsd file: <xs:element name="person" type="Person"/> <xs:complexType name="Person" abstract="true"> <xs:sequence> <xs:element name= "name" type="xs:string"/> <xs:element name= "height" type="xs:double" /> </xs:sequence> </xs:complexType> <xs:complexType name="Employee"> <xs:complexContent> <xs:extension base="Person"> <xs:sequence> <xs:element name="jobDescription" type="xs:string" /> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> However, if I want to have the person element inside, for example, a sequence of another complex type, it doesn't work anymore: xml: <staffRecord> <company>mycompany</company> <dpt>sales</dpt> <person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Employee"> <name>John</name> <height>59</height> <jobDescription>manager</jobDescription> </person> </staffRecord> xsd file: <xs:element name="staffRecord"> <xs:complexType> <xs:sequence> <xs:element name="company" type="xs:string"/> <xs:element name="dpt" type="xs:string"/> <xs:element name="person" type="Person"/> <xs:complexType name="Person" abstract="true"> <xs:sequence> <xs:element name= "name" type="xs:string"/> <xs:element name= "height" type="xs:double" /> </xs:sequence> </xs:complexType> <xs:complexType name="Employee"> <xs:complexContent> <xs:extension base="Person"> <xs:sequence> <xs:element name="jobDescription" type="xs:string" /> </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> </xs:sequence> </xs:complexType> </xs:element> When validating the xml with that schema with xmllint (under linux), I get this error message then: config.xsd:12: element complexType: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}sequence': The content is not valid. Expected is (annotation?, (element | group | choice | sequence | any)*). WXS schema config.xsd failed to compile Any idea what is wrong ? David

    Read the article

  • php xml attribute value replace

    - by Mark
    Say i have an xml file of this nature some data I wan to replace attributes of each later using one function in php: example say: replaceAttribute("collections","somecollection,"newcollection");

    Read the article

  • Using Spring's KeyHolder with programmatically-generated primary keys

    - by smayers81
    Hello, I am using Spring's NamedParameterJdbcTemplate to perform an insert into a table. The table uses a NEXTVAL on a sequence to obtain the primary key. I then want this generated ID to be passed back to me. I am using Spring's KeyHolder implementation like this: KeyHolder key = new GeneratedKeyHolder(); jdbcTemplate.update(Constants.INSERT_ORDER_STATEMENT, params, key); However, when I run this statement, I am getting: org.springframework.dao.DataRetrievalFailureException: The generated key is not of a supported numeric type. Unable to cast [oracle.sql.ROWID] to [java.lang.Number] at org.springframework.jdbc.support.GeneratedKeyHolder.getKey(GeneratedKeyHolder.java:73) Any ideas what I am missing?

    Read the article

  • SQL to retrieve the latest records, grouping by unique foreign keys

    - by jbox
    I'm creating query to retrieve the latest posts in a forum using a SQL DB. I've got a table called "Post". Each post has a foreign key relation to a "Thread" and a "User" as well as a creation date. The trick is I don't want to show two posts by the same user or two posts in the same thread. Is it possible to create a query that contains all this logic? # Grab the last 10 posts. SELECT id, user_id, thread_id FROM posts ORDER BY created_at DESC LIMIT 10; # Grab the last 10 posts, max one post per user SELECT id, user_id, thread_id FROM post GROUP BY user_id ORDER BY date DESC LIMIT 10; # Grab the last 10 posts, max one post per user, max one post per thread???

    Read the article

  • Multiple foreign keys to same table using Elixir

    - by Suvir
    Hello, I am new to ORMs in general. I have a table (lets call it Entity) with columns -- ID expression type ( can be 'long_word', 'short_word' or 'sentence' ) Often, the first two types occur in a 'sentence', so, I want to maintain another table which maps 'Sentences' to 'long_word' or 'short_word' using the 'ID' field. All i need is another table with 2 'Integer fields' referring to 'ID' as a foreign key. But, how do i do this in Elixir? Thanks a lot...

    Read the article

  • Does Java Spring 3.0 MVC support annotation/attribute based client side validation like Asp.net MVC

    - by Athens
    In Asp.Net MVC 2.0, at least in the beta, you could decoration your model classes with data annotation attributes and enable client side validation that leverages that criteria defined in your model data annotation attibutes. Is there anything similar for Java Spring MVC 3.0? Is it possible to inject a component into the response pipeline that can inspect the model's annotated properties and render client side validation logic to complement the server side validation logic that is invoked prior to the controller handling the request?

    Read the article

  • SQL Server - OPENXML how to get attribute value

    - by DotnetDude
    I have the following XML: <Field FieldRowId="1000"> <Items> <Item Name="CODE"/> <Item Name="DATE"/> </Items> </Field> I need to get the FieldRowId using OPENXML. The SQL i have so far: INSERT INTO @tmpField ([name], [fieldRowId]) SELECT [Name], --Need to get row id of the parent node FROM OPENXML (@idoc, '/Field/Items/Item', 1)

    Read the article

  • [PHP] missing keys in $_POST

    - by KPL
    Hello there, I am trying to get some form data from POST method. Here's the code of form - <form action="" method="post" name="form1" id="form1"> <input type="hidden" value="15" name="ad_id"> <table width="100%" cellspacing="0" cellpadding="0" border="0" class="block"> <tbody><tr> <td valign="top">&nbsp;</td> <td align="right">all fields are required</td> </tr> <tr> <td valign="top">&nbsp;</td> <td align="center"></td> </tr> <tr> <td valign="top" width="150"><label for="name">Advertisement Name</label> *</td> <td><input type="text" size="45" value="Banner" id="name" name="name"> e.g Home Banner</td> </tr> <tr> <td valign="top"><label for="placement">Advertisement Placement</label></td> <td><select id="placement" name="placement"> Wide Skyscrapper 160 x 600 </tr> <tr> <td valign="top"><label for="code">Advertisement Code</label></td> <td><textarea rows="5" cols="45" id="code" name="code"></textarea></td> </tr> <tr> <td>Status</td> <td><label> <input type="radio" checked="checked" value="1" name="status"> Active</label> <label> <input type="radio" value="0" name="status"> Inactive</label></td> </tr> <input type="hidden" value="1" name="banner_uploaded" id="banner_uploaded"> <tr> <td>For Country - </td> <td> <select id="country" name="country"> <option>Not posting all the names of country</option> </select> </td> </tr> <tr> <td><label for="Scheduling">Valid From </label></td> <td><input type="text" value="" id="date-from" name="date-from"> Format : dd/mm/yyyy:hh/mm</td> </tr> <tr> <td><label for="Scheduling">Valid Till </label></td> <td><input type="text" value="" id="date-to" name="date-to"> Format : dd/mm/yyyy:hh/mm</td> </tr> <tr> <td>&nbsp;</td> <td align="right"><input type="submit" onclick="return validate_ad_form(add_adv)" value="Update Advertisement" class="button" name="update"></td> </tr> </tbody></table> </form> But I am getting $_POST['code'] empty when I am passing HTML code through it. When I pass plain text, it works fine. When I printed $_POST [i.e. used - print_r($_POST) ], I got the following output - Array ( [ad_id] = 15 [name] = Banner [placement] = ad_468x60 [code] = [status] = 1 [banner_uploaded] = 1 [country] = IN [date-from] = [date-to] = [update] = Update Advertisement ) Please be known, I haven't entered the 'date-from','date-to' fields. I have entered on purpose as StackOverflow don't allow me to post images! People,any help will be highly appreciated.

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >