seti-at-home-statistics-v03-update

Gesponsorde koppelingen

PHP script bestanden

  1. seti-at-home-statistics-v03-update

« Lees de omschrijving en reacties

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?php
/*
SETI@HOME progress-script this script can be used to see
how much progress you've made with you're current work-unit
and you're statistics worldwide

To see your current WU-progress you need the commandline-version,
not the screensaver-version.

If you have setispy, you can also activate setispy-stats by altering
'var $setispy = 0;' -> 'var $setispy = 1;'
Than you'll have to set the seti-spy folder in the
var rootfolder = ""; (in the setispy-class)

********************************
******DO NOT ALTER ANYTHING*****
****** UNLESS STATED SO ********
*********Version 0.3 ***********
   application only uses PHP
********************************
*/


// alter this to your seti@home email adress

$email ="davebronckers@hotmail.com";


echo "<HTML><HEAD><TITLE>SETI@HOME Statistics VERSION 0.2</TITLE></HEAD><BODY>";

class currentprogress{

    // alter this to 1 if client installed, else set to zero.
    var $client = 1;

    /* alter this to the SETI@HOME folder, for example:
    var $rootfolder = "C:\Documents and Settings\User\Desktop\seti\\";         */

    var $rootfolder = "C:\Documents and Settings\Bert\Bureaublad\seho\\";
    
    // Set this to 1 if you want so see more detailes
    // else turn to 0

    var $showdetails = 1;
        

    function
currentprogress(){
        
        if($this->client == 1){
            
            if(!file_exists($this->rootfolder . "state.sah")){
            
                die("<P>Cannot Locate you're state.sah file in the <strong>" . $this->rootfolder . "</strong> directory. Please
                check if the state.sah file is in the right place or if you have installed the commandline version. If not, alter <em>'var \$client = 1;'</em> to <em>'var \$client = 0;'</em> in <strong>"
. $_SERVER['PHP_SELF'] ."</strong>");
            }

            
            $file = $this->rootfolder . "state.sah";
            $data = file($file);
            
            // client version:
            $version = $this->rootfolder . "version.sah";
            $getversion = file($version);
            $big = ereg_replace("^major_version=", "", $getversion[0]);
            $small = ereg_replace("^minor_version=", "", $getversion[1]);
            
            echo "<font size=-1>Client-version: " . $big . ".0" . $small . "</font><P>";
            
            echo "<h1>Your Current WU: </h1>";
            
            // current workunit progress
            $progress = ereg_replace("^prog=", "", $data[4]);
            $progress *= 100;
            echo "Your current WU is at <strong>" . round($progress, 3) . "</strong> percent done<br>";
            
            // current CPU time on WU
            $cputime = ereg_replace("^cpu=", "", $data[3]);
            $cputime /= 60;
            echo "Your CPU is currently <strong>" . round($cputime, 3) . "</strong> minutes busy";
            
            $progtil100 = 100 / $progress;
            $progtil100 *= $cputime;
            echo "<br>Estimated Total time: <strong>" . round($progtil100, 2) . "</strong> Minutes";
            
            $tillcomp = 100 /  $progress;
            $tillcomp *= $cputime;
            $tillcomp -= $cputime;
            echo "<br>Estimated time till completation: <strong>" . round($tillcomp, 2) . "</strong> Minutes";
            
                if($this->showdetails == 1){
                
                // more detailed stats
                $powerspike = ereg_replace("^bs_power=", "", $data[8]);
                $scorespike = ereg_replace("^bs_score=", "", $data[9]);
                
                $scoregaussian = ereg_replace("^bg_score=", "", $data[14]);
                $powergaussian = ereg_replace("^bg_power=", "", $data[16]);
                
                $scorepulse = ereg_replace("^bp_score=", "", $data[87]);
                $powerpulse = ereg_replace("^bp_power=", "", $data[88]);
                
                $scoretriplet = ereg_replace("^bt_score=", "", $data[96]);
                $powertriplet = ereg_replace("^bt_power=", "", $data[97]);
                
                echo "<ul>";
                    if($scorespike == 0.000000){
                    echo "<li><p><strong>No</strong> spikes found yet</li><br>";
                    }
else{
                    echo "<p><li>Spikes: <br> <strong>Best Score: </strong> $scorespike<br><strong>Best Power:</strong> $powerspike</li><br>";
                    }
if($scoregaussian == 0.000000){
                    echo "<li><strong>No</strong> gaussians found yet</li><br>";
                    }
else{
                    echo "<li>Gaussians<br><strong>Best Score: </strong> $scoregaussian<br><strong>Best Power:</strong> $powergaussian</li><br>";
                    }
if($scorepulse == 0.000000){
                    echo "<li><strong>No</strong> pulses found yet</li><br>";
                    }
else{
                    echo "<li>Pulses<br> <strong>Best Score: </strong> $scorepulse<br><strong>Best Power:</strong> $powerpulse</li><br>";
                    }
if($scoretriplet == 0.000000){
                    echo "<li><strong>No</strong> triplets found yet<br></li>";
                    }
else{
                    echo "<li>Triplets<br> <strong>Best Score: </strong> $scoretriplet<br><strong>Best Power:</strong> $powertriplet</li><br>";
                    }
                }
echo "</ul>";
                
                
                            
        }
else{
        
            echo "You don't have the commandline-version so your current statistics are not available";
            }        
    }
}

