Why we always need a friend function to overload (>>) in stream or (&lt;&lt;) out stream operator.
That's basically the question, is there a "right" way to implement operator&lt;&lt; ? Reading  I can see that something like:  friend bool operator&lt;&lt;(obj const&amp; lhs, obj const&amp; rhs);   is preferred to something like   ostream&amp; operator&lt;&lt;(obj const&amp; rhs);   But I can't quite see why should I use one or the other.  My personal case is:  friend ostream &amp; operator&lt;&lt;(ostream &amp;os, const Paragraph&amp; p) {     return os &lt;&lt; p.to_str(); }   But I could probably do:  ostream &amp; operator&lt;&lt;(ostream &amp;os) {     return os &lt;&lt; paragraph; }   What rationale should I base this decision on?  Note:   Paragraph::to_str = (return paragraph)    where paragraph's a string.
Let $R=\frac{\mathbb{C}[x,y]}{\langle x^2-y^2-1 \rangle}$. Prove that (1) $R$ is an integral domain. (2) Any nonzero prime ideal of $R$ is maximal.  My idea: (1) The first part is easy. Since $x^2-y^2-1\in \mathbb{C}[y][x]$ is Eisenstein with respect to the prime $y+i$, it is irreducible. Hence the ideal generated by it is a prime ideal. (2) I am struggling with this part. I have one approach (not sure if correct). Approach : Let $I=\langle x^2-y^2-1 \rangle$. Then $R=\mathbb{C}[x,y]/I$.  Any ideal of $R$ is of the form $J/I$ where $J\subseteq \mathbb{C}[x,y]$ is an ideal containing $I$. If we can show that any prime ideal $J$ containing $I$ is maximal, then we are done. How to prove this? Is there any other way to prove the second part? Edit: I am trying to avoid Hilbert Nullstellensatz and the notion of dimension of a ring, as these concepts are not there in the syllabus of the exam from which I found this question. Can someone explain this trigonometric limit? I have $$\lim \limits_{x\to 0}  \frac {\tan(2x)}{\sin(x)}$$ and in my case the result is $\frac{2}{1}$ =2 not whether it is right.  This is my procedure.  $$\lim \limits_{x\to 0}  \frac{\frac {\sin(2x)}{\cos(2x)}}{\frac{\sin(x)}{1}}= \lim \limits_{x\to 0}  {\dfrac {\sin(2x)}{(\cos(2x))(\sin(x))}}=\dfrac{2x\frac {\sin(2x)}{2x}}{\cos(2x)\frac{x\sin(x)}{x}}$$  I separate the limit.  $$\frac{\left(\lim \limits_{x\to 0}2x\right) \cdot \left(\lim \limits_{x\to 0}\frac {\sin(2x)}{2x}\right)}{\lim \limits_{x\to 0}\left(\cos(2x)\right)\cdot\left(\lim \limits_{x\to 0}\frac{x\sin(x)}{x}\right)} = \lim \limits_{x\to 0} \dfrac{2x}{x}=\frac{2}{1} =2$$ How to cut the non-overlapping part of 2 shapes in Illustrator CS6 I have 2 shapes (see below) a circle and a shape of the US. I want to remove the part of the US that falls outside the circle. How is this possible?    Thanks I was wondering if there was a method to alter object settings at a set point in an animation in blender.  For example, I want to make the color of an object blue for the first 20 frames, but after 20 frames I want its color to change to green. Is there any known method of doing this? I could not find anything when I searched. My computer does not store the history of the entries entered in RUN (WIN+R).   Thus, how to enable Windows to store the history? Is it possible to model a PIN InGasAS photodiode in a SPICE simulator? I want to know if it is possible to model a InGasAs panchromatic PIN photodiode, in accord with datasheet, in simulator SPICE MicroCAP 12. Because the supplier doesn't provide a SPICE model. And if it is possible, which are those steps. Here is data-sheet  And below I will attach an electrical schematic of a transimpedance amplifier with phototdiode, used as a smoke receiver. I want to monitor graphically the impulse of photodiode in function of output of transimpedance for sensibilty. I found a type of photodiode in the Micro-CAP 12 library but it is simple photodiode, which does not match the datasheet. Is this an instance of Priori Incantatem? During the climax of Fantastic Beasts and Where to Find Them, Tina briefly duels with Graves and their wands appear to lock with each other (see picture). I believe this also happens some other times in the later Harry Potter films other than Harry and Voldemort's duel in the graveyard during Goblet of Fire.    We know that this is definitely a case of Priori Incantatem for the graveyard duel in Goblet of Fire, as the wands are locked for a sufficient amount of time for past spells to begin showing themselves (significantly, showing the people Voldemort had murdered), but is this the case for the other instances of wands locking? If so, does that mean there are a lot more wands out there with shared cores, as it was my understanding this could only happen if that criteria was satisfied? Just want to get clarification on something we're noticing in our org. Its regarding a new integration user we've created for an external application to connect to Salesforce. We also created a Connected App for this application to authenticate using OAuth. All of this is setup and working up to this point.   But one thing that we don't understand is there is a related list on the integration user detail page named "OAuth Connected Apps". We're concerned because although we are connecting fine and data is getting return to the external application no records are showing up in this "OAuth Connected Apps" related list. Should we expect to see Authorization or Access tokens in this list?   We just want to make sure we aren't bypassing the connected app in anyway, which we assume not, but just want to run it by the community and see. All comments are appreciated. Thanks ahead of time for the support. Why does switching to the tty give me a blank screen? After booting to the GUI in 12.04, I attempt to move to the virtual terminal (or shell, or tty) via Ctrl-Alt-F1 (F1 through F6), and the screen remains blank. I have tried all 6 tty instances and the results are the same. Ctrl-alt-F7 brings me back to the GUI without a problem. Any thoughts? Arrows linking table cells I'm currently trying to add arrows in my synthetic division example to show people clearly how synthetic division works. I'm working on Overleaf.   The code for my synthetic division right now is:  \begin{tabular}{c |r r r r r}     &amp;1&amp; 4 &amp; -1&amp;16&amp;-20\\   1&amp;&amp; 1 &amp; 5 &amp; 4&amp;20\\   \hline    &amp;1 &amp;5 &amp; 4 &amp; 20 &amp;\rule{3pt}{16pt}\;0\\   \end{tabular}   How would I add arrows to this? For instance, a down arrow going from the first 1 to 1, then an upwards arrow pointing right from 1 to 1, then an arrow pointing down from 1 to 5, etc. Basically I would like to add arrows that look like this: Linearization of PDE: $0$ is an eigenvalue since all translates of travelling waves are also travelling waves Consider the following PDE: $$ u_t=u_{xx}+f(u)-w,~~~~~w_t=\varepsilon (u-\gamma w),~~~~~~~~~(1) $$ where $f(u)=u(u-a)(1-u), 0&lt;a&lt;\frac{1}{2}, \varepsilon,\gamma &gt;0, \varepsilon\ll 1,\gamma\ll 1$.  A travelling wave for (1) is a solution that is a function of the single variable $\xi=x-ct$, i.e., $(u(\xi),w(\xi))$ satisfies $$ -cu'=u''+f(u)-w,~~~~~~-cw'=\varepsilon (u-\gamma w)~~~~~~~('=d/d\xi).~~~~~~(2) $$  If (1) is recast in a moving coordinate frame, i.e., in terms of variables $\xi=x-ct$ and $t$, it becomes $$ u_t=u_{\xi\xi}+cu_{\xi}+f(u)-w,~~~~~~w_t=cw_{\xi}+\varepsilon (u-\gamma w).~~~~~~~~(3) $$  One can see by (2), that a travelling wave is an equilibrium solution of (3). So one nearby question is to ask whether a travelling wave is stable.    For a fixed $\varepsilon$, let $U_{\varepsilon}(\xi)=(u_{\varepsilon}(\xi),w_{\varepsilon}(\xi))$ be a travelling wave for (1), i.e., an equilibrium solution for (3).          A standard technique for determining stability of $U_{\varepsilon}(\xi)$ is to linearize: If the right-hand side of (3) is linearized along $U_{\varepsilon}(\xi)$, the resulting operator is     $$ L\begin{pmatrix}p\\r\end{pmatrix}=\begin{pmatrix}p_{\xi\xi}+cp_{\xi}+f'(u_{\varepsilon})p-r\\cr_{\xi}+\varepsilon (p-\gamma r)\end{pmatrix}, $$     where $\begin{pmatrix}p\\r\end{pmatrix}(\xi)\in\text{BC}(\mathbb{R},\mathbb{R}^2):=\left\{u\colon\mathbb{R}\to\mathbb{R}^2 | u\text{ is bounded and uniformly continuous}\right\}$.      (The linearized criterion for stability of the travelling wave is that the spectrum of $L$ (except for $0$) lies in a left half-plane and $0$ is a simple eigenvalue.)  Thats the background.  Now, there is a statement that I could not understand yet.          Note, that $0$ must be in the spectrum because the translate of a travelling wave is another travelling wave.      I know that a translate of a travelling wave is again a travelling wave. But why does this imply that $0$ is in the spectrum of $L$?  Edit  After some looks at definitions, I have an idea:  Consider a solution $U(\xi,t)$ that is a translate of the travelling wave $U_{\varepsilon}(\xi)=(u_{\varepsilon}(\xi),w_{\varepsilon}(\xi))$, i.e.  $$ U(\xi,t)=U_{\varepsilon}(\xi-k)=(u_{\varepsilon}(\xi-k),w_{\varepsilon}(\xi -k)) $$ for some $k$. Then $U$ is an equilibrium solution of (3), too.  If I am not totally wrong, then we have  $$ p=u_{\varepsilon}(\xi-k)-u_{\varepsilon}(\xi),~~~~r=w_{\varepsilon}(\xi-k)-w_{\varepsilon}(\xi) $$ and  $$ p_t=0,~~~w_t=0, $$ because travelling waves are equilibria for (3) and a translate of a travelling wave is a travelling wave.  Hence $$ L\begin{pmatrix}p\\r\end{pmatrix}=\begin{pmatrix}0\\0\end{pmatrix}, $$ meaning that $$ \text{ker}(L-0\text{ id })\neq\left\{\begin{pmatrix}0\\0\end{pmatrix}\right\}, $$ because for each translate of the travelling wave, $p,r\neq 0$ and  $\begin{pmatrix}p\\r\end{pmatrix}\in\text{ker}(L-0\text{ id})$.  Hence $0$ is in the spectrum (point spectrum) of $L$.  Is this what was meant? What computer components are currently vulnerable to magnets? When I first started using computers, law of the land in computer class was never bring magnets near anything computer related, lest you lose all your data or screw up your monitor.  Now I am pretty sure magnets will still royally mess up a standard hard drive, and I know for a fact they screw up a CRT monitor.  Though I am also pretty sure they do not screw up a LCD monitor?  Now I have my phone which uses magnets to determine if it's docked, and it made me wonder.  Is it the power of the magnet preventing data loss or the sheer fact that whatever memory type in the phone is immune to it?  What about ear buds, as I know those have tiny magnets in them. Are those capable of damaging any electronic device currently in use?  I'm wondering if I'm being paranoid, but I really am not sure what magnets will damage and what they won't!  Is there a list, or rule of thumb for determining what will be hurt by magnets and what won't be? Routing sound from different cards to a single output I have a setup where I am monitoring for silence on an incoming stream on 3 different audio cards.  When I detect silence on the master I switch to the secondary, and if I detect silence there I switch to the last card.  The way I have it set up I load/unload the loopback module for each card depending on who's the active card.  This has the inconvenience that I need a 3-to-1 minijack cable to be able to maintain the stream.  Can I load the loopback module and point the output to a single card (independently of the input card)?  How can I route the audio from any input to a single output? I need to knock out a quick animation in C#/Windows Forms for a Halloween display.  Just some 2D shapes moving about on a solid background.  Since this is just a quick one-off project I really don't want to install and learn an entire new set of tools for this.  (DirectX dev kits, Silverlight, Flash, etc..)  I also have to install this on multiple computers so anything beyond the basic .Net framework (2.0) would be a pain in the arse.  For tools I've got VS2k8, 25 years of development experience, a wheelbarrow, holocaust cloak, and about 2 days to knock this out.  I haven't done animation since using assembler on my Atari 130XE (hooray for page flipping and player/missile graphics!)  Advice?  Here's some of the things I'd like to know:   I can draw on any empty widget (like a panel) by fiddling with it's OnPaint handler, right?  That's how I'd draw a custom widget.  Is there a better technique than this? Is there a page-flipping technique for this kind of thing in Windows Forms?  I'm not looking for a high frame rate, just as little flicker/drawing as necessary.   Thanks.  Post Mortem Edit ... "a couple of coding days later"  Well, the project is done.  The links below came in handy although a couple of them were 404.  (I wish SO would allow more than one reply to be marked "correct").  The biggest problem I had to overcome was flickering, and a persistent bug when I tried to draw on the form directly.   Using the OnPaint event for the Form: bad idea.  I never got that to work; lots of mysterious errors (stack overflows, or ArgumentNullExceptions).  I wound up using a panel sized to fill the form and that worked fine. Using the OnPaint method is slow anyway.  Somewhere online I read that building the PaintEventArgs was slow, and they weren't kidding.  Lots of flickering went away when I abandoned this.  Skip the OnPaint/Invalidate() and just paint it yourself.  Setting all of the "double buffering" options on the form still left some flicker that had to be fixed.  (And I found conflicting docs that said "set them on the control" and "set them on the form".  Well controls don't have a .SetStyle() method.)  I haven't tested without them, so they might be doing something (this is the form):      this.SetStyle(ControlStyles.UserPaint, true);     this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);     this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);    So the workhorse of the code wound up looking like (pf is the panel control):      void PaintPlayField()     {         Bitmap bufl = new Bitmap(pf.Width, pf.Height);         using (Graphics g = Graphics.FromImage(bufl))         {             g.FillRectangle(Brushes.Black, new Rectangle(0, 0, pf.Width, pf.Height));             DrawItems(g);             DrawMoreItems(g);             pf.CreateGraphics().DrawImageUnscaled(bufl, 0, 0);         }     }   And I just called PaintPlayField from the inside of my Timer loop.  No flicker at all. Where is the operator panel in Blender 2.8? The tutorial I read is based on 2.79. So I'm not sure if it's still the same name in 2.8. But I can't find anything providing similar functionalities. Center of $D_6$ is $\mathbb{Z}_2$ The center of $D_6$ is isomorphic to $\mathbb{Z}_2$.   I have that $$D_6=\left&lt; a,b \mid a^6=b^2=e,\, ba=a^{-1}b\right&gt;$$ $$\Rightarrow D_6=\{e,a,a^2,a^3,a^4,a^5,b,ab,a^2b,a^3b,a^4b,a^5b\}.$$ My method for trying to do this has been just checking elements that could be candidates. I've widdled it down to that the only elements that commute with all of $D_6$ must be $\{e,a^3\}$ but I got there by finding a pair of elements that didn't commute for all other elements and I still haven't even shown that $a^3$ commutes with everything. For example, I have been trying to show now that $$a^3b=ba^3$$ and haven't gotten too far yet but if I had to answer a question like this on the exam, I feel it would be difficult, is there any kind of trick or hints other than brute force using the relations to get that $a^3$ commutes with everything?  For the solution once I have that the center of $D_6$ is what I think then as there is only one group of order $2$ up to isomorphism, it must be isomorphic to $\mathbb{Z}_2$.  Ideally a way that doesn't appeal to $D_6$ as symmetries of the hexagon if that seems possible. Number of non-isomorphic groups of order 21 How to fix a stripped pedal crank The threads on my bike's pedal crank just became fully stripped and the pedal fell off, though the pedal itself is fine. Is there any way I can fix this without fully replacing the pedal crank? Every Function in a Finite Field is a Polynomial Function From a bank of past master's exams I am going through:     Let $F$ be a finite field. Show that any function from $F$ to $F$ is a polynomial function.   I know that finite fields are fields of $p$ elements for $p$ prime [EDIT: It's actually $p^n$ for $p$ prime; see comment below]. Since I have $p$ choices for the $p$ elements to map to, then I have $p^p$ distinct functions. I think every function can be written in the form $f(x) = a_{p-1}x^{p-1} + \dots + a_0x^0$. For then given the values $f(0), f(1), \ldots f(p-1)$, I can solve for the coefficents by the linear system of equations  $$ a_0 + \sum_{i=1}^{p-1} n^i a_i = f(n).$$  This then gives me a $p-1 \times p-1$ square matrix over the field $\mathbb{F}_p$:  $$\left( \begin{array}{ccccc} 1&amp; 0 &amp; 0 &amp; \ldots &amp; 0 \\ 1&amp; 1 &amp; 1 &amp; \dots &amp; 1 \\ 1&amp; 2 &amp; 4 &amp; \dots &amp; 2^{p-1} \\ \vdots &amp; \vdots &amp; \vdots &amp; &amp; \vdots \\ 1 &amp; p-1 &amp; (p-1)^2 &amp; \dots &amp; (p-1)^{p-1} \end{array} \right) \left( \begin{array}{c} a_0 \\ a_1 \\ a_2 \\ \vdots \\ a_{p-1} \end{array}\right)  = \left( \begin{array}{c} f(0) \\ f(1) \\ f(2) \\ \vdots \\ f(p-1) \end{array} \right)$$  If I can show this matrix is invertible, then I can always find the $a_i$. But I am a bit stumped on how to show this (partially because I don't think I've ever done linear algebra in a vector space over a finite field). It does not seem easy to show linear independence, or nonzero determinant, or full row rank.    Alternatively (I just thought of this), can I show this is true by arguing that the map between the two sets (the set of polynomials of degree $p-1$; and the set of functions $F \to F$) is injective, and that it must be a bijection because the sets have the same cardinality $p^p$? Which cameras have built-in HDR? When taking landscape photos, I often struggle with dynamic range. I have either a burned out skies or landscapes are too dark.  Now I'm reading  that some cameras can take 3 pictures with different exposures, and combine them automatically to one image with higher dynamic range.   So my question is, which cameras have this feature?