THE FORUMS


German ForumsGeneral DiscussionStrategyFrench Forum
Old May 23, 2010, 6:19pm   #31
kmay06
Professional
 
kmay06's Avatar
 
Join Date: Jan 2008
Posts: 4,753
Reputation: 1740
kmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant future
Default

#I make a lasagna
#I bake all day
#my tables are empty anyway....
__________________
Quote:
I spent today cleaning up the kitchen and making an apple pie and two apple bread loafs... I am going to make someone such a lovely little house husband one day . I even put the seat down. - Tjtay89
kmay06 est déconnecté   Reply With Quote

Sponsored Links
Don't like this ad? Register to make it go away!

Old May 23, 2010, 8:20pm   #32
kmay06
Professional
 
kmay06's Avatar
 
Join Date: Jan 2008
Posts: 4,753
Reputation: 1740
kmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant future
Default

>Mozart - Piano Concerto No.20 in D minor, K466
Rating:7.35423620026

>Queen - Freddie + Pavarotti Tribute
Rating:6.89082156611

>MSI-I Never Wanted to Dance
Rating:6.60872807018

>Slayer - Disciple
Rating:6.42740693196

>Megadeth - Holy Wars
Rating:6.19569961489

>Dio - Holy Diver
Rating:5.96399229782

>Trivium - Fugue
Rating:5.73228498074

>Pantera - Cemetery Gates
Rating:5.54691912709

>Muse - Knights of Cydonia
Rating:5.50057766367

>Machinae Supermacy-Soundtrack to the Rebellion
Rating:4.70872807018

>Joaquín Rodrigo - Concierto de Aranjuez
Rating:4.57374839538

>Machinae Supremacy-Player One
Rating:4.47122807018
__________________
Quote:
I spent today cleaning up the kitchen and making an apple pie and two apple bread loafs... I am going to make someone such a lovely little house husband one day . I even put the seat down. - Tjtay89
kmay06 est déconnecté   Reply With Quote
Old May 23, 2010, 8:23pm   #33
kmay06
Professional
 
kmay06's Avatar
 
Join Date: Jan 2008
Posts: 4,753
Reputation: 1740
kmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant future
Default

If anyone cares:
Quote:
import sys;
import math;
class song:
def __init__(self,name,score):
self.name=name
self.score=score
def rate_song(file):
index=0
song_ratings=[]
for line in file:
if line.startswith(">"):
if index >=1:
song_ratings.append(instance)
index+=1
name=line
score=''
instance=song(name,score)
else:
score+=line
instance=song(name,score)
song_ratings.append(instance)
return song_ratings
ratings=rate_song(open(sys.argv[1],'r').readlines())
output=open(sys.argv[2],'w',)
totalcount=0
totalavg=0
totalvotes=0
for item in ratings:
score=item.score.rstrip('\n').split('\t');
sumscore=0
count=0
totalcount=totalcount+1
for i in range(0,len(score)):
sumscore=float(sumscore)+float(score[i])
count=count+1
totalvotes=float(totalvotes)+float(len(score))
avg=float(sumscore)/float(len(score))
totalavg=float(totalavg)+float(avg)
avgvotes=float(totalvotes)/float(totalcount)
totalavg=float(totalavg)/float(totalcount)
rating_dict={}
for item in ratings:
score=item.score.rstrip('\n').split('\t');
sumscore=0
count=0
for i in range(0,len(score)):
sumscore=float(sumscore)+float(score[i])
count=count+1
avg=float(sumscore)/float(len(score))
br = ( (float(avgvotes) * float(totalavg)) + (float(count) * float(avg)) ) / (float(avgvotes) + float(count))
rating_dict[br]=item.name
sort_ratings=rating_dict.keys()
sort_ratings.sort()
sort_ratings.reverse()
for i in range(0,len(sort_ratings)):
output.write('\n'+str(rating_dict[sort_ratings[i]])+'Rating:'+str(sort_ratings[i])+'\n')
Basically takes the input like this:

