Search Results

Search found 972 results on 39 pages for 'highest'.

Page 2/39 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • [WORDPRESS] Return highest term_taxonomy_id

    - by antosha
    Hi guys, I am trying to return the highest term taxonomy id of a post page or a taxonomy page. I was sucessful at listing all taxonomy id's like this: <?php $terms = get_the_terms( $post->ID , 'mytaxonomy' ); if($terms) { foreach( $terms as $term ) { echo $term->term_taxonomy_id; } } ?> This is what I am trying to do (return only the highest ID) (doesn't work): <?php $terms = get_the_terms( $post->ID , 'mytaxonomy' ); if($terms) { foreach( $terms as $term ) { echo max( '$term->term_taxonomy_id'); } } ?> Please help :)

    Read the article

  • Return highest number found in an array of strings

    - by Mdd
    I have an array of objects. The objects have a property called level that is a string which contains a number and is in consistent format. I am trying to find the highest number and return just that one but I seem to be blocked as far as how to proceed from my current code. Here is a fiddle to my current code: http://jsfiddle.net/6sXYR/ Here is my JavaScript: var myArray = [ { color: 'blue', level: 'L1' }, { color: 'red', level: 'L1' }, { color: 'green', level: 'L2' }, { color: 'yellow', level: 'L2' }, { color: 'purple', level: 'L3' } ]; for (var i = 0; i < myArray.length; i++) { console.log( myArray[i].level.substring(1,2) ); }; The result I am trying to get is to return just the number '3' from the example above. The highest number may not always be in the last object in the array, but it will always be in the format of L#.

    Read the article

  • Get the highest odds from the last update

    - by Frankie Yale
    I have these tables in a PostgreSQL database: bookmakers ----------------------- | id | name | ----------------------- | 1 | Unibet | ----------------------- | 2 | 888 | ----------------------- odds --------------------------------------------------------------------- | id | odds_type | odds_index | bookmaker_id | created_at | --------------------------------------------------------------------- | 1 | 1 | 1.55 | 1 | 2012-06-02 10:30 | --------------------------------------------------------------------- | 2 | 2 | 3.22 | 2 | 2012-06-02 10:30 | --------------------------------------------------------------------- | 3 | X | 3.00 | 1 | 2012-06-02 10:30 | --------------------------------------------------------------------- | 4 | 2 | 1.25 | 1 | 2012-05-27 09:30 | --------------------------------------------------------------------- | 5 | 1 | 2.30 | 2 | 2012-05-27 09:30 | --------------------------------------------------------------------- | 6 | X | 2.00 | 2 | 2012-05-27 09:30 | --------------------------------------------------------------------- What I am trying to query is the following: Give me the 1/X/2 odds from the latest update (created_at) from ALL bookmakers and from that last update, give me the highest odds for each odds_type ('1', '2', 'X'). On my website I display them as: Best odds right now: 1 | X | 2 -------------------- 2.30 | 3.00 | 3.22 I have to first get the latest, because the odds from the update from yesterday are no longer valid. Then from that last update, I have - in this case - 2 odds from 2 different bookmakers, so I need to get the best one for type '1','2','X'. Pseudo SQL would be something like: SELECT MAX(odds_index) WHERE odds_type = '1' ORDER BY created_at DESC, odds_index DESC But that doesn't work, because I would always get the latest odds (and not the highest/best from those latest) I hope I'm making sense.

    Read the article

  • Getting highest results in a JOIN

    - by Keithamus
    I've got three tables; Auctions, Auction Bids and Users. The table structure looks something like this: Auctions: id title -- ----- 1 Auction 1 2 Auction 2 Auction Bids: id user_id auction_id bid_amt -- ------- ---------- ------- 1 1 1 200.00 2 2 1 202.00 3 1 2 100.00 Users is just a standard table, with id and user name. My aim is to join these tables so I can get the highest values of these bids, as well as get the usernames related to those bids; so I have a result set like so: auction_id auction_title auctionbid_amt user_username ---------- ------------- -------------- ------------- 1 Auction 1 202.00 Bidder2 2 Auction 2 100.00 Bidder1 So far my query is as follows: SELECT a.id, a.title, ab.bid_points, u.display_name FROM auction a LEFT JOIN auctionbid ab ON a.id = ab.auction_id LEFT JOIN users u ON u.id = ab.user_id GROUP BY a.id This gets the single rows I am after, but it seems to display the lowest bid_amt, not the highest.

    Read the article

  • Converting AVI to FLV in highest quality

    - by Josh
    I want to convert some of the AVI files I recorded (presentations) to FLV so I can host them on a website and offer them to my visitors. I have done this sort of thing before but the quality they came out as would not be good enough for what I plan on doing here. So does anyone have a link to a guide or any experience they can offer in converting AVI to FLV with minimal quality loss? A lot of my presentations are 720p aswell, so I'd want to keep the aspect ratio the same as the source video. Thanks in advance.

    Read the article

  • Highest compression for files(for web transfer)?

    - by Rogue
    Have seen some highly compressed files around.(for eg: i have seen 700mb of data compressed to around 30-50mb) But how do you get such compressed files, I have tried using softwares like Winrar and 7Zip but have never achieved such high compression. What are the techniques/software that allow you to compress files so well? (P.S. I'm using Windows Xp)

    Read the article

  • Ordering view by highest group count question - Ruby on Rails

    - by bgadoci
    I've read the couple of questions about this on stack overflow but can't seem to find the answer. I am trying to display the tags in my blog by the ones with the highest count in the tags table. Thanks to KandadaBoggu for helping me get the tags feature of the blog I am designing working. Here is the basics and my question. Tag belongs_to :post and Post has_many :tags. The tags table is simple really, consisting of the normal scaffolded fields plus post_id and tag_name (I actually called the column 'tag_name' instead of just 'name'). in my /views/posts/index.html/erb file I correctly am displaying the tags by group and the amount of times they are being used (appearing in the tags table). I just want to know how to order them by the highest count. Here is the code, and I currently have it set to updated_at: PostsController def index @tag_counts = Tag.count(:group => :tag_name, :order => 'updated_at DESC', :limit => 10) conditions, joins = {}, nil unless(params[:tag_name] || "").empty? conditions = ["tags.tag_name = ? ", params[:tag_name]] joins = :tags end @posts=Post.all(:joins => joins, :conditions=> conditions, :order => 'created_at DESC').paginate :page => params[:page], :per_page => 5 respond_to do |format| format.html # index.html.erb format.xml { render :xml => @posts } format.json { render :json => @posts } format.atom end end

    Read the article

  • MySQL: SELECT highest column value when WHERE finds similar entries

    - by Ike
    My question is comparable to this one, but not quite the same. I have a database with a huge amount of books, with different editions of some of the same book titles. I'm looking for an SQL statement giving me the highest edition number of each of the titles I'm selecting with a WHERE clause (to find specific book series). Here's what the table looks like: |id|title |edition|year| |--|-------------------------|-------|----| |01|Serie One Title One |1 |2007| |02|Serie One Title One |2 |2008| |03|Serie One Title One |3 |2009| |04|Serie One Title Two |1 |2001| |05|Serie One Title Three |1 |2008| |06|Serie One Title Three |2 |2009| |07|Serie One Title Three |3 |2010| |08|Serie One Title Three |4 |2011| |--|-------------------------|-------|----| The result I'm looking for is this: |id|title |edition|year| |--|-------------------------|-------|----| |03|Serie One Title One |3 |2009| |04|Serie One Title Two |1 |2001| |08|Serie One Title Three |4 |2011| |--|-------------------------|-------|----| The closest I got was using this statement: select id, title, max(edition), max(year) from books where title like "serie one%" group by name; but it returns the highest edition and year and includes the first id it finds: |--|-----------------------|-------|----| |01|Serie One Title One |3 |2009| |04|Serie One Title Two |1 |2001| |05|Serie One Title Three |4 |2011| |--|-----------------------|-------|----| This fancy join also comes close, but doesn't give the right result: select b.id, b.title, b.edition, b.year from books b inner join (select name, max(edition) as maxedition from books group by title) g on b.edition = g.maxedition where b.title like "serie one%" group by title; Using this I'm getting unique titles, but mostly old editions.

    Read the article

  • Search row with highest number of cells in a row with colspan

    - by user593029
    What is the efficient way to search highest number of cells in big table with numerous colspan (merge cells ** colspan should be ignored so in below example highest number of cells is 4 in first row). Is it js/jquery with reg expression or just the loop with bubble sorting. I got one link as below explainig use of regex is it ideal way ... can someone suggest pseudo code for this. High cpu consumption due to a jquery regex patch <table width="156" height="84" border="0" > <tbody> <tr style="height:10px"> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> </tr> <tr style="height:10px"> <td width="10" style="width:10px; height:10px" colspan="2"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> </tr> <tr style="height:10px"> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px" colspan="2"/> </tr> <tr style="height:10px"> <td width="10" style="width:10px; height:10px" colspan="2"/> <td width="10" style="width:10px; height:10px"/> <td width="10" style="width:10px; height:10px"/> </tr> </tbody> </table>

    Read the article

  • Which language coders are paid highest.?

    - by user338322
    I am an iPhone/iPad developer. Can I know which language coders are paid highest wages. ? I am thinking to switch to C++. Any suggestions if I should move to another language. If Yes please let me know which one.? or should I continue with iPhone/iPad development.

    Read the article

  • Select a record with highest amount by joining two tables

    - by user2516394
    I've 2 tables Sales & Purchase, Sales table with fields SaleId, Rate, Quantity, Date, CompanyId, UserID. Purchase table with fields PurchaseId, Rate, Quantity, Date, CompanyId, UserID. I want to select a record from either table that have highest Rate*Quantity. SELECT SalesId Or PurchaseId FROM Sales,Purchase where Sales.UserId=Purchase.UserId and Sales.CompanyId=Purchase.CompanyId AND Sales.Date=Current date AND Purchase.Date=Current date AND Sales.UserId=1 AND Purchase.UserId=1 AND Sales.CompanyId=1 AND Purchase.ComoanyId=1

    Read the article

  • Get the ranking of highest score with earliest timestamp

    - by Billy
    I have the following records: name score Date Billy 32470 12/18/2010 7:26:35 PM Sally 1100 12/19/2010 12:00:00 AM Kitty 1111 12/21/2010 12:00:00 AM Sally 330 12/21/2010 8:23:34 PM Daisy 32460 12/22/2010 3:10:09 PM Sally 32460 12/23/2010 4:51:11 PM Kitty 32440 12/24/2010 12:00:27 PM Billy 32460 12/24/2010 12:11:36 PM I want to get the leaderboard of the highest score with earliest time stamp using LINQ. In this case, the correct one is rank name 1 Billy 2 Daisy 3 Sally I use the following query: var result = (from s in Submissions group s by s.name into g orderby g.Max(q => q.Score) descending,g.Min(q => q.Date) ascending select new ScoreRecord { name = g.Key Score = g.Max(q => q.Score) }).Take(3).ToList(); I get the following wrong result: rank name 1 Billy 2 Sally 3 Daisy What's the correct linq query in this case?

    Read the article

  • Get highest frequency terms from Lucene index

    - by Julia
    Hello! i need to extract terms with highest frequencies from several lucene indexes, to use them for some semantic analysis. So, I want to get maybe top 30 most occuring terms(still did not decide on threshold, i will analyze results) and their per-index counts. I am aware that I might lose some precision because of potentionally dropped duplicates, but for now, lets say i am ok with that. So for the proposed solutions, (needless to say maybe) speed is not important, since I would do static analysis, I would put accent on simplicity of implementation because im not so skilled with Lucene (not the programming guru too :/ ) and cant wrap my mind around many concepts of it.. I can not find any code samples from something similar, so all concrete advices (code, pseudocode, links to code samples...) I will apretiate very much!!! Thank you!

    Read the article

  • Express highest floating point quantity that is less than 1

    - by edA-qa mort-ora-y
    I was doing some rounding calculations and happened upon a question. How can I express the highest quantity less than 1 for a given floating point type? That is, how I write/represent value x such that x < 1, x + y >= 1 for any y > 0. In fractions this would be x = (q-1)/q where q is the precision of the type. For example, if you are counting in 1/999 increments then x = 998/999. For a given type (float, double, long double), how could one express the value x in code? I also wonder if such a value actually exists for all values of y. That is, as y's exponent gets smaller perhaps the relation doesn't hold anymore. So an answer with some range restriction on y is also acceptable. (The value of x I want still does exist, the relationship may just not properly express it.)

    Read the article

  • Find the highest number of occurences in a column in SQL

    - by Ronnie
    Given this table: Order custName description to_char(price) A desa $14 B desb $14 C desc $21 D desd $65 E dese $21 F desf $78 G desg $14 H desh $21 I am trying to display the whole row where prices have the highest occurances, in this case $14 and $21 I believe there needs to be a subquery. So i started out with this: select max(count(price)) from orders group by price which gives me 3. after some time i didn't think that was helpful. i believe i needed the value 14 and 21 rather the the count so i can put that in the where clause. but I'm stuck how to display that. any help?

    Read the article

  • MySQL Query Join Table Selecting Highest Date Value

    - by ALHUI
    Here is the query that I run SELECT cl.cl_id, cc_rego, cc_model, cl_dateIn, cl_dateOut FROM courtesycar cc LEFT JOIN courtesyloan cl ON cc.cc_id = cl.cc_id Results: 1 NXI955 Prado 2013-10-24 11:48:38 NULL 2 RJI603 Avalon 2013-10-24 11:48:42 2013-10-24 11:54:18 3 RJI603 Avalon 2013-10-24 12:01:40 NULL The results that I wanted are to group by the cc_rego values and print the most recent cl_dateIn value. (Only Display Rows 1,3) Ive tried to use MAX on the date and group by clause, but it combines rows, 2 & 3 together showing both the highest value of dateIn and dateOut. Any help will be appreciated.

    Read the article

  • How to find the duplicate and highest value in an array

    - by Jerry
    Hello guys I have an array like this array={'a'=>'2','b'=>'5', 'c'=>'6', 'd'=>'6', 'e'=>'2'}; The array value might be different depending on the $_POST variables. My question is how to find the highest value in my array and return the index key. In my case, I need to get 'c' and 'd' and the value of 6. Not sure how to do this. Any helps would be appreciated. Thanks.

    Read the article

  • Select highest rated, oldest track

    - by Blair McMillan
    I have several tables: CREATE TABLE [dbo].[Tracks]( [Id] [uniqueidentifier] NOT NULL, [Artist_Id] [uniqueidentifier] NOT NULL, [Album_Id] [uniqueidentifier] NOT NULL, [Title] [nvarchar](255) NOT NULL, [Length] [int] NOT NULL, CONSTRAINT [PK_Tracks_1] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] CREATE TABLE [dbo].[TrackHistory]( [Id] [int] IDENTITY(1,1) NOT NULL, [Track_Id] [uniqueidentifier] NOT NULL, [Datetime] [datetime] NOT NULL, CONSTRAINT [PK_TrackHistory] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] INSERT INTO [cooltunes].[dbo].[TrackHistory] ([Track_Id] ,[Datetime]) VALUES ("335294B0-735E-4E2C-8389-8326B17CE813" ,GETDATE()) CREATE TABLE [dbo].[Ratings]( [Id] [int] IDENTITY(1,1) NOT NULL, [Track_Id] [uniqueidentifier] NOT NULL, [User_Id] [uniqueidentifier] NOT NULL, [Rating] [tinyint] NOT NULL, CONSTRAINT [PK_Ratings] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] INSERT INTO [cooltunes].[dbo].[Ratings] ([Track_Id] ,[User_Id] ,[Rating]) VALUES ("335294B0-735E-4E2C-8389-8326B17CE813" ,"C7D62450-8BE6-40F6-80F1-A539DA301772" ,1) Users User_Id|Guid Other fields Links between the tables are pretty obvious. TrackHistory has each track added to it as a row whenever it is played ie. a track will appear in there many times. Ratings value will either be 1 or -1. What I'm trying to do is select the Track with the highest rating, that is more than 2 hours old, and if there is a duplicate rating for a track (ie a track receives 6 +1 ratings and 1 - rating, giving that track a total rating of 5, another track also has a total rating of 5), the track that was last played the longest ago should be returned. (If all tracks have been played within the last 2 hours, no rows should be returned) I'm getting somewhere doing each part individually using the link above, SUM(Value) and GROUP BY Track_Id, but I'm having trouble putting it all together. Hopefully someone with a bit more (MS)SQL knowledge will be able to help me. Many thanks!

    Read the article

  • XSL to show highest number of copies in catalog.xml file

    - by SANJAY RAO
    In this the catalog.xml file. I have two books who have the same inventory (i.e. 20). I want to write an XSL file that will display the highest number of copies of a book in a catalog. If there are two or more books of the same inventory then they have to be displayed. <catalog> <Book> <sku>12345</sku> <title>Beauty Secrets</title> <condition>New</condition> <current_inventory>20</current_inventory> <price>99.99</price> </Book> <Book> <sku>54321</sku> <title>Picturescapes</title> <current_inventory>20</current_inventory> <condition>New</condition> <price>50.00</price> </Book> <Book> <sku>33333</sku> <title>Tourist Perspectives</title> <condition>New</condition> <current_inventory>0</current_inventory> <price>75.00</price> </Book> <Book> <sku>10001</sku> <title>Fire in the Sky</title> <condition>Used</condition> <current_inventory>0</current_inventory> <price>10.00</price> </Book> </catalog> Below is my catalog3.xsl file which is able to display only one out of the two books: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:variable name="max"/> <xsl:template match="/"> <html> <body> <h2>Titles of Books for which Most Copies are Available</h2> <table border="2"> <tr bgcolor="#9acd32"> <th>Title</th> <th>No of Copies</th> </tr> <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="catalog"> <xsl:for-each select="Book"> <xsl:sort select="current_inventory" data-type="number" order="descending"/> <tr> <xsl:if test="position()= 1"> <p><xsl:value-of select="$max = "/></p> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="current_inventory"/></td> </xsl:if> </tr> </xsl:for-each> </xsl:template> </xsl:stylesheet> Could anybody correct me to achieve my goal of displaying all the copies having the same maximum inventory in the catalog. Thanks.

    Read the article

  • Math.max and Math.min outputting highest and lowest values allowed

    - by user1696162
    so I'm trying to make a program that will output the sum, average, and smallest and largest values. I have everything basically figured out except the smallest and largest values are outputting 2147483647 and -2147483647, which I believe are the absolute smallest and largest values that Java will compute. Anyway, I want to compute the numbers that a user enters, so this obviously isn't correct. Here is my class. I assume something is going wrong in the addValue method. public class DataSet { private int sum; private int count; private int largest; private int smallest; private double average; public DataSet() { sum = 0; count = 0; largest = Integer.MAX_VALUE; smallest = Integer.MIN_VALUE; average = 0; } public void addValue(int x) { count++; sum = sum + x; largest = Math.max(x, largest); smallest = Math.min(x, smallest); } public int getSum() { return sum; } public double getAverage() { average = sum / count; return average; } public int getCount() { return count; } public int getLargest() { return largest; } public int getSmallest() { return smallest; } } And here is my tester class for this project: public class DataSetTester { public static void main(String[] arg) { DataSet ds = new DataSet(); ds.addValue(13); ds.addValue(-2); ds.addValue(3); ds.addValue(0); System.out.println("Count: " + ds.getCount()); System.out.println("Sum: " + ds.getSum()); System.out.println("Average: " + ds.getAverage()); System.out.println("Smallest: " + ds.getSmallest()); System.out.println("Largest: " + ds.getLargest()); } } Everything outputs correctly (count, sum, average) except the smallest and largest numbers. If anyone could point me in the right direction of what I'm doing wrong, that would be great. Thanks.

    Read the article

  • BASH: Find highest numbered filename in a directory where names start with digits (ls, sed)

    - by Jake
    I have a directory with files that look like this: 001_something.php 002_something_else.php 004_xyz.php 005_do_good_to_others.php I ultimately want to create a new, empty PHP file whose name starts with the next number in the series. LIST=`exec ls $MY_DIR | sed 's/\([0-9]\+\).*/\1/g' | tr '\n' ' '` The preceding code gives me a string like this: LIST='001 002 004 005 ' I want to grab that 005, increment by one, and then use that number to generate the new filename. How do I do that in BASH?

    Read the article

  • SQL Query to retrieve highest item up to a point in a group

    - by James
    The best way of describing this is I have a table of people with their names and ages. Assume that people with the same surname are from the same family. I need a query in oracle which will retrieve a list of the oldest person in each family, but not older than a certain age. Table: person name surname age =============================== James Smith 23 Sarah Powell 17 Barry Smith 31 Mark Smith 35 Mary Smith 18 Bob Powell 30 How do I retrieve the oldest person in each family under 30? Results I'm after name surname age =============================== James Smith 23 Sarah Powell 17

    Read the article

  • Good way to get the key of the highest value of a Dictionary in C#

    - by Arda Xi
    I'm trying to get the key of the maximum value in the Dictionary<double, string> results. This is what I have so far: double max = results.Max(kvp => kvp.Value); return results.Where(kvp => kvp.Value == max).Select(kvp => kvp.Key).First(); However, since this seems a little inefficient, I was wondering whether there was a better way to do this.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >