Why if I use reference I don't need to deference a vector before using operator [] on it? If I pass a vector by reference to a function:  void QuadraticInterpolateArray(vector&lt;double&gt; &amp;b) {     double step = 12.2;     for (int j = 0; j &lt; b.size(); j++) {         b[j] = step;     } }   I don't need later to deference b when I need to access to its value by using operator []. Instead, if I pass vector by pointer:  void QuadraticInterpolateArray(vector&lt;double&gt; *b)   I need (*b)[j] later.   In both case I'm passing the "address" of that vector. Why with reference it works and with pointer doesn't? Its just by design?
What are the differences between a pointer variable and a reference variable in C++? I know references are syntactic sugar, so code is easier to read and write. But what is the difference between a pointer variable and a reference variable?
Why is 24.0000 not equal to 24.0000 in MATLAB? I am writing a program where I need to delete duplicate points stored in a matrix. The problem is that when it comes to check whether those points are in the matrix, MATLAB can't recognize them in the matrix although they exist.  In the following code, intersections function gets the intersection points:  [points(:,1), points(:,2)] = intersections(...     obj.modifiedVGVertices(1,:), obj.modifiedVGVertices(2,:), ...     [vertex1(1) vertex2(1)], [vertex1(2) vertex2(2)]);   The result:  &gt;&gt; points points =    12.0000   15.0000    33.0000   24.0000    33.0000   24.0000  &gt;&gt; vertex1 vertex1 =     12     15  &gt;&gt; vertex2     vertex2 =     33     24   Two points (vertex1 and vertex2) should be eliminated from the result. It should be done by the below commands:  points = points((points(:,1) ~= vertex1(1)) | (points(:,2) ~= vertex1(2)), :); points = points((points(:,1) ~= vertex2(1)) | (points(:,2) ~= vertex2(2)), :);   After doing that, we have this unexpected outcome:  &gt;&gt; points points =    33.0000   24.0000   The outcome should be an empty matrix. As you can see, the first (or second?) pair of [33.0000 24.0000] has been eliminated, but not the second one.  Then I checked these two expressions:  &gt;&gt; points(1) ~= vertex2(1) ans =      0 &gt;&gt; points(2) ~= vertex2(2) ans =      1   % &lt;-- It means 24.0000 is not equal to 24.0000?   What is the problem?    More surprisingly, I made a new script that has only these commands:  points = [12.0000   15.0000           33.0000   24.0000           33.0000   24.0000];  vertex1 = [12 ;  15]; vertex2 = [33 ;  24];  points = points((points(:,1) ~= vertex1(1)) | (points(:,2) ~= vertex1(2)), :); points = points((points(:,1) ~= vertex2(1)) | (points(:,2) ~= vertex2(2)), :);   The result as expected:  &gt;&gt; points points =      Empty matrix: 0-by-2 How to backup an Android device? Can anyone recommend a good way to backup Android devices? Ideally I would like to do this wirelessly and, not only backup my data, but also my user settings. Is it possible to backup an image of an Android device - so that one doesn't even need to reinstall apps? It would be particularly useful to hear from users that have restored backups, as to how easy, and complete, their processes were. Thanks Print to standard printer from Python? Identifying a quotient group (NBHM-$2014$) Let $\mathbb C^*$ denote the multiplicative group of non-zero complex numbers and let $P$ denote the subgroup of positive real numbers. Identify the quotient group.    My thought $$\frac{\mathbb C^*}{P}=\{P,-P,iP,-iP\}.$$ Is it right? "FTL" Communication with Quantum Entanglement? Can quantum entanglement make sending a message, whether audio, video, or even Morse code, instantaneous between two points (faster than it could travel normally at the speed of light)?  Let me first be clear, my question is not whether a message can travel faster than light. I simply mean whether a message can be generated here and then a copy of that message heard over there sooner than the message would normally be received.  Say a large number of entangled pairs are generated. One half the particles are given to Jack and the opposite ones to Sally. Jack then hops on a ship and travels 8 months to Mars. Sally then manipulates her particles in the form of a message. Do the corresponding opposite particles get manipulated simultaneously so that Jack receives the message instantly instead of the 16 light-minutes for a classically transmitted message? Travel to Australia with new passport (with visa in old passport) I was granted a visa to Australia few months ago. I’d like to travel to Australia in few days. However, I’ve just renewed my passport and I don’t have enough time to inform them about my passport renewal. Can I travel to Australia by carrying both my old and my new passports? sequence $x_{n+1}=x_n+e^{-2018x_n}$ How to create a random math problem in LaTeX? I want to create a math problem-solution sheet. The coefficients a, b, c must be assigned on the fly at random so the generated pdf will show a numeric quadratic equation rather than a symbolic quadratic equation. Note a must not be zero.  \documentclass{article} \begin{document} \section{Problem} Let \(x_1\) and \(x_2\) be the roots of \(a x^2 +bx +c=0\). Find  \(x_1x_2\).  \section{Solution} \[ x_1x_2=\frac{c}{a} \] \end{document}   Please kindly make the solution get automatically simplified. For example: \frac{c}{a}=3 when a=2 and c=6.    Actually the real case is more complex than this one. Not only the equations must be generated at random, but also the associated graphic plots that I write in PSTricks.     I chose Paulo's answer because using Maxima as the computation engine is very very great idea. Other answers are also good and creative, especially Altermundus'. $S=\{(n,{1\over n}):n\in\mathbb{N}\}$ is closed in $X$? The topological space $X=\mathbb{N}\times \mathbb{Q}$ with subspace topology of $\mathbb{R}^2$ the set $S=\{(n,{1\over n}):n\in\mathbb{N}\}$ is closed in $X$?  $S^c=\phi\times\{{1\over n}\}^c$ right? but I know $\mathbb{Q}$ is neither open nor closed in $\mathbb{R}$, I am confused here, could any one help me to answer this question?  the boundary of $S$ is $\bar{S}\setminus $ int S. as int S is $\phi$ so boundary is $\mathbb{N}\times \mathbb{R}$? At most finitely many (Hamel) coordinate functionals are continuous - different proof Algebraic proof that if $a>0$ then $1+a^9 \leq \frac{1}{a}+a^{10} $ Prove that if $a&gt;0$ then $1+a^9 \leq \frac{1}{a}+a^{10} $.   Using the fact that $a \gt 0$, multiply by $a$ on both sides and get everything to one side we have; $a^{11}-a^{10}-a+1 \geq 0$. By factoring $(a^{10}-1)(a-1) \geq 0 $.  I am not sure how to proceed any further. I have too many sections in my presentation such that the left-hand-side navigation bar is full and only shows the first sections in Fig. 2, initial situation in Fig. 1.  Pseudocode    clean the left-hand-hand side navigation bar when exceed the threshold and start a new one there when on sufficient page  this feature occurs with Beamer Berkeley appendix so it is possible also with the main document   Code which problem shown in Fig. 2   \documentclass{beamer} \usetheme{Berkeley}  \logo{\includegraphics{logo.png}} \usepackage{hyperref} % https://tex.stackexchange.com/a/346486/13173 \newenvironment{slide}[1] {\begin{frame}[environment=slide,allowframebreaks] \frametitle{\insertsection-#1} } {\end{frame}} % fragile only if code % allowframebreaks not by default   \begin{document}  \title{Sensory system. Primary sensory modalities. Cortical modalities. Kinds of sensory disturbances. Spinal cord disorders. Spinal cord transverse and partial lesion. Cauda equina damage.} \author{Leo}  \section{Cortical modalities} \begin{slide}{basics}      More refined aspects of sensation ... \end{slide}  \section{Cortical modalities} \begin{slide}{basics}      More refined aspects of sensation ... \end{slide}  \section{Cortical modalities 2} \begin{slide}{basics}      More refined aspects of sensation ... \end{slide}  \section{Cortical modalities 3} \begin{slide}{basics}      More refined aspects of sensation ... \end{slide}  \section{Cortical modalities 4} \begin{slide}{basics}      More refined aspects of sensation ... \end{slide}  \end{document}   Fig. 1 Situation at the first page,  Fig. 2 Situation at Section 6 wheere the navbar has not changed,  Fig. 3 Samcarter's answer output + one slide addition but without \part{} - fails on sufficient page count       Output: the left-hand-side navigation bar is not refreshed when the amount of sections exceed its capacity on suffcient enough page     Testing Samcarter's proposal  I include one slide before Samcarter's body so I get the wrong output in Fig. 3.  Solution: Eventually correct output by just adding \part{} in the place where the new navbar is wanted.   TeXLive: 2016 OS: Debian 8.7 This is a basic question on Box-Jenkins MA models. As I understand, an MA model is basically a linear regression of time-series values $Y$ against previous error terms $e_t,..., e_{t-n}$. That is, the observation $Y$ is first regressed against its previous values $Y_{t-1}, ..., Y_{t-n}$ and then one or more $Y - \hat{Y}$ values are used as the error terms for the MA model.  But how are the error terms calculated in an ARIMA(0, 0, 2) model? If the MA model is used without an autoregressive part and thus no estimated value, how can I possibly have an error term? Could someone advise me on how to determine all entire functions $f$ such that $|f'(z)| \leq |f(z)|, \forall z\ ?$  Hints will suffice, thank you. Want to switch from software development to testing domain The number of divisors I am reading a math book. It states the following rule:      For an integer $n$ greater than 1, let the prime factorization of $n$ be $$n=p^a_1p^b_2p^c_3...p^m_k$$    Here $a, b, c,..., m$ are nonnegative integers, and $p_1,p_1,...,p_k$ are prime numbers. Then the number of divisors of $n$ is: $$d(n)=(a+1)(b+1)(c+1)...(m+1)$$   I can use the rule to solve problems correctly, but I don't understand the rule. How to prove it? Are there any official specifications regarding the torque for camera mounts? I've been wondering why I've never seen any official specifications of the maximum allowed torque that can be exerted upon lens mounts. It seems to me like a very useful specification, but I can't seem to find it from any manufacturer.  indicates that there might be no specifications for Nikon mounts. Are there really no manufacturer that publish these specification of their mounts? Chapter number starts at 2 not 1 How can I start my chapter from "Chapter 2" instead of "Chapter 1".  I am preparing LaTeX document for each chapter. when I put \chapter{Introduction}, it produces "Chapter 1" Introduction. However I want it to be "chapter 2" Introduction instead. Transferring through US airport. Do I need traveling visa? A formal name for "smallest" and "largest" partition Consider a set $A=\{1,2,3,4,5\}$, is there any terminology for the following partitions of $A$ ?  (1) $A=\{ \{1\},\{2\},\{3\},\{4\},\{5\} \}$  (2) $A=\{\{1,2,3,4,5\}\}$.