mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   FactorDB (https://www.mersenneforum.org/forumdisplay.php?f=94)
-   -   Automatically updating factordb (https://www.mersenneforum.org/showthread.php?t=16658)

chris2be8 2012-03-26 19:15

Automatically updating factordb
 
Hello,

I'm using SNFS to factor some of the smaller composites in factordb. I'm using code copied from firejuggler's yafu.pl script from [url]http://mersenneforum.org/showthread.php?t=16359&page=3[/url] post 65. But it only seems to work about half the time.

An example failure is when I generate the url:
http://factorization.ath.cx/report.php?report=(10^110*4513+883)/9985751%3D67180229841217849970082301271*672733594449015022926507086465812106323889333502525331018102445134797068313923

I can't see any difference between requests that work and those that fail. Should I update my script to try again a few times if the update fails? Or is there a more robust technique?

Chris K

RichD 2012-03-28 02:52

I ran into a length problem so I changed it to two inquiries. Given your example I would fetch the internal ID first by:

[CODE]http://factordb.com/index.php?query=%2810%5E110*4513+883%29%2F9985751[/CODE]

Parse the html source to get the ID of the form 1100000000456380365 (19-digit) number then report a single factor with wget.

[CODE]wget -q -O /dev/null --post-data="report=67180229841217849970082301271&format=0" http://factordb.com/index.php?id=1100000000456380365[/CODE]

The remaining factor will be computed by the DB. No need to send it.

This may not be the best way to report it but it works for me.

VolMike 2012-03-29 10:27

1 Attachment(s)
[QUOTE=chris2be8;294302]Hello,

I'm using SNFS to factor some of the smaller composites in factordb. I'm using code copied from firejuggler's yafu.pl script from [url]http://mersenneforum.org/showthread.php?t=16359&page=3[/url] post 65. But it only seems to work about half the time.

An example failure is when I generate the url:
http://factorization.ath.cx/report.php?report=(10^110*4513+883)/9985751%3D67180229841217849970082301271*672733594449015022926507086465812106323889333502525331018102445134797068313923

I can't see any difference between requests that work and those that fail. Should I update my script to try again a few times if the update fails? Or is there a more robust technique?

Chris K[/QUOTE]

Some string patterns of [B]factorization number[/B] should be replaced for compatability with factrodb.com requests syntax. Replacement rules are shown below in "a" -> "b" form:

[CODE]
"%" -> "%25"
"!" -> "%21"
"+" -> "%2B"
"(" -> "%28"
")" -> "%29"
"/" -> "%2F"
"^" -> "%5E"
"#" -> "%23"

[/CODE]

These patterns have been found by me due the experiments with url requests.

The attach below is modified version of yoyo perl script ([URL="http://www.rechenkraft.net/wiki/index.php?title=Benutzer_Diskussion:Yoyo/factordb"]http://www.rechenkraft.net/wiki/index.php?title=Benutzer_Diskussion:Yoyo/factordb[/URL]), which is used to factor numbers from input file by yafu and post results to factordb. This script can handle numbers with any patterns shown above. You need yafu binary and yafu.in with numbers in the same folder with attach.
[ATTACH]7835[/ATTACH]

chris2be8 2012-03-29 18:48

Thanks VolMike, that looks to have fixed it. 5 results so far after adding it to my script, all OK.

I've also got code to write an error report if I don't get either a "Factor added" or "Factor already known" in the response. That will catch other issues such as my internet connection failing.

Chris K

Dubslow 2012-03-29 19:35

[QUOTE=VolMike;294629]
These patterns have been found by me due the experiments with url requests.
[/QUOTE]

HTTP requests are limited to the ASCII character set, and characters with special meaning must also be encoded.

[url]http://www.blooberry.com/indexdot/html/topics/urlencoding.htm[/url]

chris2be8 2012-03-31 16:23

I've had another look, now I know what to look for I can see that it didn't like a + in the url. Every attempt with a + in it failed, all but 1 of the rest worked (I think the exception was the router rebooting itself at the wrong moment). With the + encoded they all work.

Chris

RichD 2012-03-31 18:20

Sorry, that was my mistake above for misleading you with the + sign.

Thanks to VolMike for pointing that out - and the other symbols.

I've been doing some work with OPN and it never has a plus sign in any of the expressions.
(Now back to correcting my program should one day I need it for a + sign.)

chris2be8 2012-05-01 17:27

Does anyone have any perl code I could "borrow" to query factordb to see if a given number is factored? I'm finding quite a lot of the small composites I'm working on have been factored by someone else when I submit the factors. A check just before I start work should save wasted effort.

I could probably write some myself, but it will take time I'm short of.

Chris

Stargate38 2012-05-01 18:39

Any number <65 digits is automatically factored by the DB.

yoyo 2012-05-03 10:20

[QUOTE=chris2be8;298106]Does anyone have any perl code I could "borrow" to query factordb to see if a given number is factored? I'm finding quite a lot of the small composites I'm working on have been factored by someone else when I submit the factors. A check just before I start work should save wasted effort.

I could probably write some myself, but it will take time I'm short of.

Chris[/QUOTE]

Start with this [url]http://www.rechenkraft.net/wiki/index.php?title=Benutzer_Diskussion:Yoyo/factordb#yafu.pl[/url]. It fetches a small composite from factorDB, runs yafu with it and reports it back. This and the randomness which is used should avoid that you waste to much effort.

yoyo


All times are UTC. The time now is 08:16.

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