I am trying to have sections of my algorithm highlighted like the figure below. I am using algorithm2e on sharedlatex. Is there a simple solution ?
I am trying to achieve something like this:     This image is linked from .  also provides a solution and seems simpler. Both answers deal with the algorithmicx package however. I am interested in the solution for the algorithm2e package.   I read the documentation of the algorithm2e package but didn't find an answer.   How can I achieve the colored effect?  EDIT:  Here is sample code to create a minimum working example.  \documentclass{article}  \usepackage[ruled]{algorithm2e} % http://www.ctan.org/pkg/algorithm2e  \begin{document}  \begin{algorithm}[h]  \caption{Evolutionary algorithm}   initialize population \;  \For( \emph{Evolutionary loop}){$g := 1$ to $G_{max}$}  {     do things \;     evolve population \;  }  celebrate \; \end{algorithm}  \end{document}
I'm in the market for a new Smartphone. Except for iPhone's, I'm new in the field and probably have some misconceptions.  My first choice was the Google Nexus S, but I was offered a great deal on the Samsung S Galaxy II (i9100). The only issue is that I read that it came with an "enhanced" version of Android. Being familiar with PC's, I know that these enhancements are almost always bloatware: I always do a clean install of Windows to get rid of it.  My question is fairly simple: is this possible to use the stock Google Android OS on the Samsung S Galaxy II (i9100)? That was the killer feature of the Nexus S for me: coming directly from Google, easily upgradable. Would that be possible and if yes, how?  Thank you for enlightening me. Can I use Wilcoxon Signed-Rank Test to test pairs of data in a time series? I have a dataset of measurements (non-normally distributed). Each line of this dataset is composed of two measurements of the same variable at a specific time (i.e. XYY [time, meas1, meas2]). This dataset contains 24 lines.  Is it correct to use the Wilcoxon Signed-Rank Test to compare these two measurements? Is it correct to use this test to compare the mean value of these measurements between different experiments?  Thanks As the title says, how can I make this shape without resorting to a Boolean operation?    This is obviously a very simple example, but I find myself needing to do something like this relatively often when modelling.  Despite using Blender for a couple of years, and considering myself an intermediate to possibly advanced user, I still know of no easy way to make this kind of indentation in an object.  Obviously, if you are looking to make an indentation in the middle of the surface, you can simply select a face and extrude down. As you will know, this does not work at the edge of the surface.  I can create this shape using loop cuts, deleting the faces and then using snap to edge to extrude the edges down to the same level (and then filling in the faces), but it feels cumbersome and a lot of work for what feels like it should be very simple. I'd like to put some shared Javascript to Resource file to reuse it between several components. This Javascript is general purpose set of utility functions. However, functions from my resource file are not available from the Components. Static resource (named TestScript):  function helloWorld() {      return 42; }   Component:  &lt;ltng:require scripts="{!$Resource.TestScript}" &lt;ui:button label="Do job" press="{!c.doJob}"/&gt;   Controller:  doJob: function(cmp, event, helper) {      var i = helloWorld();      // failed with Uncaught ReferenceError: helloWorld is not defined }   I don't like to use  &lt;ltng:require scripts="{!$Resource.***resourceName***}" afterScriptsLoaded="{!c.afterScriptsLoaded}" /&gt;   because my static resource is a set of functions and I'd like just use them as functions later in my controllers. How can I achieve that (if possible)? If not, what's the suggested solution? What is the difference between: Rooting, Jailbreak, ROM, Mod, etc.? Check for missing fonts/characters in XeLaTeX? Because I began to use many Unicode characters (Japanese, some unusual diacritics, etc.) I switched from LaTeX to XeLaTeX to render my documents. Unfortunately, if a font is missing, the letters are simply left out (for example, when I had forgotten to specify the font for Japanese) without any error (and I can't seem to spot a warning either). I will read the result, but I prefer to get some early warning if some character isn't available. Is there any way to get a warning about characters that have not been rendered? An error would be even better. I think I remember reading somewhere that the Baire Category Theorem is supposedly quite powerful. Whether that is true or not, it's my favourite theorem (so far) and I'd love to see some applications that confirm its neatness and/or power.  Here's the theorem (with proof) and two applications:    (Baire) A non-empty complete metric space $X$ is not a countable union of nowhere dense sets.  Proof: Let $X = \bigcup U_i$ where $\mathring{\overline{U_i}} = \varnothing$. We construct a Cauchy sequence as follows: Let $x_1$ be any point in $(\overline{U_1})^c$. We can find such a point because $(\overline{U_1})^c \subset X$ and $X$ contains at least one non-empty open set (if nothing else, itself) but $\mathring{\overline{U_1}} = \varnothing$ which is the same as saying that $\overline{U_1}$ does not contain any open sets hence the open set contained in $X$ is contained in $\overline{U_1}^c$. Hence we can pick $x_1$ and $\varepsilon_1 &gt; 0$ such that $B(x_1, \varepsilon_1) \subset (\overline{U_1})^c \subset U_1^c$.   Next we make a similar observation about $U_2$ so that we can find $x_2$ and $\varepsilon_2 &gt; 0$ such that $B(x_2, \varepsilon_2) \subset \overline{U_2}^c \cap B(x_1, \frac{\varepsilon_1}{2})$. We repeat this process to get a sequence of balls such that $B_{k+1} \subset B_k$ and a sequence $(x_k)$ that is Cauchy. By completeness of $X$, $\lim x_k =: x$ is in $X$. But $x$ is in $B_k$ for every $k$ hence not in any of the $U_i$ and hence not in $\bigcup U_i = X$. Contradiction. $\Box$    Here is one application (taken from ):  Claim: $[0,1]$ contains uncountably many elements.  Proof: Assume that it contains countably many. Then $[0,1] = \bigcup_{x \in (0,1)} \{x\}$ and since $\{x\}$ are nowhere dense sets, $X$ is a countable union of nowhere dense sets. But $[0,1]$ is complete, so we have a contradiction. Hence $X$ has to be uncountable.     And here is another one (taken from ):  Claim: The linear space of all polynomials in one variable is not a Banach space in any norm.  Proof: "The subspace of polynomials of degree $\leq n$ is closed in any norm because it is finite-dimensional. Hence the space of all polynomials can be written as countable union of closed nowhere dense sets. If there were a complete norm this would contradict the Baire Category Theorem." Is it correct to use Bernoulli's theorem to explain that a disk floats in the air? Should the correct explanation be based on Boyle's law? In this video, a device is introduced from 1 minute to 18 seconds. After entering the air, the disc at the bottom of the device will be suspended in the air. The video explains that this is because of the Bernoulli effect, but I think this explanation is incorrect, because the disc gap, the radial volume is increasing. Therefore, the reason why the disk is suspended is that the air volume becomes larger, so the pressure decreases (according to Boyle's law). If the air moves along the radial direction at a constant speed, the volume of the air must be constantly increasing, right? So the pressure is decreasing, right? User is suspended network-wide, except not really A user has been active on one of the sites recently, even though they're concurrent suspended network-wide on the rest of the network. How is this possible, and is it possible to evade a network suspension on only one site? Short story, domed refuges Algorithm to match one input file with given numbers of file Make flash drive bootable with MULTIPLE Windows Installers I have seen many ways to make a USB an installer for about any Windows OS. But how can I (using grub or something like that) make it bootable to all editions on Windows XP and 7?   I have tried Googling it and researching, I've even tried to do it, But I dont understand much about GRUB or linux at all.  Please keep in mind that I am not very good with linux, so please use as many details as possible. Does the command pwd in a shell script output the directory the shell script is in? Python Script returns unintended "None" after execution of a function Integral ${\frac{1}{\pi^2}} \int_{0}^{\infty}\frac{{(\ln{x}})^2}{\sqrt{x}{(1-x)^2}} \mathrm d x$ Electric fields in continuous charge distribution My question may be very basic, but I can't think of a reasonable explanation for this.  Consider a solid charged sphere. Now, we have an electric field inside the solid sphere, but at any particular point there are charges infinitesimally close to the point. As I see it, these charges should contribute to an infinite value of the electric field.  One might possibly argue that at any given point, infinitely-close charges are distributed uniformly everywhere and hence their effects cancel out. But at the surface of the sphere the uniformity of infinitely-close charges is not present and hence here we must have infinite field, but that is not the case as well! Where are we going wrong?  Also, if we think of electric field at that point in continuous charge distribution, the contribution of electric field might exist finitely from nearby charges with both charge and distance between them tending to zero, but for the very small charge present exactly there, the electric field contribution from itself must be infinite with charge being finitely small and distance being exactly 0. What's wrong here?  I have strong suspicions, is it sensible and correct to define electric fields at such a close vicinity of other continuous charges? Some people say that mass increases with speed, some people say that the mass of an object is independent of its speed.  I understand how some (though not many) things in physics are a matter of interpretation based on one's definitions. But I can't get my head around how both can be 'true' is any sense of the word.  Either mass increases or it doesn't, right?  Can't we just measure it, and find out which 'interpretation' is right? e.g.: (in some sophisticated way) heat up some particles in a box and measure their weight?  ------------------------------  UPDATE  Right, so I've got two identical containers, each with identical amounts of water, each on identical weighing scales, and each in the same g field. If one container has hotter water, will the reading on its scale be larger than the other? If the answer is yes, and g is constant, does this mean that the m in w=mg has got bigger? What is the best way to repeatedly execute a function every x seconds? Is there an easy way to TeX geometric pictures? Pros & cons of buying gold directly vs. investing in a gold ETF like GLD, IAU, SGOL?