#include &lt;stdio.h&gt;  int main() {     int a[5] = {1,2,3,4,5};     printf(&quot;%d \n&quot;, a[1]);     printf(&quot;%d \n&quot;, 1[a]);          printf(&quot;%d \n&quot;, a[2]);     printf(&quot;%d \n&quot;, 2[a]);     return 0; }  How is the 7th and 10th line of code working?? After executing the program, I got the following result 2  2  3 3
As Joel points out in , in  (aka: K &amp; R), there is mention of this property of arrays in C: a[5] == 5[a]  Joel says that it's because of pointer arithmetic but I still don't understand. Why does a[5] == 5[a]?
Triggered by a  I was wondering what actually would happen to a ship (e.g. the Enterprise-D NCC-1701) that collides with a stationary object such as a) another ship of a similar configuration or b) a gigantic structure like a moon or even a planet.  We know the deflector is supposed to keep interstellar dust (not to be confused with ordinary dust, which is a different thing) from ripping large holes in the ship.  At first, one thinks "Obvious. ." But does it really? Would the deflector manage to actually deflect both masses? If not, where is the threshold of what a deflector can handle? Would the ship maybe tunnel right through the object, because of wibbly-wobbly space wobblification by the warp field? It does do some weird things to the space right in front and behind the vessel.  Important remark: We cannot approach this with what we know about physics at all. For all intents and purposes, both ships must measure the other ship travelling faster than light, resulting in it having infinite (or rather undefined) mass and by extension momentum. If we start with that reasoning any ship jumping to warp would suck in the entire universe (it takes a moment, but think about it). So, obviously we cannot apply our intuition (even our relativistic intuition) here. Python inheritance - how to disable a function In C++ you can disable a function in parent's class by declaring it as private in the child class. How can this be done in Python? I.E. How can I hide parent's function from child's public interface? Volume generated by revolving the region in the first quadrant bounded by the parabolas $y^2=x$, $y^2=8x$, $x^2=y$, $x^2=8y$ about the $x$-axis. I came across this question from Schaum's Outlines of Advanced Calculus:     Show that the volume generated by revolving the region in the first quadrant bounded by the parabolas $y^2=x$, $y^2=8x$, $x^2=y$, $x^2=8y$ about the $x$-axis is $\dfrac{279\pi}{2}$.   My solution was to divide the region into three parts:    $$\pi\int_{1}^{2}(x^2)^2 - (\sqrt{x})^2\;dx = 4.7\pi$$  $$\pi\int_{4}^{8}(\sqrt{8x})^2 - (\sqrt{x})^2\;dx = 42\pi$$  $$\pi\int_{2}^{4} (x^2)^2 - \left(\frac{1}{8}x^2 \right)^2\;dx = 44.9\pi.$$  Hence the total volume will be  $$\pi(4.7 + 42 + 44.9) = 91.6\pi$$  which is wrong.  Can someone point out my mistake? Triangle Inequality question with fractions Given $a, b \in \mathbb{R}$, prove that   $$\frac{|a + b|}{1 + |a + b|} \le \frac{|a|}{1 + |a|} + \frac{|b|}{1+|b|}$$  When does equality hold?  The only useful thing I could get (using the triangle inequality) is:  $$\begin{align}1 + \left|\left(a + \frac{ab}{2}\right) + \left(b - \frac{ab}{2}\right)\right| &amp;\le 1 + \left|a + \frac{ab}{2}\right| + \left|b - \frac{ab}{2}\right|\\ &amp;\le 1 + |a| + |b| + |ab|\\ &amp;=(1 + |a|)(1 + |b|)\end{align}$$  But it seems to be inapplicable! Any ideas? How do I create silhouettes in a studio environment? The trick to creating silhouettes in the field, as far as I know, is to use spot-metering and to expose for the background. However, this is a bit more difficult in a studio environment. What is the key to creating "artificial" silhouettes?  One solution that I'm considering is placing a bright flash directly behind the subject - would that work? Nearby objects won't move independently? I created a thick glass bottle and duplicated the interior faces to make a new object to create the liquid inside.   I went in the edit mode, selected the faces I wanted to copy and duplicated them with ShiftD. Then I pressed P to  separate the duplicated faces.   Now I try to make a duplicate of that liquid to make it flow out of the bottle, and I simply need the duplicate of one face of it. So I go to edit mode and do as I did to make the liquid from the bottle faces... but as soon as I'm back to the object mode and I want to move the duplicated faces, every thing moves with it...   I played around and tried things, and while doing so I realized that if I dupe the liquid object in object mode using ShiftD and press 0 to place it where the original is, they move together if I duplicate it and place it somewhere else so that they are separated.   Also if I pick one of the two separated objects and make it intersect with the other one, release my left mouse button to place it there, and then try to move it again, they both move together, but not at the same speed.  I really don't understand what is going on and I'm sure it's really badly explained, so what I'll do is make a screen capture of my Outliner and record the behavior of the objects and upload those to help you understand. How to log out user from web site using BASIC authentication? I want to merge two shape files in which one is of point geometry type and other is polygon type in order to get a single layer containing both points and polygon in a single map. Deriving ordered statistics minimum cdf Assume ${{X}_{1}}$, ${{X}_{2}}$, ${{X}_{3}}$,...,${{X}_{n}}$  are i.i.d. samples from distribution with density f, and cdf F.  Let V=min( ${{X}_{1}}$, ${{X}_{2}}$, ${{X}_{3}}$,...,${{X}_{n}}$)  To find the minimum $${B}_{v}={\{V\ge{v}\}}=\{{X}_{1}\ge{v}\}\cap\{{X}_{2}\ge{v}\}\cap...\cap\{{X}_{n}\ge{v}\}$$  So, $$P(V\ge{v})=[1-F(v)]^{n}$$  The cdf is  $$F_{v}(V)=1-[1-F(v)]^{n}$$   The density is $${f}_{v}(V)=\frac{d}{dv}[1-F(v)]^{n}=nf(v)[1-F(v)]^{n-1}$$   To find the density, why did we use $[1-F(v)]^{n}$ instead of $1-[1-F(v)]^{n}$, shouldn't we used the cdf to derive the pdf? Recovering from forgotten lock pattern My son has an impression tablet 10 and has forgot the lock pattern. How can we reset it without knowing the code? I am taking an abstract algebra course and I am really interested about the topic.  So much so that I spend most of my time reading supplementary materials.  I consequently know a lot more theorems than the ones covered in class.    In a recent quiz, I used a theorem in one of my proofs that was not mentioned in the lecture since.  My professor gave me partial marks for my answer for the reason that we didn't cover this theorem in class even though the proof was completely valid!  I can't really see where he is coming from.  How would someone be able to use a theorem correctly if he doesn't know its proof?  I was quite baffled by his comment.   Do you agree with this?  EDIT: The professor just Emailed me and said that after thinking for a while, he decided to award me the full mark for the question. He also mentioned that he didn't want discourage me from studying the subject (since he saw most of my previous quiz grades were full marks) and I was passionate about it, but kindly requested that I include any proof for a theorem that I cite from now on in his exams. He also sent a broadcast message to the whole class indicating this. Received W-2 but was never paid I just now received a W-2 from a company that I worked for 3 days as a contractor. I had to leave country for 2 months due to a family emergency. Since the employment duration was very short, I was not paid. I was told that they don't want to charge the client because 3 days is not enough contribution.  Since I had to leave country the same day, I did not argue with them and told it's okay if they feel right.  Now I have a W-2 from them saying they have paid me about $1500. I contacted them but I have not received any reply yet.  I just want to be prepared. What can I do here? Can decimal numbers be considered "even" or "odd"? Over time, I've noticed an increasing practice among moderators of the smaller sites (i.e. not in the Trilogy) to move extended comment chains to chat, just because they're too long. Is this a good idea? In the past, I've taken the position on many occasions that I believe that comments serve two purposes only: clarification, and asking for clarification.  I take this position because as a mod I want the freedom to purge a comment trail that is clearly running off the rails without having to argue with anyone about politeness definitions. But that's not the same thing as two pedantic C++ language lawyers debating the finer points of &quot;undefined behavior.&quot;  I give wide latitude to such discussions, as long as the participants don't start throwing spears, because I believe they are instructive. The SE software even has accommodations for this.  Long comment chains are automatically collapsed, so as not to disrupt the Q&amp;A format of the post.  And moving a comment chain to chat is not even a move, really; to do an actual move, you have to perform the conversion, and then delete all of the copied comments from the post. Here is a recent example:  and it's accompanying . What I find amusing is that the OP's detailed POV about the term, where he floats a theory about why everyone thinks that &quot;bugged&quot; is not a thing (that conversation took place in the comments, and is now safely sequestered in the chat room) gets to stay prominently featured in his question, at the very top of the post. Now you could argue that the chat room is a better environment to have these discussions anyway, and you'd be right.  I could argue that if we're going to do that, then why not just automatically convert long discussions to chat rooms? The problem is not so much where the comments reside.  I don't understand why mods are taking it on themselves to fix something that isn't hurting the site (at least in my opinion).  In addition, every time I see this happen, the participants in the conversation immediately lose interest in it.  The only comment that was posted in that room after all the comments were moved is most likely this one:  It wouldn't surprise me if the folks using &quot;bugged&quot; to refer to a certain software quality are the same folks who refer to their programs as &quot;codes&quot; and who believe textspeak is the pinnacle of modern English.  Which nobody will ever see. :) Some mods are really aggressive about this.  I discussed this with a mod on Physics, and he told me that they routinely move discussions when they think they might run off the rails. I am following Carroll's GR book. He explain that it is convention to parameterize geodesics of photons by a parameter $\lambda$ such that  $$p^\mu ~=~ \frac{d x^{\mu}}{d \lambda}.\tag{3.62}$$  But this is the definition of 4-velocity for a massive particle in the case of $\lambda=\tau$ equal to proper time. My question then, is $$u^\mu = p^\mu$$ for all massless particles? I ask because it's well-known that proper time $\tau$ freezes for massless particles. Finding an isomorphic subring of matrices How do I get the path of the directory in which a  script is located, inside that script? I want to use a Bash script as a launcher for another application. I want to change the working directory to the one where the Bash script is located, so I can operate on the files in that directory, like so: $ ./application What do you do in Dungeon World when someone wants to perform an action they don't have a move for? So in Dungeon World, everything breaks down to 'moves'.  What about situations where a move is not available, but a check of some sort is called for, such as in the case of a non-fighter who wants to kick down the door?  What mechanism do you use to resolve that situation? Is there the equivalent of a skill check? How do I change skins in minecraft pe? set fontsize for TikZ figure