class totalstatistics{

    function
totalstatistics($email){
    
    
        // url to open:
        $url = "http://setiathome2.ssl.berkeley.edu/fcgi-bin/fcgi?cmd=user_xml&email=" . $email;
    
    
        echo "<HR><P><h1>World-Wide Stats: </h1><br><br>";
    
        $file = file($url) or die("Error getting the seti@home stats. Please check your emailadress you've filled in. Please check if this is the right adress! Also check if you have an internet connection.");
    
            if($file[6] == ""){
        
            die("Error getting the seti@home stats. Please check your emailadress you've filled in. Your current emailadress is <strong> " . $email . "</strong>. Please check if this is the right adress!");
            }

            
        // stats
        $username = "<strong>Username: </strong>" . $file[6] . "<br>";
        $WUnumber = "<strong>Number of WU's: </strong>" . $file[7] . "<br>";
        $CPUtime = "<strong>Total CPU time: </strong>" . $file[8] . "<br>";
        $AvCPUtime = "<strong>Average CPU time per WU: </strong>" . $file[9] . "<br>";
        $AvWUperday = "<strong>WU's per day: </strong>" . $file[10] . "<br>";
        $LastWU = "<strong>Last WU received: </strong>" . $file[11] . "<br>";
        $MemReg = "<strong>Date you registered S@H: </strong>" . $file[12] . "<br>";
        $MemTim = "<strong>Time you have registered S@H: </strong>" . $file[13] . "<br><br>";
    
        $MemGroup = "<strong>Member of Group: </strong>" . $file[16] . "<br>";
        $FouGroup = "<strong>Founder of Group: </strong>" . $file[17] . "<br><br>";
    
        $RankWW = "<strong>Rank World-Wide: </strong>" . $file[20] . "<br>";
        $MemWW = "<strong>Members World-Wide: </strong>" . $file[21] . "<br>";
        $MemSameWu = "<strong>Members With same WU's: </strong>" . $file[22] . "<br>";
        $RankTop = "<strong>Top-Ranked: </strong>" . $file[23];
    
        echo $username . $WUnumber . $CPUtime . $AvCPUtime . $AvWUperday . $WUnumber . $LastWU . $MemReg . $MemTim . $MemGroup . $FouGroup . $RankWW . $MemWW . $MemSameWu . $RankTop;
    
        }
    }

class setispystats{

    // alter this to 1 if setispy installed, else set to zero.
    var $setispy = 1;
    
    // set the folder in witch you've installed setispy
    var $rootfolder = "C:\Documents and Settings\Bert\Bureaublad\seho\\";
    
        function
setispystats(){
        
            if($this->setispy == 1){
        
                if(!file_exists($this->rootfolder . "setispy.ini")){
        
                die("<P>Cannot Locate you're setispy.ini file in the <strong>" . $this->rootfolder . "</strong> directory. Please
                check if the setispy.ini file is in the right place or if you have installed setispy. If not, alter <em>'var \$setispy = 1;'</em> to <em>'var \$setispy = 0;'</em> in the file: <strong>"
. $_SERVER['PHP_SELF'] ."</strong>");
                }

            
            $files = $this->rootfolder . "setispy.ini";
            $sdata = file($files);
            
            // stats
            $cpu = ereg_replace("^CPUType=", "<strong>Processor: </strong>", $sdata[13]) . "<BR>";
            $speed = ereg_replace("^CPUSpeed=", "", $sdata[17]) . "<BR>";
            $os = ereg_replace("^OSVersion=", "<strong>Operating System: </strong>", $sdata[56]) . "<BR>";
            $memory = ereg_replace("^PhysicalMemory=", "", $sdata[57]);
            $memory /= 1024;
            $speed /= 1000000000;
            
            echo "<hr><h1>Computer Specs:</h1><br>" . $cpu . "<strong>Processor Frequenty: </strong>" . round($speed, 3) . " Gygaherz <br> " .  $os . "<strong>Physical Memory: </strong>" .  round($memory, 1) . " Mb <br>";
                
            }        
        }
    
    
}
    
// echo current stats
$progress = new currentprogress;

// echo world-wide stats
$totalstats = new totalstatistics($email);

// echo setispy stats
$setispystats = new setispystats;

echo "</BODY></HTML>";

?>

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.