Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 11-08-2005, 08:58 PM   #1
Foldin' For PCMech!
 
enhanced08's Avatar
 
Join Date: Jun 2003
Location: back home in McHenry MD
Posts: 1,657
Send a message via AIM to enhanced08 Send a message via MSN to enhanced08
General programming help... ideas

This isn't specific to any one language as of yet, but most likely it will be C++. I, and many others i'm sure, am having a problem with the folding@home program and would like to write a program to fix this problem.

BACKGROUND: When folding installs it requests a unique user ID from the Stanford servers and stores this ID in the registry. Each computer on running FAH has its own ID. In a place such as a school where machines are ghost rather than re-installing XP this causes a problem. When a machine is ghost to another you then have 2 machines with the same ID and also the same work unit. This throws things out of wack a little, the points get messed up and you endup not helping the cause at all. After time and many many ghostings all the machines ahve the same ID and all look like 1 computer to Stanford and in turn only do the work of a single computer.

The simply solution is to delete the ID each time the system is ghost but this takes time and is a pain to do.
_________________

Here is my idea for a program to solve this. Make a program that will save the computer name to a text file then run each time the computer boots up. The program will then compare the current computer name to the one on file, if they match the program exits if they don't it deletes the ID from reg and restarts the folding client allowing it to download a new one from Stanford. My thinking is that when you ghost a computer one of the 2 computers has to have its name changed because you can't have 2 of the same name on one network, thus the name change would indicate the machine has been ghost.

Do I have the right idea? Is it possible to do? Would it work?
Remember that I am not very good at C++, I took C++ 1 and 2 in high school (10th grade i think it was) but thats the only time I have really messed with it.

thanks for the input!
enhanced08 is offline   Reply With Quote
Old 11-08-2005, 09:25 PM   #2
Come in Ray...
 
faulkner132's Avatar
 
Join Date: Sep 2004
Posts: 1,668
Yes it would work. I believe, however, the ID is stored in the config file, not the registry... this would make it even easier. The only problem would be accessing the files via the network, are you using EM to monitor the clients? If so, simply read the config file from your shares, otherwise you will either have to manually set up a share (which makes no sense) or have the share built into the image (probably not likely).

I'm not sure how you would restart a service on a remote computer. You could make a batch file and copy it to the target computer which restarts using the NET command, but actually getting the target to execute it would take some research (if you know how, I would love to know).

I would use VB, much easier and very well suited for "simple" tasks like this.
faulkner132 is offline   Reply With Quote
Old 11-08-2005, 10:13 PM   #3
Foldin' For PCMech!
 
enhanced08's Avatar
 
Join Date: Jun 2003
Location: back home in McHenry MD
Posts: 1,657
Send a message via AIM to enhanced08 Send a message via MSN to enhanced08
The UserID is actually stored in the reg (HKEY_LOCAL_MACHINE>SOFTWARE>PandeGroup>Folding@home>UserID) and is not the same as the UserName which is saved in the config file. This ID is different on every folding machine out there, or should be. It is what keep track of how many CPUs a user has among other bits of info if I remember right.

I'm not sure you understand what I'm looking at doing. I thought about doing a network program but that would just use more of the bandwidth and be slower. I want this program to be on each machine, in the FAH folder or something, and run on its own machine on bootup.

Here is an example of what it will do:
we have 2 computers, Computer A and Computer B. Both running FAH and the "UserID" program. Each with its own UserID saved in reg. The UserID program runs on each machine and saves its name to a txt file. Computer B gets a bad virus and it is decided to ghost Com. A onto Com. B rather than re-install of XP. We now have Computer A and Computer A(b) but this causes a problem because you can't have two computers with the same name on the same network so we change Com. A(b) to Com. C giving us Com. A and COm. C on the network. UserID program runs and notices the change in name on Com. C, stops the FAH service, deletes the UserID reg entry and restarts the FAH service which then downloads a new UserID.

Understand a little better? Sorry for the confussuion.
enhanced08 is offline   Reply With Quote
Old 11-08-2005, 10:37 PM   #4
Come in Ray...
 
faulkner132's Avatar
 
Join Date: Sep 2004
Posts: 1,668
Ah I see now.

Yes, this is easily done. VB (.NET would be best) will be quite well suited for this project as it has built in functions for getting registry and system variables. You could just set it as a startup program and use the NET STOP and NET START commands to handle your F@H service.
faulkner132 is offline   Reply With Quote
Old 11-08-2005, 11:27 PM   #5
Foldin' For PCMech!
 
enhanced08's Avatar
 
Join Date: Jun 2003
Location: back home in McHenry MD
Posts: 1,657
Send a message via AIM to enhanced08 Send a message via MSN to enhanced08
ok, I have a copy of MS Visual Studio 6.0 which is what I did my C++ with. It has VB in with it I think, could I use that? Also, I have never used VB before so could you link me to a good online tutorial?
enhanced08 is offline   Reply With Quote
Old 11-08-2005, 11:38 PM   #6
Come in Ray...
 
faulkner132's Avatar
 
Join Date: Sep 2004
Posts: 1,668
If you are more comfortable with C++, use that. Any MS product is going to be best for pulling MS OS variables. I haven't used VB6 in a while, but any problems I encountered I just googled "VB6 [insert problem]." What you are going to be doing is beyond a beginner's tutorial, so I would suggest just using C++ and "research" using the same method I did.

The MS online library will probably be your best resource: http://msdn.microsoft.com/library/
faulkner132 is offline   Reply With Quote
Old 11-08-2005, 11:42 PM   #7
Foldin' For PCMech!
 
enhanced08's Avatar
 
Join Date: Jun 2003
Location: back home in McHenry MD
Posts: 1,657
Send a message via AIM to enhanced08 Send a message via MSN to enhanced08
Ok, thanks for the help! I guess I'll be using C++ then, I had a C++ 1 and 2 class a few years ago in high school but other than that never messed with it too much. Never even touched VB. :\

I'll have to wait for my mom to ship me my computer so it will be awhile before I can even work on this, I'm just gathering info for now.
enhanced08 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:00 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2