What is the uncertainty principle?

Question: I looked on Wikpedia for information on the uncertainty principle, but after reading it I still had no idea. I know it has something to do with how many things you can hold at some spot for some amount of time (maybe?). This is inspired by this question.
Comment: I'm not sure.
Comment: http://www.condenaststore.com/-sp/About-your-cat-Mr-Schroedinger-I-have-good-news-and-bad-news-New-Yorker-Cartoon-Prints_i13222248_.htm
Answer: Let's forget physics for a moment and just talk about the mathematics of waves.
The uncertainty principle is a property of waves.  Think of a single, narrow pulse traveling along one direction.  The pulse is narrow, and so the position of the pulse at any given time is easy to quantify.  But this is a single, non-periodic pulse.  You can build up such a pulse from a lot of sinusoids, but in doing so, the wavenumber (frequency) of such a pulse becomes ill-defined.  It's a combination of a lot of wavenumbers, so no single wavenumber describes it.
Conversely, think of a pure sinusoidal wave.  It has a single wavenumber, but what is the position of such a wave?  It a periodic thing; it doesn't have a single position.  You can describe it in terms of magnitudes at a lot of positions, but that's all.
That's the uncertainty principle, a fundamental property of waves.  You can localize a wave in terms of its position or wavenumber, but not both at the same time (at least, not below a certain limit).  The quantities $\sigma_x$ and $\sigma_k$ describe the distribution of positions and wavenumbers for a given wave (smaller $\sigma_x$ means that the wave is more like a localized spike at one position; larger $\sigma_x$ means that it's smeared out more like a sinusoid), and their product is constrained by the uncertainty principle.
The uncertainty principle is usually phrased in terms of position and momentum, instead of wavenumber as I've written.  This is just a little bit of physics: we say that momentum is proportional to wavenumber by the constant $\hbar$.
Comment: Sorry, what do you mean by, "this is only a peculiarity of the Hilbert space formulation"?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/23357/discussion-on-answer-by-muphrid-what-is-the-uncertainty-principle).
Comment: I think you should specify that you're only concerned with one particular description of one particular pair of observables. Otherwise, this answer does neither the physics nor mathematics all that well... Even for $x,p$, this is only a peculiarity of the Hilbert space formulation; it's not physically fundamental. But there is intrinsic uncertainty between any non-commuting of observables, so even mathematically, the uncertainty principle is not really about waves. (The accepted answer has a similar lack, but it's much more obvious how to generalize an instrumentalist description.)
Comment: @Muphrid just that. For example, if do QM in phase space, what you would use is a real-valued quasiprobability distribution $P(x,p)$ that's possibly negative but whose absolute value is bounded by something $\propto 1/h^3$, so you can't localize it arbitrarily, but not for reasons of waves. ... Physically, QM doesn't happen "in Hilbert space"; the Hilbert space is just one description. ... But even in Hilbert space, one should be mindful that all kinds of observables can have uncertainty between them, and the wave/Fourier analogy only works for those with commutator $i\hbar$ or similar.
Comment: @StanLiou Sorry, I don't really see the difference.  I described (on a very broad and hopefully accessible level) the notion of standard deviation of some function or distribution.  I used the word "wave" to emphasize the connection with wavefunctions in Hilbert space, yes, but this is applicable to any square integrable function. Even in phase space formalism, one ultimately arrives at a statement of uncertainty that involves a product of standard deviations, does one not? So I'm not appreciating any fundamental difference here.
Comment: @Muphrid the differences are that (1) wavenumbers would have no role in that description at all, (2) even Hilbert space, the uncertainty principle is more general than square-integrable functions. So I was recommending that context of your answer to be be explicitly specified. If you don't agree, ok. It's not so important as to fight over.
Answer: In classical physics you are supposed to be able to measure the coordinates and the velocity (really the momentum) of a mass with infinite precision at the same time. If you try this trick in the lab you notice that that's not the case. Either your position or your momentum measurement or both will always show some non-trivial statistical fluctuations when you repeat your experiment many times. If you multiply the standard deviations of these fluctuations with each other, no experiment that you can ever perform yields a product that is smaller than a certain number. That is it.
Comment: This is the uncertainty principle in a nutshell. While different interpretations of QM have different philosophical viewpoints on the philosophical ramifications of the uncertainty principle, they all agree that under even the most ideal circumstances, the product of the measurement errors in position and momentum, $\Delta x \Delta p$, (or for that matter, the product of the uncertainties of any two conjugate variables), is at least $\hbar/2$. To me, talking about what this means for stuff you can't measure is not science. Last time I checked, physics was still a science. +1.
Comment: @WillO: Physics is the human enterprise of explaining certain aspects of nature. The uncertainty principle is a number of symbols on a piece of paper that explain how certain types of measurements will come out. Newtonian mechanics is a different set of symbols on paper that explain how other measurements will work out. Are you sure you understand the definition of science?
Comment: The uncertainty principle holds whether or not anybody chooses to measure anything, so any explanation that relies on what someone is doing in a lab is at best misleading.
Comment: @WillO  I'm with CuriousOne on this one.  Nothing in quantum mechanics is meaningful without a measurement.  One interpretation is that the expectation value and deviation are to be considered to apply to measurements made on an ensemble of identically prepared systems.
Comment: @WillO: I didn't say anything about the "same particle". I didn't even use the word "particle". I said something about repeating the same experiment. Please criticize what I said, not what you think I said.
Comment: @garyp:  I am quite confident that there are elementary particles in the Universe that nobody will ever observe, and I am quite confident that the states of those particles satisfy the uncertainty principle.
Comment: @DavidHammen: As you can notice in some of the angry replies, a lot of folks who think that they understand the "philosophy" of quantum mechanics have serious problems with its phenomenology. I think the OP deserves to be given the simple physical facts before we overwhelm him or her with metaphysics about "why" the uncertainty principle is what it is.
Comment: @CuriousOne - Exactly. That's why I upvoted this answer. Just the facts, ma'am (okay, that dates me).
Comment: +1, but this answer would be much better if it was made clear that position and momentum are just one particular case, in that there is uncertainty between many other pairs of observables, although typically in a more complicated relationship.
Comment: @CuriousOne, you're missing my point. I'm not claiming UP describes experimental errors. I claim experimental errors are always present in measurements and that's the reason why the statement *"In classical physics you are supposed to be able to measure the coordinates and the velocity (really the momentum) of a mass with infinite precision at the same time."* is untenable. In classical physics the *physical quantities in a model* are supposed to have "precise" real values; measurement has no special place in classical physics and there is no reason to demand infinite precision.
Comment: @garyp: We can go one step further. Nothing in science is meaningful without observations. I do acknowledge how easy that is to forget when you have to pass your next theory class... I felt the same.
Comment: Aside from everything else, this answer is wrong because it talks about repeatedly observing the same particle.  After any given observation, the particle is likely to be in a different state than it was before.  But the uncertainty principle applies to a particle in a *given state*.  So putting aside all the folderol about math versus physics, this answer still has pretty much nothing to do with the uncertainty principle.
Comment: @WillO: That's a religious, not a scientific statement.
Comment: @StanLiou: Completely agreed. I was trying to keep it as simple as possible, so it's also incomplete.
Comment: *"In classical physics you are supposed to be able to measure the coordinates and the velocity (really the momentum) of a mass with infinite precision at the same time."* Actually, this is not true. In classical physics there is no such requirement on the accuracy of measurements. The errors of measurement are always present even in classical physics and dealt with daily in experiments. The distinction relevant for the uncertainty relations is rather in the existence and use of simultaneous values of coordinate and velocity in classical *theory*. In quantum *theory* that is not the case.
Comment: @JánLalinský: The uncertainty principle doesn't describe experimental errors. Those are on top of it every time one does a real measurement, even in quantum mechanical measurements. Please read in detail what I wrote. I was never talking about measurement errors.
Comment: @JánLalinský: I am referring to the structure of nature as expressed in theory, not the structure of experimental physics. There is an overlay of experimental ontology on top of theoretical structure, but that doesn't address the question what the uncertainty principle is, which is an easy to understand fundamental difference between CM and QM. Of course  CM introduces a mathematical structure (finite dimensional product spaces of real numbers) that comes with a measurement ontology (multi-variate calculus), just as QM introduces Hilbert spaces. This has been discussed to death in textbooks.
Answer: There is a related (and relevant) question with answer called Uncertainty principle and measurement but I want to give a specific answer for this situation and background.  You will need top know the difference between precision and accuracy.  A precise dart thrower throws darts that land very close to each other, this isn't a deep statement, in fact it is just a definition of the word precision as it is used in science.  An accurate dart thrower throws darts that average out near the center, this also isn't a deep statement, in fact it is just a definition of the word accurate as it is used in science.  A precise dart player might throw them all at the same small upper region just barely on the dart board.  If only they could aim more accurately they would be awesome.  Maybe they are blind and someone is describing the center of the dart board poorly, but they are precise, they can control their variability very very well.  An accurate dart player might throw them so they always hit the middle half of the target, distributed equally in that region.  They know where the center is very accurately a better description wouldn't help, they have  totally accurate image of their target, they just can't reliably throw the same way each time, they have control over not being too high or low in general but can't control how off they are each time.
The same things happen for experiments.
In general, the uncertainty principle relates how a particular experimental setup sometimes has a tradeoff between how variable the results of different measurements could turn out.  The precision of one measurement comes at the expense of the precision of other measurements.  And I hate the name measurement because it makes that sound totally crazy.  Just think of it as the variability of the the results of one interaction coming at the expense of the variability of the results of other interactions.
Imagine you setup your equipment but you don't know who is going to come in or what they are going the measure.  In Newtonian physics you can just set it up precisely and whatever they measure they will get results based on how precisely you set it up.  (Precision being how reliably you set it up, accuracy being how close to what you aimed for, but this discussion is all about precision (reliably consistent, not variable), not accuracy).  In quantum theory there is a tradeoff, no matter how you set up your system some people will find it a more reliably setup system then other people will find it.  And whether they find it reliable will depend on what they choose to measure.  So we need to discuss variability so that we can discuss and quantify how well it can be done.
One way to measure the variability of a measurement $A$ is to first look at the average of many results, denoted $\langle A\rangle$.  Sometimes people put a line over it as an alternative notion, and sometimes people call it a mean rather than an average.  OK.  But a mean or average doesn't tell you how variable is, it really tells you more about the accuracy, whether you are on average over doing it or under doing it.  But if you always got the same result, then your results would always be that average result, so you can look at the result of measurement $A$ and see if it is above or below $\langle A\rangle$, which is the same as checking whether $A-\langle A\rangle$ is positive or negative or zero.  So for a low variability result (a precise result) that number will be close to zero. However it will on average be zero, regardless of how precise or variable you are.  So we can't just discuss the average of $A-\langle A\rangle$ since $\langle A-\langle A\rangle\rangle=0$.
But we can look at$ \langle \left( A-\langle A\rangle\right)^2\rangle$ and since each result of $\left( A-\langle A\rangle\right)^2$ is zero or positive, we don't expect the average to be zero unless it is zero with probability 100%.
So that's a way to measure variability.  We said there was a tradeoff.  The tradeoff is that sometimes a decreased variability for one measurement comes at the expense of an increased variability of other measurements.
I'll get into that later. But first I want to mention that when people say "the" uncertainty principle they often mean the particular tradeoff between position measurements and momentum measurements. So they will say the variability of position and the variability of momentum have a tradeoff in that they can't both be small.
But we do need to be clear about what the tradeoff is.
Step 1, select a state $\Psi$.  You can select any state you want.
Step 2, prepare many systems in same state $\Psi$ (you need many to see how reliable/precise or variable you are).
Step 3, select two operators A and B (these correspond to the interaction/measurement, as mentioned people probably assume position and momentum as the two operators/interactions/measurements)
Step 4a, for some of the systems prepared in state $\Psi$, measure A (mathematically you use the operator to make the prediction, in reality you do the interaction, and linguistically you call it a measurement even though that is a horrific name)
Step 4b, for some of the systems prepared in state $\Psi$, measure B (same deal, different operator/measurement/interaction)
Now you analyze the results. Every time you measured A, you got a a result. (Mathematically every time the oeprator A came up you got an eigenvalue of A), and similarly for B.  Each result had a probability (which is equal to the ratio of the squared norm of the projection onto the eigenspace divided by the squared norm before you projected onto the eigenspace, but that doesn't matter here).  So your results of A come from a probability distribution that often has a mean $\langle A\rangle=\langle \Psi|A|\Psi\rangle $ and a standard deviation (that measures the variability) of $\Delta A=\sqrt{\langle \Psi|\left(A^2-\langle \Psi|A|\Psi\rangle^2\right)|\Psi\rangle}$.  And your results for B come from a probability distribution that often has a mean $\langle B\rangle=\langle \Psi|B|\Psi\rangle $ and a standard deviation $\Delta B=\sqrt{\langle \Psi|\left(B^2-\langle \Psi|B|\Psi\rangle^2\right)|\Psi\rangle}$. You don't get those from a single measurement, o they are averages. You don't even get them from a whole bunch, but from steps 4a and 4b you do get a sample mean and a sample standard deviation (which are mean and deviation of the actually experiments you did not the mean of the unlimited number you could have done but didn't), and for a large sample these are likely to be very close to the theoretical mean and the theoretical standard deviation.
The uncertainty principle says that way back in step 1 (when you selected $\Psi$) you could select a $\Psi$ that gives a small $\Delta A$, or a $\Psi$ that gives a small $\Delta B$ (in fact if $\Psi$ is an eigenstate of A then $\Delta A=0$, same for $B$).  However, $$\Delta A \Delta B \geq \left|\frac{\langle AB-BA\rangle}{2i}\right|=\left|\frac{\langle\Psi| AB-BA |\Psi\rangle}{2i}\right|,$$
So it's saying that the product of the two measures of variability  $\Delta A$ and $\Delta B$ each of which is not negative have to have a product that is at least $\left|\frac{\langle\Psi| AB-BA |\Psi\rangle}{2i}\right|$ (itself a kind of average).  When A and B are position and momentum, that thing is $\hbar/2$, so if $\Delta B < \hbar/2$ (numerically) then $\Delta A > 1$ (numerically).
So this explains why people bring it up.  They say that when you claim to balance the pencil it sounds like you have a never small $\Delta X$ where $X$ is position, and that therefore $\Delta P$ must be large (where $P$ is momentum), so they want to say that it must have a large variability in momentum, hence velocity, hence can't be balanced.
But that is misleading.  The uncertainty principle talks about the distribution of results for many systems prepared the same way under particular interactions.  And the inherent tradeoff that when results of one interaction (say momentum) are low variability then the other one (say position) his highly variable.
The real problem is that things like electric fields are quantum too, so matter what state you put them in, there is some uncertainty, so they are never truly "not there".  You can try to have as small an electric field as possible but at some point there is a tradeoff even for the state we call the vacuum.  So photons (light, electric fields) can interact with your pencil.  And your pencil is capable of falling in a way that gives energy to the photons, and you can't really stop that from happening. The quantum photons can break the symmetry of the pencil even if you try to minimize their effect.
Unfortunately the uncertainty principle for the photons is not the momentum-position uncertainty principle that people usually bring up.  Which is why I brought up a more general one.  Some people will call the minimal electric field a zero point field or discuss a zero point energy.  The point is that it can steal energy from your pencil and you can't stop it.  And since the electric field can come from elsewhere and can't go away entirely no matter what you do, it is unavoidable.
Answer: Let $X$ and $Y$ be random variables with density functions $f$ and $\hat{f}$, where $\hat{f}$ is the Fourier transform of $f$.  Then the uncertainty principle is a lower bound on $\sigma_X\cdot \sigma_Y$ (where $\sigma$ is the standard deviation).  In particular, $\sigma_X\sigma_Y\ge 1/4\pi$.
For example, take a particle moving in one dimension, in a fixed quantum state. Let $X$ be the observed value of the particle's location (if you choose to measure its location) and let $Y$ be the observed value of its momentum (if you choose to measure its momentum).  Then $X$ and $Y$ satisfy the assumptions above, and hence satisfy the conclusion.
Comment: -1  If the Wikipedia answer was not helpful to the OP, then this answer won't be, either.
Comment: @garyp: In that case nothing will be helpful to the OP because that is what it is. There is no magic physical intuition behind the uncertainty principle. It's an observed fact of the physical world put into an easy to apply mathematical form. The OP simply has to accept the fact that that is how the world around him is structured.
Comment: @CuriousOne There's plenty of physical intuition, as the other answers (including your own!) demonstrate.
Comment: @DavidRicherby: I think I was trying to stress "magical" in the sense of finding an easy way to beat ones brain into accepting that "quantum is different". I never found QM "easy" on the intuition and I am still struggling with many aspects of it (especially when it comes to "groking" how quantum computing is supposed to work). Just going back to the basics and reminding myself what these things mean for basic experimental outcomes helps me to stay grounded. Beyond that I do not have a "magic recipe", either, which I think is obvious.
Answer: A highly simplified analogy that attempts to get thinking going in a direction that can sometimes lead to eventual understanding...
Think of various photographs taken of a baseball in flight. Different photographs are taken with different exposures. They are part of an attempt to measure both speed and position at the same time. In particular, imagine that one photograph is "instantaneous".
All of the photographs except the "instantaneous" one will show the baseball as something of a smear because the exposures caught the ball in motion. Longer exposures will show longer smears.
By knowing the exposure times, you can measure the lengths of the smears and determine how fast the baseball was moving. The longer the exposure, the closer you can get to determining the speed because the length of the smear can be measured more precisely. If measuring the smear has a measurement error of half a millimeter, then a 10 centimeter smear gives a more precise result than a smear that's only one millimeter long. Unfortunately, the longer the smear, the harder it is to say exactly what the "position" is because the position was continually changing.
The smear helps some with speed, but it still doesn't tie down all related details, e.g., it doesn't expose whether travel is from left to right or right to left. There is much more to the problem for precision on the much smaller scales where the uncertainly principle becomes more important.
Then think of the "instantaneous" photo. In that exposure, there was zero smear. It's a perfect image of the ball at one/single point in its flight. But now, by looking at your 'measurement', what can you tell about its speed? Or even about its direction? The ball would look exactly the same if it was going left to right across the photo or falling straight down or if it had been tossed up in the air and had just reached the highest point and was reversing its direction. With a perfect measurement of position, you totally lost all information about motion.
Now, a physical baseball is not a great expression of the details about particle physics. Unfortunately, nothing we experience in 'the real world' is. But if we want simple analogies, we're stuck with incorrect examples. Still, by using real-world examples, it sometimes becomes possible to use the terms to illustrate the bizarre happenings in quantum realities. Maybe it helps lead to understanding for you, maybe not. Just always be aware that analogies are not the realities and and are never correct.
Comment: You need to add the assumption that, in the blurred photo, you don't know whether the ball was travelling left-to-right or right-to-left. If you know which way the ball was moving, you know which end of the smear corresponds to the location of the ball at the instant the shutter closed.
Comment: @DavidRicherby Good point. I was only going for an analogy that had some meaningful details without needing wave functions, math, etc., but it's worth it to strive towards completeness.
Answer: user2338816 put forth a photography analogy.  I like photography analogies, but I have a different one to share which I believe is a hair closer to the full story.
First off, to answer the question directly, the uncertainty principle is that the product of the minimum error possible in your measurements often limited.  The most famous example is position and velocity.  If you measure position and velocity of a particle (QM scale), you will have some errors.  Some of it is because your machine is imprecise, but the Uncertainty Principle states that no matter how good your measuring equipment is, you will never get that product below h-bar/2 (ΔxΔp >=  ℏ/2).
Why do they claim this?  Well the really short answer is because the math of QM says it should be so, and nobody has ever found an experiment that contradicts the claim.  The long version is that quantum mechanics claims that everything is a waveform, and there methods of generating a "classical measurement," like position or velocity cannot capture "all of the information."
Here's my photography metaphor.  We're going to take a picture of a string on a violin after it has been plucked.  We know from the mathematics of how strings vibrate that there should be a standing wave.  We should see one of those nice sinusoid waves we see in mathematics class.
However, our camera has limits.  It has to see photons to resolve an image.  Arguably it measures the photons which interact with the string and find their way to the lens.  To get enough photons, we keep the shutter open a long time.  This means, instead of a nice clear sinewave, we get a blur whose envelope is definitely the magnitude of the standing wave.  We can even calculate the velocity of the particles going up and down on that string, we just don't know their position in the up/down axis.
So lets use a strobe.  Strobes emit a huge number of photons rapidly, so that they interact with the string in "almost an instant."  With this, we can collect a bunch of photons that show the string, clear as day.  Now we can easily see exactly where the string is, but we've lost velocity information.  The string looks like it is holding still.
Now we're clever people, so we can make a strobe that fires over a larger time period, so we can get "decent position information" and "decent velocity information" from a picture where the string has some blur (from a long strobe time), but much less blur than the first picture, so you can get some position information as well.
If you squint your eyes at this analogy, you can see the first layer of the uncertainty principle forming.  There's a tradeoff between how well you can measure the velocity of any part of the wire against how well you can measure its position.  You're free to play the tradeoff game, but you can't exceed the physical limits of the system.
So now we solve the problem by taking two pictures.  In the classical world, this is a totally valid technique to measure both position and velocity -- we do it in highschool physics classes.  Two super-bright strobe flashes later, we have two super-crisp pictures of the string in different positions.  We can do some math between the pictures, calculate the velocity and position of the wave at both times, and then we can predict the state of the wave forever.  Easy!  And very classical.
In the quantum world, the rabbit hole goes deeper.  As you get smaller, a discrepancy between classical and QM measurements comes to light: your machine is no longer a passive observer -- it is part of the system.  The flash bulb had always affected the string by bombarding it with photons.  However, at the macroscopic level, this didn't do much to the string at all.  It behaved just as though you were not there.
However, get smaller, and your measurement apparatus starts to interact with your subject.  For the photography analogy, the photons from the strobe start to shove the string around in highly unpredictable ways (the actual QM situation is more complicated, but I find this analogy is sufficient for understanding).  The strobe flash of the first picture dramatically changes the velocity of the string, as the photons bombard it (interact with it, in QM speak).  The same goes for the second one.
When we try to run the math in this case, we find that the strobe flash effectively invalidates a great deal of the information we thought we knew about the system before hand because it perturbs the subject.  The mere fact that we used a strobe flash strong enough to apparently freeze the string in space cause it to disrupt the velocity of the particles so greatly that we lost nearly all information about it.
And so, the uncertainty principle is the real life version of this photographic metaphor.  It is "true" simply because we've measured this behavior, and never once have we found a way to get around it, no matter how hard we try.
Is it possible to measure a quantum state exactly, using classical terms?  Maybe.  The universe is a strange place, and we're only just starting to understand it.  However, to date, not only has there been no theory showing how to do it, most theories proposed explicitly forbid it.  It's simply the world, as best as we know it!

What is the uncertainty principle?


Recommendations for a lightweight/no-install C or C++ based dense linear algebra solver

Question: Most of my programming is one-off research codes in C for my own use. I have never distributed any code to other than close collaborators. I have developed an algorithm that I am publishing in a scientific journal. I want to provide the source code and perhaps executable code in the online supplement to the article. A colleague requested that I make a generalization to the algorithm which required me to write in C++ (ack!) and which requires that I solve small dense linear systems. If I succeed in getting a user base for the algorithm it will be partly because the entry bar to using it is low (like on the floor). Potential users won't install libraries, etc. in order to use the code. I want the code to be fully stand alone and unencumbered by any license at all. I might simply write my own solver by taking something out of Golub and van Loan but I'd rather use a vanilla solver that someone else has already written if there are any out there. Suggestions appreciated. Thanks!
Comment: possible duplicate of [Recommendations for a usable, fast C++ matrix library?](http://scicomp.stackexchange.com/questions/351/recommendations-for-a-usable-fast-c-matrix-library)
Comment: Dear jep, welcome to the forum. Your question is very similar to the one here: http://scicomp.stackexchange.com/questions/351/recommendations-for-a-usable-fast-c-matrix-library
Comment: Library solvers tend to be complex and big for the sake of robustness, efficiency, and generality. If your problems are very small and reasonably well conditioned, I would suggest you to write your own mini-implementation.
Comment: @GertVdE, thanks for the quick response on this question.  I'm uncomfortable linking to the "Recommendations..." question because both the question and the top answer are too general to provide any help in situations like these.  If you'd like to discuss this further, I suggest we take it to the [scicomp chat room](http://chat.stackexchange.com/rooms/1878/computational-science).
Comment: @AronAhmadia: I think the only way to start settling some of these debates is to start implementing a computational science programming chrestomathy that is both language and library dependent. If the code is clear, and configuration issues can be taken care of (using a shell script, Chef, or Puppet), then debates about performance can be taken care of (or made concrete) by just running the code and timing it on a reference machine. Debates about clarity can be resolved (or at least, made more concrete) by looking at the code. Otherwise, we'll keep having the same arguments.
Comment: I don't think it's a duplicate, since the focus is quite different (lightweight/ease of installation/wide availability instead of performance/convenient api). Maybe the question can be edited to make the requirements more explicit.
Comment: I read the other post before making mine and while they are clearly related I didn't think that mine was a duplicate for the reasons Christian Clason mentioned. Performance is not much of an issue for me. I have to solve one of these low dimensional systems per iterations in an iterative procedure.
Comment: The bulk of the work lies elsewhere. I was hoping to find a rudimentary solver (10-100 lines of code say LU or gaussian elimination) that I could simply paste into my code.
Answer: I would suggest to exactly duplicate the Lapack interface to the function that you need, most probably you just need dgesv. That way people that have Lapack installed can simply link to it and it will just work. For people that don't have Lapack installed, you provide your own simple implementation of this function, or possibly implement it using Eigen or FLENS as others suggested.
In the Fortran land, the Lapack library is such a standard, that most people simply use it and that's it, instead of providing their own implementations.
Comment: +1 Add to it the fact that most Linux distributions (at least Debian based) have binary packages in the repository and all vendor supplied math libs (MKL, SunPerf, ACML, ESSL etc.) carry it. You should always use standard libs as much as possible though if you're on Windows/Mac you might be better off with something C based as installing a free Fortran compiler (gfortran) on them is some amount of work or so I have heard.
Comment: I have used lapack many times but I am not currently in fortran land. I expect that the statistical distribution of platforms my user base run on would be similar to that of the world at large meaning mainly windows, a smaller percentage of macs and an even smaller percentage of *nix. My experience with windows is minimal and I prefer to keep it that way. This is the reason I want a stand alone C++ code. I figure I'll have to provide some of my users with help getting the code to compile and run. I need to minimize the work required to do that.
Comment: If your user base is Windows/Macs then you're better of with a simple C based (perhaps even your own) implementation. A package that is difficult to install or depends on 5 other libs, specially when there is no first class binary package repository (like Debian) available, will turn your users off for a long time. Remember most Windows/Mac users are used to one click install. Ease of use triumphs everything else.
Answer: A very early mistake that many people make when getting started in scientific computing is assuming that you need to write all of your code in the same language.  I think this is due largely to historical reasons, when it wasn't clear how to make compiled programs communicate with each other across even versions of the same compiler.  That said, in this case, if you are going to be using C++ anyway, there are several very good C++ header-only template libraries that might fit your needs.
Since you are distributing your code for academic reasons, and you would like to embed a dense linear algebra solver into your code, I would strongly recommend that you consider Eigen.  Eigen has been licensed under the Mozilla Public License and is a header-only library.  This means that you can distribute Eigen with your code in source form (this does not impose any licensing restrictions on your code), and you will receive access to its general capabilities, including extremely efficient dense linear solvers.  As GertVdE mentions, you have several other options.
Comment: I was hoping for a single file. I've done scientific programming for quite a while. I have mixed languages like C and fortran quite a bit but for this project I really just want one file containing all my source code. I suppose I could put a C solver in the C++ code which wouldn't be a big deal. Mainly I want to keep the code as simple as possible. LU with pivoting should be adequate. I'll look at Eigen. Thanks!
Comment: @jep, you could also try cherry-picking the routines you need from [CLAPACK](http://www.netlib.org/clapack/readme.install) if you really don't care at all about performance.
Comment: There are good reasons for writing all the dependent code in the same language, in particular, in HPC environments, you have weird compiler/linking issues and 32/64-bit interface issues. For example, how do I know the width of an integer for built-in libraries? How do I know for sure what compiler was used for a built-in library, and can I link against it with this other compiler? Having everything in one language simplifies many of these issues. And yes, there should be documentation provided by the cluster maintainers, but most of the time there isn't.
Comment: @VictorLiu - The issues you are referring to are more tightly coupled to implementations than languages.  Comment space is a poor place to get into a serious discussion, but I am happy to engage you in chat or elsewhere if you'd like me to expand my thoughts on this.
Answer: If you want a reliable solver for systems of linear equations I would recommend FLENS.  It contains an exact re-implementation of LAPACK (it even reproduces the same roundoff errors as LAPACK if a single-threaded BLAS implementation is used).  This is true for all FLENS-LAPACK functions (together with the utility functions about 100 routines).
FLENS is under a BSD License and therefore allows to be incorporated into proprietary products.
FLENS is header only and if you only need a subset of FLENS I can give you a stripped-down version containing only those functions you need.  FLENS comes with its own reference BLAS implementation.  But optionally your users can link against optimized BLAS libraries like ATLAS, OpenBLAS or GotoBALS.  For large matrices this gives a performance gain of about 40% compared to Eigen.
And yes, Eigen also uses the LAPACK test suite to check their results.  They do this for 3 functions (Lu, Cholesky and Eigenvalues/-vectors of a symmetric matrix).  However, their computation of eigenvalues/-vectors of a non-symmetric matrix would fail the LAPACK test suite.
Disclaimer: Yes, FLENS is my baby!  That means I coded about 95% of it and every line of code was worth it.
Comment: I just want to say thanks for doing this; I had similar plans to re-implement a large part of Lapack in C++. However, it seems that for most of the advanced (eigenvalue) routines, you simply defer to calling into Lapack, so it's a bit of false advertising to say that you  re-implement the whole thing. On the other hand, I have actually ported the ZGEEV source to C++ in [RNP](https://github.com/victorliu/S4/tree/master/src/RNP), albeit some parts are still in 1-based indexing from auto-conversion.
Comment: Michael - Please consider this a friendly warning that you need to [follow the rule in the faq regarding disclosing affiliation](http://scicomp.stackexchange.com/faq).
Comment: Your remarks about Eigen are not at issue here (although they seem off-topic to me).  You are a primary developer of FLENS, if you are going to recommend it in an answer here, you must disclose your affiliation as developer of the project.
Comment: Sure, but you also could re-phrase your posts from 'I would strongly recommend that you consider Eigen' to something like 'there is for example Eigen'.  In this case I delete my remarks about Eigen (although they are all proven to be true) including this one.
Comment: Ah, ok then. I thought was was implicitly clear by '...  I can give you ...'.  Is the disclosure in this form ok?
Comment: Yes, it's better to be explicit about these things than implicit. Thank you for your revision.
Comment: I think I can get by with LU decomposition with pivoting . I'm solving Ax=b and ultimately I'll want x. I've forgotten how the lapack lu decomposition works but I guess there are several functions needed. One that does LU and one that takes the LU decomposition and b and gives back x. Anyway how do I contact you to get code? I thought we weren't allowed to post e-mail addresses on here?
Comment: At the bottom of the FLENS site you find a link to the author (which is me).  And you also can ask Google.  or you can send an email to the FLENS email-list.
Comment: @jep - If you'd like your email address or other information to be publicly listed, put it in the About section of your profile.  More information [here](http://meta.stackexchange.com/questions/148394/should-real-e-mail-addresses-be-forbidden-in-questions-answers).
Comment: I really completely re-implemted dgeev with all its dependent routines (and that was quite some effort).  Just look how I compile the examples at http://apfel.mathematik.uni-ulm.de/~lehn/FLENS/flens/examples/tut04-page04.html  I am not linking with any external LAPACK.  It just needs a C++ compiler.  BTW: I you are looking for a complete C++ port of LAPACK look at MPACK (http://mplapack.sourceforge.net).
Comment: My primary intension of FLENS-LAPACK was to show that the combination C++/FLENS makes it easy to implement something like LAPACK without sacrificing performance.  Its like an Fortran 90 implementation of LAPACK.  In my opinion FLENS is rather a tool than a concrete library.
Also look at this simple example (http://apfel.mathematik.uni-ulm.de/~lehn/FLENS/flens/examples/tut01-page08.html) showing how FLENS simplifies the implementation of getf2/getrf. Analogously to FLENS-LAPACK I am working on something similar to MAGMA with ViennaCl as GPU backend.
Comment: @VictorLiu: About your comment "you simply defer to calling into Lapack" and "false advertising" is that resolved? For each LAPACK routine that I re-implemented I also have an (optional) interface/binding to an external LAPACK routine. I mainly use this for checking my results. And on the FLENS_LAPACK page I marked each LAPACK routine that was not completely re-implemented. So I really do not think that I did any wrong advertising. But I want to clarify any concern you have.


What would D A and A in an octave higher played as a chord be called?

Question: I've been writing an electronic song, and this is part of the background melody.
But I know little to no music theory (that I remember), so I'm unsure of what it is.
And if it's not a chord, what is it?
(Also the first D and A are played in the same octave, it's the last A that's played in the higher octave, for clarification).
Comment: This looks like a duplicate of [this question](https://music.stackexchange.com/questions/49137/what-are-no3-chords)
Comment: I don't understand how it's duplicate, and if it is, it doesn't answer my question in a way I can understand it.
Comment: Sorry! I'll try and write an answer...
Comment: Related: https://en.wikipedia.org/wiki/Voicing_(music)
Answer: For starters, consider reading the wikipedia article on chords and focus on how it mentions triads and says in various ways that "three notes are needed to define any common chord". The basic idea is that you have only two notes because 2 of them are an A. Chord specifications totally ignore octaves so you have only 2 distinct notes -- D and A. While some might consider this a chord, doesn't define a major or minor chord or 7th chord or anything.
EDIT: This article, although quite involved, looks super handy. The section on power chords says that you might call this chord a fifth chord, indeterminate chord, or neutral chord.
And the name of the chord will depend on which note is on the bottom. I.e., which note is the lowest note you are playing. This matters because chords usually have the root note played on the bottom. Inverted chords are also a thing but in your case we probably don't need to introduce that possibility.
Assuming you are playing the D on the bottom and it is the root and then you are playing an A a perfect fifth up and then an A above that, your chord is a D but an indeterminate D chord -- i.e., neither major nor minor and no 7ths or augumented or diminished bits. EDIT according to @david-bowling this chord would be referred to as D5. I do not personally recall ever seeing this type of notation in any tab or fake book.
Assuming you play the A on the bottom with a D a perfect fourth up from that and another A on the top, you might call that chord Asus4 but the chord lacks the third tone of an Asus4 chord which would be an E.
Comment: Of course it has a name. D with an A above is called a **D5**; these are commonly called _fifth chords_ or _power chords_, even though two notes don't really determine a chord. With the A doubled an octave higher, I probably wouldn't call it a power chord any longer, but it would still be a fifth chord.
Comment: Fifth chords with notation like **D5** show up in tablature and chord charts for rock music all the time. Doubtful that you would find anything like this in fake books like _The Real Book_, though. [Here is an example](https://tabs.ultimate-guitar.com/tab/ozzy_osbourne/crazy_train_chords_1492045).
Comment: '5' 'chords' don't feature in any real or fake books I've used, they seem to be a modern development, and can be found in a lot of recent stuff - particularly tab. Tab, as they also appear to be especially associated with guitar music. they have little to do with sus chords - which have three notes, but again are indeterminate - neither major nor minor.
Comment: Thanks, I did happen to read the Wikipedia article on Suspended Chords, and I slowly figured it out, but this clarified it well. I happened to make a mistake when I asked the question, and I said "an octave above" when I meant "an octave below" silly me. I imagine the same info applies regardless.
Comment: I'm glad to have helped, however little. You may find it encouraging to know what chords are often ambiguous and a single triad might be described by more than one chord name. It sort of depends on context.
Answer: So as S. Imp has said above, two notes don't form a triad. Whether anything less than a triad is considered a chord is subject to debate (and therefore not appropriate to this forum). You can certainly leave it as it is (a D5 as it seems to be called) or you could add a third tone (most likely either an F# to make a D triad or an E to make it an Asus4 triad, possibly a natural F for a D minor (minors tend to sound sad or serious)). If you do choose to add a note, you'll want to find the one that makes the most sense in your song (this depends on the chords and notes around this specific chord). Play around with it and see which one sounds better. Otherwise, you could just leave it as a D5, there's nothing wrong with playing two notes together and not making a triad.


Length of sleep time

Question: Why do we wake up after 6-8 hours of sleep ? Why don't we sleep for lets say 20-30 hours ? What mechanism is it that controls when to wake us up and how does it determine the moment that we should wake up ?
Comment: It's considered a requisite on biology.se that at least some reading/research is carried out and presented with your question. Otherwise it will be closed as *homework*. [For example, have you read about *circadian rhythms*?] The [site tour](http://biology.stackexchange.com/tour) and the [help center](http://biology.stackexchange.com/help)  provide guidance on how to use this site. Please take a few minutes to read about the kind of questions which are on topic here.
Comment: [Related question.](http://biology.stackexchange.com/questions/1295/human-sleep-cycles-and-dream-times-what-influences-the-timing-and-intensity-sl?rq=1)
Answer: Think this review from Nature can answer your question. A brief summary  ( with slight simplification):
The ascending activating system (that is responsible for wakefulness) has two branches:
The first one ascends to the thalamus and activates the thalamic relay neurons - these transmit information to the cortex. They get their main input form two acetylcholine producing group of cells:  the pedunculo-
pontine and laterodorsal tegmental nuclei (PPT/LDT). These two group of cells are also the source of main input for reticular nucleus of the thalamus.

The neurons in the PPT/LDT fire most rapidly during wakefulness and rapid eye movement (REM) sleep, which is the stage accompanied by cortical
  activation, loss of muscle tone in the body and active dreams

The second branch, directly activates neurons in the hypothalamus, basal forebrain (BF) and cortex, bypassing the thalamus. This pathway has origins in monoaminergic neurons in the upper brainstem, caudal hypothalamus, as well as the noradrenergic locus coeruleus (LC), serotoninergic dorsal (DR) and median raphe nuclei, dopaminergic ventral periaqueductal grey matter and histaminergic tuberomammillary neurons. Input from this pathway to the cortex is extended /augmented by the lateral hypothalamic peptidergic neurons (that contain melanin-concentrating hormone (MCH) or orexin/hypocretin), and BF neurons(that produce acetylcholine or GABA).
Sleep is promoted by the so called VLPO (ventrolateral preoptic nucleus).
The VLPO send outputs to major group of cells of the arousal system in the hypothalamus and brainstem.

The VLPO neurons are primarily active during sleep, and contain the inhibitory neurotransmitters, galanin and GABA.
  The VLPO also receives afferents from each of the major
  monoaminergic systems. Both noradrenaline and serotonin inhibit
  VLPO neurons. The latter do not have histamine receptors, but the
  tuberomammillary neurons also contain GABA, which is inhibitory
  to VLPO neurons, as well as several other potentially inhibitory pep
  tides, such as galanin and endomorphin. Therefore, the VLPO can
  be inhibited by the very arousal systems that it inhibits during sleep.

As you can see in the quote from the paper these two systems can mutually inhibit each other and basically work as a seesaw or 'flip-flop switch'. In this system activity in one  subsystem shuts down the inhibition from the other subsystem and disinhibits its own action (selfreinforcing loop). The transition from one state to the other is relatively fast. Orexin plays important role in stabilizing the switch in one position or the other.

Regulation pf sleep:
Homeostatic:
It is unclear how homeaostatic regulation of sleep work, yet it has been proposed, that adenosine accumulation in the brain may signal for 'need for sleep'. The extended wakefulness causes the exhaustion of brain glycogen reserves and depletion of ATP levels. As ATP is degraded to ADP, AMP and eventually adenosine, extracellular adenosine levels rise in some parts of the brain including the BF.

In addition, adenosine might disinhibit the  VLPO via presynaptic A1 receptors by reducing inhibitory GABAergic inputs.

This implies that during sleep ATP and energy sources are regenerated and free adenosine levels drop, thus inhibition of VLPO might take place again.
Also it is important to note that the amount of sleep we need is proportional to the time we spend awake.
Circadian regulation:
It is known that humans have quite precise :circadian rhythm:

The suprachiasmatic nucleus (SCN) serves as the brain's 'master
  clock'. Neurons in the SCN fire in a 24-hour cycle that is driven by a
  transcriptional–translational loop, which persists even when the neurons are dissociated in cell culture.

The SCN has moderate output to the VLPO or orexin neurons, but it has more important projections to the adjacent subparaventricular zone (SPZ) and the dorsomedial nucleus of the hypothalamus (DMH).

The SPZ also has relatively limited projections to the VLPO, orexin
  neurons and other components of the wake-sleep-regulatory system. However, a major target is the DMH. This region receives inputs from many more neurons in the SPZ than the SCN, so the SPZ is in a position to amplify the output of the SCN. (...) The DMH is one of the largest sources of input to the VLPO and orexin neurons and is crucial for conveying SCN influence to the wake–sleep-regulatory system. The DMH projection to the VLPO comes largely from GABA-containing neurons (that is, those that promote wakefulness by inhibiting sleep), and the projection to the LHA originates from neurons containing glutamate and thyrotropin-releasing hormone (which should presumably be excitatory and promote wakefulness).

So as you can see our circadian rhythm as direct control over our sleep-wake cycle, and that the SCN can heavily promote awakening through SPZ and DMH.
Thorough review and details can be found in the article I linked at the beginning, I only tried to select key information to provide a (not so ) brief summary. We only sleep about 7-8 hours normally because this is enough for homeostatic regeneration and our circadian rhythm promotes wakefulness in the morning (this is quite simplified).
Based on their abstract these limited access papers might also be useful (unfortunately I do not have full access to them right now):

http://www.eurekaselect.com/87813/article
http://www.sciencedirect.com/science/article/pii/S0074774210930018
http://www.sciencedirect.com/science/article/pii/S0896627315001312
Answer: I think what the OP is getting at is less about the mechanism of sleep -> wake transition and more about how the length of sleep time is regulated...
In that regard, it's an interesting question without a definitive answer. In a sense, it is a question of homeostasis and the time when your sleep need/pressure is satisfied determines when you wake up (without an alarm clock).
It is hypothesised that sleep drive is a function of the previous wake period plus any sleep debt you carried from the previous days.  One molecule, adenosine, is thought to represent that and the accumulation of that in the brain makes you want to sleep [Ref. 1].  Thus, the clearance of external adenosine in the brain to a certain level may be part of the homeostatic mechanism signalling enough sleep.
Another hypothesis is that sleep is required to encode memories long term [Ref. 2] and to calibrate emotion/mood [Ref. 3] which themselves can add to the sleep need and those processes would need to be completed to a certain level to release that sleep need.
As for the specific moment for awakening, if there isn't some external arousal stimulus like daylight/alarm or the rush of cortisol cycle driven by your circadian mechanism, then it will likely correlate to the end of the current 90min sleep cycle when your brain is close to the wake state coming out of REM [Ref. 4]. In fact, it's thought you wake a little every 90min through the night, it's just you don't remember it.
[Ref. 1]: Link to adenosine and sleep review
[Ref .2]: Link to sleep and memory review
[Ref. 3]: Link to sleep and mood review
[Ref. 4]: Link to brief summary of sleep staging

Length of sleep time


Is using of the term "KPI" correct at process level?

Question: I have read in many business books that KPIs should be only those metrics that directly relate to organizational strategic goals. Also that C-level people look at them and can act on them. According to those books, many people confuse KPIs with simple PIs.
So I am wondering, if I want to define some performance indicators for my processes in my department, I assume I should not call them KPIs?
Then how should I call metrics that are important for me (or people in my department?)
Comment: I usually just call them "metrics". What's the need for a formal name if just within a team?
Answer: Use the term at any level you desire.  If you need to discriminate one KPI from another, then simply name them: Process Alpha KPIs.
If you own a process, let's say the F-35 assembly line, I'm pretty sure you'd have quite a few KPIs to monitor the health of your line, and if anyone else at LM would complain, you could tell them where to put their KPIs.
Comment: Well but that is using the term in a wrong way. The same is the fact that KPI is not financial, and yet many professionals use financial kpisb(when actually there is FPI)
Comment: I think the term KPI has become so overloaded that original distinctions have become all but useless. That shouldn't stop you from sticking to the "right" terms set by some authority if you want, but be aware others won't and you probably shouldn't expect them to.
Comment: There are many schools of thoughts with everything and those schools evolve constantly.  Terms come and go, people have their opinions about how to classify this or that, others disagree.  We make things more complex by dividing these things up, and then someone says enough and makes them simpler again, only for someone else to make it more complex down the line.  If a performance indicator is key to you for what you have as an accountability, then call it what you like.  The name is less important than that you know what to do with it.
Answer: TL;DR
Consider the source! Business books aimed at the C-suite or at the executive level probably only care about metrics that should roll up, but other levels will have other indicators that matter too. What makes a great indicator will therefore be very context-dependent.
Explanation
A Key Performance Indicator (KPI) should focus on the word key. It's any metric that helps you quickly visualize the status of whatever you're measuring, with a bias towards being an easy-to-read indicator of whether things are good or bad. With that said, what makes a KPI useful will vary tremendously between organizations, projects, and even the people viewing it. While the metric should be an objective measure, the value of the KPI is in how accurately it indicates what matters to the people who can do something about it.
At the executive level, KPIs are often strategic or financial in nature. For example, "Are we within 10% of our initial $20M budget?" might be a great strategic indicator of whether an initiative is financially on track.
At lower levels, "Are the widgets coming off the embiggening assembly line more than 25% larger than the ensmallened widgets?" might be a great indicator of how well a process or control is operating. This type of metric is key to monitoring process health, even if it's not immediately visible in higher-level dashboards. So, while a C-level executive might not care about this particular metric, it doesn't mean it isn't a key indicator at the right level, nor that it can't roll up into a higher-level indicator when necessary.
In other words, KPIs can (and probably should) exist at multiple levels, but the selection and implementation of the indicators will vary based on what's important to track at any given level. Understand the context and the control objectives, and the right KPIs may become self-evident.


What happens if I push a pawn to the 8th rank and press the clock before promoting?

Question: What happens if I push a pawn to the 8th rank and press the clock before converting it to another piece?
Does it make a difference if it's Blitz or not?
Answer: "If the player has moved a pawn to the furthest distant rank, pressed the clock, but not replaced the pawn with a new piece, the move is illegal."
Source: Fide Laws of Chess taking effect from 1 January 2018 at 7.5.2.
If a move is illegal, it's illegal in Blitz, too. What can differ between Blitz and classical is what the penalty for an illegal move is.
Previously, in blitz/rapid a player making an illegal move would instantly lose the game.
However, January 1, 2018 revisions to FIDE Laws of Chess acted "to equalize the rules for classical chess on the one hand, and rapid and blitz on the other, with regard to the penalty for making an illegal move."

Before, in both rapid or blitz an "illegal move" (which includes moving with two hands, or not making a move and pressing the clock) would instantly lose the game in case the arbiter intervened or the opponent stopped the clock. Now, in the first instance it will lead to a time penalty and only if a player does it again, he or she loses—just like in classical chess.

Source for quotes on 1/1/2018 change: Peter Doggers, New FIDE Laws Of Chess For Blitz, Rapid Still Not Perfect
Comment: Since the question was tagged [tag:illegal-move] I think your answer is stating something the OP already knew (but it's always good to cite the rules to confirm!), and what the OP is actually asking is "what happens" if you play this particular illegal move. In my interpretation, that means he is asking about the penalty, I think including that would greatly improve the answer.
Comment: What happens is not specific to this particular form of illegal move, but applies to all illegal moves. The FIDE regulations are to be found here: https://www.fide.com/fide/handbook.html?id=171&view=article.
Comment: @11684 hello :) In fact, I was not sure whether or not it was an illegal move. I added the illegal-move tag because I thought it probably was, but wasn't sure. Regardless you're right that I'm interested in the penalty, especially from the "what happens" part of the question :) Upvoted this answer anyway.
Comment: I've updated my answer to point out that, as of 1/1/2018, an illegal move is no longer an instant loss in blitz.
Answer: Building on Jim Ratliff's answer that this would be an illegal move, the regulation says:
7.5
a. If during a game it is found that an illegal move has been completed, the position immediately before the irregularity shall be reinstated. If the position immediately before the irregularity cannot be determined, the game shall continue from the last identifiable position prior to the irregularity. Articles 4.3 and 4.7 apply to the move replacing the illegal move. The game shall then continue from this reinstated position.
If the player has moved a pawn to the furthest distant rank, pressed the clock, but not replaced the pawn with a new piece, the move is illegal. The pawn shall be replaced by a queen of the same colour as the pawn.
b. After the action taken under Article 7.5.a, for the first completed illegal move by a player the arbiter shall give two minutes extra time to his opponent; for the second completed illegal move by the same player the arbiter shall declare the game lost by this player. However, the game is drawn if the position is such that the opponent cannot checkmate the player's king by any possible series of legal moves.
Answer: It's a good question, especially regarding the difference between time controls. The answer is yes, there is an important difference: in Blitz (and Rapid chess, which is a frequently overlooked time control also covered in the rules) the game is a draw if the arbiter observes that the illegal position remains after the failing promotion move:
A.4.4 If the arbiter observes both kings are in check, or a pawn on the rank furthest from its starting position, he shall wait until the next move is completed. Then, if an illegal position is still on the board, he shall declare the game drawn.
For reference: A position is illegal when it cannot have been reached by any series of legal moves. (article 3.10.3)
Of course, the opponent could claim a win before he makes his move. But if he makes a move and the pawn remains on the last rank, the observing arbiter shall declare the game drawn.
This is not possible in standard chess (where each player's thinking time is at least 60 minutes) because the position immediately before the irregularity shall be reinstated, and the penalty is two minutes extra time to his opponent (or the player loses the game if this is the second illegal move).


Can cancer incidence rates, calculated from the general population, be used in primary care?

Question: I calculated incidence rates (IR) for colorectal cancer using an age-period-cohort model. Is it useful for GPs to use such age, gender and anatomical sub-site specific IRs as a baseline risk, during the assessment of cancer risk in patients who present with lower abdominal symptoms?
My concern is that CRC risk is different in the general population and in the primary care population.
Comment: Epidemiology?!?
Answer: Hello and welcome to SE Medical Sciences.
I'd recommend not over using acronyms, (you forgot to define 'CRC' as Colorectal Cancer.). It is difficult to know what you mean you mean by 'general population' & 'primary care', regardless could I get some clarification?
As Rodrigo de Azevedo rightfully pointed out, this is not quite an epidemiological question.
Definitions
Epidemiology - The incidence, distribution, and possible control of diseases and other factors relating to health.
Epidemiology of cancer - Seeks to identify the cause of cancer.
Primary health care - Is generally the first contact a person has with the health care system and therefore present with symptoms.
General population - People that make-up the population of a city, state or country.
Experimental Procedure
If a study uses a representative sample from a population, check their method to see where their statement on 'how' or 'why' they chose that exact sample. It should sate if it is from private practice, the general population or specialist clinic.
In the method of this attached paper it states:

"A randomly-selected cohort in the general population recruited by telephone, and patients recruited in the waiting room of 12 primary care clinics"
Comment: Thank you for your answer and for the paper. 'Primary care' - primary care clinics (general practice), 'general population' - the whole population of a country.


Brother MFC-240C Ubuntu 12.04.1

Question: Brother MFC-240C Not scanning to computer. Test page and a document page printed fine. The photo copy part works OK to.
Answer: I have sucessfully installed, printed and scanned the brother mfc240c since 8.04, I have found it to work perfectly in 12.04...please make sure to install the correct drivers that can be found here ...http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/index.html
Answer: Ok, first of all make sure your printer/scanner MFC is supported in Ubuntu at the following websites.
For your specific manufacturer click here
All manufacturers can be found here
The Sane Projects list of supported devices can be found here
You can find linux drivers made by Brother here
Make sure you do Brothers pre-required procedures by clicking here.
Then Click here to go to Brothers printer cups driver installation guide and here to go to Brothers lpr printer installation guide. Follow the guide according to whether you want CUPS or LPR, Brother recommends cups. I have heard following these steps have worked for others and that the MFC print drivers is all you should need on some models to make both work. Mine doesn't work this way. I have never came across one that works this way.
I searched all these websites and couldn't find a Brother MFC-240C scanner that was supported. However, I did see a Brother MFC-7240 and a Brother MFC-230C. So for your sake I hope you made a typo and your device is supported. The photo copy part of the machine is not handled by your computer and should work whether its connected to a computer or not.
This being a brother device I do know that they can be a pain to get both printer and scanning capabilities to work correctly in any Linux distrobution if it isn't supported. I've read where others have the same issue as you with Brother devices, printer works scanner doesn't. I have a brother MFC device that has never worked correctly and it seems never will unless I learn how to write device drivers. I can get it to work if I don't set it up as a printer first. But if the scanner works the printer part never will, and vice versa. So you can try removing the printer set up and driver, disconnect it from the computer. Then reconnect it and try setting it up to scan first. If that works then you can try setting up printer and hope they both work that way. Mine wouldn't. Its one or the other.
Other than what I have already stated the following is basically my experience and some suggestions. I work for a networking/computer repair company and I personally specialize in printer networking and repairs. Always check that the device you have in mind to buy is supported in Linux and Ubuntu before buying. You'll save yourself a possible headache.  I always recommend HP devices for Linux systems, they are usually supported, at least the ones I have came across, and are a snap to get working. Research what other people have bought and have had good experiences with when installing and using in Linux. In my experiences, multi function printers/scanners/fax machines can be a pain to get working correctly if unsupported in any version of Linux. Also, I've found that USB devices work and are easier to configure compared to Parallel devices that hardly ever work for scanning especially. That being said it has been a few years since I've installed any type of MFC on a linux machine because most of our customers use Windows and the ones that use Linux I have to set it up once and they never screw up so I hardly have to fix them again.
Hope this helps.
Comment: This user asks how to get their scanner working, but you give instructions on how to install the printer drivers.  Consider revising your answer to be more succinct.

Brother MFC-240C Ubuntu 12.04.1


Coda folder sorting

Question: Does anybody know if there's an option in Coda somewhere (or a hack) that would sort folders at the top of the list in the file browsers?
Answer: I don't know if that option exists, but if you send the question to @panic on twitter or better yet email firstname.lastname@example.com, they'll respond and let you know.
Answer: I suspect that the File Browser sidebar is a standard Cocoa Widget. What this means is that it would follow all the same rules that standard OSX applications do (think: Finder).
Since the Finder does not show Folders first, Coda will probably not have a way to show Folder first.
I second Kris + Matthew B.'s answer, that Panic is a great company that answers users' questions. Having said that, don't get your hopes up, because Coda is just behaving exactly like the Finder does.

Coda folder sorting


Can I use my Bachelor's Degree as qualification to find a job in Germany, even if I do a Master's Degree there in another field?

Question: This seems to be slightly confusing to me, because the regulations state that the job that a foreign student graduated from a Germany university can take "should be related to his/her field of study" which seems a bit vague. If I hold a Bachelor's degree in Computer Science (classification A3), but later do a master's degree in another field (Master of Arts), can I still land a job as software engineer/"IT specialist" using my bachelor's degree as qualification? I think there shouldn't be any reason that the job has to be restricted by the graduate degree only, but I'm not totally sure about it. Also, a personnel from DAAD in my region gave me some confusing replies as well(he told me to ask the diploma-offering university in Germany for clarification).
Comment: How did you solve this in the end? Can you put in a self-answer here?
Comment: @mts The field of my current master's degree is still in some way related to the bachelor's degree (which is actually normally a requirement to get admission in the first place in Germany), so sorry, I guess I can't provide an answer here. Maybe it would be best to ask the related authority yourself, since the regulations might also vary a lot across different regions/cities, as the local authorities have quite some power of discretion in issuing the work visa.
Answer: You write "the regulations state that the job that a foreign student graduated from a Germany university can take "should be related to his/her field of study". What regulations are that?
If the regulation under which you are currently allowed to live and study in Germany is § 16 Aufenthaltsgesetz (AufenthG) in your case, I cannot find any regulation as to what field you are allowed to work in. It just states that you may not work for more then 120 days / year as a general rule.
Believe it or not, law is more logical in Germany than one may think. Just get used to asking youself what the abuse of a law mihght be and you usually understand better what the idea behind a law is.
In this case it's: If they would allow you to work full-time 365 days a year, please could easily circumvent any working visa and just register as a student in a German university (which would by the way provide some more goodies) but never actually study at all. It would take at least one year, in practice rather 2-3 years before the university would kick you out and as a result you'd loose your visa. And this is what they don't want. On the other hand they don't want to limit to opportunity to study to those who bring enough money to sustain their living in Germany for several years without any income. Thus the compromise that they allow you to work for 120 days / years which will hopefully be enough to cover your cost and leaves enough time for actually studying.
Comment: Maybe you misunderstood my original question. It was about work **after graduation**, not while during the study. Anyways I do believe the laws shouldn't be as inflexible as that, and if a company wants to hire you in whatever field they should be able to do so without being confined by the actual degree you obtained. However I remember reading something that explicitly states the degree that you obtained matters in this case, thus the question.
Comment: You may also refer to this question here: https://expatriates.stackexchange.com/questions/7079/is-it-true-that-you-dont-need-a-degree-to-work-as-an-it-specialist-in-germany?rq=1 Sources do state that you will need certain degrees to work in Germany. For example a company can't just hire somebody who doesn't have any kind of proof of qualification from abroad. That's what my question was about.
Comment: @JIXiang Yes, I completely misunderstood your question. But that might be due to the part "if I do a Master's Degree there in another field". I understood you have a bachelor in A and you are currently doing your masters in B and would like to work aside.


What orb effects can be stacked in Dota and Dota 2

Question: I was wondering what orb effects can be stacked in Dota and Dota 2.
Why eye of Skadi and helm of dominator orbs effect can be stacked?
Answer: As of patch 7.07 : all Orb Effect (Unique Attack Modifiers) have been removed. Lifesteal can stack additively with itself. Only Manabreak (Antimage) doesn't stack with Feedback (Diffusal Blades).
Tehcnically, no Orb Effects stack. That's why they're Orb Effects (or UAM : Unique Attack Modifier in DotA 2). However...
From  items
Some items applies a debuff which could be (or was) concidered as an Orb Effect but is not :

Eye of Skadi : "On ranged heroes, Eye of Skadi can be combined with a lifesteal Unique Attack Modifier". So only a lifesteal, no Skadi + desolator for example.
Vladimir's Offering : Lifesteal from Vladimir's Offering is not concidered as an Orb Effect however the lifesteal is reduced on ranged heroes.
Lesser Maim (15% chance to get 20% attack speed and movement speed slow on your target) on Sange (or Heaven's Hallberd) used to be a Orb Effect but no longer is one.
Greater Maim (16% chance to get 30% attack speed and movement speed slow on your target) on Sange and Yasha used to be an Orb Effect but no longer is one.
Manabreak on Diffusal Blades used to be an Orb Effect but no longer is one.

The Orb Effect  chain lightning from Mjollnir (and Maelstrom) depend on if you proc it or not (25% chance). When you do not proc it and if you have another orb effect in your inventory, it will be applied. Basically you can lifesteal, corrupt (desolator) etc. between each chainlightning.
That also mean that on a ranged hero you can have Skadi +  Lifesteal (Mask of death, Mask of madness, Satanic) + Mjollnir/Maelstrom and a Sange and Yasha and you would benefit from all passive debuff.
From skills
Orb Effect can be provided by some skills in the game aswell. Some of those are passive like Manabreak (Antimage). Some are manually casted or autocasted such as Drow Ranger's Frost Arrow, Viper's Poison Attack, Enchantress' Impetus, Outworld Devourer's Arcane Orb etc.
When dealing with Orb Effect from skills, same rules apply for stacking them (Sange and Yasha works, Vlad stacks too but less lifesteal on ranged hero etc.).  For casted one : when you are not using a Manually/Auto casted Orb Effect (like those mentionned above), you can apply another Orb Effect from a purchased item (A common example is Drow + Helm of the dominator : You will want to manually slow your target while you lifsteal between each Frost Arrow).
Comment: sange, sange&yasha and heaven's halberd stack with themself. but this is a bug at the moment
Answer: The answer by WizLiz already gave you a good overview of item based orb effects, but I want to extend on that a little with skill based orb effects.
Some heroes have attack modifier/orb effect skills, like Viper, Drow Ranger, Outworld Destroyer, Huskar and some more that don't come to my mind right now.
These skills conflict with item based orb effects just like other items would, with one notable exception: You can manually prioritize an orb effect! This is also known as Orb Walking.
The way this works is that you have to turn off Autocast on the hero skill by right clicking it or holding the Alt button when pressing the skill key. You can see whether autocast is on or not by a yellowish box around the skill image.
Once autocast is turned off, the skill will obviously not be applied to your attacks, and your item based orb effects become active. But if you now manually press the skill button and then click on an enemy, the skill based effect will be used instead of the item effect.
This also has another nice sideeffect: If you attack an enemy hero by orbwalking, you will not draw aggro from their creeps!
By using this strategy effectively, you can make use of usually conflicting orb effects, which can give you great benefits.
While this isn't orb stacking per se, it comes near it in many situations when debuffs stay applied for a certain amount of time. Consider the following scenario:
Drow Ranger with Desolator: Drows Frost Arrow skill and Desolator are both orb effects that don't stack with each other. But if you turn off autocast on Frost Arrow and manually use it you can alternate between slowing the enemy and reducing the armor. Depending on your attackspeed you can easily keep up both debuffs at the same time!
Comment: I hope you dont mind I took the liberty to edit my previous answer in order to add some of your precision.
Comment: Sure, no problem.
Answer: Answers are 3.5 years old and many patches made many changes in orb effects{that is old title in dota2 it is Unique attack modifier}. Unique Attack Modifiers UAM function on a system of priority, because UAM do not stack. For each attack only one Unique Attack Modifier will be applied. In last patches many of UAM was changed to Attack Buffs, Desolator for example. Difference is they will stack with UAM. But still you can have only 1 active UAM. Source
UAM:
The following list contains UAM which do not stack with each other and will adhere to the rules detailed above.
Hero abilities:
Anti-Mage : Mana Break; Outworld Devourer : Arcane Orb
Item abilities:
Morbid Mask, Mask of Madness, Satanic all three items provide Lifesteal and Satanic + Unholy Rage
Attack Buffs.
The following list contains simple attack buffs. These can stack with Unique Attack Modifiers.
Hero abilities:
Abaddon : Curse of Avernus
Broodmother : Incapacitating Bite
Clinkz : Searing Arrows
Doom : Inferal Blade
Drow Ranged : Frost Arrows
Enchantress : Impetus
Huskar : Burning spears
Jakiro : Liquid Fire
Kunkka : Tidebringer
Legion Commander : Moment of Courage
Lifestealer : Feast
Meepo : Geostrike
Sand King : Caustic Finale
Silencer : Glaives of Wisdom
Tusk : Walurus PUNCH!
Ursa : Fury Swipes
Venomancer : Poison Sting
Viper : Poison Attack
Weaver : Geminate Attack
Wraith King : Vampiric Aura
Item abilities:
Blight Stone : Blight
Desolator : Corruption
Diffusal Blade : Manabreak
Eye of Skadi : Cold Attack
Heaven's Halberd : Lesser Maim
Maelstorm : Chain Lighting
Mjollnir : Chain Lighting
Orb of Venom : Poison Attack
Sange : Lesser Maim
Sange and Yasha : Greater Maim
Silver Edge : Lesser Maim
Vladimir's Offering : Vladimir's Aura
Answer: Removed the remaining Unique Attack Modifiers since: 7.07
Lifesteal is no longer a Unique Attack Modifier (stacks additively)
Outworld Devourer : Arcane Orb is no longer a Unique Attack Modifier
Anti-Mage : Mana Break is no longer a Unique Attack Modifier (does not stack with Diffusal Blade's Mana Break)


How to optimize 'select found_rows()' query? Several 'high load average' alerts daily

Question: I have 5,000 regular posts, 6,000 posts in one post type and 2,000 posts in another post type. Needless to say, that has made the wp_posts table quite large. Not to mention, I have custom taxonomies set up to mimic the post types so for every Company A entered into Company post type, there is Company A, I manually entered Company A into Company taxonomy. That way, when I do a regular post about Company A, I can effectively tag Company A into the post and then that post appears on Company A's custom post type page.
Specs : Running WP Super Cache w/ Cloudflare as CDN. Theme is Wordpress TwentyEleven but heavily customized. Server: 2048 RAM, 80gb Raid, 8+CPU 4x priority, 5000GB Bandwidth. Traffic is 750k views/month & 200k uniques.
I'm starting to see performance issues increase pretty rapidly with two instances in the last week where I got an

error connecting to database

message on the site and had to restart mysql service. Not to mention, high load average emails several times a day.
Ran Debug queries. Ran it with WP Super Cache. Uninstalled WP Super Cache & tried W3 Total Cache w/ most of the options enabled. In both trials, I saw the longest load time caused by these two queries (but only on the first load! Almost 0 on subsequent loads):
Time: 7.79628753662E-5
Query: SELECT FOUND_ROWS()
Call from: require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/child-theme/index.php'), WP_Query->__construct, WP_Query->query, WP_Query->get_posts, WP_Query->set_found_posts, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query

Time: 6.29425048828E-5
Query: SET SESSION query_cache_type = 0;
Call from: require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/child-theme/index.php'), get_footer, locate_template, load_template, require_once('/themes/child-theme/footer.php'), wp_footer, do_action('wp_footer'), call_user_func_array, Debug_Queries->the_queries, Debug_Queries->get_queries, W3_Db->query, W3_DbCache->query, W3_DbCallUnderlying->query, W3_Db->query, W3_DbProcessor->query, W3_Db->default_query

I did remove an array which made it so that we looked for posts types in addition to regular posts but that didn't seem to make a difference.
Full example query output: http://pastebin.com/L0mSXe9q
Also, here is the template code for the main index:
    <?php if ( have_posts() ) : ?>

        <?php /* Start the Loop */ ?>

            <?php while ( have_posts() ) : the_post(); ?>

            <?php if ( 'status' == get_post_format() ) {

                get_template_part( 'content-status', get_post_format() );

            } else get_template_part( 'excerpt', get_post_format() );

        ?>

        <?php endwhile; ?>

Really not sure where to proceed from here.
Answer: Just put this in your functions.php and you'll be fine.
add_filter( 'pre_get_posts', 'optimized_get_posts', 100 );
function optimized_get_posts() {

    global $wp_query;

    $wp_query->query_vars['no_found_rows'] = 1;

    return $wp_query;

}

Comment: will that not break pagination of queries?
Comment: Yeah, it might break the pagination...
Answer: This should not break pagination:
add_filter('pre_get_posts', 'optimized_get_posts', 100);
function optimized_get_posts() {
    global $wp_query, $wpdb;
    $wp_query->query_vars['no_found_rows'] = 1;
    $wp_query->found_posts = $wpdb->get_var( "SELECT COUNT(*) FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')" );
    $wp_query->found_posts = apply_filters_ref_array( 'found_posts', array( $wp_query->found_posts, &$wp_query ) );
    if($wp_query->query_vars['posts_per_page'] <= 0) {
        $wp_query->max_num_pages = 0;
    } else {
        $wp_query->max_num_pages = ceil($wp_query->found_posts / $wp_query->query_vars['posts_per_page']);
    }
    return $wp_query;
}


Manuscript Format in Microsoft Word

Question: I plan to write a novel, but before I do so, I need to know if Microsoft Word's manuscript format is accurate.
Comment: Use the simple high school MLA format, I use it and it seems a lot cleaner than anything else I've used in the past.
Comment: @AspenRand MLA format is different from novel writing.  It is designed with the purpose of research writing and presenting facts backed by resources.
Comment: To answer your question Galactic, there seems to be a ton of custom templates you can insert into Word and a quick google showed a bunch of templates for manuscripts.  [This how to format manuscripts](http://www.scribophile.com/academy/how-to-format-a-novel-manuscript) might be what you are looking for or help you gauge accuracy.
Comment: @ggiaquin Oh, I'm still using MLA in school, so that's what I use for writing drafts. It can still be useful if you're looking at sources and want to keep the original search  ..
Answer: I'll go one step further. (I run a publishing company). Do as little formatting as possible!
Italics, bold -- ok.
Lists, numbering -- ok.
Justify -- turn off.
line spacing, indenting, page formatting -- avoid tinkering with that.
I would use only two styles from the  MS Word styles: the Title style  (or Heading style) and the Body style. Then I would modify the Body style to choose a more readable font (like  Calibri, Cambria, Candara, Consolas and Corbel). Edit the Style -- not the text itself.
A publisher will accept a digital copy, then import the content into their own template. Any extraneous formatting needs to be manually removed.
Each publisher is different -- and if they have guidelines, you will need to follow them. But generally, the fewer things you format, the better.
Comment: @ggiaquin16 They mean a ragged right edge. By "justification" they mean do not allow it to add space between words so sentences all end at the same point.
Comment: You mention turning off justification and august in their answer also said to turn it off but leave the ragged edge.  Since MS word defaults to left justification, and you have to pick one of the options, how do you not justify something?
Comment: Great answer, thank you.  Is there a comma missing after "indenting"?  Are you saying that new paragraphs *should* be indented or it should be turned off?  The default in Word is not to have indenting and you say to avoid tinkering with it.
Comment: Actually, even though I've already upvoted this, would you *ahem* reformat paragraph 2 to be clear what is on or off?  This is super useful info and I'm finding it hard to parse that paragraph.  Thanks! (just noticed this is 2 years old...so no worries if you don't see it or don't want to bother)
Comment: It's generally not a good idea to make a style which globally affects indenting. There may be special cases -- verse, etc, but the reading system usually handles what happens to all paragraphs.
Answer: It actually depends on to whom you submit: some
want no tabs, others want certain fonts or
certain headers and pagination. Your best bet is to forget all templates and rely on this:
Double-spaced 12 point Courier or Times New Roman; ragged edge (do not justify---ever); page numbers in the top right corner; your name at the top, and, quite possibly, the title of the MS on every page.
Answer: It's actually good, if you're talking about the default supplied Word MS format.
I don't use Word, I use Scrivener, but I checked it against the template I use and it's almost identical. TNR 12, double spaced you can't go wrong with and the header is professionally laid out.
The only things I changed for submission were:

Larger chapter headings that start halfway down the page.
Not to indent the first paragraph at chapter start and following line breaks for time (I think this looks more professional).
All caps for my header (just a personal preference).

If you're submitting to agents, they're human beings. They aren't going to toss a great MS because it uses a slightly different MS format/template. All they really want is something easily readable. But check the submission guidelines for every agent/publisher you submit to and make sure its in line. Most just say a standard 12pt font double spaced, and no more than that.
You're onto a winner with that template though, it's fine.
Good luck!

Manuscript Format in Microsoft Word


What is calculated KPI

Question: What is calculated KPI? I am not looking for "how to create it" but rather its concept. What exactly it is? How do you define calculated KPI if someone asks?
Answer: KPI, or key performance indicators, are measurements used by a business to track company performance against its specific objectives. Every KPI has either a specific target or a range in which the score must fall in for the company to successfully meet its goals. KPIs vary depending on the particular business and the performance indicators they aim to measure.
refer below links More details.....
http://www.ehow.com/how_5875354_calculate-kpi.html
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.btools.help.modeler602.doc/doc/concepts/measures/kpis.html

What is calculated KPI