![]() |
Requests?
We have some free time to work on the forum, so are there any requests?
We cannot promise that requests will be implemented, but they will be looked into. :mike: |
Factor the post counts!
:ttu: |
[QUOTE=Mark Rose;427438]Factor the post counts![/QUOTE]We wrote a (really ugly) routine that does this but it is too server-intensive.
Because we don't store the results, each post is calculated over and over. Every post on the page generates a new shell_exec() call, which is just the beginning of our convoluted scheme. Is there anything less taxing you'd like to see? :mike: |
I hope the maximum post count hasn't exceeded 10k yet for any user on this forum? In that case you can just generate a pre-computed look-up table (array) php file with hard coded factors for all integers upto 10k. No need to make sys-call or anything, just attach that as header file.
My 2 cents. :smile: |
Make the year show as 4 digits.
15 Jan 14 is ambiguous, is it 2014 or 2015? [size=1]Or was it when Jesus was a teenager?[/size] |
Some threads get very long. If someone points me to a thread with 200 pages
I am not even going to try to find the interesting parts. What if each thread had a shared posting all pages of the thread displayed. The originator of the thread could put conclusions in the shared posting. For some threads, like "strategic double checks" the shared page could remind people to reserve the exponents they should work on. For the benchmark thread, the shared post could give the rules for the thread. |
[QUOTE=Xyzzy;427929]We wrote a (really ugly) routine that does this but it is too server-intensive.
Because we don't store the results, each post is calculated over and over. Every post on the page generates a new shell_exec() call, which is just the beginning of our convoluted scheme. Is there anything less taxing you'd like to see? :mike:[/QUOTE] I guess shell_exec("factor $postcount"); is a bit slow with all the process forks. I tested the performance: [code]<?php $loops = 1000; $begin = microtime(true); for ($i = 0; $i < $loops; $i++) shell_exec("factor 12345"); $time_taken = microtime(true) - $begin; $time_per_loop = $time_taken / $loops; echo "It took $time_taken seconds to call factor $loops times. Time per loop was $time_per_loop seconds.\n";[/code] It took 1.2856957912445 seconds to call factor 1000 times. Time per loop was 0.0012856957912445 seconds. 1.3 ms per post count is a lot of overhead, I agree. |
[QUOTE=retina;428011]Make the year show as 4 digits.[/QUOTE]:tu:
|
[QUOTE=ramshanker;428009]In that case you can just generate a pre-computed look-up table (array) php file with hard coded factors for all integers upto 10k. No need to make sys-call or anything, just attach that as header file.[/QUOTE]That is an interesting idea. Could you show us an example bit of code?
:mike: |
[QUOTE=Xyzzy;428025]That is an interesting idea. Could you show us an example bit of code?
:mike:[/QUOTE] For numbers smaller than 10000, trial division is an entirely acceptable method of factoring. Are you saying you don't know how to do trial division in PHP? |
[QUOTE=Xyzzy;428024][QUOTE=retina;428011]Make the year show as 4 digits.[/QUOTE]:tu:[/QUOTE]:retina:
|
| All times are UTC. The time now is 13:31. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.