![]() |
|
|
#111 |
|
"Mark"
Apr 2003
Between here and the
11000110100102 Posts |
|
|
|
|
|
|
#112 |
|
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
102538 Posts |
I modified HTMLGenerator.cpp to make it so if you load /all.html or / it will put out all the info from all the pages, in this order:
Code:
PrimesByUser(theSocket);
theSocket->Send("<br>");
UserStats(theSocket);
theSocket->Send("<br>");
PendingTests(theSocket);
theSocket->Send("<br>");
ServerStats(theSocket);
I'd suggest implementing this. (of course with any modifications you think would improve it, e.g. reordering the info)I tried it out with 3.2.0 and it works just fine (with the PrimesByUser part commented out because it's crashing, but that's fixed in 3.2.1 so you can leave it in). It is attached. Why? Just so you can have all the info on one easy link. I've been using a page with a bunch of carefully-sized iframes, but then I realized that it'd be near-trivial to modify the PRPnet server to have a page with all the info in one spot.
Last fiddled with by Mini-Geek on 2010-03-02 at 23:31 |
|
|
|
|
|
#113 | |
|
"Mark"
Apr 2003
Between here and the
2×32×353 Posts |
Quote:
Here is the corrected PrimesByUser function: Code:
void HTMLGenerator::PrimesByUser(Socket *theSocket)
{
SQLStatement *sqlStatement;
int64_t longDate;
int32_t primeCount, showOnWebPage, hiddenCount;
char dtString[80], dateReported[20], prevUserID[201];
char candidatName[51], userID[201], clientID[201];
double decimalLength;
time_t theDate;
struct tm *theTM;
char *theSelect = "select UserID, ClientID, CandidateName, " \
" DateReported, DecimalLength, ShowOnWebPage " \
" from UserPrimes " \
"order by UserID, DecimalLength; ";
sqlStatement = new SQLStatement(ip_Log, ip_DBInterface);
sqlStatement->PrepareSelect(theSelect);
sqlStatement->BindSelectedColumn(userID, sizeof(userID));
sqlStatement->BindSelectedColumn(clientID, sizeof(clientID));
sqlStatement->BindSelectedColumn(candidatName, sizeof(candidatName));
sqlStatement->BindSelectedColumn(dateReported, sizeof(dateReported));
sqlStatement->BindSelectedColumn(&decimalLength);
sqlStatement->BindSelectedColumn(&showOnWebPage);
theSocket->StartBuffering();
if (!sqlStatement->FetchRow(false))
theSocket->Send("<p align=center>No primes found");
else
{
*prevUserID = 0;
hiddenCount = primeCount = 0;
do
{
if (strcmp(prevUserID, userID))
{
if (*prevUserID)
{
if (hiddenCount)
theSocket->Send("<tr><td align=center colspan=4>User %s has found %d prime%s, %d %s hidden</tr>",
prevUserID, primeCount, ((primeCount>1) ? "s" : ""), hiddenCount, ((hiddenCount>1) ? "are" : "is"));
else
theSocket->Send("<tr><td align=center colspan=4>User %s has found %d prime%s</tr>",
prevUserID, primeCount, ((primeCount>1) ? "s" : ""));
theSocket->Send("</table><p><p>");
}
theSocket->Send("<table frame=box align=center border=1>");
theSocket->Send("<tr><td align=center colspan=4>Primes and PRPS for User %s</tr>", userID);
theSocket->Send("<tr><td>Candidate<td>Client<td>Date Reported<td>Decimal Length</tr>");
strcpy(prevUserID, userID);
hiddenCount = primeCount = 0;
}
primeCount++;
if (showOnWebPage)
{
sscanf(dateReported, "%lld", &longDate);
theDate = longDate;
theTM = gmtime(&theDate);
strftime(dtString, sizeof(dtString), "%c", theTM);
theSocket->Send("<tr><td align=center>%s<td>%s<td>%s<td align=right>%.0lf</tr>",
candidatName, clientID, dtString, decimalLength);
}
else
hiddenCount++;
} while (sqlStatement->FetchRow(false));
if (hiddenCount)
theSocket->Send("<tr><td align=center colspan=4>User %s has found %d prime%s, %d %s hidden</tr>",
prevUserID, primeCount, ((primeCount>1) ? "s" : ""), hiddenCount, ((hiddenCount>1) ? "are" : "is"));
else
theSocket->Send("<tr><td align=center colspan=4>User %s has found %d prime%s</tr>",
prevUserID, primeCount, ((primeCount>1) ? "s" : ""));
theSocket->Send("</table>");
}
theSocket->SendBuffer();
delete sqlStatement;
}
Last fiddled with by rogue on 2010-03-03 at 00:45 |
|
|
|
|
|
|
#114 | |
|
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17·251 Posts |
Quote:
Code:
else if (!strcmp(thePage, "all.html") || !strlen(thePage))
{
theSocket->Send("<html><head><title>PRPNet %s Status - %s</title>", PRPNET_VERSION, is_HTMLTitle.c_str());
theSocket->Send("<link rel=\"icon\" type=\"image\/ico\" href=\"data:image\/ico;base64,AAABAAEAEBAQAAAABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD\/\/wD\/AAAA\/wD\/AP\/\/AAD\/\/\/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD\/\/wAA\/\/8AAP\/\/AAD\/\/wAAva8AAL1vAAC87wAAhCEAALWtAAC1rQAAhCEAAP\/\/AAD\/\/wAA\/\/8AAP\/\/AAD\/\/wAA\">");
theSocket->Send("</head><body>");
PrimesByUser(theSocket);
theSocket->Send("<br>");
UserStats(theSocket);
theSocket->Send("<br>");
PendingTests(theSocket);
theSocket->Send("<br>");
ServerStats(theSocket);
theSocket->Send("</body></html>");
}
I put your change into my file and it works. Last fiddled with by Mini-Geek on 2010-03-03 at 02:34 |
|
|
|
|
|
|
#115 |
|
"Mark"
Apr 2003
Between here and the
2·32·353 Posts |
|
|
|
|
|
|
#116 | |
|
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17·251 Posts |
Quote:
I hadn't noticed such a warning, but looking back on the build log I see this repeated several times: .\HTMLGenerator.cpp(50) : warning C4129: '/' : unrecognized character escape sequence I know that it still lets the compile finish (naturally, as it is only a warning) and it sends the right thing to the browser, and the browser reads it correctly. I don't recall exactly why I originally thought forward slashes needed to be escaped, but perhaps it had something to do with "//" being present in the base64 encoding of the image and also the code to mark a comment. I'll see if they're needed at all... Nope. Works just fine as plain old "/" without any escaping, and it's smart enough to see that it's not saying "from here to the end is a comment". And encoding the icon as a gif instead of an ico makes it a great deal smaller, while still working the same. So this line works: Code:
theSocket->Send("<link rel=\"icon\" type=\"image/gif\" href=\"data:image/gif;base64,R0lGODlhEAAQAIABAAAAAP///yH5BAEAAAEALAAAAAAQABAAQAIijI9pwBDtoJq0Wuue1rmjuFziSB7S2YRc6G1L5qoqWNZIAQA7\">");
|
|
|
|
|
|
|
#117 | |
|
"Mark"
Apr 2003
Between here and the
2×32×353 Posts |
Quote:
|
|
|
|
|
|
|
#118 |
|
"Mark"
Apr 2003
Between here and the
143228 Posts |
I have put an alpha for 3.2.1 here:
http://home.roadrunner.com/~mrodenki...pnet_3.2.1.zip I have not gone through any of the heavy duty testing for NPLB, but there are enough other improvements that people have been waiting for. Here is a summary of the changes: All executables:
Client only:
Server only:
I will change this to a beta as soon as I do the testing for NPLB. |
|
|
|
|
|
#119 |
|
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17×251 Posts |
(tested with resuming from 3.2.0 files)
The client no longer detects that base 16 work (I'm guessing it's like that for all power-of-2 bases, maybe even including base 2, but have not tested this) should be sent to LLR instead of PFGW. Because of this, I've reverted my clients to 3.2.0 for now. e.g. with this as the work_servername.in file: Code:
ABC $a*$b^$c+1 31347 16 200799 Last fiddled with by Mini-Geek on 2010-03-04 at 14:36 |
|
|
|
|
|
#120 | |
|
"Lennart"
Jun 2007
46016 Posts |
Quote:
Lennart EDIT: This is on both Linux and Windows. Last fiddled with by Lennart on 2010-03-04 at 15:14 |
|
|
|
|
|
|
#121 |
|
Account Deleted
"Tim Sorbera"
Aug 2006
San Antonio, TX USA
17·251 Posts |
history.txt says 3.2.1 was released Februrary 2011. I think you mean March 2010.
|
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PRPNet 5.4.3 Released | rogue | Software | 178 | 2021-06-24 11:56 |
| PSP goes prpnet | ltd | Prime Sierpinski Project | 86 | 2012-06-06 02:30 |
| PRPNet 4.0.0 Released | rogue | Software | 84 | 2011-11-16 21:20 |
| PRPNet 4.0.1 Released | Joe O | Sierpinski/Riesel Base 5 | 1 | 2010-10-22 20:11 |
| PRPNet released! | rogue | Conjectures 'R Us | 250 | 2009-12-27 21:29 |