How to insert a space after a substitution of a variable or a command? I am trying to learn how to define commands (\newcommand) and variables (\def) in LaTeX.  When I try:  \def \new {$new$}   or  \newcommand{\new}{$new$}   and substitute it in the text:  \documentclass{article}  %\def \new {$new$}            %\newcommand{\new}{$new$}  \begin{document} lala \new lala \end{document}   The substituted text sticks to the following text as shown here:    no matter how many spaces I put after the command.   What causes this behavior and how can I change it?
No space following macro without argument With a macro such as:  \def\naive{na\"{\i}ve}   I find that the space which I would hope to follow it, is absent. So, with  the \naive approach   I get     the naïveapproach   in the output. How do I bring back the space?
$n$ people attend the same meeting, what is the chance that two people share the same birthday? Given the first $b$ birthdays, the probability the next person doesn't share a birthday with any that went before is $(365-b)/365$. The probability that none share the same birthday is the following: $\Pi_{0}^{n-1}\frac{365-b}{365}$. How many people would have to attend a meeting so that there is at least a $50$% chance that two people share a birthday?   So I set $\Pi_{0}^{n-1}\frac{365-b}{365}=.5$ and from there I manipulated some algebra to get $\frac{364!}{(364-n)!365^{n}}=.5\iff (364-n)!365^{n}=364!/.5=.....$   There has to be an easier way of simplifying this. Managing constructors with many parameters in Java In some of our projects, there's an class hierarchy that adds more parameters as it goes down the chain. At the bottom, some of the classes can have up to 30 parameters, 28 of which are just being passed into the super constructor.  I'll acknowledge that using automated DI through something like Guice would be nice, but because of some technical reasons, these specific projects are constrained to Java.   A convention of organizing the arguments alphabetically by type doesn't work because if a type is refactored (the Circle you were passing in for argument 2 is now a Shape) it can suddenly be out of order.  This question might be to specific and fraught with "If that's your problem, you're doing it wrong at a design level" criticisms, but I'm just looking for any viewpoints. Is there a quick way to get the control that's under the mouse? I need to find the control under the mouse, within an event of another control.  I could start with GetTopLevel and iterate down using GetChildAtPoint, but is there a quicker way? Identify a catastrophic sci fi story written before 1980: ruptured spleen, alien moon base, time and space travel, antimatter tool I read a sci fi short story sometime between 1974-1980 but it may have been written long before that.  I believe it was in a paper back anthology of sci fi stories, but I'm not certain.  I think the protagonist is facing the final climactic conflict when we meet him.  Most of the story is memories and flashbacks.  The first flashback is to his childhood.  He and his younger brother are sled riding.  His brother crashes, ruptures his spleen and dies.  He feels responsible and is wracked with guilt.  Much later, as an adult, he is exploring a long-deserted alien base on the moon.  There are unfamiliar artifacts on the base, including a time-travel device/vehicle, and a tool with an anti-matter tip.  It carves neat holes and eliminates matter simply by moving it through matter.  He accidentally drops the tool, which plummets unimpeded to the center of the moon.  He realizes that over time, it will consume and destroy the moon, which will be catastrophic for Earth.  He uses the time-travel device to travel to the moon at an earlier time so that he can prevent himself from dropping the tool.  He makes bigger problems for himself, forcing him to travel back further and further in time.  He travels so far back that he encounters the original alien inhabitants of the base.  Now we are at the present time in the story.  This is his final conflict, he has to escape, travel forward in time and resolve all of the problems he created.  Unfortunately, the alien inhabitants capture him, and the story ends.  Can anyone identify the story and author? Where's the error in this $2=1$ fake proof? I'm reading Spivak's Calculus:  2 What's wrong with the following &quot;proof&quot;? Let $x=y$. Then $$x^2=xy\tag{1}$$ $$x^2-y^2=xy-y^2\tag{2}$$ $$(x+y)(x-y)=y(x-y)\tag{3}$$ $$x+y=y\tag{4}$$ $$2y=y\tag{5}$$ $$2=1\tag{6}$$  I guess the problem  is in $(3)$, it seems he tried to divide both sides by $(x-y)$. The operation would be acceptable in an example such as:  $$12x=12\tag{1}$$ $$\frac{12x}{12}=\frac{12}{12}\tag{2}$$ $$x=1\tag{3}$$  I'm lost at what should be causing this, my naive exploration in the nature of both examples came to the following: In the case of $12x=12$, we have an imbalance: We have $x$ in only one side then operations and dividing both sides by $12$ make sense. Also, In  $\color{red}{12}\color{green}{x}=12$ we have a $\color{red}{coefficient}$ and a $\color{green}{variable}$, the nature of those seems to differ from the nature of $$\color{green}{(x+y)}\color{red}{(x-y)}=y(x-y)$$ It's like: It's okay to do the thing in $12x=12$, but for doing it on $(x+y)(x-y)=y(x-y)$ we need first to simplify $(x+y)(x-y)$ to $x^2-y^2$. It seems intuitive that $a\; \propto \frac{F}{m}$, as the greater the force that is applied on an object, the greater its acceleration will be. Inversely, the greater the mass of the object, the slower the acceleration will be.  However, when rewriting proportions as equations, you must introduce a constant of proportionality, and in this case of a direct proportion, if $a \propto \frac{F}{m}$ then when rewriting as an equation you will have $$a = k\cdot\frac{F}{m}$$  In order to get the standard formula $F = ma$ this constant must be $1$. However, how do we know that this is the case? How do we know that the constant isn't $2$ and the formula $F = \frac{1}{2}ma$, for instance? Like many others, I commonly find myself ending a sentence with a preposition.  Yes, it makes me cringe.  I usually rewrite the sentence, but sometimes (in emails) I just live with it.  To, with... you know who you are.  Should I keep fighting myself on this one, or is it okay in some circumstances? $e^{i\theta}=\cos\theta + i\sin \theta$  $e^{i\sin^{-1}x}=\cos(\sin^{-1}x)+i\sin(\sin^{-1}x)$  $i\sin^{-1}x=\ln|\sqrt{1-x^2} + ix|$  $\sin^{-1}x=-i\ln|\sqrt{1-x^2} + ix|$  Now from here I'm kind of lost, since it seems like this should be the definition, but when I look it up, the definition of inverse hyperbolic sine is:  $\sinh^{-1}x=\ln(\sqrt{1+x^2} + x)$  So although they're very similar, I guess I just don't know how to handle the logarithm and anything to the ith power or drop off the absolute value. What are the advantages and limitations of dynamic type languages compared to static type languages?  See also:  (a far more argumentative thread...) The reply buttons in chat shouldn't reposition themselves on pinged messages Can houseplants actually improve air quality? Can someone please explain the difference between the protected and protected internal modifiers in C#? It looks like their behavior is identical. What measures does Cognito Forms take to ensure Privacy/ Security Level for Completed Forms/ User Data? Some forms may contain confidential information - even something basic like where a person lives.   What measures do Cognito Forms take to ensure that data stored within its site is secure? Why is Newton's method not widely used in machine learning? This is something that has been bugging me for a while, and I couldn't find any satisfactory answers online, so here goes:  After reviewing a set of lectures on convex optimization, Newton's method seems to be a far superior algorithm than gradient descent to find globally optimal solutions, because Newton's method can provide a guarantee for its solution, it's affine invariant, and most of all it converges in far fewer steps. Why is second-order optimization algorithms, such as Newton's method not as widely used as stochastic gradient descent in machine learning problems? This is more of a panic question after reading reviews on Istanbul Atatürk Airport. They said it's messy and hard to navigate, therefore I'm asking questions here in name of my girlfriend who will need to transit through this airport.  My girlfriend (Canadian national) traveling from Toronto (YYZ) to Istanbul (IST) for a couple hours (~4 hrs, so transiting) in order to come to Pristina (PRN). I would like a quick guideline on how to pass through this airport seamlessly without facing any trouble or delay.  Her tickets are both with Turkish Airlines. She purchased it via a third party (Flighthub.ca). It's only one booking and it includes both flights in it.   Once my girlfriend departs, she's obviously required to follow the signs and go to the transit area. Once she's there, will she be required to present a ticket? Where does she get that ticket? Does she get it in YYZ or does she need to visit a counter in IST and get it? After she's got the proper ticket, what does she need to do exactly? Wait in line to have her passport checked? Will they also control her carryon?  After this step, does she simply go to the PRN flight gate and that's it?   We're simply worried about Istanbul Atatürk Airport because of the recent things that happened in Turkey (coup attempt and ISIS attack) and she doesn't wanna somehow end up locked up there. I've read that the airport is a mess lately and a lot of people will be there waiting in line. So, another question: Are 4 hours enough?  I would appreciate a step by step guideline on how she needs to navigate and what she needs to do in that airport to have a smooth experience without facing any delays. Also some misc information on Istanbul Atatürk Airport would be appreciated. How can I print a variable with padded center alignment? How do I find out what tool a shortcut is triggering? I used to have problem with connecting two objects, because when I smooth the final object, there was a darker line on the connected parts (for example when I was making head, I've had eyes darker this way). Then I found out that I can get rid of it by hitting Ctrl+N, but I don't realy know what it does. I can just see that the lines are gone. So, what does Ctrl+N do? Importing QGIS3 processing tools in standalone script Inspired by , but for QGIS 3 (and therefore Python 3), I would like to use the QGIS processing algorithms in a standalone Python script without a GUI, with a standard installation of Ubuntu Linux. A simple import processing is insufficient: import processing processing.run(    &quot;qgis:rasterlayerstatistics&quot;,    {        'INPUT': .'/somefile.tif',        'BAND': 1,        'OUTPUT_HTML_FILE': './result.html'    } )  Results in: Traceback (most recent call last):   File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt; ModuleNotFoundError: No module named 'processing'  How do you get access to the QGIS processing module to use the QGIS processing algorithms in a standalone Python script (not the QGIS interpreter)? I need to check CPU and memory usage for the server in java, anyone know how it could be done? Why are my sauces splitting?