DPAD - Any of you guys know php?

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

DanC

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

Holy bat-lips batman... :Q ;)
 

Zbox

Senior member
Aug 29, 2003
881
0
76
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

Awesome, thanks for the update ;)

Keep up the great work :D
 

amdxborg

Diamond Member
Aug 27, 2002
6,790
23
81
For a short time in my life I thought this could be done by a mere mortal...but something like this:
#!/usr/bin/perl
my $string = "Bok[Free-DC.org]";
unless ($string=~/\[(.*?)\]/) { die "Regex Failed!\n\n"; }
print "Regex returned '$1'\n\n";

Wow and GeoffS's doing a lot of this [/*/}~. stuff :confused: so GREAT work! :beer::D
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
Thanks... I think what I'm going to do is load all the teams into an array and look for substrings in the userids. I'm not sure how else to do it since the team name could be at the front or the back and does not necessarily have any distinguishing features. This is a relatively small project, so there shouldn't be much of a hit when running the stats... if this were SETI on the other hand...
rolleye.gif


What's done so far is the daily load of the rawstats.txt file and loading the totals into the member daily total table. Next is to derive the member daily work from the last two day member totals (easy), the parsing out of the team name (little more difficult), and loading the team daily total and daily work tables (easy). This process can easily be modified to run the hourly updates. Once the data is in place, I'll start on the presentation. I should have pages that you guys can hit within a couple of days :)

amdxborg - I don't even know how to read that code! :)

Geoff

:)

Geoff
 

Confused

Elite Member
Nov 13, 2000
14,166
0
0
Geoff,

Awesome work so far :cool:

One of my ideas was to have the information for all members on all teams updating daily, and the data for TA updating hourly. This will give us the advantage of having comparative stats of other teams, but regularly updated for TA members, plus not taking up as much disk space for the data :)

If you don't want to go for that...then that's fine...just one of my ideas :)


Garry
 

MechxWarrior

Senior member
Mar 2, 2004
565
0
76
Originally posted by: Bok7575
#!/usr/bin/perl
my $string = "Bok[Free-DC.org]";
unless ($string=~/\[(.*?)\]/) { die "Regex Failed!\n\n"; }
print "Regex returned '$1'\n\n";

Line One: Path to Perl
Line Two: sets variable
Line 3 like an iff statement, will return whatever is inside the [ ]'s
Line 4 prints what line 3 returns.

:)
Regex's are confusing as hell but rule.

 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
Let's see.... @1600 EST,

Geoff's stats say....

[TA]DanC is on team [TA], has 675 v4.2 results and 58664 v4.3 results, 11899273.4 mPts, and 15.942787 as his best v4.2 result & 9.884053 as his best v4.3 result.

Official stats say...

[TA]DanC is on team [TA], has 0 v4.2 results and 58664 v4.3 results, and 11899273.4 mPts.

- Where do I find the best percentages on the official stats page to validate what I have?

- Here's the whole team... fields are userid date v42results v43results mpts bestpct1 bestpct2 hoursidle team ... lmk if anything looks wonky....


