mersenneforum.org New online applet for factorization
 Register FAQ Search Today's Posts Mark Forums Read

2011-02-25, 02:31   #34
kar_bon

Mar 2006
Germany

13·227 Posts

Quote:
 Originally Posted by kar_bon Other idea: - reading first the page which expos without any factor - run any of those
Here's that sort of script:

- Download this 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
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).

Last fiddled with by kar_bon on 2011-02-25 at 02:36

2011-02-25, 07:33   #35
Uncwilly
6809 > 6502

"""""""""""""""""""
Aug 2003
101×103 Posts

244158 Posts

Quote:
 Originally Posted by ET_ Finally, I'm trying to implement links that allow automatization of simple tasks (like run some TF) on smallest/biggest factored/unfactored exponents.
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.

2011-02-25, 10:07   #36
ET_
Banned

"Luigi"
Aug 2002
Team Italia

22·7·173 Posts

Quote:
 Originally Posted by Uncwilly 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.
Of course, that makes sense!

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

Luigi

Last fiddled with by ET_ on 2011-02-25 at 10:07

2011-02-25, 14:27   #37
ET_
Banned

"Luigi"
Aug 2002
Team Italia

113548 Posts

Quote:
 Originally Posted by ET_ Of course, that makes sense! You should have those links by the end of this week. Luigi
It seems that my page is having more success than expected...

I'm getting too many 500 Internal Server Error, 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...

Sorry for the inconvenience.

Luigi

Last fiddled with by ET_ on 2011-02-25 at 14:37

2011-02-25, 14:54   #38
Rodrigo

Jun 2010
Pennsylvania

23·32·13 Posts

Quote:
 Originally Posted by ET_ It seems that my page is having more success than expected... I'm getting too many 500 Internal Server Error, 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... Sorry for the inconvenience. Luigi
Ain't me (yet)! But I will keep your request in mind as I work on the script.

Rodrigo

Last fiddled with by Rodrigo on 2011-02-25 at 14:55

 2011-02-28, 21:35 #39 Rodrigo     Jun 2010 Pennsylvania 23×32×13 Posts 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
2011-02-28, 23:22   #40
kar_bon

Mar 2006
Germany

B8716 Posts

Quote:
 Originally Posted by Rodrigo 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:
 Originally Posted by Rodrigo 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.
Perhaps the extension 'bat' was not assiciated properly to the cmd-command.

Quote:
 Originally Posted by Rodrigo 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 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:
 Originally Posted by Rodrigo 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.
Under Win 98 all should work fine but not the command "findstr".
Code:
find "Factor found :" results.txt >>factors.txt
Another point: the line with "echo.>>factors.txt" can/should be deleted.

2011-02-28, 23:34   #41
Uncwilly
6809 > 6502

"""""""""""""""""""
Aug 2003
101×103 Posts

1050910 Posts

Quote:
 Originally Posted by Rodrigo 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 version on wget attached above is not for the older DOS, there is a version that should run, check here:

And for DOS gawk, check here:
http://www.gnu.org/software/gawk/man...C-Installation

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.

2011-03-01, 00:09   #42
Rodrigo

Jun 2010
Pennsylvania

23×32×13 Posts

Quote:
 Originally Posted by kar_bon 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.
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:
 Originally Posted by kar_bon Under Win 98 all should work fine but not the command "findstr". Instead you can use find "Factor found :" results.txt >>factors.txt
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. 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

2011-03-01, 00:15   #43
kar_bon

Mar 2006
Germany

295110 Posts

Quote:
 Originally Posted by Rodrigo 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.
Comment out the first line with "REM @echo off". This will now show any output of the batch, good for testing.

2011-03-01, 00:31   #44
Rodrigo

Jun 2010
Pennsylvania

23·32·13 Posts

Quote:
 Originally Posted by Uncwilly The version on wget attached above is not for the older DOS, there is a version that should run, check here: http://wget.addictivecode.org/Freque...t=Faq#download And for DOS gawk, check here: http://www.gnu.org/software/gawk/man...C-Installation 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.
Thanks, Uncwilly.

The link to WGET for DOS didn't work for me ("Explorer cannot display the page"). But I did find this: http://www.rahul.net/dkaufman/. 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! 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

 Similar Threads Thread Thread Starter Forum Replies Last Post a1call Programming 19 2019-11-08 22:31 alpertron Factoring 87 2014-11-21 21:23 alpertron Programming 2 2013-03-19 11:28 3.14159 Miscellaneous Math 7 2010-06-01 01:29 alpertron Factoring 14 2006-01-01 04:00

All times are UTC. The time now is 20:46.

Mon May 16 20:46:54 UTC 2022 up 32 days, 18:48, 2 users, load averages: 2.66, 2.12, 1.83