Considering $ (1+i)^n - (1 - i)^n $, Complex Analysis
Is there a formula for $(1+i)^n+(1-i)^n$?
Suppose I attach an blur function to an HTML input box like this:  &lt;input id="myInput" onblur="function() { ... }"&gt;&lt;/input&gt;   Is there a way to get the ID of the element which caused the blur event to fire (the element which was clicked) inside the function? How?  For example, suppose I have a span like this:  &lt;span id="mySpan"&gt;Hello World&lt;/span&gt;   If I click the span right after the input element has focus, the input element will lose its focus. How does the function know that it was mySpan that was clicked?  PS: If the onclick event of the span would occur before the onblur event of the input element my problem would be solved, because I could set some status value indicating a specific element had been clicked.  PPS: The background of this problem is that I want to trigger an AJAX autocompleter control externally (from a clickable element) to show its suggestions, without the suggestions disappearing immediately because of the blur event on the input element. So I want to check in the blur function if one specific element has been clicked, and if so, ignore the blur event. Does separability imply the Lindelöf property? Does separability imply a sort of Lindelöf property?  Since I can't prove this fact I'm beginning to think that my conjecture is false.  Intuitively, $\mathbb{R}$ has a countable subset $\mathbb{Q}$ which is used to form a countable basis for $\mathbb{R}$ with the usual topology and prove the Lindeöf property. In .NET, which loop runs faster, 'for' or 'foreach'? In C#/VB.NET/.NET, which loop runs faster, for or foreach?  Ever since I read that a for loop works faster than a foreach loop a  I assumed it stood true for all collections, generic collections, all arrays, etc.  I scoured Google and found a few articles, but most of them are inconclusive (read comments on the articles) and open ended.  What would be ideal is to have each scenario listed and the best solution for the same.  For example (just an example of how it should be):   for iterating an array of 1000+ strings - for is better than foreach for iterating over IList (non generic) strings - foreach is better than for   A few references found on the web for the same:               [Edit]  Apart from the readability aspect of it, I am really interested in facts and figures. There are applications where the last mile of performance optimization squeezed do matter. I recently made my pen-drive bootable with Ubuntu 14.04. But I need to unboot my pen-drive now. I formatted my pen-drive once,But the size of the pen-drive still shows 2.25 MB. Whereas,this is an 8GB pen-drive. How can I get rid of this problem. I'm still using Windows 7. Two envelope problem revisited I was thinking of this problem.  I believe the solution and I think I understand it, but if I take the following approach I'm completely confused. Problem 1:  I will offer you the following game. You pay me \$10 and I will flip a fair coin. Heads I give you \$5 and Tails I give you \$20. The expectation is \$12.5 so you will always play the game.  Problem 2:  I will give you an envelope with \$10, the envelope is open and you can check. I then show you another envelope, closed this time and tell you: This envelope either has \$5 or $20 in it with equal probability. Do you want to swap? I feel this is exactly the same as problem 1, you forgo \$10 for a \$5 or a \$20, so again you will always switch.  Problem 3:  I do the same as above but close the envelopes. So you don't know there are $10 but some amount X. I tell you the other envelope has double or half. Now if you follow the same logic you want  to switch. This is the envelope paradox.  What changed when I closed the envelope?? EDIT: Some have argued that problem 3 is not the envelope problem and I'm going to try and provide below why I think it is by analysing how each views the game. Also, it gives a better set up for the game. Providing some clarification for Problem 3: From the perspective of the person organising the game:  I hold 2 envelopes. In one I put \$10 close it and give it to the player. I then tell him, I have one more envelope that has either double or half the amount of the envelope I just gave you. Do you want to switch? I then proceed to flip a fair coin and Heads I put \$5 in and Tails I put \$20. And hand him the envelope. I then ask him. The envelope you just gave me has twice or half the amount of the envelope you are holding. Do you want to switch?  From the perspective of the player:  I am given an envelope and told there is another envelope that has double or half the amount with equal probability. Do I want to switch. I think sure I have $X$, hence $\frac{1}{2}(\frac{1}{2}X + 2X) &gt; X$ so I want to switch. I get the envelope and all of a sudden I am facing the exact same situation. I want to switch again as the other envelope has either double or half the amount. Trouble doing polynomial interpolation I understand that the alphabet for the English language is not strictly English as languages such as French, Dutch and many more use the same alphabet, with few additions in other languages. Is Roman alphabet the common term to refer to this set of symbols for writing texts? Solving factorial equations I am given that $${n \choose a}={n \choose b}$$ I need to show that $n=a+b$ or $a=b$.  Now I am left with $a!(n-a)!=b!(n-b)!$.  I don't know what to do next. I checked there on google to solve the above, it says:- "On comparing, we get the required result." But it makes no sense to me. Installing to SDCard by default Why modules with no variables? Trisect a quadrilateral into a $9$-grid; the middle has $1/9$ the area Trisect sides of a quadrilateral and connect the points to have nine quadrilaterals, as can be seen in the figure. Prove that the middle quadrilateral area is one ninth of the whole area. Is it possible to query the content of the Time-based Workflow Queue from an Apex unit test to assess that a specific Workflow Rule has been executed and added a new item to the queue? I didn't see anything alike in the documentation, but wish it could be possible to improve testing and stability overtime.  Thanks Is there a way to make rigid body interact with softbody physics? The no. of all possible matrices of order $3\times 3$ with each entry $0$ and $1$ and $ -1$. My Pakistani passport expires less than a month from now. I understand that some countries only let people in if their passport is valid for six months or more. Will I be able to enter Pakistan on a passport that is about to expire?  Also, travelling back to Pakistan is likely to involve transiting through some other country.  Does the six-month rule still apply to people returning to their country of citizenship? I am studying statistics and I am wondering when it comes to standard error or a sampling if the calculation changes when there are weights added.   I have a weighted mean:  $$\mu_{w} = \dfrac{\sum_{i=1}^Nw_ix_i}{\sum_{i=1}^Nw_i}$$ and a weighted variance calculated by:  $$s^2_{w}=\dfrac{\sum_{i=1}^Nw_i}{(\sum_{i=1}^Nw_i)^2-\sum_{i=1}^Nw_i^2}\cdot \sum_{i=1}^N(x_i-\mu)^2$$  is the sampling error still calculated as  $$\text{SE}=\sqrt{\dfrac{s^2_{w}}{n}}$$ Checking host availability by using ping in bash scripts I built a ZI model and it is producing predicted values that are from a very small range when compared to the observed values. Plus it does not produce any zeros. See the fitted vs. observed graph below.     My model structure is given below. My response is a count variable and the predictor is continuous water level measurements (scaled).   m.u.meanwl.gu &lt;- zeroinfl(GU ~ MeanWLScaled | MeanWLScaled, data = uluabat_wl_fg, dist = "negbin", link = "logit")   I need help to figure out what's wrong and fix it. Thanks in advance. How can I search an Excel spreadsheet in SharePoint? Looking to be able to search an Excel spreadsheet from the SharePoint mobile app.  I have a spreadsheet with Postal Codes/Zip Codes with corresponding information. I would like to be able to search as you would in Excel.  When I upload a test spreadsheet, it opens as like a PDF. User has "Read" permissions for the document library the spreadsheet is located in.  Thanks in advance, I'm taking an intro course in Probability theory, and we have just defined expectation for a random variable as $E(X) = E(X^+) - E(X^-)$ if either of them is finite (extending the definition first from simple positive rv to positive rv, and then to all rvs, positive or not).  Then I came across this result for the expectation of a positive random variable. Let $(\Omega, \mathcal{F}, P)$ be a probability space and $X \ge 0$ be a positive rv:  $$ E(X) = \int_{\Omega} X dP = \int_\Omega \int_0^\infty \mathbf{1}_{\{X &gt; t\}} dt  \, d P = \int_{0}^\infty P(X &gt; t) dt. $$ Actually, I'm familiar with this result, and the proof I've seen before involves converting $\int^\infty_0 P(X &gt; t) \, dt$ to a double integral. What I'm struggling with is the step $ \int_{\Omega} X dP = \int_\Omega \int_0^\infty \mathbf{1}_{\{X &gt; t\}} dt  \, d P $, and also the formal definition of an expectation itself.   I have no previous with integration or a "hard analysis" background, and the material covered so far in the course I'm taking has only used $\int_\Omega X dP$ as a notational device for $E(X)$. In general, any pointers to literature or "intuitive" explanations are more than welcome.  Thanks in advance!