[TA] 20040306 0 193 6822.4 0.000000 0.467690 108 [TA]
[TA] Bamavoo 20040306 0 93 22669.8 0.000000 9.866198 110 [TA]
[TA] Cowboy 20040306 0 17184 3361001.1 0.000000 9.884002 31 [TA]
[TA] Kwatt 20040306 0 1595 221968.8 10.786834 0.000000 6788 [TA]
[TA] Mandrill 20040306 0 1933 317437.0 0.000000 9.887998 17 [TA]
[TA] OhioDude 20040306 0 94 19005.6 0.000000 9.827511 412 [TA]
[TA] Tyr 20040306 0 2819 114545.6 0.000000 2.144492 29 [TA]
[TA] Xemus 20040306 0 866 223687.0 0.000000 9.892406 4 [TA]
[TA]AbsoluteParadigm 20040306 0 167 3603.1 0.000000 0.614440 63 [TA]
[TA]Actaeon 20040306 0 6392 1405692.5 0.000000 9.883686 43 [TA]
[TA]Adul 20040306 0 129 36671.3 0.000000 9.866774 3 [TA]
[TA]amd.borg 20040306 0 31931 6786077.9 0.000000 9.883930 24 [TA]
[TA]Anansi 20040306 0 2692 99466.4 0.000000 2.386110 1 [TA]
[TA]aphex 20040306 0 21504 1037880.5 0.000000 3.770598 1 [TA]
[TA]ARKAZAB 20040306 0 61 15215.8 0.000000 9.813079 412 [TA]
[TA]Artos 20040306 0 578 17400.4 0.000000 1.029294 137 [TA]
[TA]Assimilator1 20040306 1 51 6275.5 15.164425 0.000000 4218 [TA]
[TA]B 20040306 0 2546 203347.5 0.000000 4.646419 6 [TA]
[TA]bamavoo 20040306 0 193 4571.9 0.000000 0.674061 129 [TA]
[TA]beatle 20040306 0 465 115897.3 0.000000 9.873180 18 [TA]
[TA]BnT 20040306 0 9102 2065472.7 0.000000 9.858231 31 [TA]
[TA]Bot2600 20040306 0 4552 262478.5 9.587462 0.000000 6788 [TA]
[TA]brxndxn 20040306 0 3333 166463.6 0.000000 4.601890 0 [TA]
[TA]CADkindaGUY 20040306 1231 16483 3581503.4 15.754645 9.883993 18 [TA]
[TA]CamelToe 20040306 0 24197 5492010.1 0.000000 9.891475 8 [TA]
[TA]Chipster22 20040306 0 3029 649482.0 0.000000 9.882317 17 [TA]
[TA]Chrishuff1 20040306 0 584 19080.1 0.000000 0.858068 8 [TA]
[TA]Christian Diepold 20040306 0 5658 1474706.1 0.000000 9.878414 49 [TA]
[TA]Colt 20040306 0 69 1719.6 0.000000 0.257926 203 [TA]
[TA]compudog 20040306 0 2191 464734.3 0.000000 9.877497 26 [TA]
[TA]Confused 20040306 0 9598 1605883.5 0.000000 9.883973 1 [TA]
[TA]cooper76 20040306 0 8130 1750512.8 0.653041 9.883953 43 [TA]
[TA]crystal 20040306 0 2243 96771.9 0.000000 2.870341 8 [TA]
[TA]DaFinn 20040306 0 37 9433.6 0.000000 9.839223 47 [TA]
[TA]DanC 20040306 675 58664 11899273.4 15.942787 9.884053 5 [TA]
[TA]datalink7 20040306 0 152 40820.3 0.000000 9.883574 14 [TA]
[TA]deerewa 20040306 0 391 16078.8 0.000000 0.879519 145 [TA]
[TA]DKappos 20040306 0 1585 369234.6 0.000000 9.866093 37 [TA]
[TA]DrPizza 20040306 0 292 9075.4 0.000000 0.549370 9 [TA]
[TA]DurocShark 20040306 0 1749 77177.5 0.000000 1.325075 1 [TA]
[TA]FallOutBoy525 20040306 0 93 22456.2 0.000000 9.881688 33 [TA]
[TA]Farbio 20040306 0 1532 67984.5 0.000000 2.078624 1 [TA]
[TA]Force-TeamGundogs 20040306 0 2188 229351.4 0.000000 9.951380 23 [TA]
[TA]Glitchny 20040306 0 186 45669.0 0.000000 9.876405 24 [TA]
[TA]gtprojectx 20040306 0 2454 169431.6 0.000000 9.872723 53 [TA]
[TA]Hallis 20040306 2 629 124872.2 14.988043 0.000000 5865 [TA]
[TA]id0ntfear 20040306 0 918 35788.9 0.000000 1.908871 43 [TA]
[TA]IDLORJ 20040306 0 7265 453604.4 4.089739 9.827103 412 [TA]
[TA]jar5tyle 20040306 0 4558 476722.4 0.000000 9.883738 51 [TA]
[TA]jliechty 20040306 870 2038 192897.6 13.522134 9.847874 31 [TA]
[TA]JonB 20040306 0 9648 2124261.2 0.000000 9.884079 8 [TA]
[TA]JonnyBlazeRSP 20040306 0 191 5392.3 0.000000 0.415730 154 [TA]
[TA]Ken g6 20040306 16 969 202981.5 0.000000 9.877364 43 [TA]
[TA]KifArU 20040306 0 2167 465024.1 0.000000 9.883463 21 [TA]
[TA]Kk4Jc 20040306 278 4486 815205.7 15.935834 9.240919 412 [TA]
[TA]kyparrish 20040306 0 1212 67693.6 0.000000 3.243981 20 [TA]
[TA]LANMAN 20040306 0 1034 80668.1 9.120848 0.000000 7272 [TA]
[TA]Larciel 20040306 0 186 44042.6 0.000000 9.824083 10 [TA]
[TA]Lash444 20040306 0 667 26111.4 0.000000 1.098540 7 [TA]
[TA]LinuxIdiot 20040306 0 225 7039.6 0.000000 0.545881 160 [TA]
[TA]magomago 20040306 0 2871 94257.6 0.000000 1.594224 3 [TA]
[TA]Mastertech01 20040306 0 6592 270007.1 0.000000 2.411353 1 [TA]
[TA]MCrusty 20040306 0 1916 74271.1 0.000000 1.719316 16 [TA]
[TA]MechEng 20040306 0 3038 681455.1 0.000000 9.883412 32 [TA]
[TA]MechxWarrior 20040306 0 116 28641.4 0.000000 9.866150 43 [TA]
[TA]Moltres 20040306 0 3655 176597.5 0.000000 2.834443 43 [TA]
[TA]Mookow 20040306 0 65 14699.5 0.000000 9.868816 37 [TA]
[TA]mordrid52 20040306 0 96 3084.3 0.000000 0.554022 43 [TA]
[TA]Murphyrulez 20040306 0 2327 123660.0 0.000000 9.884142 36 [TA]
[TA]nexus9 20040306 0 2314 492072.3 0.000000 9.876248 38 [TA]
[TA]nickPOWERZ 20040306 0 1594 367110.8 0.000000 9.883775 66 [TA]
[TA]Nourdmrolnmt1 20040306 0 685 29810.0 0.000000 1.961167 47 [TA]
[TA]nukefarmer 20040306 0 8973 367219.5 0.721973 9.880322 51 [TA]
[TA]OrangeKid 20040306 0 4796 1069279.0 0.000000 9.888273 9 [TA]
[TA]Ornery 20040306 0 919 34325.5 0.000000 9.858447 1 [TA]
[TA]Overkiller 20040306 695 17807 3495166.7 13.640588 9.884022 18 [TA]
[TA]Overvolt 20040306 0 3997 866001.2 0.000000 9.867909 412 [TA]
[TA]Pirate 20040306 6988 0 0.0 0.000000 0.000000 6247 [TA]
[TA]r0tt3n1 20040306 0 7159 1651969.9 0.000000 9.884007 47 [TA]
[TA]RaynorWolfcastle 20040306 0 1042 230014.7 0.000000 9.859924 412 [TA]
[TA]Rebel Alliance 20040306 0 8502 1259521.3 0.000000 9.880339 7 [TA]
[TA]Redviffer 20040306 0 207 53188.2 0.000000 9.876910 9 [TA]
[TA]Robbie2281 20040306 0 76 20883.0 0.000000 9.868439 18 [TA]
[TA]Saxophonoia 20040306 0 348 80485.9 0.000000 9.891041 0 [TA]
[TA]scoser 20040306 0 326 40044.1 0.000000 9.873152 43 [TA]
[TA]ScottSwingleComputers 20040306 0 2807 329078.7 0.000000 9.888190 3 [TA]
[TA]sduguid 20040306 0 232 10309.3 0.000000 0.623104 36 [TA]
[TA]se7enty7 20040306 0 279 66655.6 0.000000 9.824260 56 [TA]
[TA]Silverthorne 20040306 0 601 107324.7 0.000000 9.882124 43 [TA]
[TA]SlangNRox 20040306 0 2518 525071.3 13.415879 9.880193 303 [TA]
[TA]SociallyChallenged 20040306 0 194 4309.3 0.000000 0.343074 40 [TA]
[TA]SoGold 20040306 0 119 1824.7 0.000000 0.181069 412 [TA]
[TA]soni 20040306 0 8006 1595873.8 0.000000 9.886058 43 [TA]
[TA]SpeedFreak03 20040306 0 474 97194.1 0.000000 9.826788 412 [TA]
[TA]Spencer 20040306 0 47 12216.8 0.000000 9.883781 55 [TA]
[TA]SpiderX 20040306 0 100 4799.4 0.000000 0.312943 177 [TA]
[TA]Spoooon 20040306 0 56 13056.3 0.000000 9.875515 12 [TA]
[TA]Starfire 20040306 0 328 65425.0 0.000000 9.881609 127 [TA]
[TA]Starrider 20040306 0 14221 2868437.6 0.000000 9.883664 103 [TA]
[TA]StarUPlink 20040306 0 335 8789.5 0.000000 0.563322 122 [TA]
[TA]Stojakapimp 20040306 0 42 14053.1 0.000000 9.888889 38 [TA]
[TA]Stormgiant 20040306 7616 33934 5936357.8 15.753501 9.885978 1 [TA]
[TA]SuperCommando 20040306 0 1867 51121.1 0.000000 1.260640 97 [TA]
[TA]TA andy 20040306 83 0 0.0 0.000000 0.000000 1481 [TA]
[TA]TerryMathews 20040306 1249 5330 364729.6 7.099861 0.000000 6788 [TA]
[TA]ThaWolfMan 20040306 0 275 14161.8 0.000000 9.828678 42 [TA]
[TA]titanmiller 20040306 0 525 16745.9 0.000000 8.819884 174 [TA]
[TA]Turin39789 20040306 0 1148 71554.5 0.000000 3.043394 16 [TA]
[TA]tw1164 20040306 0 2608 153355.5 0.000000 9.853674 4 [TA]
[TA]Twioz 20040306 0 2026 110015.4 0.000000 9.884329 1 [TA]
[TA]ucdnam 20040306 0 2191 172048.6 0.000000 9.879773 0 [TA]
[TA]Vincero 20040306 824 2449 610687.8 0.000000 9.790223 332 [TA]
[TA]Viper6 20040306 0 952 43426.3 0.000000 1.225137 47 [TA]
[TA]ViperMagic 20040306 0 615 23648.8 0.000000 1.389285 20 [TA]
[TA]wellcky 20040306 0 2254 140622.4 0.000000 2.515921 3 [TA]
[TA]xcript 20040306 0 470 16424.8 0.000000 0.874911 63 [TA]
[TA]Xede 20040306 0 1444 59622.1 0.000000 1.608202 3 [TA]
[TA]yelo333 20040306 0 117 22667.1 0.000000 9.812589 412 [TA]
[TA]yukichigai 20040306 0 1242 66258.0 0.000000 2.692253 18 [TA]
[TA]Yzzim 20040306 0 1737 105342.3 0.000000 3.819603 2 [TA]
[TA]z 20040306 0 56074 4057745.2 0.000000 9.892486 1 [TA]
[TA]ziggy 20040306 0 154 37385.5 0.000000 9.879964
 

