mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Lone Mersenne Hunters (https://www.mersenneforum.org/forumdisplay.php?f=12)
-   -   New online applet for factorization (https://www.mersenneforum.org/showthread.php?t=15294)

kar_bon 2011-02-25 02:31

[QUOTE=kar_bon;253609]Other idea:
- reading first the page which expos without any factor
- run any of those[/QUOTE]

Here's that sort of script:

- Download [url=www.rieselprime.de/dl/GIMPS_IT.zip]this[/url] zip-file containing all scripts and programs (and the script from above, too)

- unzip the file in an empty folder
- run "do.bat"

Explanations:
- the script first downloads the page with all exponents and factors found so far
- it creates a file called "expo.txt" with all exponents without a factor
- from this list another temporary batch called "gimpsget.bat" is created to test one of those exponents (by random or one after each other)
- the result (factor found or not) is written in "results.txt"
- after 100 attempts, the exponents-page is downloaded again, to be sure, only expos w/o factors are searched
- found factors are then collected in "factors.txt" and "results.txt" is deleted

[code]
@echo off

:begin
set /a n=1
if not exist results.txt goto begin1
findstr /c:"Factor found :" results.txt >>factors.txt
echo.>>factors.txt
del results.txt

:begin1
wget -O gimps.txt "http://www.moregimps.it/mersenne-test/"
gawk -f get_expo.awk gimps.txt >expo.txt

:next
if exist expo_neu.txt del expo_neu.txt
gawk -f make.awk -v random=1 expo.txt
del expo.txt
ren expo_neu.txt expo.txt

echo.>>results.txt
call gimpsget.bat
copy results.txt+in.txt results.txt >nul
del in.txt
set /a n=%n%+1
if %n% GTR 100 goto begin

goto next
[/code]

I've just found the factor 110648174743660201 of exponent #683 = 4294981591 with this script.

Set "random=0" to go through the whole list from top to down.
Doing this, the counter for 'n' should be set higher than 100 (see line "if %n% GTR 100 goto begin" at the end),
otherwise only first 100 expos will tested (currently should be 877 or more).

PS: I think, the DOS-command "findstr" is not available in V6.20 so please check first.

The currently tested expo-no is shown only in the DOS-BOX title because all outputs are disabled during testing (echo off).

Uncwilly 2011-02-25 07:33

[QUOTE=ET_;253581]Finally, I'm trying to implement links that allow automatization of simple tasks (like run some TF) on smallest/biggest factored/unfactored exponents.[/QUOTE]

Can you also allow a sort of k from smallest to lowest? That way it would be easier to request the lowest k's that have have no factor.

ET_ 2011-02-25 10:07

[QUOTE=Uncwilly;253660]Can you also allow a sort of k from smallest to lowest? That way it would be easier to request the lowest k's that have have no factor.[/QUOTE]

Of course, that makes sense! :smile:

You should have those links by the end of this week.

Luigi

ET_ 2011-02-25 14:27

[QUOTE=ET_;253672]Of course, that makes sense! :smile:

You should have those links by the end of this week.

Luigi[/QUOTE]

It seems that my page is having more success than expected... :smile:

I'm getting too many [COLOR="Red"]500 Internal Server Error[/COLOR], so I will lower the k request from 500,000 to 400,000 tonight, and see if the problem goes away.

Meanwhile, I'd appreciate if you put a sleep call in your scripts to avoid web server clobbering... :smile:

Sorry for the inconvenience.

Luigi

Rodrigo 2011-02-25 14:54

[QUOTE=ET_;253692]It seems that my page is having more success than expected... :smile:

I'm getting too many [COLOR=red]500 Internal Server Error[/COLOR], so I will lower the k request from 500,000 to 400,000 tonight, and see if the problem goes away.

Meanwhile, I'd appreciate if you put a sleep call in your scripts to avoid web server clobbering... :smile:

Sorry for the inconvenience.

Luigi[/QUOTE]
Ain't me (yet)! But I will keep your request in mind as I work on the script. :smile:

Rodrigo

Rodrigo 2011-02-28 21:35

Update
 
OK, I’ve done some experimenting with these batch files, and here’s what I have so far.

In Windows Vista, they work to perfection from Start – Run. DO.BAT also works if I double-click on it from Windows Explorer. It opens a DOS window and does its thing. RUNGIMPS.BAT (by itself) will also run, but it doesn’t seem to accomplish anything since from that route there is no way to tell it which exponent to test.

At first, neither of the batch files would work if I opened a DOS window first and then tried to launch them from there. For example, in these circumstances DO.BAT was returning an error saying that, “’do’ is not recognized as an internal or external command, operable program or batch file” (!). But today both batch files are working properly if I open a DOS window first.

The real test, though, is on the Windows for Workgroups 3.11/DOS 6.20 computer, which is the one that I’m trying to add to the project. I haven’t been able to get either of the batch files to work there. They both return a whole mess of error messages, no matter how I try to launch them. The most serious error appears to be that, “This program cannot be run in DOS mode.” This happens whether I click on the batch file through File Manager, open a DOS prompt, or use Run.

The next step will be to try these files on one of my Windows 98 systems. Windows 98 is of course at an intermediate stage between Windows 3.11 and Vista, so I'm curious to see how well it handles these batch files.

When I get the chance to (hopefully, later today) I will try a couple of ideas I’ve come up with to see if they solve (or work around) this issue. Suggestions are, of course, welcome!

Rodrigo

kar_bon 2011-02-28 23:22

[QUOTE=Rodrigo;254002]RUNGIMPS.BAT (by itself) will also run, but it doesn’t seem to accomplish anything since from that route there is no way to tell it which exponent to test.

RUNGIMPS.BAT needs a parameter "%1" so calling "RUNGIMPS.BAT 1" will test cand. No.1.

Creating a shortcut on your desktop, you can add this param. at the target.
Doubleclick should work now.
[/quote]

[QUOTE=Rodrigo;254002]
At first, neither of the batch files would work if I opened a DOS window first and then tried to launch them from there. For example, in these circumstances DO.BAT was returning an error saying that, “’do’ is not recognized as an internal or external command, operable program or batch file” (!). But today both batch files are working properly if I open a DOS window first.
[/quote]

Perhaps the extension 'bat' was not assiciated properly to the cmd-command.

[QUOTE=Rodrigo;254002]
The real test, though, is on the Windows for Workgroups 3.11/DOS 6.20 computer, which is the one that I’m trying to add to the project. I haven’t been able to get either of the batch files to work there. They both return a whole mess of error messages, no matter how I try to launch them. The most serious error appears to be that, “This program cannot be run in DOS mode.” This happens whether I click on the batch file through File Manager, open a DOS prompt, or use Run.
[/quote]

The two used programs (wget and gawk) seems not working for those old WfW.
I have no chance to make this working here! So sorry for this task.

[QUOTE=Rodrigo;254002]
The next step will be to try these files on one of my Windows 98 systems. Windows 98 is of course at an intermediate stage between Windows 3.11 and Vista, so I'm curious to see how well it handles these batch files.
[/QUOTE]

Under Win 98 all should work fine but not the command "findstr".
Instead you can use
[code]
find "Factor found :" results.txt >>factors.txt
[/code]

Another point: the line with "echo.>>factors.txt" can/should be deleted.

Uncwilly 2011-02-28 23:34

[QUOTE=Rodrigo;254002]The real test, though, is on the Windows for Workgroups 3.11/DOS 6.20 computer, which is the one that I’m trying to add to the project. I haven’t been able to get either of the batch files to work there. They both return a whole mess of error messages, no matter how I try to launch them. The most serious error appears to be that, “This program cannot be run in DOS mode.” This happens whether I click on the batch file through File Manager, open a DOS prompt, or use Run.[/QUOTE]The version on wget attached above is not for the older DOS, there is a version that should run, check here:
[url]http://wget.addictivecode.org/FrequentlyAskedQuestions?action=show&redirect=Faq#download[/url]

And for DOS gawk, check here:
[url]http://www.gnu.org/software/gawk/manual/gawk.html#PC-Installation[/url]

I have taken to manually fetching the status page and then sorting it in Excel. Then I paste the expos that I want into the expo.txt file. I modified the do.bat to just loop the selected expos in order.

Rodrigo 2011-03-01 00:09

[QUOTE=kar_bon;254013]
The two used programs (wget and gawk) seems not working for those old WfW.
I have no chance to make this working here! So sorry for this task.
[/QUOTE]
Not a problem, kar_bon. Thank you for trying. And, in addition to the factoring work that my Vista did with these programs during testing, it looks like other folks have adopted the batch file for their own use with the project. So your efforts were not in vain.

[QUOTE=kar_bon;254013]Under Win 98 all should work fine but not the command "findstr".
Instead you can use
find "Factor found :" results.txt >>factors.txt
[/QUOTE]
I will try that. When launching DO.BAT in Win98, the results were stranger than in WFWG. The DOS window opened and the program appeared to start working, but unlike in Vista, there was no visible output after the first line or two, and all it showed was a blinking cursor. Then entering CTRL-C did not stop the program -- got an error message saying that I could not close the program from Windows. The Pause key didn't work, either. Used Task Manager to close the application, but I could still hear the PC churning afterward. :confused: Ended up having to shut down completely.

By coincidence, the MOREGIMPS.IT server may also have been down just at the time when I tried these batch files, and that may have influenced the results. (Going to the page via IE8 in Vista was yielding an "Internal Server Error" message.)

But Win98 was just an experiment for our purposes. I'll look into MS-DOS versions of GAWK.EXE and WGET.EXE.

Thanks again!

Rodrigo

kar_bon 2011-03-01 00:15

[QUOTE=Rodrigo;254016]The DOS window opened and the program appeared to start working, but unlike in Vista, there was no visible output after the first line or two, and all it showed was a blinking cursor.[/QUOTE]

Comment out the first line with "REM @echo off". This will now show any output of the batch, good for testing.

Rodrigo 2011-03-01 00:31

[QUOTE=Uncwilly;254014]The version on wget attached above is not for the older DOS, there is a version that should run, check here:
[URL]http://wget.addictivecode.org/FrequentlyAskedQuestions?action=show&redirect=Faq#download[/URL]

And for DOS gawk, check here:
[URL]http://www.gnu.org/software/gawk/manual/gawk.html#PC-Installation[/URL]

I have taken to manually fetching the status page and then sorting it in Excel. Then I paste the expos that I want into the expo.txt file. I modified the do.bat to just loop the selected expos in order.[/QUOTE]
Thanks, Uncwilly.

The link to WGET for DOS didn't work for me ("Explorer cannot display the page"). But I did find this: [URL]http://www.rahul.net/dkaufman/[/URL]. Do a search on that page for "wget 1.8.2", it's about halfway down. What do you think?

Will also look into GAWK for DOS. This is taking me back 20 years! :smile: It could end up being a lot of fun, or highly frustrating. Hopefully it'll be like what they say for riding a bicycle, that you never forget and it comes back to you...

Rodrigo


All times are UTC. The time now is 13:17.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.