Hot answers tagged

20

Enough! Enough! If you post any more answers here, we're going to run out of room in the database! Er, I mean, you've done a good job of presenting evidence, and have convinced us on the Community Team. As of about ten minutes ago, MathJax has been enabled for Code Review. Use it well!


14

Here is an example: $$ \newcommand{ptr}[1]{\overset{\mathtt{#1}}{\longrightarrow}} \begin{align*} &\mathtt{newNode} \\ &\quad\downarrow \\ \mathtt{head} \ptr{} \fbox{first} \ptr{next} &\fbox{another} \ptr{next} \mathtt{null} \\ ...


14

Based on Space Exploration SE's similar feature request, the SE devs would want to see a list of questions that can benefit from this feature. We may not use this feature a whole lot, but we at least need several good examples of posts that would benefit from this. Even then, they may not feel that it's a good fit for CR, but that's something they will ...


13

This seems to happen because of the above line having two $ in a row. static std::string TOKEN_LINEDUMP("$$ static std::string TOKEN_INDENTNEXT("$$>"); Removing the second $ on the first line causes it to be shown normal: static std::string TOKEN_LINEDUMP("$ static std::string TOKEN_INDENTNEXT("$$>"); Further investigation is needed.


13

The following sites support MathJax (there may be more I'm unaware of): Math Overflow Math Cross Validated Theoretical Computer Science Computer Science Computational Science Cryptography Signal Processing Physics Chemistry Biology Space Exploration If even Biology supports MathJax, then leaving MathJax disabled on Code Review looks more like an oversight ...


13

This answer to the Knight's Distance required taking a 'snip' screenshot to get the formula in. Screen-Shot Snip


12

In Optimizing unique partitions of integers, I just want to write the quadratic equation nicely. Having to resort to ASCII art to do so is just ridiculously frustrating! _________ -1 ± √ 1 + 8 n x = ————————————————— max 2 Have I mentioned the mad keyboard skills necessary to type symbols ± √ —? The lazy workaround ...


9

We rely on external scripts for everything. Seriously - if you block all 3rd-party scripts, just about every page on the site will error out and you'll be stuck using the script-free fallbacks, at least where they exist. I'm not gonna judge you if you want to block 3rd-party scripts. That's a personal decision, and if you're satisfied you have good reason ...


9

I think it could be worth mentioning that http://yuml.me/diagram/scruffy/class/draw can be a nice picture-based alternative to the almighty MathJax, for perhaps simpler diagrams: [Customer]<>-orders*>[Order] [Order]++-0..*>[LineItem] [Order]-[note:Aggregate root.]


8

This answer could have been a lot less awkward if proper mathematical notation were a reasonable option. You should find an algorithm finding the root square of 1 module n. x^2 = 1 mod n To do that: Factorize n in prime factor. n = p1^e1 * p2^e2 * ... * pk^ek Find the root for all prime xi^2 = 1 mod pi^ei. easy, it is 1 and -1 (or pi - 1) ...


8

Here's an answer that would have been a lot easier to write if MathJax had been available: Is there any more optimal way to solve this idempotent equation? So if n can be factored as p1e1 . p2e2 . ... then each piei must divide either a or a − 1 (because each pi can divide into at most one of a and a − 1).


8

You can draw box-and-pointer diagrams using a combination of \fbox{} and arrows. $$ \newcommand{ptr}[1]{\overset{\mathtt{#1}}{\longrightarrow}} \begin{align*} &\mathtt{newNode} \\ &\quad\downarrow \\ \mathtt{head} \ptr{} \fbox{first} \ptr{next} &\fbox{...


8

You can make tables using \begin{array}{colspec} … \end{array}, where colspec is some string consisting of l, c, r specifying left, center, and right alignment for the columns. The colspec may also have | characters indicating the placement of vertical column-separating bars. To draw horizontal row-separating lines, use the \hline command. Here is a ...


7

You can use it to get color text, such as \$ \bbox[black]{\color{white}{\textrm{white}}}\ \color{black}{\textrm{black}}\ \color{red}{\textrm{red}}\ \color{green}{\textrm{green}}\ \color{blue}{\textrm{blue}}\ \color{cyan}{\textrm{cyan}}\ \color{magenta}{\textrm{magenta}}\ \bbox[gray]{\color{yellow}{\textrm{yellow}}} \$. The MathJax \color command works ...


7

Even using subscripts and superscripts, formulas still look odd and can be hard to read. An example would be from this answer: Is it reasonable to assume that most numbers will be non-palindromes? If not, I would suggest something like this: Determine the approximate number of digits in your number a using mpz_sizeinbase() and call this ...


7

This answer was a pain to type without MathJax, with all the italics, subscripts, and the Greek alpha character: St = α Yt-1 + (1 - α) St-1 where α is the decay rate Yt is the value at time t St is the exponential moving average at time t. That equation was taken from the linked Wikipedia article, so I wanted to copy it faithfully ...


6

If MathJax were available, the author of this question might have been able to describe what the code was trying to accomplish: Improve performance of math function applied to arrays Also, if a reviewer chooses to overhaul the code, it would also be helpful to write an explanation using MathJax.


6

Since we're giving the usage examples to show how much is this needed, here are those linked in the question: Here, I had to use code block for one formula (to achieve alignment) and LaTeX formulas off-site and attach them as images (for summations). Here are the formulas: sum = (a2 - a1) + (a3 - a1) + (a4 - a1) + ... + (an - a1) + ...


6

Could you please look into whether this is something which might be corrected The bold, is a problem with the font. There is no CSS change that makes the text larger. And if you change the font-weight to normal, it's exactly the same as the text around it. The only fix I know for this would be to use a new typeface. However the MathJax is potentially due ...


5

http://asciiflow.com/ ! +-------------------+ |TimerQueue (static)| +-------+-----------+ | +-----------+ +------v-------+ +-------------+ |TimerHolder+--------...


5

It's almost a duplicate of @Mat's Mug answer, but there is also Scruffy that is an open-source desktop application designed to create yUML-like diagrams with a yUML-like syntax. Morevoer, it also introduces some extensions to the yUML syntax and provides some basic support for sequence diagrams: We really need to embed such a tool on some StackExchange ...


5

In this answer, the author took the effort to write sqrt(⌈log10(B)⌉*81) The subscript takes a little bit of effort. The brackets for the ceiling function aren't easy to type at all. Then there's still the sqrt(…) which is impossible to nicely typeset using regular Markdown.


5

In Counting occurrences of values in C Array (Shannon Entropy), the entropy formula was posted as an image. A MathJax expression would have been better.


4

You can use Graphviz, possibly through its online version, GraphViz Workspace. For example: digraph { node [ shape = box ]; a -> b; b -> c; c -> d1; c -> d2; }


4

An excerpt is selected from the post to highlight the keywords in context, and subsequent edits to the answer mean that the snippets chosen are now different and the problem is not reproduced. Basically the keyword "shell" was added earlier in the post, and so the text around that addition is chosen in preference. After a bit of trial and error I've found a ...


4

I managed to reproduce the problem outside the tag wiki. If one takes the regularly working code: $$ a_{i+1} =\begin{cases} \frac{a_i}{2} & \text{if $a_i$ is even}\\[2ex] 3 a_i + 1 & \text{if $a_i$ is odd} \end{cases} $$ $$ a_{i+1} =\begin{cases} \frac{a_i}{2} & \text{if $a_i$ is even}\\[2ex] 3 a_i + 1 & \text{if $a_i$ is odd} \end{cases} $...


3

In my experience, such results are very dependent on the zoom level and font size. For example, if I zoom the linked question one level, then the two fonts are the same size for me. That suggest that this is a font rendering issue, not a configuration problem. Rasterizing an outline font is a tricky business, and it has all kinds of pitfalls related to ...


3

Let's try it, shall we? \$\LaTeX\$ At the time of writing, this shows up as the modified, \$\textbf{u got hax'd}\$ variant for me, although other clients - the Android app and SOUP users - report different results.


3

You can use yEd (a desktop application). I especially like its grid mode, which allows you to position the boxes exactly the way you want, while keeping them evenly spaced. Example:


Only top voted, non community-wiki answers of a minimum length are eligible