Why does:  [ "a" != "$(printf "\na")" ] &amp;&amp; echo true || echo false   print true while:  [ "a" != "$(printf "\n")a" ] &amp;&amp; echo true || echo false   print false?
The following code best describes the situation.  Why is the last line not outputting the trailing newline char?  Each line's output is shown in the comment.  I'm using GNU bash, version 4.1.5          echo -n $'a\nb\n'                  | xxd -p  # 610a620a              x=$'a\nb\n'   ; echo -n "$x" | xxd -p  # 610a620a      echo -ne "a\nb\n"                  | xxd -p  # 610a620a x="$(echo -ne "a\nb\n")" ; echo -n "$x" | xxd -p  # 610a62
how long does the care take to reach the last pole algebra word problem There are 20 poles with a constant distance between each pole. A car takes 22 seconds to reach the 12th pole starting from the first pole, with a constant speed between each pole. how many seconds will it take to reach the last pole?   Is the answer 36 seconds?   since $\frac{22} {12}  = 1.83 $  $1.83 \times 20 = 36.67 $ MacOS dmg file question Not entirely sure if this is where to ask this, but I can't find another place to...  I've recently switched from Windows to Mac and I am trying to understand more in depth what I'm working with.  My question is: are .dmg files the equivalent of .zip files in Windows? I came to this theory when downloading a .dmg and when I opened it, it contained a .app and and text file read me. To me, this seems like a compressed file.   Is this correct? Lily Potter chose to die instead of sacrificing her son Harry to Voldemort. In doing so, protective enchantments were created that protected Harry and made him less vulnerable to Voldemort and Voldemort's attempts to kill Harry.   Yet, I don't understand how Lily's enchantments, when Voldemort stole Harry's blood in the graveyard scene in Goblet of Fire (chapter 33, The Death Eaters), were helpful to Voldemort at all.     ‘He took my blood,’ said Harry.   ‘Precisely!’ said Dumbledore. ‘He took your blood and rebuilt his living body with it! Your blood in his veins, Harry, Lily’s protection inside both of you! He tethered you to life while he lives!’   Deathly Hallows - page 568 - Bloomsbury - chapter 35, Kings Cross   Yet I wonder about the following canon information:    Lily's enchantment was contingent upon Petunia Dursley giving Harry a home, which Petunia     grudgingly did&#185;. It was the blood bond between Harry and Petunia, plus the fact that Petunia gave Harry a home, where he could return to once per year, that sealed Lily's   protective enchantments and made them strong. Voldemort was never granted a home at the Dursleys, and in fact never stepped foot into the Dursleys' home at any point in canon. Never having been given a home at the Dursleys, how, then, did Lily, Petunia, and Harry's blood bond exist within Voldemort? Or did it? If it did, would it be because ? Lily's enchantments broke the moment Harry turned 17 and could not protect Harry any more&#178;. According to the 's page on Voldemort, Voldemort was 69 years old when he stole Harry's blood. If Lily's enchantment broke for Harry at age 17, why would the enchantments work for Voldemort when he was 69? Dumbledore tells Harry in Order of the Phoenix that Voldemort would not possess Harry because the love that fills Harry -- Lily's love -- is a force that Voldemort detests so greatly that he cannot bear to come into contact with it&#179;. Yet the love Lily infused into Harry runs in his veins; Voldemort took Harry's blood, the blood that is imbued with Lily's love. How can he bear to be in contact with the love given to Harry in his own veins?   Given this canon information, why did Lily's enchantments work for Voldemort?  &#185;Half-Blood Prince - chapter 3, Will and Won't and Order of the Phoenix - chapter 37, The Lost Prophecy &#178;Half-Blood Prince - chapter 3, Will and Won't &#179;Order of the Phoenix - chapter 37, The Lost Prophecy Continued fraction of a square root If I want to find the continued fraction of $\sqrt{n}$ how do I know which number to use for $a_0$? Is there a way to do it without using a calculator or anything like that? What's the general algorithm for computing it? I tried to read the wiki article but was overwhelmed and lost. I tried Googling but couldn't find a website that actually explained this question.  If anyone has a good site that answers these questions either, please let me know. Thanks! AngularJS Directives: Change $scope not reflected in UI $A_n$ is the only subgroup of $S_n$ of index $2$. How to prove that the only subgroup of the symmetric group $S_n$ of order $n!/2$ is $A_n$?  Why isn't there other possibility?  Thanks :) If the laws of random variables weakly converge to a point mass at $c$, then the random variables converge in probability to $c$. This is question 10.3.1 from Rosenthal's First Look at Rigorous Probability.  Suppose $\mathcal{L}(X_n) \Rightarrow \delta_c$ for some $c \in \mathbb{R}$. Prove that $\{X_n\}$ converges to $c$ in probability.  Here $\mathcal{L}(X_n)$ refers to the distribution of $X_n$.  Is the following proof correct?  Is a simpler proof available?  Is there a simple proof using Skorohod's theorem?  I attempted to prove the contrapositive. Suppose $X_n \not \to c$ in probability.  This means that there is an $\varepsilon &gt; 0$ so that for all $N$, there exists an $m &gt; N$ such that  \begin{equation}   P(|X_m - c| \geq \varepsilon) &gt; \eta, \text{ for some $\eta &gt; 0$}. \end{equation}  Consider  \begin{equation}   B := \{x \in \mathbb{R} : |x - c| \leq \varepsilon\} \in \mathcal{B} \text{ the Borel sets on $\mathbb{R}$}. \end{equation}  Then $B^c \in \mathcal{B}$ and denoting the distribution of $X_n$ as $\mu_n$ we have  \begin{equation}   \mu_n(B^c) = P(X_n \in B^c) = P(|X_n - c| \geq \varepsilon) &gt; \eta. \end{equation}  For all $N$, there exists an $m &gt; N$ such that the cumulative distribution function of $X_m$ is not the same as the cumulative distribution function of $\delta_c$; in particular it's mass changes somewhere at least $\varepsilon$ distance from $c$. Finally because $\delta_c(\{x\}) = 0$ for all $x \neq c$ this completes the proof. for (i=0 ; i&lt;=10; i++) {     ..     .. }  i=0; while(i&lt;=10) {     ..     ..     i++; }   In for and while loop, which one is better, performance wise? I was wondering how to create a theorem environment similar to the following example:   Specifically, the environment should resemble the box that contains "Claim -- The function g is linear".  This comes from a , who has his style files uploaded  I have tried to mimic what I believed to be the relevant code (as there's a lot of stuff there that isn't related to this), to no avail. I have attached my attempt below, but it may be better to ignore it.  \usepackage{amsmath} \usepackage{amsthm} \usepackage{mdframed} \usepackage{thmtools} \usepackage{tikz} \usepackage{xcolor} \usepackage[framemethod=TikZ]{mdframed}     \mdfdefinestyle{mdgreenbox}{%         linewidth=0.5pt,         skipabove=12pt,         frametitleaboveskip=5pt,         frametitlebelowskip=0pt,         skipbelow=2pt,         frametitlefont=\bfseries,         innertopmargin=4pt,         innerbottommargin=8pt,         nobreak=true,         backgroundcolor=SpringGreen!15,         rightline=false,         leftline=false,         topline=false,         bottomline=false,         linecolor=green,     }     \declaretheoremstyle[         headfont=\bfseries\color{OliveGreen},         mdframed={style=mdgreenbox},         headpunct={\\[3pt]},         postheadspace={0pt},     ]{thmgreenbox} \declaretheorem[style=thmgreenbox]{thrm1}   This returns an error, one for xcolor not recognizing the colors, and the following.  l.17        \mdfdefinestyle                       {mdgreenbox}{% The package mdframed has already been loaded with options:   [] There has now been an attempt to load it with options   [framemethod=TikZ] Adding the global options:   ,framemethod=TikZ to your \documentclass declaration may fix this. Try typing  &lt;return&gt;  to proceed.  Package thmtools Info: Key `mdframed' (with value `style=mdgreenbox') (thmtools)             is not a known style key. (thmtools)             Will pass this to every \declaretheorem (thmtools)             that uses `style=thmgreenbox' on input line 39. Package thmtools Info: Automatically pulling in `thmdef-mdframed' on input line 40. (/usr/local/texlive/2017/texmf-dist/tex/latex/thmtools/thmdef-mdframed.sty Package: thmdef-mdframed 2014/04/21 v66 ) \c@thrm1=\count282 (/compile/output.aux) \openout1 = `output.aux'.   I am looking for a way to mimic the environment more than to fix my methods.  Thank you in advance! Why do some font commands behave differently? I've always been confused by the differences in behavior of font commands.  For example, we have \mathrm{} and \texttt{}, which can be used like this: \texttt{hello} world.  And then we have \it and \bf which must be used as {\it hello} world. If one uses \it{hello} world, both words are italicized.  Internally, what is the difference here? And was this difference a conscious design decision? If so, why? What is attached to this spigot and how to remove What's a big-vocabulary word for someone with a big vocabulary?  I'd like to say I'm looking for a "_____". Prove that the only automorphism of $\mathbb{Q}(\sqrt[3]{2})$ is the identity automorphism. I am having difficulty with this proof. I have previously proved that for an automorphism on the extension field $K$ of $F$ that when restricted to $F$ is the identity automorphism must take roots of $f(x)\in F[x]$ in $E$ to roots of $f(x)$ in $E$. I was thinking of using the minimal polynomial $x^{3}-2\in\mathbb{Q}[x]$ and the result of previous problem I solved, but I suspect there are automorphisms that don't fix the subfield, so the result can't be used or I need to prove that any automorphism of an extension field must fix the subfield that is being extended or always sends roots in $E$ to roots in $E$.  I am not asking for a solution to this, but maybe a hint or pointer in the right direction. This problem is introduced in the text prior to Galois theory, so please keep that in consideration. I need to prove this equivalence   Let $a,b \in \mathbb{Q^{+}}$ then $\sqrt{a} + \sqrt{b} \in \mathbb{Q} $ if and only if $\sqrt{a} \in \mathbb{Q}$ and $\sqrt{b} \in \mathbb{Q}$  I have already proved the reciprocal (the obvious part) but I am having difficulties with the other part  Please any hint will be appreciated.  Thanks in advance. Can you negate the Frightened condition by not looking at the source of your fear? As the title says, if you cause a creature to be Frightened of you, as in the Frightened condition, but they can somehow manage to not see you, do they stop rolling with disadvantage to attacks/ability checks?  Below are scenarios to illustrate my question.  Scenarios:   If a creature is frightened of you, and they turn their back against you to hit someone else, would they no longer have disadvantage to attack rolls/ability checks? If a creature is frightened of you and they have Blindsight, can they close their eyes to stop seeing you, and hence stop rolling with disadvantage? If a creature has 60 ft of movement and is frightened of you, and there is a corner they can reach in 15 ft that will block you from sight, can they run to that corner to stop being frightened, then run back to attack without disadvantage? Assume they would not provoke OA to do this, although the OA is immaterial to the question. Does taking levels in a prestige class cause XP Penalty? How can I re-write the conditionals for this button I've been trying out React for a couple of days and I tried to build a button component with some conditionals. Everything works but I feel like I am not doing it the right way. Could anyone review my code and give me some advice and tell me what I am doing wrong or what i could do better. I think I am using too many return statements. I use Typescript for type checking. Would appreciate any help! import { Link } from &quot;gatsby&quot;;  interface Props {   content: string,   color: string,   path?: string,   type?: string }  export default function Button(props: Props): JSX.Element {   let elementType;    const checkProps = () =&gt; {     const availableColors = ['blue', 'grey', 'dark-grey', 'white'];     const borderColors = [''];     let buttonStyle;      // Check if props.color exists in availableColors     if(!availableColors.includes(props.color)) {       console.error(`&quot;${props.color} color key not available for button style`);       return;     }          buttonStyle = buttonStyles[`button--${props.color}`];      // Check if props.content is valid     if(!props.content) {       console.error(`&quot;${props.content} is not valid as content`);       return;     }      // Check if props.type exists     if(!props.type) {       elementType = &lt;button className={ buttonStyle }&gt;{ props.content }&lt;/button&gt;       return;     }      if(props.type !== 'link') {       console.error(`&quot;${props.type} is not a valid type, use 'link' instead or use nothing for default button`);       return;     } else {         elementType = &lt;Link to={ props.path } className={ buttonStyle }&gt;{ props.content }&lt;/Link&gt;     }   }    checkProps();    return (     &lt;React.Fragment&gt;       { elementType }     &lt;/React.Fragment&gt;   ); }``` script custom previews in a menu I want to know how to create a menu with previews for an add-on. Until now I know that this is related with the bpy.utils.preview. I'm making an add-on that appends objects from a .blend file, I know how to append objects but what I want to do is to create a menu with previews of the objects /(similar to the matcaps menu - see below), select them and then press an &quot;import button&quot; to append the object. Here's some documentation about the module:    Also, as this is an add-on I don't know if I should have a def register() and a def unregister() inside this .py file as well as in the __init__.py file. Short story about aliens that are parts of a spaceship So I am currently making a minecraft custom map (for 1.9). I want to make the player "say" something using /tellraw commands. I did figure out how to make the player name come up using /say commands, but still have no idea how to do it using the /tellraw command.  How do I do that?