so as in the title, I have the following theorem to prove.   Theorem  Show that for all $a$, $b\in \mathbb R$, that the following inequality holds, $\begin{equation} ab \leq \frac{1}{2}(a^2 + b^2) \end{equation}$.  My attempt  So if $a=b=0$, then the inequality is trivially $0 \leq 0$ and we are ok.  If $a &gt; 0$ and $b &lt; 0$, then the product on the right is less than zero, while the one on the right is greater than $0$, so the inequality holds.  The problem that I am having is that if the numbers are the same sign, we have that both products will be positive and now we have to the show the inequality is true in this case.   I tried making the following re-arrangement as a starting point $\begin{equation} \\ 2ab \leq (a^2 + b^2) \end{equation}$  But I am not really sure where to go from here. I've been staring at it for a while and I just can't seem to get anything out of it. I noticed that it looks rather similar to the law of cosines for theta equal to 90 degrees and $c = 0$, though that would be wierd indeed. Anyway that hasn't been talked about in the book yet so I don't think it matters.   We have been introduced to the binomial theorem, difference of powers and geometric sum theorems, but I couldn't find any enlightenment from these.  I don't really want an answer if you can help it, but a hint in the right direction would be appreciated if you could offer one. Thanks.
How can I prove the inequality $|xy|\leq\frac{1}{2}(x^2+y^2)$  I have tried substitute $x,y$ for numbers, which turns out right, but I don't know how to reason here.  Thanks in advance!
Rendering order in an Entity System Say I use a , and also inside Systems I hold lists of all entities that Systems are required to process.  How do I maintain this list of entities in desired rendering order, i.e. for a dumb 2D RenderingSystem?   I saw , and what they suggest is to do something like Z ordering - what I would probably do is just to store a "layer" int in DrawableComponent and then, inside RenderingSystem, just sort entities by mentioned "layer" whenever the entity list for RenderingSystem changes.  They also say we could just delete and recreate the entity whenever we want it on the top, but it seems too inflexible to me.  How is this problem usually solved? Helix on a cylinder In the  question one of the answers had the following code snippet:  IEnumerable&lt;object&gt; FilteredList() {     foreach(object item in FullList)     {         if(IsItemInPartialList(item))             yield return item;     } }   What does the yield keyword do there?  I've seen it referenced in a couple places, and one other question, but I haven't quite figured out what it actually does.  I'm used to thinking of yield in the sense of one thread yielding to another, but that doesn't seem relevant here. Dynamically adding a form to a Django formset I want to dynamically add new forms to a Django formset, so that when the user clicks an &quot;add&quot; button it runs JavaScript that adds a new form (which is part of the formset) to the page. “Airplane Mode” in OS X. Alternative command for `rfkill`? Mac OS X doesn't recognize rfkill from its terminal, and I am looking for an alternative command that has similar functionality (toggling "Airplane Mode").  NOTE: I don't wish to open an .app to toggle. I'd like to execute the command from command line or within script in Bash (or equivalents).    By "Airplane Mode", I meant to borrow the term from iOS support page . I would like to disable all incoming/outgoing network communications from my system. Intuition behind the definition of a measurable set Inside the alley I found myself cornered by unpleasant sights: walls covered with cracks and peeling paint, storm drains clogged with moss, dumpsters overflowing with bags, cans, and rotten trash. Inside the alley I found myself cornered by unpleasant sights: walls covered with cracks and peeling paint; storm drains clogged with moss; dumpsters overflowing with bags, cans, and rotten trash. Inside the alley I found myself cornered by unpleasant sights. Walls covered with cracks and peeling paint. Storm drains clogged with moss. Dumpsters overflowing with bags, cans, and rotten trash.  Or maybe the three of them are orthographically correct in their respective contexts? EDIT (based on dockeryZ's answer): I think second example is right, regardless of the context. Explanation: . Run MySQLDump without Locking Tables ffmpeg is not even cutting this and other mp4s to the nearest second I have a file  Other - Analogue Clock-JEJqy1Wlovw.mp4  which is just a download from     It's 2 minutes 13 seconds long.  I had some issues cutting it to the second.  I was able to use this command   ffmpeg -ss 0 -i infile.mp4 -c copy -t 60 output.mp4  to make a file that was 60 seconds, so no problem so far.  That's the file exactly 1 minute, no issue there so far.  C:\vids\a&gt;dir blahhclo.mp4   9,590,540 bytes  C:\vids\a&gt;   C:\vids\a&gt;mediainfo blahhclo.mp4 General Complete name                            : blahhclo.mp4 Format                                   : MPEG-4 Format profile                           : Base Media Codec ID                                 : isom File size                                : 9.15 MiB Duration                                 : 1mn 0s Overall bit rate                         : 1 278 Kbps Writing application                      : Lavf58.3.100  Video ID                                       : 1 Format                                   : AVC Format/Info                              : Advanced Video Codec Format profile                           : High@L4.0 Format settings, CABAC                   : Yes Format settings, ReFrames                : 3 frames Codec ID                                 : avc1 Codec ID/Info                            : Advanced Video Coding Duration                                 : 1mn 0s Bit rate                                 : 1 146 Kbps Width                                    : 1 920 pixels Height                                   : 1 080 pixels Display aspect ratio                     : 16:9 Frame rate mode                          : Constant Frame rate                               : 25.000 fps Color space                              : YUV Chroma subsampling                       : 4:2:0 Bit depth                                : 8 bits Scan type                                : Progressive Bits/(Pixel*Frame)                       : 0.022 Stream size                              : 8.21 MiB (90%)  Audio ID                                       : 2 Format                                   : AAC Format/Info                              : Advanced Audio Codec Format profile                           : LC Codec ID                                 : 40 Duration                                 : 1mn 0s Bit rate mode                            : Constant Bit rate                                 : 126 Kbps Channel count                            : 2 channels Channel positions                        : Front: L R Sampling rate                            : 44.1 KHz Compression mode                         : Lossy Delay relative to video                  : 40ms Stream size                              : 920 KiB (10%)    C:\vids\a&gt;   But I do have an issue when I try to cut it at the following times, and it's whether I try to cut the 1 minute one or the whole 2 min 13sec one.  If I cut with -ss 0 -t 1,   it produces a file that is 1s 22ms.  So that's not too bad that's fairly close to one second. 1.022 seconds is quite good for an attempt to cut one second.  If I cut with -ss 0 -t 2, it produces a file that is 3s 19ms   That is terrible! it's meant to be one second!  If I cut with -ss 0 -t 30 then it is fine it does 30s 1ms.  Or this video for example, also an mp4   C:\blah&gt;ffmpeg -ss 189 -i vid.mp4 -c copy -t 6 someoutput.mp4  C:\blah&gt;mediainfo someoutput.mp4   produces a duration of 8s 383ms  That is so wrong though 'cos it should be 6 seconds! So that is two seconds too long!  C:\blah&gt;ffmpeg -ss 191 -i vid.mp4 -c copy -t 6 someoutput2.mp4  C:\blah&gt;mediainfo output2.mp4   shows that ffmpeg produced a duration of 10s 403ms  which is crazily wrong 'cos the ffmpeg command specified 6 seconds!  So that's not just one second out, that is 4 seconds out!  That's almost 50% longer than it should be! Converting a string to a tuple in python I just picked up a copy of Windows 7 Pro OEM for install on my computer.  Guy at the store said the only real difference between OEM and standard retail box was tech support.  However, the outside of the box has this big warning that says "The software must be installed with an OPK"?  What is the OPK?  Is it really necessary?  The MS site about it seemed to say it was optional.  EDIT:  BTW - I'm just an individual tinkerer, and not a System Builder Company Employee.  I should have made that clear.  I've used sysprep in a professional setting in the past, so I'm somewhat familiar with its concepts. Minimize the sum of distances between two point and a circle Let's $A$,$B$ and $O$ be random point in a plane, such that they are not colinear. Let's $c$ be a circle centered on $O$, such that points $A$ and $B$ are outside of it. Find a point $X$ that lies on the circle $c$ and the sum $AX + BX$ is minimal.  First I tried to minimize the function:  $$f(x,y) = \sqrt{(A.x - x)^2 + (A.y - y)^2} + \sqrt{(B.x - x)^2 + (B.y - y)^2}$$ with  constraint $$g(x,y) = x^2 + y^2 - r^2 = 0$$  By moving $O$ to $(0,0)$ and do the same with $A$,$B$ so the relative distance will not change.  But these works when we know the coordinates of $A$,$B$ and the radius of the circle. Yet this isn't the right way because the problem is to construct that point.  Later I tried to approach using geometry.  The smallest distance from the point $A$ to the circle is the intersection of the circle $c$ and the ray $OA$, this is the same for $B$. Then we construct circles centered on $A$ and $B$ that are tangent to $c$. If the two circle intersect we'll get a common point for the both $A$ and $B$ and the distance will be minimal. Using computer I find the point X should be somewhere around the intercetion of the circle $c$ and the ray from $O$ to the new point.   Sometimes the optimal point differs just a bit and also this method fails when the two circles do not intersect each other Finding $\frac{3}{1!+2!+3!}+\frac{4}{2!+3!+4!} +\frac{5}{3!+4!+5!}+\cdots+\frac{2008}{2006!+2007!+2008!}$ How to find :  $$\frac{3}{1!+2!+3!}+\frac{4}{2!+3!+4!} +\frac{5}{3!+4!+5!}+\cdots+\frac{2008}{2006!+2007!+2008!}$$ Why does an electron shell further away from nucleus has higher energy level? Using electrical potential energy $V=\frac{1}{4\pi \varepsilon_0} \frac{Q_1 Q_2}{r}$ , a particle further away from nucleus has lower magnitude of energy.  Using Coulomb's law, a particle further away from nucleus experiences weaker attraction, hence less energy is needed to maintain orbit$^\star$ around that e-shell compared to a electron shell closer to nucleus, hence the one closer to nucleus supposedly should have higher energy.  $^\star$I know in reality $e^-$ does not orbit around a atom, but its position exists as a probability density or radial probability function. I got pretty confused at that question... Can anyone help me understand this question better and/or drop some hints please? Thank you! Parameter evaluation order before a function calling in C Can it be assumed a evaluation order of the function parameters when calling it in C ? According to the following program, it seems that there is not a particular order when I executed it.   #include &lt;stdio.h&gt;  int main() {    int a[] = {1, 2, 3};    int * pa;      pa = &amp;a[0];    printf("a[0] = %d\ta[1] = %d\ta[2] = %d\n",*(pa), *(pa++),*(++pa));    /* Result: a[0] = 3  a[1] = 2    a[2] = 2 */     pa = &amp;a[0];    printf("a[0] = %d\ta[1] = %d\ta[2] = %d\n",*(pa++),*(pa),*(++pa));    /* Result: a[0] = 2  a[1] = 2     a[2] = 2 */     pa = &amp;a[0];    printf("a[0] = %d\ta[1] = %d\ta[2] = %d\n",*(pa++),*(++pa), *(pa));    /* a[0] = 2  a[1] = 2 a[2] = 1 */  } What does "What are you up to?" mean? I overheard my manager asking "What are you up to?"  What does that idiom mean? Is it an informal/negative way of asking?? How to run grep with multiple AND patterns? I would like to get the multi pattern match with implicit AND between patterns, i.e. equivalent to running several greps in a sequence:  grep pattern1 | grep pattern2 | ...   So how to convert it to something like?  grep pattern1 &amp; pattern2 &amp; pattern3   I would like to use single grep because I am building arguments dynamically, so everything has to fit in one string. Using filter is system feature, not grep, so it is not an argument for it.    Don't confuse this question with:  grep "pattern1\|pattern2\|..."   This is an OR multi pattern match. How do I stop program from skipping over getline? Is it possible to do a multiline pattern match using sed, awk or grep? Take for example, I would like to get all the lines between { and }  So it should be able to match    1. {}  2. {.....}  3. {.....      .....}  Initially the question used &lt;p&gt; as an example. Edited the question to use { and}.