C++: Why is 'operator+=' defined but not 'operator+' for strings?
What are the basic rules and idioms for operator overloading?
Is it possible record videos of my screen? Suppose that I would like to record some video sessions of Angry Birds on my phone.   Are there any apps that I can use? I have root permissions. I've grown quite fond of HTTP reverse proxies in our development environment and found the DNS based virtual host reverse proxy quite useful. Having only one port (and the standard one) open on the firewall makes it much easier for management.  I'd like to find something similar to do SSH connections but haven't had much luck. I'd prefer not to simply use SSH tunneling since that requires opening port ranges other than the standard. Is there anything out there that can do this?  Could HAProxy do this? Solve $x^2+5x+6 \equiv 187 \mod 187$ Solution $$x^2+5x+6 \equiv 187 \mod 187$$ $$ (x+\frac{5}{2})^2 \equiv \frac{1}{4}$$ $$ 4(x+\frac{5}{2})^2 \equiv 1$$ $$ y:= x+\frac{5}{2} $$ $$ 4y^2 \equiv 1 \mod 11 \wedge 4y^2 \equiv 1 \mod 17  $$ $$ ( 2y \equiv 1 \mod 11 \vee 2y \equiv 10 \mod 11 ) \wedge ( 2y \equiv 1 \mod 17  \vee 2y \equiv 13 \mod 17)  $$ $$ ( y \equiv 6 \mod 11 \vee y \equiv 5 \mod 11 ) \wedge ( y \equiv 9 \mod 17  \vee y \equiv 15 \mod 17)  $$ Combining that from CRT I got: $$ y \in \left\{49, 60,83,94 \right\} $$ and for example: $$ x+\frac{5}{2}  \equiv 94 \mod 187$$ $$ 2x  \equiv 183 \mod 187$$ some calculus and get... $$x \equiv 185 $$ And the same thing for each other case. Question Is there any faster (or smarter) way to solve equations like that? On the nature of the collapse of the wave function The collapse of the wave function by measurements is one of the most mysterious properties of quantum mechanics.    At what scale does the wave function collapse? What are the conditions for a collapse?  Can it be made precise?  Does the collapse happen instantaneously, or is it spread out in time?  What is the precise equation for the collapse?  Why is the collapse time-asymmetric, and can this explain the arrow of time? This question is related to a couple of other questions ( and ) relating to some material that I teach in sampling theory.  Consider the critical points of the  defined as follows.  The value $t_{n-1, \alpha/2}$ is a function of $n$ defined by the implicit equation: $$\frac{\alpha}{2} = \frac{1}{\sqrt{(n-1) \pi}} \cdot \frac{\Gamma(\tfrac{n}{2})}{\Gamma(\tfrac{n-1}{2})} \int \limits_{t_{n-1, \alpha/2}}^\infty \Big( 1+ \frac{r^2}{n-1} \Big)^{-n/2} dr.$$ Normally we treat the input $n&gt;1$ as an integer, but it is possible to extend the treatment to consider it a real value (since the T-distribution is well-defined for non-integer degrees-of-freedom).  I'm trying to come up with a (relatively simple) proof that this critical point value is decreasing in $n$, but I seem to be making quite a mess.  Differentiation using Leibniz rule gets part way, but it quickly becomes a bit of a mess.  Consequently, I would like to solicit proofs of this result --- this simpler the better. Question: How do you prove that this critical point is strictly decreasing in $n$? differences between 2 JUnit Assert classes The JUnit framework contains 2 Assert classes (in different packages, obviously) and the methods on each appear to be very similar. Can anybody explain why this is?  The classes I'm referring to are:  and . Methods to see if a polynomial is irreducible Given a polynomial over a field, what are the methods to see it is irreducible? Only two comes to my mind now. First is Eisenstein criterion. Another is that if a polynomial is irreducible mod p then it is irreducible. Are there any others? I believe it's a common practice in some communities to name children after their grandparents or parents or relatives and sometimes even friends and popular people. Places, roads, streets etc., get named after famous people, too. Many inventions and discoveries have been named after people who invented or discovered them.  But I am not yet aware of a term that refers to the person whose name is given to people, places or objects this way. Is there a suitable word to fill in the blank below?     They named their son after the famous football player, David Beckham.      David Beckham is .......... of their son. How to print only last column? echo -e 'one two three\nfour five six\nseven eight nine' one two three four five six seven eight nine   how can I do some "MAGIC" do get this output?:  three six nine   UPDATE: I don't need it in this specific way, I need a general solution so that no matter how many columns are in a row, e.g.: awk always displays the last column. How do I print an IFrame from javascript in Safari/Chrome Can someone please help me out with printing the contents of an IFrame via a javascript call in Safari/Chrome.  This works in firefox:  $('#' + id)[0].focus(); $('#' + id)[0].contentWindow.print();   this works in IE:  window.frames[id].focus(); window.frames[id].print();   But I can't get anything to work in Safari/Chrome.  Thanks  Andrew The times they are a-changin' Replacing ArcPy with ArcGIS API for Python? Today I found out about the . I was wondering if you could use this to (eventually) replace ArcPy?  Recently I have been doing analyses that require cloud based solutions. When using AWS, Docker and Jupyter it is very convenient to stick with a Unix based OS such as Ubuntu. However, the Unix alternatives for ArcGIS have their own limitations as well such as the always hard to install python bindings for the  GDAL library. ArcGIS for Python operates cross platform.  Perhaps there are the things I should and should not expect from the ArcGIS API for Python.  Perhaps Arcpy is going to disappear altogether. Why is it considered a bad practice to omit curly braces? Why does everyone tell me writing code like this is a bad practice?  if (foo)     Bar();  //or  for(int i = 0 i &lt; count; i++)     Bar(i);   My biggest argument for omitting the curly braces is that it can sometimes be twice as many lines with them. For example, here is some code to paint a glow effect for a label in C#.  using (Brush br = new SolidBrush(Color.FromArgb(15, GlowColor))) {     for (int x = 0; x &lt;= GlowAmount; x++)     {         for (int y = 0; y &lt;= GlowAmount; y++)         {             g.DrawString(Text, this.Font, br, new Point(IconOffset + x, y));         }      }  }  //versus using (Brush br = new SolidBrush(Color.FromArgb(15, GlowColor)))     for (int x = 0; x &lt;= GlowAmount; x++)         for (int y = 0; y &lt;= GlowAmount; y++)             g.DrawString(Text, this.Font, br, new Point(IconOffset + x, y));   You can also get the added benefit of chaining usings together without having to indent a million times.  using (Graphics g = Graphics.FromImage(bmp)) {     using (Brush brush = new SolidBrush(backgroundColor))     {         using (Pen pen = new Pen(Color.FromArgb(penColor)))         {             //do lots of work         }     }  } //versus using (Graphics g = Graphics.FromImage(bmp)) using (Brush brush = new SolidBrush(backgroundColor)) using (Pen pen = new Pen(Color.FromArgb(penColor))) {     //do lots of work }     The most common argument for curly braces revolves around maintance programming, and the problems that would ensue by inserting code between the original if statement and its intended result:  if (foo)     Bar();     Biz();     Questions:   Is it wrong to want to use the more compact syntax which the language offers? The people that design these languages are smart, I can't imagine they would put a feature which is always bad to use. Should we or Shouldn't we write code so the lowest common denominator can understand and have no problems working with it?  Is there another argument that I'm missing? Type safety: Unchecked cast In my spring application context file, I have something like:  &lt;util:map id="someMap" map-class="java.util.HashMap" key-type="java.lang.String" value-type="java.lang.String"&gt;     &lt;entry key="some_key" value="some value" /&gt;     &lt;entry key="some_key_2" value="some value" /&gt;    &lt;/util:map&gt;   In java class, the implementation looks like:  private Map&lt;String, String&gt; someMap = new HashMap&lt;String, String&gt;(); someMap = (HashMap&lt;String, String&gt;)getApplicationContext().getBean("someMap");   In Eclipse, I see a warning that says:  Type safety: Unchecked cast from Object to HashMap  What did I do wrong? How do I resolve the issue? In column B I have contact number. I want to add a country code to all of them.  For example, if the number is 123456, I want it to become 88123456.    Each number is in 1 row, and there are about a thousand of them, so I want an automatic way to do this that allows me to add the country code to each of them without a space. (a) Solve the equation $yu_x+xu_y=0$  with the condition $u(0,y) = e^{-y^2}$. (b) In which region of the xy plane is the solution uniquely determined?     I did the first part but I don't understand how to do part b.  I read   But I don't understand how the argument is based. A more clear explanation is appreciated How did Voldemort get his body back? In the first book it seems that Voldemort has been reduced to nothing but a ghostly wisp. But IIRC by the fourth book he somehow has a body that is carried around by Wormtail. In the first book he needs someone to inhabit, by the fourth, he can't really move around, but he does have a body back which can hold a wand.  How did this transition happen? Monochromatic squares in a colored plane Opacity problem over white object in Illustrator I have a problem. I'm working with an object at 50% opacity. When it's over the artboard itself the color looks great, but when I put a white object behind it I get this weird color that doesn't look accurate.  This happens with every object and only in CMYK. I'm pretty sure this never happened to me before so maybe I changed something in the settings or I don't know.  Does anyone have any idea? A long time ago, I remember hiding some really personal files on my computer. Something that nobody could ever find, so I buried them down pretty darn good.  Now to my problem, I don't remember where.   Do anyone know a way to scan a drive and list all hidden folders and/or files?   I know how to view hidden files in Windows, but as far as I know, there is no way to search for them? I've been looking for a program, but I couldn't find one - and now I'm here, asking the experts. ;)  I'd really appreciate any tips.