Quote:
>MSI-I Never Wanted to Dance
7.0 7.0
>Machinae Supremacy-Player One
3.0 4.25
>Machinae Supermacy-Soundtrack to the Rebellion
4 4.0
>Iron Maiden - Phantom Of The Opera
5.0
>Megadeth - Holy Wars
6.5
>Slayer - Disciple
7.0
>Pantera - Cemetery Gates
5.1
>Joaquín Rodrigo - Concierto de Aranjuez
3.0
>Mozart - Piano Concerto No.20 in D minor, K466
9.0
>Symphony X - Divine Wings of Tragedy Part II
8.0
>Dio - Holy Diver
6.0
>Muse - Knights of Cydonia
5.0
>In Flames - The Mirrors Truth
5.5
>In Flames - Colony
5.5
>Trivium - The Rising
5.5
>Trivium - Anthem
5.5
>Trivium - Fugue
5.5
>Queen - Don't Stop me Now
8.0
>Queen - Freddie + Pavarotti Tribute
8.0
From a txt file, ">" signifies the name of the song, and the scores are seperated by tabs. So for ones that people have voted more than once, it'll be like:

>song1
5.6 4.2 2.1 4.5

etc.

It basically uses the average# of votes across all songs, the average score for all songs, and uses that to weight the songs.
__________________
Quote:
I spent today cleaning up the kitchen and making an apple pie and two apple bread loafs... I am going to make someone such a lovely little house husband one day . I even put the seat down. - Tjtay89
kmay06 est déconnecté   Reply With Quote
Old May 23, 2010, 8:26pm   #34
kmay06
Professional
 
kmay06's Avatar
 
Join Date: Jan 2008
Posts: 4,753
Reputation: 1740
kmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant future
Default

Bah, except it isn't printing all of the songs. Ok, sec.
__________________
Quote:
I spent today cleaning up the kitchen and making an apple pie and two apple bread loafs... I am going to make someone such a lovely little house husband one day . I even put the seat down. - Tjtay89
kmay06 est déconnecté   Reply With Quote
Old May 23, 2010, 8:46pm   #35
MCT
Brunson
 
MCT's Avatar
 
Join Date: Sep 2008
Location: Newfoundland
Posts: 216
Reputation: 186
MCT has a spectacular aura aboutMCT has a spectacular aura about
Default

Chad VanGaalen - "Clinically Dead"



MCT est déconnecté   Reply With Quote
Old May 23, 2010, 9:38pm   #36
kmay06
Professional
 
kmay06's Avatar
 
Join Date: Jan 2008
Posts: 4,753
Reputation: 1740
kmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant future
Default

Quote:
import sys;
import math;
import operator;
class song:
def __init__(self,name,score):
self.name=name
self.score=score
def rate_song(file):
index=0
song_ratings=[]
for line in file:
if line.startswith(">"):
if index >=1:
song_ratings.append(instance)
index+=1
name=line
score=''
instance=song(name,score)
else:
score+=line
instance=song(name,score)
song_ratings.append(instance)
return song_ratings
ratings=rate_song(open(sys.argv[1],'r').readlines())
output=open(sys.argv[2],'w',)
totalcount=0
totalavg=0
totalvotes=0
for item in ratings:
score=item.score.rstrip('\n').split('\t');
sumscore=0
count=0
totalcount=totalcount+1
for i in range(0,len(score)):
sumscore=float(sumscore)+float(score[i])
count=count+1
totalvotes=float(totalvotes)+float(len(score))
avg=float(sumscore)/float(len(score))
totalavg=float(totalavg)+float(avg)
avgvotes=float(totalvotes)/float(totalcount)
totalavg=float(totalavg)/float(totalcount)
rating_dict={}
for item in ratings:
score=item.score.rstrip('\n').split('\t');
sumscore=0
count=0
for i in range(0,len(score)):
sumscore=float(sumscore)+float(score[i])
count=count+1
avg=float(sumscore)/float(len(score))
br = ( (float(avgvotes) * float(totalavg)) + (float(count) * float(avg)) ) / (float(avgvotes) + float(count))
rating_dict[item.name]=br
sorted_x = sorted(rating_dict.iteritems(), key=operator.itemgetter(1))
sorted_x.reverse()
print sorted_x
for i in range(0,len(sorted_x)):
output.write('\n'+sorted_x[i][0]+'Rating: '+str(sorted_x[i][1])+'\n')



