tea.mathoverflow.net - Discussion Feed (Russell's paradoxon for MathJax) Sun, 04 Nov 2018 23:18:37 -0800 http://mathoverflow.tqft.net/ Lussumo Vanilla 1.1.9 & Feed Publisher Andrew Stacey comments on "Russell's paradoxon for MathJax" (12403) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12403#Comment_12403 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12403#Comment_12403 Fri, 07 Jan 2011 03:12:52 -0800 Andrew Stacey True, I was just pedantically pointing out minor details. I suspect that the chance of this being used as a weapon against MO is very slight.

What worries me more is the probability of someone copying over all their basic macros and making the site slow to an absolute crawl for the rest of us.

Another thing also just occurred to me about these definitions. Heading on over to faketestsite, I see that I'm not the only one to think of this: http://faketestsite.stackexchange.com/questions/151/let-me-test-mathjax. To save people the bother of clicking on the link, it appears that \newcommands are global. That means that the \newcommands on one part of the page will affect what happens in another. Since the order matters, and the order can change (it can even be different for different users as some will order the entries by date, some by reputation), this is potentially quite a serious issue.

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12402) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12402#Comment_12402 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12402#Comment_12402 Fri, 07 Jan 2011 02:31:42 -0800 Anton Geraschenko Yes, it would, but you'd have to earn enough rep to comment first.

]]>
Andrew Stacey comments on "Russell's paradoxon for MathJax" (12401) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12401#Comment_12401 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12401#Comment_12401 Fri, 07 Jan 2011 02:05:10 -0800 Andrew Stacey What if you put it in a comment on the original question? Wouldn't that appear above any answer?

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12400) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12400#Comment_12400 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12400#Comment_12400 Fri, 07 Jan 2011 01:22:33 -0800 Anton Geraschenko @Mariano: \renewcommand is implemented as an exact synonym of \newcommand, and \def is also basically a synonym, but with slightly different syntax. I don't think it's worth worrying about this too much until it occurs in the wild, at which point we'll probably be able to handle it by simply getting angry with the perpetrator. You can only cause trouble with \renewcommand if you can get your posts to appear above some worthwhile post. This is not something a troll can easily do, and certainly not something that can be done by a script.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12399) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12399#Comment_12399 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12399#Comment_12399 Thu, 06 Jan 2011 23:48:59 -0800 Mariano Allowing \renewcommand, for example, is just asking for trouble. See http://faketestsite.stackexchange.com/questions/151/let-me-test-mathjax I wonder if there is a sensible subset that could be allowed in public fora...

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12397) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12397#Comment_12397 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12397#Comment_12397 Thu, 06 Jan 2011 21:44:55 -0800 Anton Geraschenko The fix is now running on MO. You're welcome to go type $\newcommand{\x}{\x}\x$ in and see what happens (though you should clear your cache first, and it would really be better for you to run such experiments at faketestsite). I've brought MAXMACROS down from 10000 to a more conservative 50. If this ever turns out to be too small, we can make it bigger.

One thing that wasn't clear to me before was the meaning of MAXMACROS. It's the cap on the maximum number of macros that will be expanded in any given formula. So you might exceed the cap of 50 as follows:

$\newcommand{\Z}{\mathbb Z}
\newcommand{\Zp}{\Z/p\Z}$

Consider the 11-tuple of groups $(\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp,\Zp)$

Each \Zp results in five macro expansions:
one to convert \Zp in to \Z/p\Z,
two more to convert \Z/p\Z into \mathbb Z/p\mathbb Z, and
two more to conver \mathbb Z/p\mathbb Z into {\bbFont Z}/p{\bbFont Z}

The single formula with 11 instances of \Zp results in 55 macro expansions, so that formula breaks.

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12377) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12377#Comment_12377 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12377#Comment_12377 Tue, 04 Jan 2011 15:11:52 -0800 Anton Geraschenko Yes, they're tunable. I agree that 20 is probably a sufficiently big number for MAXMACROS.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12376) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12376#Comment_12376 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12376#Comment_12376 Tue, 04 Jan 2011 14:50:14 -0800 Mariano Are those tunable by sites? I am pretty sure that anything with 20 macro substitutions in an equation in MO is evil...

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12375) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12375#Comment_12375 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12375#Comment_12375 Tue, 04 Jan 2011 13:19:21 -0800 Anton Geraschenko Davide has implemented a limit on the number of macro substitutions and a limit on the size of the string after substitution:

MAXMACROS: 10000,    // maximum number of macro substitutions per equation
MAXBUFFER: 5*1024    // maximum size of TeX string to process

Faketestsite is currently running the branch with the fix, but MO is not. I invite you all to go experiment on Faketestsite to see if you can cause trouble of find unexpected behavior.

I've noted at the issue tracker one way to still cause a fair amount of trouble with \newcommand.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12267) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12267#Comment_12267 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12267#Comment_12267 Tue, 28 Dec 2010 09:25:54 -0800 Mariano A limit on stack length during expansion should not be that hard to implement, and would not impair essentially no sensible latex expression on MO.

(If we could limit the scope of definitions to an answer, for example, we could all start pasting our favorite latex prologue when writing an answer... :) )

]]>
Anton Geraschenko comments on "Russell's paradoxon for MathJax" (12266) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12266#Comment_12266 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12266#Comment_12266 Tue, 28 Dec 2010 09:22:31 -0800 Anton Geraschenko I've created an issue on the MathJax issue tracker. I'm not sure there's a good solution to this problem aside from simply disabling \newcommand and \def. This problem will also crash LaTeX (at least the implementation I have installed right now).

What is the scope of a definition? The whole html page?

I think it's everything on the page below where the definition is made.

]]>
Mariano comments on "Russell's paradoxon for MathJax" (12261) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12261#Comment_12261 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12261#Comment_12261 Tue, 28 Dec 2010 05:51:46 -0800 Mariano What is the scope of a definition? The whole html page?

]]>
darijgrinberg comments on "Russell's paradoxon for MathJax" (12260) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12260#Comment_12260 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12260#Comment_12260 Tue, 28 Dec 2010 05:33:51 -0800 darijgrinberg MathJax probably has never been developed with a forum in view... ]]> Kevin Buzzard comments on "Russell's paradoxon for MathJax" (12259) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12259#Comment_12259 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12259#Comment_12259 Tue, 28 Dec 2010 05:19:53 -0800 Kevin Buzzard darijgrinberg comments on "Russell's paradoxon for MathJax" (12258) http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12258#Comment_12258 http://mathoverflow.tqft.net/discussion/869/russells-paradoxon-for-mathjax/?Focus=12258#Comment_12258 Tue, 28 Dec 2010 05:00:55 -0800 darijgrinberg The bad thing: It works.
(A troll friend of mine used this to kill a chat channel which was running MathJax.) ]]>