Search Results

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

Page 20/39 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Specify which row to return on SQLite Group By

    - by lozzar
    I'm faced with a bit of a difficult problem. I store all the versions of all documents in a single table. Each document has a unique id, and the version is stored as an integer which is incremented everytime there is a new version. I need a query that will only select the latest version of each document from the database. While using GROUP BY works, it appears that it will break if the versions are not inserted in the database in the order of version (ie. it takes the maximum ROWID which will not always be the latest version). Note, that the latest version of each document will most likely be a different number (ie. document A is at version 3, and document B is at version 6). I'm at my wits end, does anybody know how to do this (select all the documents, but only return a single record for each document_id, and that the record returned should have the highest version number)?

    Read the article

  • Displaying most popular posts on my blog - Ruby on Rails

    - by bgadoci
    I have created a simple blog application using Ruby on Rails, both of which I am new to. I am trying to get my most 'voted' posts to display in my /views/posts/index.html.erb view. Here are the basics. I have created a votes table and successfully allow a user to 'vote' for a post on the /views/posts/show.html.erb page. When they vote, it passes '1' to the votes table and I return the vote count via ajax to the same show page. Vote belongs_to :post and Post has_many :votes. I would like to display in /views/posts/index.html.erb the post title and the amount of times it has been voted for, ordered by posts with the highest vote count. Any ideas on how to do this?

    Read the article

  • Java App Engine - ranked counter

    - by Richard
    I understand the sharded counter, here: http://code.google.com/appengine/articles/sharding_counters.html The problem is that a simple counter will not work in my application. I am sorting my entities by a particular variable so I am returned not so much a count, but more of a rank. My current method is: SELECT COUNT(this) FROM Entity.class WHERE value <= ? Result + 1 is then the rank of the parameter in relation to the value variable in the persistent Entity objects. The limitation of this is the highest rank being returned is 1001 because count() can give a maximum of 1000. The reason I cannot store the rank on the Entity object is that the ranks are updated very often, and re-setting this rank variable would be much too costly. Any ideas on the best way to accomplish this?

    Read the article

  • Open Source Utilization Questions: How do you lone wold programmers best take advantage of open sour

    - by Funkyeah
    For Clarity: So you come up with an idea for a new program and want to start hacking, but you also happen to be a one-man army. How do you programming dynamos best find and utilize existing open-source software to give you the highest jumping off point possible when diving into your new project? When you do jump in where the shit do you start from? Any imaginary scenarios would be welcome, e.g. a shitty example might be utilizing a open-source database with an open-source IM client as a starting off point to a make a new client where you could tag and store conversations and query those tags at a later time.

    Read the article

  • Floodfill with "layers"

    - by user146780
    What I want is to create a vector drawing program with layers, but to avoid using transparency / opacity, I want to draw each shape from lowest layer to highest layer onto a single bitmap. For the filling, I want to floodfill the shape. My issue is that, if I have a shape that is drawn then floodfilled, then the next shape overlaps it a bit and that new shape's border is the same as the other one's then floodfill will only partially fill it. Is there a way given a shape's coordinates that I can find the actual bounds for floodfill rather than use a target color? Thanks

    Read the article

  • How to utilize my computation resources.

    - by carter-boater
    Hi all, I wrote a program to solve a complicated problem. This program is just a c# console application and doesn't do console.write until the computation part is finished, so output won't affect the performance. The program is like this: static void Main(string[] args) { Thread WorkerThread = new Thread(new ThreadStart(Run), StackSize); WorkerThread.Priority = ThreadPriority.Highest; WorkerThread.Start(); Console.WriteLine("Worker thread is runing..."); WorkerThread.Join(); } Now it takes 3 minute to run, when I open my task manager, I see it only take 12% of the cpu time. I actually have a i7 intel cpu with 6G three channel DDR3 memory. I am wondering how I can improve the utilization of my hardware. Thanks a lot

    Read the article

  • mysql Command timeout error

    - by Rahul Malhotra
    I am converting my database from sql server 2005 to mysql using asp .net mvc. I have bulk data in sql server(around 4 lakh records), But i am facing command timeout/wating for comand timeout error which when i search on google can be given 65535 as its highest value Or can be given 0 if someone wants that comand should wait for unlimited time untill its above command get executed. Both of these a'int working with me. I also have given any connectTimeout to 180. So shoiuld i have to change it too. Anybody who had face this problem or have any confirm knowledge please share

    Read the article

  • Virtual dedicated surver repetitive draining RAM, OOM constantly

    - by Deerly
    My linux (fedora red hat 7) virtual dedicated server has been experiencing OOM multiple times a day for the past several days. I thought the issue was with spamd/spamassassin but after disabling this the errors remains. The highest usage displayed on ps faux --cumulative: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 28412 8.7 0.5 309572 109308 ? Sl 22:15 0:17 /usr/java/jdk1. mysql 7716 0.0 0.0 136256 18000 ? Sl 22:12 0:00 _ /usr/libexe named 17697 0.0 0.0 120904 15316 ? Ssl 22:09 0:00 /usr/sbin/named I'm not running any java applications so I'm not sure why the top issue is showing up. It is frustrating as I barely have anything running on the server and use the tiniest fraction of bandwidth. Any help or suggestions on zeroing in on the source of the drain would be much appreciated! Thanks!

    Read the article

  • What should the SQL keyword "ISABOUT" [deprecated?] be replaced with?

    - by Atomiton
    In MS SQL Full-text search, I'm using ISABOUT in my queries. For example, this should return the top 10 ProductIDs (PK) with a RANK Field in the ProductDetails Table SELECT * FROM CONTAINSTABLE( ProductDetails, *, ISABOUT("Nikon" WEIGHT (1.0), "Cameras" Weight(0.9)), 10 ) However, according to the SQL Documentation ISABOUT is deprecated. So, I have two questions: What is ISABOUT being replaced with? DO I even NEED any extra SQL Command there? ( IOW, would just putting the search phrase 'Nikon Cameras' be better? ) What I was originally trying to accomplish here was to weight the first word the highest, then the second word lower, and keep descending to 0.5 where I would just rank the remaining words at 0.5. My logic ( and perhaps it's flawed ) was that people's most relevant search words usually happen near the beginning of a phrase ( in English ). Am I going about this the wrong way? Is there a better way? Am I asking too many questions? (^_^) Thanks all for your time...

    Read the article

  • Select count() max() Date

    - by DAVID
    I have a table with shifts history along with emp ids. I'm using this query to retrieve a list of employees and their total shifts by specifying the range to count from: SELECT ope_id, count(ope_id) FROM operator_shift WHERE ope_shift_date >=to_date( '01-MAR-10','dd-mon-yy') and ope_shift_date <= to_date('31-MAR-10','dd-mon-yy') GROUP BY OPE_ID which gives OPE_ID COUNT(OPE_ID) 1 14 2 7 3 6 4 6 5 2 6 5 7 2 8 1 9 2 10 4 10 rows selected. How do I choose the employee with the highest number of shifts under the specified range date?

    Read the article

  • Can only "agents" build and submit Applications to Apple?

    - by Martin
    I'm afraid I know the answer to this but I'll ask on the longshot chance that I'm wrong: I've been doing some freelance work creating an iPhone application for a company. They've created their own developer account and added me as an team member with "admin" rights. That seems to be the highest assignable rights (with the only higher level being "agent" and belonging only to whoever signed up for the account). Yet, I don't have an option under the provisioning portal to create a distribution certificate or profile. Is there any way to create these myself without having to ask my client for their primary login? They're not particulary tech savy so it would be difficult to walk them through the process to create the necessary certificates (and would require me giving them a certificate request from my computer, etc. etc.). But it seems like there should be some way to create a distribution build without "agent" rights, right? Could Apple seriously expect only one person from a company to do all the building and uploading of apps to the store?

    Read the article

  • Why GWT? Advantages and Trade-Offs of Using This RIA Framework

    - by prometheus
    I'm new to stackoverflow and have been reading through a bunch of the "highest voted" questions for GWT. Several of these questions talk about the pitfalls or problems with GWT. In the articles: Which Javascript framework (jQuery vs Dojo vs … )? and Biggest GWT Pitfalls?, some posters seem to suggest that GWT is not lightweight enough or that there are better alternatives that may be used. Do most of you feel that there are problems with GWT that have not been fixed with GWT 2.0 -- which would make you inclined to suggest using a simpler framework for a new project? To some extent, shouldn't GWT be somewhat future-proof (since you don't have to worry about it changing drastically from release to release and since it is backed by Google)? I realize that the answer to this question depends greatly upon what you want to do or what you wish to make. I am looking at this from the perspective of starting a new web application that will eventually be used by millions of users.

    Read the article

  • Limiting the Amount of Tags for Acts as Taggable On

    - by bob
    Hello, I am wondering how to limit the amount of tags, the tag_cloud function returns for this plugin. http://github.com/collectiveidea/acts-as-taggable-on Also, I would like to know how to order it so that it orders the tags by the highest count. So the most popular are at the top. I tried to do @tags = Post.tag_counts_on(:tags, :limit = 5) but that did not work. Controller: class PostController < ApplicationController def tag_cloud @tags = Post.tag_counts_on(:tags) end end View: <% tag_cloud @tags, %w(css1 css2 css3 css4) do |tag, css_class| %> <%= link_to tag.name, { :action => :tag, :id => tag.name }, :class => css_class %> <% end %> Thanks!

    Read the article

  • Sorting nested hash in ruby

    - by Rabbott
    Provided the following ruby hash: { cat: { 1: 2, 2: 10, 3: 11, 4: 1 }, wings: { 1: 3, 2: 5, 3: 7, 4: 7 }, grimace: { 1: 4, 2: 5, 3: 5, 4: 1 }, stubborn: { 1: 5, 2: 3, 3: 7, 4: 5 } } How can I sort the hash by the sum of 'leaf' excluding "4", for instance the value to compare for "cat" would be (2 + 10 + 11) = 23, the value for "wings" would be (3 + 5 + 7) = 15 so if I was comparing just those two they would be in the correct order, highest sum on top. It is safe to assume that it will ALWAYS be {1: value, 2: value, 3: value, 4: value} as those are keys for constants I have defined. It is also safe to assume that I will only ever want to exclude the key "4", and always use the keys "1", "2", and "3"

    Read the article

  • Multidimensional vectors in scheme?

    - by incrediman
    I earlier asked a question about arrays in scheme (turns out they're called vectors but are basically otherwise the same as you'd expect). Is there an easy way to do multidimensional arrays vectors in PLT Scheme though? For my purposes I'd like to have a procedure called make-multid-vector or something. By the way if this doesn't already exist, I don't need a full code example of how to implement it. If I have to roll this myself I'd appreciate some general direction though. The way I'd probably do it is to just iterate through each element of the currently highest dimension of the vector to add another dimension, but I can see that being a bit ugly using scheme's recursive setup. Also, this seems like something I should have been able to find myself so please know that I did actually google it and nothing came up.

    Read the article

  • Filter DataTable to show only the most recent transaction for each user

    - by Dan Neely
    I have a datatable that contains rows of transaction data for multiple users. Each row includes UserID and UserTransactionID columns. What would I use for as a RowFilter in the tables DefaultView to only show the row for each user that has the highest UserTransactionID value? sample data and results UserID UserTransactionID PassesFilter 1 1 False 1 2 False 1 3 True 2 1 True 3 1 False 3 2 True My data is orginating in a non-SQL source, the DataTable is being created to be bound to a DataGridView so I can't make changes to a query being used to get the data initially.

    Read the article

  • Algorithm - Pick the best combination of Armor (for a game)

    - by Chu
    I'm designing a piece of a game where the AI needs to determine which combination of armor will give the best overall stat bonus to the character. Each character will have about 10 stats, of which only 3-4 are important, and of those important ones, a few will be more important than the others. Armor will also give a boost to 1 or all stats. For example, a shirt might give +4 to the character's int and +2 stamina while at the same time, a pair of pants may have +7 strength and nothing else. So let's say that a character has a healthy choice of armor to use (5 pairs of pants, 5 pairs of gloves, etc.) We've designated that Int and Perception are the most important stats for this character. How could I write an algorithm that would determine which combination of armor and items would result in the highest of any given stat (say in this example Int and Perception)?

    Read the article

  • Convert PDF to PNG using ImageMagick

    - by StackOverflowNewbie
    using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way): convert -density 300 -depth 8 -quality 85 a.pdf a.png Looking at what Gmail does when a user "view" a PDF, the quality is awesome and the file size very minimal. The DPI is just 96 (I have to set a density of 300 to get anything decent). Anyone know how GMail does it? Thanks.

    Read the article

  • Random noise in Solr score

    - by Andrea Campi
    I am looking for a way of introducing random noise into my scoring function, and I'm at a loss on how to best proceed. Some background: We use Solr for a web application that manages large-ish sets of photos for agencies. One customer has an interesting requirement for scoring: 'quality' field, maintained by editors, from 1 (highest) to 3 (lowest); 'date' field, boosting more recent photos; I would probably use a logarithmic function; However, due to how the stock photo market works, this will likely result in many similar photos appearing together. Their request is to give 'quality' a large boost, but introduce some randomness so that photos will not appear in a strict date order. Any idea? EDITED: a key requirement is to have "stable" query results: if I search twice for "tropical island" I can get a slightly different result set, but if I ask for the first page, then the second, then the first, I'd better get the same results :)

    Read the article

  • Alright to truncate database tables when also using Hibernate?

    - by Marcus
    Is it OK to truncate tables while at the same time using Hibernate to insert data? We parse a big XML file with many relationships into Hibernate POJO's and persist to the DB. We are now planning on purging existing data at certain points in time by truncating the tables. Is this OK? It seems to work fine. We don't use Hibernate's second level cache. One thing I did notice, which is fine, is that when inserting we generate primary keys using Hibernate's @GeneratedValue where Hibernate just uses a key value one greater than the highest value in the table - and even though we are truncating the tables, Hibernate remembers the prior value and uses prior value + 1 as opposed to starting over at 1. This is fine, just unexpected. Note that the reason we do truncate as opposed to calling delete() on the Hibernate POJO's is for speed. We have gazillions of rows of data, and truncate is just so much faster.

    Read the article

  • Virtual dedicated server repetitive draining RAM, OOM constantly

    - by Deerly
    My linux (fedora red hat 7) virtual dedicated server has been experiencing OOM multiple times a day for the past several days. I thought the issue was with spamd/spamassassin but after disabling this the errors remains. The highest usage displayed on ps faux --cumulative: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 28412 8.7 0.5 309572 109308 ? Sl 22:15 0:17 /usr/java/jdk1. mysql 7716 0.0 0.0 136256 18000 ? Sl 22:12 0:00 _ /usr/libexe named 17697 0.0 0.0 120904 15316 ? Ssl 22:09 0:00 /usr/sbin/named I'm not running any java applications so I'm not sure why the top issue is showing up. It is frustrating as I barely have anything running on the server and use the tiniest fraction of bandwidth. Any help or suggestions on zeroing in on the source of the drain would be much appreciated! Thanks!

    Read the article

  • Insert coding query in yii

    - by nerd
    I need to auto insert the next orders_id into an Orders table in a database. orders_id is not the primary Key, and it does not auto-increment I need to query the database, find the last (highest) id value, increment 1, and insert it in Orders table in database. Actually, I have a shipping action which will provide address of shipping of orders. So as soon as the user fills address form and move to payments page, I want to simultaneously fill my Orders table by max(orders_id)+1. I have built relations between Address table and Orders table but my orders Table is not getting populated. Please detail me correct codes to implement it in my controller in Yii

    Read the article

  • Grouping timestamps by interval between timestamps, then calculating from group MySQL

    - by Emile
    To put this question into context, I'm trying to calculate "time in app" based on an event log. Assume the following table: user_id event_time 2 2012-05-09 07:03:38 3 2012-05-09 07:03:42 4 2012-05-09 07:03:43 2 2012-05-09 07:03:44 2 2012-05-09 07:03:45 4 2012-05-09 07:03:52 2 2012-05-09 07:06:30 I'd like to get the difference between the highest and lowest event_time from a set of timestamps that are within 2 minutes of eachother (and grouped by user). If a timestamp is outside of a 2 minute interval from the set, it should be considered a part of another set. Desired output: user_id seconds_interval 2 7 (because 07:03:45 - 07:03:38 is 7 seconds) 3 0 (because 07:03:42) 4 9 (because 07:03:52 - 2012-05-09 07:03:43) 2 0 (because 07:06:30 is outside 2 min interval of 1st user_id=2 set) This is what I've tried, although I can't group on seconds_interval (even if I could, I'm not sure this is the right direction): SELECT (max(tr.event_time)-min(tr.event_time)) as seconds_interval FROM some_table tr INNER JOIN TrackingRaw tr2 ON (tr.event_time BETWEEN tr2.event_time - INTERVAL 2 MINUTE AND tr2.event_time + INTERVAL 2 MINUTE) GROUP BY seconds_interval

    Read the article

  • HQL query for entity with max value

    - by Rob
    I have a Hibernate entity that looks like this (accessors ommitted for brevity): @Entity @Table(name="FeatureList_Version") @SecondaryTable(name="FeatureList", pkJoinColumns=@PrimaryKeyJoinColumn(name="FeatureList_Key")) public class FeatureList implements Serializable { @Id @Column(name="FeatureList_Version_Key") private String key; @Column(name="Name",table="FeatureList") private String name; @Column(name="VERSION") private Integer version; } I want to craft an HQL query that retrieves the most up to date version of a FeatureList. The following query sort of works: Select f.name, max(f.version) from FeatureList f group by f.name The trouble is that won't populate the key field, which I need to contain the key of the record with the highest version number for the given FeatureList. If I add f.key in the select it won't work because it's not in the group by or an aggregate and if I put it in the group by the whole thing stops working and it just gives me every version as a separate entity. So, can anybody help?

    Read the article

  • sql query question

    - by bu0489
    hey guys, just having a bit of difficulty with a query, i'm trying to figure out how to show the most popular naturopath that has been visited in a centre. My tables look as follows; Patient(patientId, name, gender, DoB, address, state,postcode, homePhone, businessPhone, maritalStatus, occupation, duration,unit, race, registrationDate , GPNo, NaturopathNo) and Naturopath (NaturopathNo, name, contactNo, officeStartTime, officeEndTime, emailAddress) now to query this i've come up with SELECT count(*), naturopathno FROM dbf10.patient WHERE naturopathno != 'NULL' GROUP BY naturopathno; which results in; COUNT(*) NATUROPATH 2 NP5 1 NP6 3 NP2 1 NP1 2 NP3 1 NP7 2 NP8 My question is, how would I go about selecting the highest count from this list, and printing that value with the naturopaths name? Any suggestions are very welcome, Brad

    Read the article

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