mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Programming

Reply
 
Thread Tools
Old 2003-11-22, 14:20   #1
dsouza123
 
dsouza123's Avatar
 
Sep 2002

2×331 Posts
Default Triple ranking report program

A small windows program to create a new ranking report using
the file ftops.txt from the link

http://mersenne.org/primenet/ftops.txt

and initially produce a modified version substituting the column

P90 CPU
hrs/day
--------

with

Total P90
CPU yrs
---------

either reusing the Rank column for combined rank OR leaving the Factoring rank and putting a new column before it with Total rank.
(probably reuse the Rank column).

An ideal list would have the three ranks Total, LL, Factoring.

A triple rank report with the 3 ranks, Account ID, the 3 CPU yrs.

The first version will leave the Factoring Rank values alone but sort them by Total CPU yrs, repurpose the last column, making it hold Total P90 CPU yrs.

An eventual version will be the triple report.
dsouza123 is offline   Reply With Quote
Old 2003-11-22, 14:43   #2
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

2×2,417 Posts
Default

You could use two edit boxes, one for ftop.txt and one for the one merged in the topproducers.shtml page, and merge accounts.

Or just add edit boxes where you could insert your personal stats.

Luigi
ET_ is offline   Reply With Quote
Old 2003-11-22, 15:03   #3
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2×33×13 Posts
Default

Let's not get ahead of ourselves. First step is to get the info we need. Shouldn't be a big problem considering that each column is a fixed distance from beginning of the line and each line has the same length. So we just skip to info we need (UserID, factoring years, LL years) copy the appropriate number of characters, strip out any leading blanks, then convert from ASCII to decimals which we can then add together. The tricky part will be to resort them. Any ideas on an efficient way to do that?
PrimeCruncher is offline   Reply With Quote
Old 2003-11-22, 15:12   #4
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

2·2,417 Posts
Default

Easy.

You create an array of strings, cut the original string in substrings having the needed length (the fields of the array), use the "StringToInt" function on the numeric fields and finally apply a quicksort on the specified field. The other fields will follow automagically.

Luigi
ET_ is offline   Reply With Quote
Old 2003-11-22, 15:27   #5
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2×33×13 Posts
Default

That QuickSort sounds like a nice function. Too bad MASM doesn't have something similar. But if we were to write it in MASM we could still code a similar function ourselves. All that quicksort seems to do is compare a value with the value below it. If the below value is higher, it flips them and continues through the list. Then it continues to call itself until the entire list has been sorted. But considering the size of the ftops.txt list it would be difficult to reserve and use that much memory, not to mention that you wouldn't have a fixed size so you have reserve as you go. If this is to be programmed it looks like MASM is not the optimal choice.
PrimeCruncher is offline   Reply With Quote
Old 2003-11-22, 17:02   #6
ET_
Banned
 
ET_'s Avatar
 
"Luigi"
Aug 2002
Team Italia

2×2,417 Posts
Default

Well, we could use a list of pointers instead...

Luigi
ET_ is offline   Reply With Quote
Old 2003-11-22, 17:05   #7
pakaran
 
pakaran's Avatar
 
Aug 2002

3·83 Posts
Default

Quote:
Originally posted by PrimeCruncher
That QuickSort sounds like a nice function. Too bad MASM doesn't have something similar. But if we were to write it in MASM we could still code a similar function ourselves. All that quicksort seems to do is compare a value with the value below it. If the below value is higher, it flips them and continues through the list. Then it continues to call itself until the entire list has been sorted. But considering the size of the ftops.txt list it would be difficult to reserve and use that much memory, not to mention that you wouldn't have a fixed size so you have reserve as you go. If this is to be programmed it looks like MASM is not the optimal choice.
If QuickSort is Quicksort, it's a classic algorithm. Google on that word, it's the (usually, but sometimes grossly not) fastest way to sort a list of more than about 20 values.
pakaran is offline   Reply With Quote
Old 2003-11-22, 18:35   #8
antiroach
 
antiroach's Avatar
 
Jun 2003

3648 Posts
Default

The algo PrimeCruncher described sounds more like a Bubble sort than a quicksort. Bubble sort has runtime O(n^2) which is really slow. Quicksort is much faster somewhere around nlogn or maybe even logn. You can also try mergesort or heapsort maybe :) The only type of sort I know how to do in assembly (just had assembly programming this quarter) is selection sort :).
antiroach is offline   Reply With Quote
Old 2003-11-22, 18:54   #9
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

7×1,193 Posts
Default

Quote:
Originally posted by PrimeCruncher
Let's not get ahead of ourselves. First step is to get the info we need. Shouldn't be a big problem considering that each column is a fixed distance from beginning of the line and each line has the same length. So we just skip to info we need (UserID, factoring years, LL years) copy the appropriate number of characters, strip out any leading blanks, then convert from ASCII to decimals which we can then add together.
wget -O - -q "http://mersenne.org/primenet/ftops.txt" | cut -c 9-73 | tr -s " " "," | grep '[.]..$'
Xyzzy is offline   Reply With Quote
Old 2003-11-22, 23:35   #10
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2×33×13 Posts
Default

No need to code a program. Just finished whipping up an Excel spreadsheet that will do the job just fine. It's almost completely automated. When opened it will automatically retrieve the ftops.txt file from mersenne.org, then put all the info in the appropriate places. I've added a column with a formula that computes LL+TF. Doesn't auto sort by Total CPU years, so I've implemented a macro to do that. Press Ctrl-Shift-S to sort. I've also "frozen" the first 3 rows (the column headings) so you can scroll to anywhere you like and still know which numbers are which. Oh, almost forgot to mention: it will automatically update the sheet every 60 minutes if you leave it open.

You have to be patient with it. Even on my broadband (cable) connection, it takes about 10 seconds. So be prepared to wait a while if you have dial-up (it IS a multi-megabyte file).

Speaking of multi-megabyte files, the spreadsheet itself is! Well I guess that's what you get for using BloatSoft products. 3.4MB according to my computer. Fortunately it's only about 500KB zipped.

Since the max attachment size is 97.6KB and even ZIPed the file is 500KB, I've uploaded it to my personal web space. You can download it here:

http://home.comcast.net/~captainrichard/files/ftops.zip

One more thing. I know this works on Excel 2000 so it should also work on later versions. Don't know about 97 (if anyone's using that) or KOffice, OpenOffice.org, Spread32 or other programs that can read Excel files.

Questions/comments/suggestions welcome... though I'm not too experienced with MS Excel so it might take a while...

Last fiddled with by PrimeCruncher on 2003-11-22 at 23:37
PrimeCruncher is offline   Reply With Quote
Old 2003-11-22, 23:43   #11
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2·33·13 Posts
Default

Update:
Does not work with Spread32.
PrimeCruncher is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
* Provisional Ranking a1call Miscellaneous Math 8 2018-02-04 03:14
Member Ranking. jwaltos Forum Feedback 8 2015-03-13 17:01
Report: Bush surveillance program was massive cheesehead Soap Box 4 2009-07-12 03:19
Ranking and Speed nngs Lounge 1 2008-03-31 21:23
RPS Ranking grobie Riesel Prime Search 2 2006-01-18 17:56

All times are UTC. The time now is 00:46.


Thu Dec 2 00:46:22 UTC 2021 up 131 days, 19:15, 1 user, load averages: 0.78, 0.83, 0.83

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.