Another cpu!
Published Thursday February 7th, 2002
Hrm.. ah yes... i got another cpu... or well.. 2... ... excelent.... now i have a totall of 3.06Ghz in my box.. yey.. haha, dual proccessing... excelent.. Its cool... i watch my cpu's usage rates.. and.. if i use all the cpu.... my kernel runs all the proccesses that arent taking much cpu on one, and the other proccess which is taking all the cpu cycles on another cpu.. and then every so often it swaps... and the other cpu takes the larger load... lol, its cool.. amuzing too.. hrm.. what else is new... Hrm.. no clue... Today i had a minimum day.. which is more like a 2/3's day.. heh.. fun fun fun... oh yes... very fun.. hrm.. tomorrow i have another session of moorpark class... fun.... great excitement.. lalalalalalalalalalalalala... im listening to di radio.. excellent.. indeed.. hrm.. yes... well then... im quite bored... hrm.. i think ill post a snipet of code... lets see.. what could i post...
#### polls.php #####
if ($pID==""){
$title="Emel Studio: Polls > No Poll Selected";
include("/home/marco/web/marco.luethy.net/includes/header.inc");
print "No Poll was selected.";
include("/home/marco/web/marco.luethy.net/includes/footer.inc");
die();
}
$link=mysql_connect("sqlserver","username","userpassword");
if (!$link){die("Couldn't connect to MySQL");}
mysql_select_db("marco",$link) or die("Error".mysql_error());
if ($presults=="1"){
include("/home/marco/web/marco.luethy.net/php-bin/polls/$pID.inc");
$pagetb="Polls > $poll_name"; $paget="$poll_name";
include("/home/marco/web/marco.luethy.net/includes/header.inc");
if ($psubmit=="1"){
if ($vote==""){
$inclimg="/images/error.jpg";
$incl="";
include("/home/marco/web/marco.luethy.net/includes/polls.inc");
include("/home/marco/web/marco.luethy.net/includes/footer.inc");
die();
}
$result=mysql_query("SELECT * FROM home_polls WHERE datype='1' AND poll_ID='$pID'") or die(mysql_error());
if (mysql_num_rows($result)==0){$IP=1;}
else {
while ($row=mysql_fetch_array($result)){
if ($row[part]==$REMOTE_ADDR){$IP=0; break;}
else {$IP=1;}
}
}
if ($IP==1){
$result=mysql_query("INSERT INTO home_polls (poll_ID, datype, val, part) values('$pID', '1', '$vote', '$REMOTE_ADDR')");
$result=mysql_query("SELECT val FROM home_polls WHERE part='$vote' AND datype='0' AND poll_ID='$pID'");
$data=mysql_fetch_array($result);
$newdata=$data[val]+1;
$result=mysql_query("UPDATE home_polls SET val='$newdata' WHERE part='$vote' AND datype='0' AND poll_ID='$pID'") or die(mysql_error());
}
else {
$inclimg="/images/error.jpg";
$incl="It apears as though you have already voted on this poll! You are only allowed to vote once.";
include("/home/marco/web/marco.luethy.net/includes/polls.inc");
}
}
#Get Total votes!
$counter=0;
while ($counter<=$parts){
$result=mysql_query("SELECT val FROM home_polls WHERE part='$counter' AND datype='0' AND poll_ID='$pID'");
$data=mysql_fetch_array($result);
$num=(int)($num+$data[val]);
$counter++;
}
$inclimg="/images/apollforfunhr.jpg";
# Print graph!
$counter=0;
$incl="
";
include("/home/marco/web/marco.luethy.net/includes/polls.inc");
include("/home/marco/web/marco.luethy.net/includes/footer.inc");
}
else {
if ($pmode=="include"){
include("/home/marco/web/marco.luethy.net/php-bin/polls/$pID.inc");
print "
0 comments, 2092 views, 0 revisions
Permanent Link
- Add Comment
Hrm.. ah yes... i got another cpu... or well.. 2... ... excelent.... now i have a totall of 3.06Ghz in my box.. yey.. haha, dual proccessing... excelent.. Its cool... i watch my cpu's usage rates.. and.. if i use all the cpu.... my kernel runs all the proccesses that arent taking much cpu on one, and the other proccess which is taking all the cpu cycles on another cpu.. and then every so often it swaps... and the other cpu takes the larger load... lol, its cool.. amuzing too.. hrm.. what else is new... Hrm.. no clue... Today i had a minimum day.. which is more like a 2/3's day.. heh.. fun fun fun... oh yes... very fun.. hrm.. tomorrow i have another session of moorpark class... fun.... great excitement.. lalalalalalalalalalalalala... im listening to di radio.. excellent.. indeed.. hrm.. yes... well then... im quite bored... hrm.. i think ill post a snipet of code... lets see.. what could i post...
#### polls.php #####
if ($pID==""){
$title="Emel Studio: Polls > No Poll Selected";
include("/home/marco/web/marco.luethy.net/includes/header.inc");
print "No Poll was selected.";
include("/home/marco/web/marco.luethy.net/includes/footer.inc");
die();
}
$link=mysql_connect("sqlserver","username","userpassword");
if (!$link){die("Couldn't connect to MySQL");}
mysql_select_db("marco",$link) or die("Error".mysql_error());
if ($presults=="1"){
include("/home/marco/web/marco.luethy.net/php-bin/polls/$pID.inc");
$pagetb="Polls > $poll_name"; $paget="$poll_name";
include("/home/marco/web/marco.luethy.net/includes/header.inc");
if ($psubmit=="1"){
if ($vote==""){
$inclimg="/images/error.jpg";
$incl="";
include("/home/marco/web/marco.luethy.net/includes/polls.inc");
include("/home/marco/web/marco.luethy.net/includes/footer.inc");
die();
}
$result=mysql_query("SELECT * FROM home_polls WHERE datype='1' AND poll_ID='$pID'") or die(mysql_error());
if (mysql_num_rows($result)==0){$IP=1;}
else {
while ($row=mysql_fetch_array($result)){
if ($row[part]==$REMOTE_ADDR){$IP=0; break;}
else {$IP=1;}
}
}
if ($IP==1){
$result=mysql_query("INSERT INTO home_polls (poll_ID, datype, val, part) values('$pID', '1', '$vote', '$REMOTE_ADDR')");
$result=mysql_query("SELECT val FROM home_polls WHERE part='$vote' AND datype='0' AND poll_ID='$pID'");
$data=mysql_fetch_array($result);
$newdata=$data[val]+1;
$result=mysql_query("UPDATE home_polls SET val='$newdata' WHERE part='$vote' AND datype='0' AND poll_ID='$pID'") or die(mysql_error());
}
else {
$inclimg="/images/error.jpg";
$incl="It apears as though you have already voted on this poll! You are only allowed to vote once.";
include("/home/marco/web/marco.luethy.net/includes/polls.inc");
}
}
#Get Total votes!
$counter=0;
while ($counter<=$parts){
$result=mysql_query("SELECT val FROM home_polls WHERE part='$counter' AND datype='0' AND poll_ID='$pID'");
$data=mysql_fetch_array($result);
$num=(int)($num+$data[val]);
$counter++;
}
$inclimg="/images/apollforfunhr.jpg";
# Print graph!
$counter=0;
$incl="
$poll_name | |||
$poll_quest | |||
$part[$counter] | $data[val] | $vote_val | |
Poll is out of $num votes. |
include("/home/marco/web/marco.luethy.net/includes/polls.inc");
include("/home/marco/web/marco.luethy.net/includes/footer.inc");
}
else {
if ($pmode=="include"){
include("/home/marco/web/marco.luethy.net/php-bin/polls/$pID.inc");
print "