ROSE Compiler Framework/Sandbox

Some common tricks to write things on wikibooks/wikipedia (both are using the mediawiki software).

How to create a new page

Usually you have to start a new page from an existing wikipage.

Go to the wiki page you want to have a link to the new page you want to create

• click the edit tab the existing page
• at the place you want to have a link to the new page, use
 [[ROSE_Compiler_Framework/name of the page]]

.
• If there is already a page with the desired name. It will become a link to the page.
• If not, the link is red so you can click the red link to enter editing model to add content to the page.

Please link the new page to the print version of this wikibook so it can be visible in the print out.

How to do XYZ in wiki?

The best way is to goto en.wikipedia.com and find a page with the output you want. Then pretend to edit the page (by clicking edit) to see the source used to generate the output.

For example, you want to know how C++ syntax highlighting is obtained in wikibook. Go to en.wikipedia.com and find the page for C++. There must be sample code snippet.

Then you pretend to edit it to see the source: http://en.wikipedia.org/w/index.php?title=C%2B%2B&action=edit&section=6

You will see the source code generating the syntax highlighting:

<source lang="cpp">

# include <iostream>

int main()
{
std::cout << "Hello, world!\n";
}
</source>


Use the HTML comments: for example, the following comment will not show up in the paper rendered. But it is visible to editor to reminder why things are done in certain way.

<!-- Please keep the pixel size to 400 so they are clean in the pdf version, Thanks!  -->
[[File:Rose-compiler-code-review-1.png|thumb|400px|Code review using github.llnl.gov]]


Syntax highlighting

<source lang="cpp">

# include <iostream>

int main()
{
std::cout << "Hello, world!\n";
}
</source>



Can generate the following highlighted code:

# include <iostream>

int main()
{
std::cout << "Hello, world!\n";
}


Math formula

You can pretend to edit this section to see how math formula are written.

More resources are at

$\sum_{j=1}^N (Si,j) =1$

$\begin{matrix} \log_2(n!) & = & \log_2(n) + \log_2(n-1) + \log_2(n-2) + ... + \log_2(1) \\ & & \qquad \ \ \ \ \log_2(n) + \log_2(n) + \log_2(n) + ... + \log_2(n) \\ & & \qquad \ \ \ \ \qquad \ \ \ \ \qquad \ \ \ \ \qquad \ \ \ \ \qquad \ \ \ \ \ \ \ n log_2(n) \end{matrix}$

\begin{align} \log_2(n!) &= \log_2(n) + \log_2(n-1) + \log_2(n-2) + ... + \log_2(1) \\ &< \log_2(n) + \log_2(n) + \log_2(n) + ... + \log_2(n) \\ &= n log_2(n) \end{align}

$\begin{array}{lcr} z & = & a \\ f(x,y,z) & = & x + y + z \end{array}$

$\operatorname{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^{\infty} e^{-t^2}\,dt = \frac{e^{-x^2}}{x\sqrt{\pi}}\sum_{n=0}^\infty (-1)^n \frac{(2n)!}{n!(2x)^{2n}}$