GeoffS

Lifer
Oct 10, 1999
11,583
0
71
Just checked slipstream's stats and got the same percentages for DanC... that's good news! :)

Onto the team total and daily summaries, and then the output! :)

Geoff
 

BlackMountainCow

Diamond Member
May 28, 2003
5,759
0
0
I just checked Stephen's stats and according to him, nobody has any results for 4.2 anymore. Looks like Stephen took them out of the stats. I guess that SlipStream has them because they're in his data base.

The top percentages can be found here when u scroll all the way down to the bottom. :D
 

CyGoR

Platinum Member
Jun 23, 2001
2,017
0
0
Great work Geoff!!! (However I'm not in the DPAD team :p)
I still need to learn how to extract data with PHP instead of Perl..

I do love Perl because of it's enourmous strenght in fetching data from files etc,
but I want to run PHP only...
I need my UD - stats server back up, me wants to do some serious programming again! :D

Geoff, for your D2OL stats, you could only keep the first day of every month in your database
instead of all days. This way you can still calculate monthly averages etc but it takes much less
space in you DB.. You could do this with stats more then say ~3 months old..
One question, do you, when the data is inserted into the database also calculate the daily difference
and insert that into the database as well? Or is that being calculated when the page is requested?

As a TeAm we already have many stats pages now! :D