ranking

How i can create a new ties.method with R rank() function ?

Hello guys, I'm trying to order this dataframe by population and date, so i'm using order() and rank() function : idgeoville date population 1 5 1950 500 2 8 1950 450 3 4 1950 350 4 3 1950 350 5 4 2000 650 6 5 ...

PHP MySQL Query most popular in last 24 hours

Say I want to get ten records with the MOST likes in the last 24 hours. Here's what I have so far: $date = date("o-m-d"); $query = "SELECT date_created,COUNT(to),from,to FROM likes WHERE date_created LIKE '$date%' GROUP BY to ORDER BY COUNT(to) DESC LIMIT 10"; The problem with that is that it only gets the most liked from THAT DAY, no...

Determine position of first occurence of string in MySQL?

For a table like this: username | time --------------------------------------- animuson | 0.678 aP*animuson | 0.967 animuson | 0.567 qykumsoy | 0.876 I'm trying to find a way in MySQL to order these by times and then find the position where username occurs and username is only counted once. So, if I'm s...

How to mitigate against bandwagon effect (voting behavior) in my ranking system?

What I mean by bandwagon effect describes itself like so: Already top-ranked items have a higher tendency to get voted on at all, possibly even to get upvoted. What I am hoping to get is some concrete recommendations, at best based on your practical experience with a mathematical formula and in which situation it helped. However, any u...

Building a web on server, how to stop search engines to find it?

I am building a website and heard that if the website gets listed on search engines, it might get bad reputation and its very difficult to lift it up on the rank of those search engines. I would like to know, how could I make my website not to be listed on search engines until I finish it. Any help would be appreciated. Thanks. ...

How to Rank in MySQL Using a WHERE clause and UNION ALL

I need some help with a MySQL query. I'm trying to rank participants using a WHERE clause. So, I'd like to rank novices, intermediates, and experienced separately. For example: Rank Name Grade Type ---------------------------------- 1 Bob 98 Novice 2 Jill 88 Novice 3 Jimmy 42 Novice 1 Mark 87 ...

How can I reduce the size of this Ranking Query in MySql?

I've got a ranking query that ranks the performance of teams in challenges. The hierarchy of data is as follows: teams have members members have activities activities have activitytypes challenges have activitytypes If I want to rank the performance all teams in a single challenge, this query works great: SELECT t.teamID, t.teamNa...

Optimize a rankings page using PHP and MySQL

I could really use some help optimizing a table on my website that is used to display rankings. I have been reading a lot on how to optimize queries and how to properly use indexes but even after implementing changes I thought would work, little improvement can be seen. My quick fix has been simply to use only the top 100,000 rankings (...

Fixed navigation which may result in hidden content for SEO

I have a website which uses a fixed navigation at the top of the site. It works on browsers down to IE6 but the problem I sometimes see on the chached version on Google is that everything else (but the navigation) does not appear. Does Google think this is hidden content which may be affecting my ranking? I have put in many things to i...

SQL Server 2000: Length of field in 1/3 (or 2/3) of the records

Is there a simpler/cleaner way to do this using SQL Server 2000? Every few days I need to do this. I first look at how many records we have total: SELECT COUNT(*) FROM MyTable Then I list all the lengths of a certain field: SELECT LEN(MyText) FROM MyTable ORDER BY LEN(MyText) ASC I then need to scroll down 1/3rd of the way... and...

String similarity algorithims?

I need to compare 2 strings and calculate their similarity, to filter down a list of the most similar strings. Eg. searching for "dog" would return dog doggone bog fog foggy Eg. searching for "crack" would return crack wisecrack rack jack quack I have come across: QuickSilver LiquidMetal Do you know of any more string simila...

Hibernate search question: How to get top ranking terms?

I've already tokenized the field, so, for example, 'kw1' appears 10 times across all document, 'kw2' 20 time, and so on and so force. The table will be looking like 'kw1':10, 'kw2':20, ... I need get top N highest ranking terms. It is something like Google trend. Any idea? ...

assign a specific value to an array element using a MySQL query.

The idea is to run a sort of ranking MySQL command such as: $sql = mysql_query("SELECT f_score FROM ".TBL_FACTIONS." ASC"); EDIT: I do need to add a WHERE f_id = $id in here too. The numeric value in my MySQL database table in the *f_score* column should determine the rank. f_score contains only numeric values, from 0 to anythin...

calculate rank in highscore from 2 tables

i have a trivia game and i want to reward users for 2 events: 1) answering correctly 2) sending a question to the questions pool i want to query for score and rank of a specific player and i use this query: SELECT (correct*10+sent*30) AS score, @rank:=@rank+1 AS rank FROM ( trivia_players JOIN ( SELECT COUNT(*) AS sent,...

Ranking without ranking functions

Hi, I have written the following query so as to select the rank of each customer and show it with other information in the output. use northwind go select Employees.EmployeeID as ID, FirstName+' '+LastName as Name, DENSE_RANK() over (order by SUM(Orders.OrderID)) as [Rank] from employees inner join orders on Employees.EmployeeID...

Sorting A List Of Songs By Popularity

For student council this year, I'm on the "songs" committee, we pick the songs. Unfortunately, the kids at the dances always end up hating some of the stupid song choices. I thought I could make it different this year. Last thursday, I created a simple PHP application so kids could submit songs into the database, supplying a song name, a...

best practice for maintaining ranking tables?

Using MySQL and PHP, I have a simple ranking table with 2 columns user and score. Once a week, I re-run the ranking script and it computes scores for each user. many users have new scores some do not some times there are new users to add to the table What's the best way to approach this with MySQL? Does update work if I need to add ...

How to increase Alexa rank ?

Hello, I'm trying to sell my ad slot via BSA and the advertisers are looking for the "alexa rank" to make their call. The problem is that my alexa rank is not good at all. Alexa Rank : 2,117,406 My stats : 12,000 visits per month / 120,000 viewed pages per month Website launched 2 months ago. Domain is : Seek Team which ends up to ...

I'm looking for a "most read" module for Drupal

Is there a "most read" module for Drupal? I want to create a "most read" block on my drupal page. ...

Implementing the Hacker News ranking algorithm in SQL.

Here's how Paul Graham describes the ranking algorithm for Hacker News: News.YC's is just (p - 1) / (t + 2)^1.5 where p = points and t = age in hours I'd like to do that in pure mySQL given the following tables: Table Posts with fields postID (index) and postTime (timestamp). Table Votes with fields voteID (index), post...