Strange behaviour while adding string to another string in C++ one is 2, and ans is &quot;000000&quot;. string ans = &quot;000000&quot;; ans += string(&quot;1&quot;, one); cout&lt;&lt;ans&lt;&lt;endl;  The output is: 0000001� But I want the output: 00000011 What am I doing wrong?
How to repeat a string a variable number of times in C++? I want to insert 'n' spaces (or any string) at the beginning of a string in C++. Is there any direct way to do this using either std::strings or char* strings?  E.g. in Python you could simply do  &gt;&gt;&gt; "." * 5 + "lolcat" '.....lolcat'
How do I easily switch between windows rather than applications in GNOME Shell? Taylor's Remainder $x-\frac{x^2}{2}+\frac{x^3}{3(1+x)}<\log(1+x) <x-\frac{x^2}{2}+\frac{x^3}{3}$ Prove that   $\displaystyle x-\frac{x^2}{2}+\frac{x^3}{3(1+x)}&lt;\log(1+x) &lt;x-\frac{x^2}{2}+\frac{x^3}{3}$  My attempt: I can prove this by taking one side at a time and assuming $\displaystyle f(x) = \log (1+x)-x+\frac{x^2}{2}-\frac{x^3}{3}$   and then proving that it is a decreasing function and then the same for the other side.  But I am looking for a better solution using Lagrange's Mean Value Theorem or using Taylor's remainder. How to prevent a coauthor from stealing the article? Please go through the following incidents to understand the problem.  Mr. A is a Ph.D. student of some institute who was working with Prof. B of another institute on a very interesting mathematical problem since last three years. Recently, they came across a significant solution to it. They wrote a research article to publish in a very good mathematics journal that accepts the online submission.  Prof. B wanted to submit it to the journal by himself. Mr. A agreed.   A few days ago, Mr. A wanted to know about the submission of their article via telephone. Prof. B informed that the article is submitted. But, Mr. A received any confirmation e-mail neither from the journal nor Prof. B forwarded the submission mail to him. Prof. B did not upload it in arXiv, which is a free preprint repository.  Mathematics journals used to take a long duration to review and publish an article. Prof. B told that submitting this article to arXiv will immediately attract community attention. Many researchers will start working in the new direction. As a result, Mr. A and Prof. B may lose their opportunity to work on that problems. Also, the article may be stolen.  Mr. A did not ask Prof. B to forward the submission confirmation mail to him. Prof. might think that Mr. A is suspecting him. It may affect the relationship. Also, Prof. is a very powerful person in the administration, who may prevent an opportunity for Mr. A to gain a job. Again from some of his friends, Mr. A came to know that Prof. had distributed related research problems to his collaborators.  As a consequence, Mr. A is thinking that Prof. has submitted this work in his own name and he has lost his credit as the first author of this article.  Now the question is: How Mr. A may save his credit and his work without hampering his relationship with Prof B? What's the difference between a method and a function? Can someone provide a simple explanation of methods vs. functions in OOP context? don't really understand how to log on with your SE account in the new logon screen.  And although it might be obvious to most of us, some people find the new dialog hard to understand.        Can we add a logo and some text to make clear users can log on with their SE account? Something like:     [SE LOGO] Log on using your StackExchange account   Followed by the two boxes for email and password. How can I stop applications and services from running? When my phone starts up there are several application/services running in the background that I would rather not.  And when I press the Home button while using an app, that app usually goes into the background without exiting.  How can I stop these apps from running? How to fix Eclipse with OpenJDK 9 I've been working with ArcGis for a while now and was wondering if there was a way to change positions of parameters inside the toolbox for the user. The only time I have seen this done in arc toolbox is with the Raster clip tool with the Rectangle parameter where the 4 parameters are aligned in a circle in the toolbox.     I don't know if what I want is possible since I haven't seen anyone else do it. How many ways can we let people into a movie theater if they only have half-dollars and dollars? My interest in combinatorics was recently sparked when I read about the many things that the Catalan numbers count, as found by Richard Stanley. I picked up a copy of Brualdi's Combinatorics, and while browsing the section on counting sequences I found a nice little puzzle that has definitely puzzled me.     Let $m$ and $n$ be nonnegative integers with $n\geq m$. There are $m+n$ people in line to get into a theater for which admission if $50$ cents. Of the $m+n$ people, $n$ have a $50$-cent piece and $m$ have a $\$ 1$ dollar bill. The box offices opens with an empty cash register. Show that the number of ways the people can line up so that change is available when needed is   $$ \frac{n-m+1}{n+1}\binom{m+n}{m}. $$     I first noted that the first person to enter must be one of the $n$ with a half-dollar. Now the register has a half-dollar change. The second person can be either a person with a half-dollar or a dollar. In the first case, the register will now have two half-dollars, in the second case, the register will now have one dollar bill. So it seems to me that when one of the $n$ people with a half-dollar enters, the number of half-dollars in the register increases by $1$, and when one of the $m$ people with a bill enters, the number of half-dollars decreases by $1$ but the number of bills increases by $1$.   I tried to model this by looking at paths in $\mathbb{Z}^2$. The $x$-axis is like the number of half-dollars, and the $y$-axis is the number of bills. You start at $(0,0)$, and you can take steps forward $(1,0)$ or backwards diagonally $(-1,1)$ corresponding to who enters, but you must always stay in the first quadrant of the plane without crossing over the axes. The goal is to make $m+n$ moves, and I figured maybe the number of such paths is counted by $\frac{n-m+1}{n+1}\binom{m+n}{m}$, but I'm not sure how to show this. I don't know if this observation simplifies the problem at all, as I don't know how to finish up. I'd be happy to see how this problem is done, thank you. I vaguely remember a SciFi novel from my younger days, where scientists discover "alternative" forms of power beside electromagnetism.  I do not remember the specific forms, but it was something along the lines of "electrogravity", "magnetogravity" etc. -- you get the idea. If I remember correctly, the effects of these power forms were basically psionic / magic in nature.  Unfortunately I remember very little of the actual plot, and couldn't put it into words with any coherency. Some treachery from within the group of scientists, perhaps some involvement of aliens? I cannot really remember. I just remember I enjoyed the story very much, and would like to re-read it.  The title could be "The fifth column" or similar -- then again I might be confusing two seperate novels.  I know that's not much, sorry. Anyone remembers this? Vector spaces for the irreducible representations of the Lorentz Group EDIT:  The vector space for the $(\frac{1}{2},0)$ Representation is $\mathbb{C}^2$ as mentioned by Qmechanic in the comments to his answer below! The vector spaces for the other representations remain unanswered.  The definition of a representation is a map (a homomorphism) to the space of linear operators over a vector space. My question is: What are the corresponding vector spaces for the   $(0,0)$ Representation $(\frac{1}{2},0)$ Representation  $(0,\frac{1}{2})$ Representation $(\frac{1}{2},0) \oplus (0,\frac{1}{2}) $ Representation $(\frac{1}{2},\frac{1}{2})$ Representation infinite dimensional Representation? How to download Ubuntu Server backups automatically? I'm thinking of an investment in a new root server running ubuntu. Due to the fact, that the provider won't have extra backup-space, I need an other solution.  Is it possible to download the server backups automatically when my desktop machine is connected to the internet and in idle state? How to loop the particle simulation indefinitely? I've made a simple snowfall particle simulation (using gandalf3's solution: ). Is there a way to loop the animation, so the transition between last frame and first frame is not visible? Is there a setting to do it? How do I free up more space in /boot? How can I move the top panel to the bottom in Gnome 3? Is there a way to move the top panel to the bottom in Gnome 3? It is very annoying to have this panel at the top, because then I have to aim for the close button when I want to close a window. When the panel is at the bottom, I can simply throw the mouse pointer to the corner. Big usability issue. Prove that $\exp(x)>0$ using only formal definition of exp Training on the full dataset after cross-validation? Why are neural networks becoming deeper, but not wider? In recent years, convolutional neural networks (or perhaps deep neural networks in general) have become deeper and deeper, with state-of-the-art networks going from 7 layers () to 1000 layers ( in the space of 4 years. The reason behind the boost in performance from a deeper network, is that a more complex, non-linear function can be learned. Given sufficient training data, this enables the networks to more easily discriminate between different classes.  However, the trend seems to not have followed with the number of parameters in each layer. For example, the number of feature maps in the convolutional layers, or the number of nodes in the fully-connected layers, has remained roughly the same and is still relatively small in magnitude, despite the large increase in the number of layers. From my intuition though, it would seem that increasing the number of parameters per layer would give each layer a richer source of data from which to learn its non-linear function; but this idea seems to have been overlooked in favour of simply adding more layers, each with a small number of parameters.  So whilst networks have become "deeper", they have not become "wider". Why is this? I see a lot of questions comparing full frame (e.g EF for Canon, FX for Nikon) and crop lenses (e.g. EF-S for Canon, DX for Nikon) but I can't find the answer to what would be the differences between the photos taken with say a 50mm f/1.4 EF and EF-S lenses both used with   same APS-C sensor sized camera same ISO same f/1.4 f-stop same focal length same shutter speed   What would be the resulting differences in the photos? Which one would   be brighter than the other due the EF-S lens concentrating the light more? no that's wrong. Both put the same amount of light from the same FoV on the sensor. have greater depth-of-field? neither less problems towards the edges? generally the full frame more lens flare? generally the full frame lens unless there is, or you provide more shading anything else? not really, unless you start down the road of which one is typically of better build quality.   Edit: Added the answers from what seems to be the general consensus from the multiple answers and comments.  Results: My desire to buy a fast medium-high quality lens compatible with both full frame and crop camera's doesn't have to be hampered by the APS-C sensor size of my current camera.  This means I'm willing to part with more money to get a higher performance/quality lens as the performance/quality will be useful now and when I upgrade my camera.  Though reading reviews of some full frame lenses with short focal lengths, look out, as some are really only made to perform well on crop cameras even though they fit on a full frame camera and will give you a full frame picture, the edge quality is very bad. Is the differentiation operator an open mapping? Consider the vector spaces $C([0, 1])$ and $C^1([0, 1])$ with norm, \begin{align*} \displaystyle \|f\|_\infty=\sup_{x\in [0, 1]}|f(x)|, \end{align*} and let $T:C^1([0, 1])\to C([0, 1])$ the operator given by, \begin{align*} \displaystyle Tf=f'. \end{align*} Is $T$ defined this way an open mapping? If it's, how to prove it?