It is currently Fri Aug 29, 2014 12:40 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Remote Folding Status Servlet
PostPosted: Wed Apr 30, 2003 10:11 am 
Offline

Joined: Fri Mar 14, 2003 1:31 pm
Posts: 108
Location: Denton, TX
Is there any way for the folding client to pass information to other programs? I'm running Apache Tomcat and would like to create a servlet that would let me see my folding progress on the web so I can track it when I'm not at home.

If anybody wants to collaborate on this, let me know. I'll probably be doing some brainstorming on it for the next few days.

_________________
Silence is Gouldin.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 30, 2003 12:27 pm 
Offline

Joined: Tue Apr 08, 2003 8:43 am
Posts: 221
you can always have a webpage up with the logfile and WU data file (they're just text files) refreshing every 30seconds or so. that should be good.

EM accesses data in the same sort of way.

_________________
Image

http://www.riffst3r.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 30, 2003 12:47 pm 
Offline

Joined: Fri Mar 14, 2003 1:31 pm
Posts: 108
Location: Denton, TX
That should work great! I can use Java file IO to test the modified date of the log and refresh its data when the log refreshes.

The only problem I can see coming up is if my servlet is trying to access the log at the same time it's being written ...

But that shouldn't happen very often if at all.

_________________
Silence is Gouldin.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2003 8:29 am 
Offline

Joined: Fri Mar 14, 2003 1:31 pm
Posts: 108
Location: Denton, TX
Update: I wrote a simple JSP to put the contents of the log on a web page. As soon as I ran it the first time, I couldn't finish any more frames in my FAH Console. Processor usage was still 100%, but the darn thing ran for 50 minutes without finishing a frame. I ran the graphical client to see if anything would be different there, and it locked up my machine. Upon rebooting everything seems to work.

I'm betting my problem is the one I mentioned earlier with 2 programs trying to access the file at the same time.

I'll probably make a temporary copy of the file when the JSP is accessed instead of opening the original log. Any other ideas/suggestions?

_________________
Silence is Gouldin.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2003 9:32 am 
Offline
*Lifetime Patron*

Joined: Sun Mar 09, 2003 12:27 pm
Posts: 1465
Location: Reading.England.EU
Did you see Electron Microscope seems to have a last page of options that seem to build a complete web page? And/or will even act as a web server? Haven't tried it myself.

_________________
2009/Oct: Jetway JNC81-LF * 4850e naked under fanless Xigmatek Apache * Antec mini Skeleton w/Nexus 120mm PWM fan * Delta 90W brick w/Skeleton DC-DC board * WD2500BEVT 250Gb blue


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2003 9:43 am 
Offline

Joined: Fri Mar 14, 2003 1:31 pm
Posts: 108
Location: Denton, TX
I haven't looked at it. Creating a webpage would be nice ... I don't want it to run as a webserver because Tomcat is already taking port 80. Thanks for the tip!

PS - I got my JSP to work. Here's the code for anybody who's interested:

Edited to reflect FAHlog.txt:
Code:
<%@ page language="java" import="java.io.*" %>
<HTML>
<HEAD>
<TITLE>Folding@Home Status</TITLE>
</HEAD>
<BODY>
<FONT FACE="Courier New" Size="-1">
<%
Runtime.getRuntime().exec("cmd /c copy \"C:\\Program Files\\Folding@Home\\FAHlog.txt\" \"C:\\Program Files\\Folding@Home\\templog.txt\"").waitFor();
File logFile = new File("C:\\Program Files\\Folding@Home\\templog.txt");
String tempStr = "  ";
try {
  BufferedReader in = new BufferedReader(new FileReader(logFile));
  while (tempStr != null){
    out.println(tempStr + "<BR>");
    tempStr = in.readLine();
  }
} catch (IOException e) {
}
logFile.delete();
%>
</FONT>
</BODY>
</HTML>


Really simple ... just displays the contents of the log file.

_________________
Silence is Gouldin.


Last edited by dgouldin on Thu May 01, 2003 1:55 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2003 1:34 pm 
Offline
Patron of SPCR

Joined: Thu Apr 10, 2003 1:56 am
Posts: 316
Erm, I hate to say this to you but the filename of the logfile changes with every WU. :) FAH has a queue for 10 workunits, dunno why but it's there (in the graphical version, right-click on the icon, ->status->queue info). The 03 in the logfile's filename is slot# in the queue, it can range from 00 to 09.
You can use the FAHlog.txt file, perhaps your locking problem is gone then as well.

_________________
XP 2800@2270mhz+SLK800A+Nexus fan, Aopen 8RDA+@414mhz, Samsung 80gb on foam, XFX6800GT with a Nexus 120mm fan taped onto it, Nexus 4090 PSU, Chieftec Dragon+Nexus fan@1200rpm


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2003 1:41 pm 
Offline

Joined: Fri Mar 14, 2003 1:31 pm
Posts: 108
Location: Denton, TX
Thanks for the heads up. That file has a lot more information I can do cool stuff with. It will have the same copy problem, but I'm not worried about that. I'll develop it over the next few days and let you guys know what I come up with.

Even if there is something already in Electron Microscope, using it wouldn't be nearly as much fun as this is. (aren't I a nerd?) :D

_________________
Silence is Gouldin.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 01, 2003 1:47 pm 
Offline
Patron of SPCR

Joined: Thu Apr 10, 2003 1:56 am
Posts: 316
dgouldin wrote:
Even if there is something already in Electron Microscope, using it wouldn't be nearly as much fun as this is. (aren't I a nerd?) :D


That's like buying a Dell! :mrgreen:

You may find the unitinfo.txt file useful too.

_________________
XP 2800@2270mhz+SLK800A+Nexus fan, Aopen 8RDA+@414mhz, Samsung 80gb on foam, XFX6800GT with a Nexus 120mm fan taped onto it, Nexus 4090 PSU, Chieftec Dragon+Nexus fan@1200rpm


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group