Search Results

Search found 13969 results on 559 pages for 'word count'.

Page 18/559 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Displaying count for current_user 'likes' on a 'question' in questions/show.html.erb view

    - by bgadoci
    I have an application that allows for users to create questions, create answers to questions, and 'like' answers of others. When a current_user lands on the /views/questions/show.html.erb page I am trying to display the total 'likes' for all answers on that question, for the current_user. In my Likes table I am collecting the question_id, site_id and the user_id and I have the appropriate associations set up between user, question, answers and likes. I think I just need to call this information the right way, which I can't seem to figure out. All of the below is taking place in the /views/questions/show.html.erb page. I have tried the following: <% div_for current_user do %> You have liked this question <%= @question.likes.count %> times <% end %> Which returns all the 'likes' for the question but not filtered by current_user You have liked this question <%= current_user.question.likes.count %> times Which gives an error of 'undefined method `question' You have liked this question <%= @question.current_user.likes.count %> times Which gives an error of 'undefined method `current_user' I have tried a couple of other things but they don't make as much sense as the above to me. What am I missing?

    Read the article

  • reverse many to many fields in Django + count them

    - by cleliodpaula
    I'm trying to figure out how to solve this class Item(models.Model): type = models.ForeignKey(Type) name = models.CharField(max_lenght = 10) ... class List(models.Model): items = models.ManyToManyField(Item) ... I want to count how many an Item appears in another Lists, and show on template. view def items_by_list(request, id_): list = List.objects.get(id = id_) qr = list.items.all() #NOT TESTED num = [] i = 0 for item in qr: num[i] = List.objects.filter(items__id = item__id ).count() #FINISH NOT TESTED c = {} c.update(csrf(request)) c = {'request':request, 'list' : qr, 'num' : num} return render_to_response('items_by_list.html', c, context_instance=RequestContext(request)) template {% for dia in list %} <div class="span4" > <div> <h6 style="color: #9937d8">{{item.type.description}}</h6> <small style="color: #b2e300">{{ item.name }}</small> <small style="color: #b2e300">{{COUNT HOW MANY TIMES THE ITEM APPEAR ON OTHER LISTS}}</small> </div> {% endfor %} This seems to be easy, but I could not implement yet. If anyone has some glue to me, please help me. Thanks in advance.

    Read the article

  • How to compress .pdfs in word 2007?

    - by chobo2
    Hi I am trying to send my cover letter and resume away but apparently it is too big to send through craigs list(my computer says the total size is 500kb) as it has a 600kb limit(so small should be at least a meg). Hi there. You recently tried to email Some job Email, an anonymous craigslist address. However, your message was too big to be sent through our system. Craigslist has a 600KB limit on the messages we'll send. Please reduce the size of your mail and try again. Thanks for using craigslist. So when I convert my word 2007(.docx) files to pdf they become huge. Like they got from 32kb to 320kb. So is there a way I can either get around craigslist limits or compress my pdfs a bit to make it happy. I don't want to send zips and stuff since the person who gets it might not even know what to do. I rather not send .docx since not sure if will have office 2007 or the compatibility view installed and I rather just send it as pdf(as some place require it anyways to be in pdfs). Thanks

    Read the article

  • Word 2010, Multiple Columns, Vertical center one column only

    - by Nancy N Jones
    I am creating a document with two columns in Microsoft Word 2010. I want the first column to be centered vertically. I want the second column to be on the same page and the vertical placement to be from the top. I highlight my text in the first column that I want centered vertically, then go to Page Layout Margins Custom Margins Layout, you can choose to center the vertical alignment. I have choosen the "Section Start" to be "Column" and also tried "Continuous." In all cases it always shifts all of my second column information to a new page. I don't want my second column text to be on a new page, I want it to be on the same page and vertically aligned from the top--not the center. Am I understanding the functionality of the Section Start on the Layout tab correctly? Maybe the page layout isn't the correct formatting to use. What I am really doing is formatting columns. I haven't found anywhere to format the columns for this. Am I missing some important column formatting features? I know that I can use the paragraph formatting and add space above the first line of text to make it look like it is centered vertically. However, this is a template for a master document and will be changed frequently. I really would like the first column text to be automatically formatted to be centered vertically without having to go in and manually change the space above the paragraph every time. Your assistance would be greatly appreciated.

    Read the article

  • Numbered paragraphs in Word 2007

    - by Kit
    I have the following styles defined in Word 2007. They all have outline levels 1-6. They also correctly show up in the Table of Contents (not all, I only set the TOC up to Level 3). 1 Heading 1 1.1 Heading 2 1.1.1 Heading 3 1.1.1.1 Heading 4 1.1.1.1.1 Heading 5 1.1.1.1.1.1 Heading 6 This is what I want 1 Heading 1 1.1 Body text under Heading Level 1 1.2 Body text under Heading Level 1 2 Heading 1 2.1 Heading 2 2.1.1 Body text under Heading Level 2 2.1.2 Body text under Heading Level 2 2.1.3 Body text under Heading Level 2 2.2 Heading 2 2.2.1 Body text under Heading Level 2 2.2.2 Body text under Heading Level 2 How do I make two list sequences link to each other? Here's a {fill in the blanks} illustration: {section number} Heading 1 {section number}.{clause number} Body text under Heading Level 1 {section number}.{clause number} Body text under Heading Level 1 The example above should expand to: 1 Heading 1 1.1 Body text under Heading Level 1 1.2 Body text under Heading Level 1 Another example: {section number} Heading 1 {section number}.{subsection number} Heading 2 {section number}.{subsection number}.{clause number} Body text under Heading Level 2 {section number}.{subsection number}.{clause number} Body text under Heading Level 2 should expand to: 2 Heading 1 2.1 Heading 2 2.1.1 Body text under Heading Level 2 2.1.2 Body text under Heading Level 2 2.1.3 Body text under Heading Level 2 The numbered body text paragraphs shouldn't show up the Table of Contents. I couldn't find the right way to do that, whether in multilevel lists, fields, styles, etc. How do I do it right?

    Read the article

  • Adding a prefix or postfix to a Word 2013 quotation source

    - by user2690527
    I am using the German version of Word 2013, so I am not absolutely sure, if "quotation source" is the term being used in the English version. I am talking about the automatic text field, one can get via "References" (German: "Verweise"), "Insert quotation" (German: "Zitat einfügen"). Then one gets a drop down menu with all the entries from the biobliography, one can pick one and then an automatic text field is inserted into the text. After it is hopefully clear what I am talking about, here is the question: I choosed the citation style "ISO 690" that generates labels of the pattern "(author+year)" in round parentheses. Sometimes I have to append a prefix or postfix to the label, but this prefix/postfix must go into the parantheses. Is there any way how I can do this? For example, I can add page numbers to the end of a quotation label via a special dialog box that appears after a right click onto the text field and choosing "Edit quote" (German: "Zitat bearbeiten"). But there are a lot more cases of optional pre-/postfixes than page numbers. I am looking for a way to add general pre-/postfixes.

    Read the article

  • Creating MS Word 2010 Relative Links?

    - by leeand00
    Okay here is what I've tried so far for creating relative links in my MS Word Documents. In my document from the ribbon I select the File tab. I then select Info from the side bar. Click the properties drop down from the right hand column. (a bit difficult to find initially, since it looks like text not a drop down, but it's there). Click Advanced Properties The <document-name>.docx Properties Dialog Appears I enter .\ to specify that I want a relative path for the links in my document. I click OK. I go back into my document select some text and attempt to make a link out of it clicking the Insert tab of the ribbon, and then clicking Hyperlink. I then select a document from the current folder, and strip the full path from it, leaving just the name of the .docx file to which I wish to link. Then I click OK. The link appears, I try to click it using Ctrl+Click. I am informed that the address of the site is not valid. Check the address and try again. What could I possibly be doing wrong here? I just want a relative link. It's so easy in to do this in HTML.

    Read the article

  • Django queries: Count number of objects with FK to model instance

    - by Chris Lawlor
    This should be easy but for some reason I'm having trouble finding it. I have the following: App(models.Model): ... Release(models.Model): date = models.DateTimeField() App = models.ForeignKey(App) ... How can I query for all App objects that have at least one Release? I started typing: App.objects.all().annotate(release_count=Count('??????')).filter(release_count__gt=0) Which won't work because Count doesn't span relationships, at least as far as I can tell. BONUS: Ultimately, I'd also like to be able to sort Apps by latest release date. I'm thinking of caching the latest release date in the app to make this a little easier (and cheaper), and updating it in the Release model's save method, unless of course there is a better way. Edit: I'm using Django 1.1 - not averse to migrating to dev in anticipation of 1.2 if there is a compelling reason though.

    Read the article

  • Beginner SQL question: arithmetic with multiple COUNT(*) results

    - by polygenelubricants
    Continuing with the spirit of using the Stack Exchange Data Explorer to learn SQL, (see: Can we become our own “Northwind” for teaching SQL / databases?), I've decided to try to write a query to answer a simple question (on meta): What % of stackoverflow users have over 10,000 rep?. Here's what I've done: Query#1 SELECT COUNT(*) FROM Users WHERE Users.Reputation >= 10000 Result: 556 Query#2 SELECT COUNT(*) FROM USERS Result: 227691 Now, how do I put them together into one query? What is this query idiom called? What do I need to write so I can get, say, a one-row three-column result like this: 556 227691 0,00244190592

    Read the article

  • Core Data table record count

    - by user339633
    I have an entity called Person and it has a relationship called participatingGames, to another entity called GameParticipant. I (apparently) can retrieve the number of matches in the GameParticipant entity using this simple code in the Person object I created from the entity in the model: [self.participatingGames count]; However, I'd just like to retrieve the number of Person records and one might guess the syntax for this is just as simple. I have lots of books including those by Jeff LaMarche, but those sources and what I find around here make me wonder if I need to set up a fetchedResultsController just to know the count of some entity. My background is in SQL, so of course it seems odd that what would take 15 seconds to code in any other environment seems like such a well-guarded secret in Core Data. I'm using iPhone SDK 3.1.4 under OSX 10.5.8 Suggestions?

    Read the article

  • Check for a unique value within a count, but get all results

    - by pedalpete
    I'm trying to create a single query which, similar to stack overflow, will give me the number of votes, but also make sure that the currently viewing user can't upvote again if they've already upvoted. my query currently looks like SELECT cid, text, COUNT(votes.parentid) FROM comments LEFT JOIN votes ON comments.cid=votes.parentid AND votes.type=3 WHERE comments.type=0 AND comments.parentid='$commentParentid' GROUP BY comments.cid But I'm completely stumpted on how to add the check to see if the userid is in the votes table. The other option is to add a seperate query where SELECT COUNT(*) FROM votes WHERE userid='$userid' AND parentid='$commentParentid' AND type=3 I'm just realizing I'm so lost with this that I don't even really know what tags to provide.

    Read the article

  • Facebook Graph API - Get like count on page/group photos

    - by JackLeo
    I've been testing graph API and ran into a problem. How can I get like count from photos of a page/group? I'm administrator/creator of a group. When entering in https://developers.facebook.com/tools/explorer/ certain photo ID from that group it brings almost all data, even comments, but not the like count. For like part it needs (according to docs) access token despite the fact that anyone can access that info. How to get access token of my page/group with required permissions and how to use it to get info I need? If possible I would like to get JSON from a single address if it is possible.

    Read the article

  • Write/read count to txt file

    - by Brian
    Hi, I need a batch file that writes the count number to a txt file. Next time the batch file is run, it should read the current count number from the txt file and add 1 to count and save this new value in the txt file. (nothing else is in the txt file) When count is 5 it should start from 1 again Example: Count.bat runs 1 time: count.txt has no count so Count.bat saves the value 1 in count.txt Count.bat is run 2 time: Count.bat reads 1 from count.txt and saves the new value 2 to count.txt When count.bat is run for the 6 time it should start over by saving the value 1 in count.txt I think this just be easy to do, but I'am not use to batch commands So hopefully someone here could help me.

    Read the article

  • Broken count(*) after adding LEFT JOIN

    - by Iain Urquhart
    Since adding the LEFT JOIN to the query below, the count(*) has been returning some strange values, it seems to have added the total rows returned in the query to the 'level': SELECT `n`.*, exp_channel_titles.*, round((`n`.`rgt` - `n`.`lft` - 1) / 2, 0) AS childs, count(*) - 1 + (`n`.`lft` > 1) + 1 AS level, ((min(`p`.`rgt`) - `n`.`rgt` - (`n`.`lft` > 1)) / 2) > 0 AS lower, (((`n`.`lft` - max(`p`.`lft`) > 1))) AS upper FROM `exp_node_tree_6` `n` LEFT JOIN `exp_channel_titles` ON (`n`.`entry_id`=`exp_channel_titles`.`entry_id`), `exp_node_tree_6` `p`, `exp_node_tree_6` WHERE `n`.`lft` BETWEEN `p`.`lft` AND `p`.`rgt` AND ( `p`.`node_id` != `n`.`node_id` OR `n`.`lft` = 1 ) GROUP BY `n`.`node_id` ORDER BY `n`.`lft` I'm totally stumped... Thank you!

    Read the article

  • sqlite COUNT in flex returning [object Object]

    - by Adam
    I'm sure this is an easy questions and I'm just doing something stupid but I'm really new to all this code. I'm trying to run a sqlite query in flex to count the total number of records I believe its working fine but I just can't figure out how to display the results - all I get back is [object Object]. private function overviewOne():void{ var stmt:SQLStatement = new SQLStatement(); stmt.sqlConnection = sqlConn; stmt.text = "SELECT COUNT(user_id) FROM tbl_user WHERE status_status ='Away'"; stmt.execute(); var result:SQLResult = stmt.getResult(); acoverviewOne = new Array(result.data); trace (result.data[0]); }

    Read the article

  • Count Records in Listing View

    - by 47
    I have these two models: class CommonVehicle(models.Model): year = models.ForeignKey(Year) series = models.ForeignKey(Series) engine = models.ForeignKey(Engine) body_style = models.ForeignKey(BodyStyle) ... class Vehicle(models.Model): objects = VehicleManager() stock_number = models.CharField(max_length=6, blank=False) vin = models.CharField(max_length=17, blank=False) common_vehicle = models.ForeignKey(CommonVehicle) .... What I want to do is to have a count of how many times a given CommonVehicle object is used in the Vehicle class. So far my attempts are giving me one number, which is a total of all the records. How can I have the count being the total appearances for each CommonVehicle

    Read the article

  • Count, inner join

    - by Urosh
    I have two tables: DRIVER (Driver_Id,First name,Last name,...) PARTICIPANT IN CAR ACCIDENT (Participant_Id,Driver_Id-foreign key,responsibility-yes or no,...) Now, I need to find out which driver participated in accident where responsibility is 'YES', and how many times. I did this: Select Driver_ID, COUNT (Participant.Driver_ID)as 'Number of accidents' from Participant in car accident where responsibility='YES' group by Driver_ID order by COUNT (Participant.Driver_ID) desc But, I need to add drivers first and last name from the first table(using inner join, I suppose). I don't know how, because it is not contained in either an aggregate function or the GROUP BY clause. Please help :)

    Read the article

  • Footnote continuation notice

    - by Patti Miller
    I have a document with multiple footnotes, some of which continue from page to page. The footnote separator has been customized for both 'continues on next page' and continues from previous page. However, on 1 particular page, the separator shows saying the footnote continues from previous page, but a brand new footnote follows. Is there a way to edit/delete the separator on 1 particular page only? (Word 2007)

    Read the article

  • Is there a way to convert MS 2010 Equation to Object in MS Equation 3.0?

    - by Teodorescu
    I have a lot of equations (for faculty) written in MS Equation (button from right side) and saved it in .docx format. All good and the best until my professor told me that he has MS 2003 and I have to convert from docx to doc format and the equations must be editable. I don't have enough time to rewrite all the equations in MS Equation 3.0. Is there a way to convert from MS Equation to MS Equation 3.0 Object to be recognized and editable in Word 2003?

    Read the article

  • Multiline Equation won't center and align on equals sign

    - by cubicleWar
    I have a multiline equation which I wish to align on the '=' and center the equation block on the page. I have selected align on '=' and center as a group, however the equation group becomes left justified on the page (and aligned on the =). No matter what I do I cannot get it to concurrently center the group on the page and also align on the '='. Does anyone know what setting at what level would cause this type of behavior? (I'm using MS Word 2011 on OS X 10.8)

    Read the article

  • Pasted image hides behind text even when set to be inline

    - by John
    I copied an image from MSPaint and pasted it into a Word document I'm working on. For some reason the image hides behind the text even with the default "in line with text" setting. Trying other settings don't work as expected either. It does the same when I insert a picture from a file. Can anyone shed any light what would be causing this and how to fix it - I am guessing some formatting issue in the existing document?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >