I have defined an environment called \equ, which is an aligned equation environment to save time when writing a thesis with lots of equations.  However, after using this environment there is a small indent, which is not there if I just use the \begin{equation} and \begin{aligned} commands directly (see MWE):  \documentclass{book} \usepackage{mathtools}  \newenvironment{equ}[1] {\begin{equation} \label{equation:#1}     \begin{aligned} } {     \end{aligned} \end{equation} }    \begin{document} \chapter{Test Chapter} This is the first paragraph of text in the document. It is not indented, as expected.  This is the second paragraph of text in the document. It is indented, as expected.  \begin{equation}\label{equation:1} \begin{aligned}     F &amp;= m a\\     E &amp;= m c^{2} \end{aligned} \end{equation} This is the paragraph after an equation. It is not indented, as expected. \begin{equ}{1} F &amp;= ma\\ E &amp;= m c^{2} \end{equ} This is the paragraph after an equ. It is indented with a small indent, and the vertical spacing around the equation looks slightly different, but I don't know why?!  \end{document}     I am fairly new to this; I'm sure it's something obvious so any help would be appreciated!
If I create a custom environment based on the equation environment, I get a spacing issue: the next line of text after my environment closes doesn't start on the left margin.  Example code:  \documentclass{article} \begin{document} \newenvironment{myenv}{\begin{equation}}{\end{equation}} \noindent $| \leftarrow$ this is the left margin. \begin{myenv} e ^{i \pi} + 1 = 0 \end{myenv} $| \leftarrow$ this isn't the left margin. \end{document}   Output:    Removing the newline after \end{myenv} solves the spacing problem, but the resulting code is not readable.  Of course, in this example I could just use the equation environment itself. My real issue involves a more complex custom environment that suffers from the same problem, and which also includes an equation environment within it.
Questions about    setting environment variables the PATH   are very common here, and in most cases the answers are very similar to each other. In the future it would be nice to have a good Q/A for this.  So the question is: What are environment variables, like the executable PATH, and how can I change and use them on major operating systems?  A good answer would include a simple explanation of what environment variables and especially PATH mean to the OS, as well as simple guidelines on how to set and read them accordingly. Shouldn't the association bonus acquired via serial upvoting be reversed? When a user's rep gets bloated because of serial upvoting, and as result the user is given the association bonus, shouldn't that association bonus also be reversed in case of serial upvoting reversal? Jump between open windows on multiple monitors in Task View on Windows 10 with keyboard I'm using two monitors with Windows 10 and I have a few windows open on each monitor. When I open the Task View (Win + Tab) I can only navigate between the main monitor's windows with keyboard (using arrow keys or the Tab key). I see the other display's windows on that display but can't figure out how to cycle through those windows with my keyboard.  Is there a way I can give focus to secondary monitor's windows in the Task View using keyboard?  To put it another way, how do I select the first item on the right monitor in the following screenshot using keyboard? Is there a performance difference between i++ and ++i in C++? We have the question   What's the answer for C++? With powershell get exactly the same application list as in Add/Remove programms There are various methods to find installed applications on the system but to my knowledge none returns exactly the same list as control panel item Add Remove Programs. Some of the ways I tried are:   WMI via Win32_Product and Win32Reg_AddRemovePrograms Registry, both x32 and x64 branches   For instance, I have 217 entries in AR and   gwmi  Win32_Product   returns 261 items.  gp HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | ? {![string]::IsNullOrWhiteSpace($_.DisplayName) } | select DisplayName   returns 119 items.   (gwmi Win32Reg_AddRemovePrograms) + (gwmi Win32Reg_AddRemovePrograms64) | sort DisplayName -Unique    returns 107 items.  I tried to nail it down with more complex filter that included InstallLocation, InstallSource, InstallDate etc without success. Shuffling questions in exam Git ignore file for Xcode projects Which files should I include in .gitignore when using Git in conjunction with Xcode? Understanding MCMC and the Metropolis-Hastings algorithm Over the past few days I have been trying to understand how Markov Chain Monte Carlo (MCMC) works. In particular I have been trying to understand and implement the Metropolis-Hastings algorithm. So far I think I have an overall understanding of the algorithm but there are a couple of things that are not clear to me yet. I want to use MCMC to fit some models to data. Because of this I will describe my understanding of Metropolis-Hastings algorithm for fitting a straight line $f(x)=ax$ to some observed data $D$:  1) Make an initial guess for $a$. Set this $a$ as our current $a$ ($a_0$). Also add $a$ at the end of the Markov Chain ($C$).  2) Repeat the steps bellow a number of times.  3) Evaluate current likelihood (${\cal L_0}$) given $a_0$ and $D$.  4) Propose a new $a$ ($a_1$) by sampling from a normal distribution with $\mu=a_0$ and $\sigma=stepsize$. For now, $stepsize$ is constant.  5) Evaluate new likelihood (${\cal L_1}$) given $a_1$ and $D$.  6) If ${\cal L_1}$ is bigger than ${\cal L_0}$, accept $a_1$ as the new $a_0$, append it at the end of $C$ and go to step 2.  7) If ${\cal L_1}$ is smaller than ${\cal L_0}$ generate a number ($U$) in range [0,1] from a uniform distribution  8) If $U$ is smaller than the difference between the two likelihoods (${\cal L_1}$ - ${\cal L_0}$), accept $a_1$ as the new $a_0$, append it at the end of $C$ and go to step 2.  9) If $U$ is bigger than the difference between the two likelihoods (${\cal L_1}$ - ${\cal L_0}$), append the $a_0$ at the end of $C$, keep using the same $a_0$, go to step 2.  10) End of Repeat.  11) Remove some elements from the start of $C$ (burn-in phase).  12) Now take the average of the values in $C$. This average is the estimated $a$.  Now I have some questions regarding the above steps:   How do I construct the likelihood function for $f(x)=ax$ but also for any arbitrary function? Is this a correct implementation of Metropolis-Hastings algorithm? How the selection of the random number generation method at Step 7 can change the results? How is this algorithm going to change if I have multiple model parameters? For example, if I had the model $f(x)=ax+b$.   Notes/Credits: The main structure of the algorithm described above is based on the code from an MPIA Python Workshop. Say I have a huge text file (>2GB) and I just want to cat the lines X to Y (e.g. 57890000 to 57890010).  From what I understand I can do this by piping head into tail or viceversa, i.e.   head -A /path/to/file | tail -B   or alternatively  tail -C /path/to/file | head -D   where A,B,C and D can be computed from the number of lines in the file, X and Y.  But there are two problems with this approach:   You have to compute A,B,C and D. The commands could pipe to each other many more lines than I am interested in reading (e.g. if I am reading just a few lines in the middle of a huge file)   Is there a way to have the shell just work with and output the lines I want? (while providing only X and Y)? Getting arguments underneath \min in an align environment What is the difference between Affection and Friendship, if any? I've risen Pokemon Amie Affection to 5 hearts on my Riolo in the hopes that it will evolve as soon as it levels up, but I'm not certain that this is the same thing as friendship, and I'd like to not waste a level.  My question is this: What is the difference between Pokemon Amie Affection and the Friendship stat? MacBook Pro 13" Touch bar permanently blank I'm on a new 2019 MacBook pro 13”. The TouchID fingerprint sensor is working. But my touch bar has gone completely blank. I tried restarting my MacBook Pro but it did not help.    I've also done a factory reset, SMC, NVRAM/PRAM and an Apple diagnostics, hoping to fix the problem but it did not work.  After re-install macOs, I was able to see touch bar configuration on System Preferences -> Keyboard menu:    I am not able to see touch bar option and it is completely dark black.  I tried resetting the touchbar through the terminal by using the below syntax:   sudo pkill “TouchBarServer” sudo pkill "Touch Bar Agent" sudo pkill ControlStripAgent   I have tried to verify whether they are running by using below command and could not find any process running.   ps -A | grep -i "touch bar agent" ps -A | grep -i "controlstrip”   I can see the control strip and touch bar server is running in activity monitor:      I could see this is a common issues across mac book pro and customer don’t have any proper fix for it. Can you grammatically end a sentence with "with"? Do you want to come with? Can I come with?  I seem to hear this construction more often in recent years, but it still grates on my ear. I know it's often said that one shouldn't , but I class that rule along with  (i.e. — pedantic tosh). Is it always informal/casual speech to end a sentence with &quot;with&quot;? Was it ever thus? What and where are the stack and heap? Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear explanation of this.  I understand what a stack is. But,    Where and what are they (physically in a real computer's memory)? To what extent are they controlled by the OS or language run-time? What is their scope? What determines the size of each of them? What makes one faster? How do you do a deep copy of an object in .NET? Let $A [a_{i,j}]$  and $B =[b_{ij}]$   be two diagonal matrices in   $M_n(F)$. Let $i \ne j \in \left\{1, \ldots, n \right\}$. Using the   product rule, we obtain      $$(AB)_{ij} = \sum_{k=1}^{n} a_{ik}b_{kj}$$      We claim that $a_{ik}b_{kj} =0$ for all $k \in \left\{1, \ldots, n \right\}$ thus $(AB)_{ij}=0$ for all $i \ne j$ and $AB$ is diagonal. To    prove the claim, note that since $i \ne j$ , we have $i \ne k$ or $    k\ne j$. Thus either $a_{ik} = 0$ (since $A$ is diagonal) or $b_{kj} =  0$ (since $B$ is diagonal), thus in all cases $a_{ik}b_{kj}=0$ and the   claim is proved.   Where does the bit "we have $i \ne k$ or $k\ne j$" come from? I understand that since $i \ne j$, and $k$ and $j$ run over the same set of natural numbers, we also have $i \ne k$. But the "or $k \ne j$" baffles me. I understand that $k \ne j$ implies that we can have $i=k$. But that's from the other direction ($\Longleftarrow).$  Also, when it says $a_{ik}=0$ or $b_{kj}=0$ it's talking about when $i \ne k$ or $k \ne j$ right? Many thanks. How do I downgrade Firefox v. 57 to v. 56? What is the most straight forward way to downgrade Firefox 57 to Firefox 56?   This is to have more time to wait for working replacements for legacy extensions. Change icon on MATE main menu How can I change the default logo icon to a custom icon by the applications menu in Ubuntu MATE without changing the theme? Is there a system in place to prevent new users asking, answering and accepting answers to each others' off-topic questions? Normally new users are not allowed to up-vote until they gain a bit of reputation by receiving up-votes or accepts from the community of a site.  But this has a weak point that is being exploited:     A number of new users post, answer, and accept each others'    off-topic questions before we can close them (in less than 5 min).    Accepting each others' answers gains them enough reputation to    start up-vote each others' posts.   We are closing them and the moderators clean up afterwards but  this keeps happening over and over again and becoming frustrating  to the extent that I think a systematic solution might be required. Is there a system to prevent this kind of circumvention of  the reputation requirements using accepts by new users?  One possible solution might be to change the system so accepts from users who do not have enough reputation to up-vote  do not give any reputation (at least until the answer gets an up-vote). ERROR running force:source:pull: Entity of type 'CustomApplication' named 'Contact' cannot be found