Search Results

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

Page 64/433 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • Django: Sum on an date attribute grouped by month/year

    - by Sébastien Piquemal
    Hello, I'd like to put this query from SQL to Django: "select date_format(date, '%Y-%m') as month, sum(quantity) as hours from hourentries group by date_format(date, '%Y-%m') order by date;" The part that causes problem is to group by month when aggregating. I tried this (which seemed logical), but it didn't work : HourEntries.objects.order_by("date").values("date__month").aggregate(Sum("quantity"))

    Read the article

  • Special chars in Amazon S3 keys?

    - by Martin
    Is it possible to have special characters like åäö in the key? If i urlencode the key before storing it works, but i cant really find a way to access the object. If i write åäö in the url i get access denied (like i get if the object is not found). If i urlencode the url i paste in the browser i get "InvalidURICouldn't parse the specified URI". Is there some way to do this?

    Read the article

  • MySQL Many to Many with Unique keys and Update/Select if Exists otherwise Insert

    - by Jayrox
    In my goal to have a Many-to-Many relationship in my MySQL database I have arrived at another bridge to build. Current Tables: Users (id, name) Tags (id, name) User_Tags (user_id, tag_id) Here is the goal: I would like to have the ability to take a tag i.e: #fb and insert it into my Tags database which has a unique constraint on name and if the tag exists I would like to return it's id I would like to insert the tag.id and the current user's user.id into User_Tags. I do not have any unique constraints on the User_Tags table because I would like to be able to track the user's most commonly used tags and present them in a list ordered by frequency of use. I am currently developing this project in PHP using prepared statements. Additionally, performance is not currently an issue as my user count is still fairly small, but it is steadily growing and may be an issue in the future.

    Read the article

  • jQuery multiple selectors into dynamic attribute

    - by Jason Fletcher
    I am trying to attach an event to a separate onhover trigger. But I am having problems using multiple selectors since its dynamic. Need help ::: Upon hovering on the yellow box named 'Rings', this should trigger the animated slide event for the green box above it. http://home.jasonfletcher.info/all/alliteration/index.html $('.boxgrid1').hover(function(){ $(".cover", this).stop().animate({top:'0px'},{queue:false,duration:300}); }, function() { $(".cover", this).stop().animate({top:'247px'},{queue:false,duration:300}); });

    Read the article

  • JSF SelectOneMenuItem onselect attribute

    - by William
    I have created selectOneMenuItem(JSF).I placed my events on valueChangeListener / onchange like that <h:selectOneMenu id="ddl" value="#{Foo.attr}" onchange="submit()" valueChangeListener="#{Foo.renderFoo}"> When I select one vlaue from selectOneMenuItem then event fires.Now when I reselect that value ,then event doesn't fire (because this is the valueChangeListener event) so it doesn't fire.I want that event should fire on every selection even on again the same selection.I found onselect but unable to find that is it right and how can i use this onselect.Anyu help would be greatly appreciable

    Read the article

  • android service exported attribute??

    - by doloop
    Hi, I am quite new about android platform. I want to export my service to be public used. I find something on developer doc android:exported Whether or not components of other applications can invoke the service or interact with it — "true" if they can, and "false" if not. When the value is "false", only components of the same application or applications with the same user ID can start the service or bind to it. but i dont understand it Can anyone show me a brief example of how to use it? many thx

    Read the article

  • C++ find multiple keys from a std::multimap

    - by sch0ck9
    I have a STL::multimap and I search to populate a std::list with value which key is duplicated. Can I find/insert to a std::list the value of elements for all key where count 1 without counting them one by one? std::multimap<int, std::string> mm ; mm[0] = "a" ; mm[1] = "b" ; mm[0] = "c" ; mm[2] = "j" ; mm[2] = "k" ; std::list<std::string> lst ; lst might contains "a" ,"c","j","k" ; I try this template <class K, class V> class extract_value { private: K last_key_ ; std::list<V> m_list_value ; std::pair<K, V> first_elem ; public: extract_value(const K& k_): last_key_(k_) { } void operator() (std::pair<const K, V> elem) { if (last_key_ == elem.first) { m_list_value.push_back(elem.second) ; } else { // First entry last_key_ = elem.first; first_elem= elem ; } } std::list<V> get_value() { return m_list_value ; } }; ex_ = for_each(mm.begin(),mm.end(), extract_value<int, std::string>(0)) ; std::list<std::string> lst = ex_.get_value() ; I'm not sure that this code compile.

    Read the article

  • XSLT: insert parameter value inside of an html attribute

    - by usr
    How to make the following code insert the youtubeId parameter: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:YouTube="urn:YouTube" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml umbraco.library YouTube"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="videoId"/> <xsl:template match="/"> <a href="{$videoId}">{$videoId}</a> <object width="425" height="355"> <param name="movie" value="http://www.youtube.com/v/{$videoId}&amp;hl=en"></param> <param name="wmode" value="transparent"></param> <embed src="http://www.youtube.com/v/{$videoId}&amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed> </object>$videoId {$videoId} {$videoId} <xsl:value-of select="/macro/videoId" /> </xsl:template> </xsl:stylesheet> As you can see I have experimented quite a bit. <xsl:value-of select="/macro/videoId" /> actually outputs the videoId but all other occurences do not. This must be an easy question to answer but I just cannot get it to work.

    Read the article

  • Xquery get value from attribute

    - by Steven
    Hi, I have some xml and need to extract values using sql <?xml version="1.0" ?> <fields> <field name="fld_AccomAttic"> <value>0</value> </field> <field name="fld_AccomBathroom"> <value>1</value> </field> </fields> </xml> I need to get column name fld_AccomAttic Value 1 The xml is held in a sql server 2005 db I have used xquery before and it has worked. Can any one show me how to extract these values Im baffeled as to why i am unable to do this Thanks Sp

    Read the article

  • How do I restrict foreign keys choices to related objects only in django

    - by Jeff Mc
    I have a two way foreign relation similar to the following class Parent(models.Model): name = models.CharField(max_length=255) favoritechild = models.ForeignKey("Child", blank=True, null=True) class Child(models.Model): name = models.CharField(max_length=255) myparent = models.ForeignKey(Parent) How do I restrict the choices for Parent.favoritechild to only children whose parent is itself? I tried class Parent(models.Model): name = models.CharField(max_length=255) favoritechild = models.ForeignKey("Child", blank=True, null=True, limit_choices_to = {"myparent": "self"}) but that causes the admin interface to not list any children.

    Read the article

  • Indexes and multi column primary keys

    - by David Jenings
    Went searching and didn't find the answer to this specific noob question. My apologies if I missed it. In a MySQL database I have a table with the following primary key PRIMARY KEY id (invoice, item) In my application I will also frequently be selecting on "item" by itself and less frequently on only "invoice". I'm assuming I would benefit from indexes on these columns. MySQL does not complain when I define the following: INDEX (invoice), INDEX (item), PRIMARY KEY id (invoice, item) But I don't see any evidence (using DESCRIBE -- the only way I know how to look) that separate indexes have been established for these two columns. So the question is, are the columns that make up a primary key automatically indexed individually? Also, is there a better way than DESCRIBE to explore the structure of my table?

    Read the article

  • Drupal : how to emulate the public/private attribute available in WordPress

    - by Parneix
    Hi, Basically, I'm looking for an easy way (module) to add a private/public option to any kind of content I may published in Drupal (blog entry, image, etc.). So that when I'm logged in, I can see everything. But when an anonymous user visit the site, he will only see the public stuff. It's way to manage a kind of front window/back-store architecture. I can use the same Drupal installation to all my needs and choose to filter the stuff I may want to make publicly available. * Important : 1) Private items must not be accessible even if anonymous users guess its URL; 2) Private item must not show up if anonymous user perform a search; 3) Private content must not be indexed by search engines; 4) Private items should show up if I perform a search while being logged in. Any idea? Thanks a lot, P.

    Read the article

  • Weird behavior of matching array keys after json_decode()

    - by arnorhs
    I've got some very weird behavior in my PHP code. I don't know if this is actually a good SO question, since it almost looks like a bug in PHP. I had this problem in a project of mine and isolated the problem: // json object that will be converted into an array $json = '{"5":"88"}'; $jsonvar = (array) json_decode($json); // notice: Casting to an array // Displaying the array: var_dump($jsonvar); // Testing if the key is there var_dump(isset($jsonvar["5"])); var_dump(isset($jsonvar[5])); That code outputs the following: array(1) { ["5"]=> string(2) "88" } bool(false) bool(false) The big problem: Both of those tests should produce bool(true) - if you create the same array using regular php arrays, this is what you'll see: // Let's create a similar PHP array in a regular manner: $phparr = array("5" => "88"); // Displaying the array: var_dump($phparr); // Testing if the key is there var_dump(isset($phparr["5"])); var_dump(isset($phparr[5])); The output of that: array(1) { [5]=> string(2) "88" } bool(true) bool(true) So this doesn't really make sense. I've tested this on two different installations of PHP/apache. You can copy-paste the code to a php file yourself to test it. It must have something to do with the casting from an object to an array.

    Read the article

  • assign keys for combo box in java

    - by adesh kumar
    I want to add a JComboBox in Swing that is simple but I want to assign the values for each items in combo. I have the following code JComboBox jc1= new JComboBox(); jc1.addItem("a"); jc1.addItem("b"); jc1.addItem("c"); Now what I want is that when click on combo box it should return 1, 2 and 3 correspondingly instead of a ,b, c. Is there any way to assign the key values for each items in combo box?

    Read the article

  • Identifying all types with some attribute

    - by Tom W
    Hello SO; I have an issue with .Net reflection. The concept is fairly new to me and I'm exploring it with some test cases to see what works and what doesn't. I'm constructing an example wherein I populate a set of menus dynamically by scanning through my Types' attributes. Basically, I want to find every type in my main namespace that declares 'SomeAttribute' (doesn't matter what it is, it doesn't have any members at present). What I've done is: For Each itemtype As Type In Reflection.Assembly.GetExecutingAssembly().GetTypes If itemtype.IsDefined(Type.GetType("SomeAttribute"), False) Then 'do something with the type End If Next This crashes the application on startup - the first type it identifies is MyApplication which is fairly obviously not what I want. Is there a right and proper way to look for all the 'real' 'sensible' types - i.e. classes that I've defined - within the current assembly?

    Read the article

  • Adding a variable href attribute to a hyperlink using XSLT

    - by Pete
    I need to create links using dynamic values for both the URL and the anchor text. I have column called URL, which contains URL's, i.e., http://stackoverflow.com, and I have a column called Title, which contains the text for the anchor, i.e., This Great Site. I figure maybe all I need to do is nest this tags, along with a little HTML to get my desired result: <a href="> <xsl:value-of select="@URL">"> <xsl:value-of select="@Title"/> </xsl:value-of> </a> In my head, this would render: <a href=" http://stackoverflow.com"> This Great Site </a> I know there's more to it, but I haven't been able to clearly understand what more I need. I think this issue has been addressed before, but not in a way I could understand it. I'd be more than happy to improve the question's title to help noobs like myself find this item, and hopefully an answer. Any help is greatly appreciated.

    Read the article

  • Counting distinct and duplicate attribute values in an array

    - by keruilin
    I have an array of users that's sorted in descending order based on total_points. I need to find the rank of each user in that array. The issue is that more than one user can have the same total points and, thus, the same rank. For example, three users could be in 3rd place with 200 Points. Here's my current code: class Leader < ActiveRecord::Base def self.points_leaders all_leaders = all_points_leaders # returns array of users sorted by total_points in desc order all_leaders_with_rank = [] all_leaders.each do |user| rank = all_leaders.index(user)+1 all_leaders_with_rank << Ldr.new(rank, user) # Ldr is a Struct end return all_leaders_with_rank end end How must I modify the code so that the correct rank is returned, and not just the value of the index position?

    Read the article

  • How i change the Enabled= attribute via a preloaded field

    - by user1904656
    I want to modify the PXUIField Enabled=false/true using an existing boolean field #region LastBatNbr public abstract class lastBatNbr : PX.Data.IBqlField { } protected String _LastBatNbr; [PXDBString(10, IsFixed = true)] [PXUIField(DisplayName = "Last Batch Nbr")] public virtual String LastBatNbr { get { return this._LastBatNbr; } set { this._LastBatNbr = value; } } #endregion

    Read the article

  • What will we use Theory Attribute for ?

    - by Sandbox
    I discovered [Theory] and [Datapoint] attributes in NUnit. I am not very sure about how should I use these. I think they can be used for data-driven testing and this has got me interested. There aren't many resources available on the same. Can someone explain to me how to use them or point me to resources? Thanks.

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >