DPAD - Any of you guys know php?

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Ken g6

Programming Moderator, Elite Member
Moderator
Dec 11, 1999
16,610
4,530
75
If several of us are working on this, it would make sense to choose a common language. If you're all doing PHP, I have used it a little before, and I should be able to pick it up pretty quickly.

Since I assume this site will host stats for all projects, I'm thinking that, in order to make the stats programming as easy as possible, stats processing should be split into two parts. The first stage converts stats into a format common to all stats pages. For example (and no need to stick to this exact format):

Line 1:
Project_name, Last_retrieval, Primary_stat_name [, Other_stat_name [, Other stat name ... ] ]
Subsequent lines:
Username, Team_Name, primary_stat [, other_stat [, other_stat ... ] ]

Then we could write a common second stage that converts this to the pretty stats page.

Edit: Just looking at GeoffS's page now. How do I get per-team member stats? :confused:
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
Originally posted by: Ken_g6
Edit: Just looking at GeoffS's page now. How do I get per-team member stats? :confused:

Not sure what you mean... how do you see per team member stats on my page? Just click on a team link and then Team Daily Stats :)

If you mean how will I do it in DPAD with my stats, I'm going to have to parse out the team based on the square-brackets convention.

I'll have to give some thought to adddin the project-name as a key to the tables that I currently have in place for D2OL... I'm sure it's not a problem, just want to make sure that it won't cause any problems. The only problem I could see is degradation of performance as a table like User Daily Stats containing the results of each member of each project for each day grows.

Since the only page that would benefit from a single table would be the front page, which I envision showing, for example, the TeAm's position in each project, and maybe the top TeAm producer overall and for the day for that project. After that, the drilldown is into the distinct project. So with the majority of the processing happening within a project, it may make sense to keep the projects in separate sets of tables.

Geoff

 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
lol... jpgraph is the one I use... not to it's best potential obviously! I have to change the bars to a filled line graph I think :)
 

DanC

Diamond Member
Jun 2, 2000
5,553
0
0
I think you guys are on the right track! Let's just be sure it's an open dialogue and all players have a "say" - we want this to be the BEST stats in the game!

Thanks so much to all for your valuable time. :)

Now - on to Tastats.com? ;)
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
Question about the stats found HERE

Looking at the first line, I'm guessing the data elements are:

- userid (duh!)
- 4.3 results ?
- total mPts
- mPts today ?
- best pct (but why are there 2 for some folks... best by version? is this necessary?)
- how many hour idle ?
- team (duh!)
- 7-days of what? Not mPts... Average?
- 30-day of what? Again, not mPts... Average?

Thanks!
 

amdxborg

Diamond Member
Aug 27, 2002
6,790
23
81
- userid (duh!) - yip
- 4.3 results ? - client version yip
- total mPts - yip
- mPts today ? - muon points aka work units yip
- best pct (but why are there 2 for some folks... best by version? is this necessary?) - the one in () yip
- how many hour idle ? - time since last results recieved yip
- team (duh!) - yip
- 7-days of what? Not mPts... Average? - mpts avr yip
- 30-day of what? Again, not mPts... Average? - mpts avr yip

Anybody else? :D
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
Thanks... is your answer to

- best pct (but why are there 2 for some folks... best by version? is this necessary?)

yip, it's necessary?

Geoff
 

amdxborg

Diamond Member
Aug 27, 2002
6,790
23
81
OK yip it is necessary :D
2 are because the second one is for an older simulation.
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
How do I tell, for someone that has results for V4.3, which simulation the best percent belongs so? Pretty easy for someone with two result records with results for v4.3 like CADkindaGUY who has one record for 15.754645 followed by a record for 9.883993. I assume the data in the file is chronological in that all v4.2 data preceeds all v4.3 data and that all data from one v4.3 simulation preceeds the data in the other v4.3 simuation, but what do I do with a single v4.3 record like [TA]amd.borg with just 9.883930? I didn't notice any delimiters in the data file...
 

BlackMountainCow

Diamond Member
May 28, 2003
5,759
0
0
Don't know if this helps you, but by now there's no transfer for 4.3 ever above 10 and probably won't ever be. So basically, when u got a result like th 15.75... it MUST belong to 4.2, while a result of 9.89.... SHOULD belong to 4.3
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
But I can't tell for a single result of 9.89 which simulation that belongs to if there is only one record with v4.3 data on it.... when did the first v4.3 simulation end? Do I need to look at idle hours?

Geoff
 

Bok7575

Member
Mar 6, 2004
92
31
91
Originally posted by: GeoffS
But I can't tell for a single result of 9.89 which simulation that belongs to if there is only one record with v4.3 data on it.... when did the first v4.3 simulation end? Do I need to look at idle hours?

Geoff

Geoff, The file is delimited. Look for <SolenoidsOnly> and <Solenoidsto15cm>

Loev the D2OL stats by the way :)

Bok
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
Cool... so the first section is v4.2 and earlier, the second section is v4.3a and the third is v4.3b? :)

Geoff
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
As an update... I've got the table structure for the daily user and daily user totals done. I need to work out an algorithm to extract team from the user name (the one I have in mind is ugly...), and then I just need to work on the php scripts that output the html... few days tops I figure! :)

Geoff
 

ProviaFan

Lifer
Mar 17, 2001
14,993
1
0
Originally posted by: GeoffS
As an update... I've got the table structure for the daily user and daily user totals done. I need to work out an algorithm to extract team from the user name (the one I have in mind is ugly...), and then I just need to work on the php scripts that output the html... few days tops I figure! :)

Geoff
Excellent! Sounds good. :D
 

Bok7575

Member
Mar 6, 2004
92
31
91
Originally posted by: GeoffS
As an update... I've got the table structure for the daily user and daily user totals done. I need to work out an algorithm to extract team from the user name (the one I have in mind is ugly...), and then I just need to work on the php scripts that output the html... few days tops I figure! :)

Geoff

Geoff, if you're using perl this will do it..

#!/usr/bin/perl
my $string = "Bok[Free-DC.org]";
unless ($string=~/\[(.*?)\]/) { die "Regex Failed!\n\n"; }
print "Regex returned '$1'\n\n";

courtesy of Dyyryath from Free-DC for helping me out on that one :)

Bok