Updated code. Doesn't retain proper indentation so if you use python and actually want the script let me know and I'll upload it. This was mostly for my own fun so I figured people won't actually need it.

Quote:
>Mozart - Piano Concerto No.20 in D minor, K466
Rating: 7.35423620026

>Queen - Freddie + Pavarotti Tribute
Rating: 6.89082156611

>Symphony X - Divine Wings of Tragedy Part II
Rating: 6.89082156611

>Queen - Don't Stop me Now
Rating: 6.89082156611

>MSI-I Never Wanted to Dance
Rating: 6.60872807018

>Slayer - Disciple
Rating: 6.42740693196

>Megadeth - Holy Wars
Rating: 6.19569961489

>Dio - Holy Diver
Rating: 5.96399229782

>In Flames - Colony
Rating: 5.73228498074

>Trivium - The Rising
Rating: 5.73228498074

>In Flames - The Mirrors Truth
Rating: 5.73228498074

>Trivium - Anthem
Rating: 5.73228498074

>Trivium - Fugue
Rating: 5.73228498074

>Pantera - Cemetery Gates
Rating: 5.54691912709

>Muse - Knights of Cydonia
Rating: 5.50057766367

>Iron Maiden - Phantom Of The Opera
Rating: 5.50057766367

>Machinae Supermacy-Soundtrack to the Rebellion
Rating: 4.70872807018

>Joaquín Rodrigo - Concierto de Aranjuez
Rating: 4.57374839538

>Machinae Supremacy-Player One
Rating: 4.47122807018
Updated List.
__________________
Quote:
I spent today cleaning up the kitchen and making an apple pie and two apple bread loafs... I am going to make someone such a lovely little house husband one day . I even put the seat down. - Tjtay89
kmay06 est déconnecté   Reply With Quote
Old May 24, 2010, 3:54pm   #37
kmay06
Professional
 
kmay06's Avatar
 
Join Date: Jan 2008
Posts: 4,753
Reputation: 1740
kmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant futurekmay06 has a brilliant future
Default

Well I effectively killed this thread.
__________________
Quote:
I spent today cleaning up the kitchen and making an apple pie and two apple bread loafs... I am going to make someone such a lovely little house husband one day . I even put the seat down. - Tjtay89
kmay06 est déconnecté   Reply With Quote
Old May 24, 2010, 3:59pm   #38
acehole_76
I found Kc...............
 
acehole_76's Avatar
 
Join Date: Feb 2006
Location: now bring back northview
Posts: 7,632
Reputation: 2310
acehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond repute
Default

Quote:
Originally Posted by MCT View Post

not awful but nothing really stood out either 6/10
__________________
Quote:
Originally Posted by killcrazy View Post
obviously, it's always my fault whenever anyone does anything stupid around here.

fucking morons every one of you. there isn't a man in this village that i wouldn't feed into an incinerator for no reason other than to get rid of them.

Kc
acehole_76 est déconnecté   Reply With Quote
Old May 24, 2010, 4:19pm   #39
Red4Eva
Grinder
 
Red4Eva's Avatar
 
Join Date: Aug 2007
Posts: 898
Reputation: 651
Red4Eva is a splendid one to beholdRed4Eva is a splendid one to beholdRed4Eva is a splendid one to beholdRed4Eva is a splendid one to beholdRed4Eva is a splendid one to beholdRed4Eva is a splendid one to behold
Default

http://www.youtube.com/watch?v=IRvGZffXhfk
Red4Eva est déconnecté   Reply With Quote
Old May 24, 2010, 4:26pm   #40
acehole_76
I found Kc...............
 
acehole_76's Avatar
 
Join Date: Feb 2006
Location: now bring back northview
Posts: 7,632
Reputation: 2310
acehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond reputeacehole_76 has a reputation beyond repute
Default

Quote:
Originally Posted by Red4Eva View Post

crap......1/10
__________________
Quote:
Originally Posted by killcrazy View Post
obviously, it's always my fault whenever anyone does anything stupid around here.

fucking morons every one of you. there isn't a man in this village that i wouldn't feed into an incinerator for no reason other than to get rid of them.

Kc
acehole_76 est déconnecté   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



All times are GMT. The time now is 1:21am. vBulletin 3.7.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.