Why did Valery Salov quit competitive chess?

Question: Why did Valery Salov stop playing in chess tournaments in the last 15 years?
Answer: According to this article, it was because he was a pain in the ass and offended too many of chess' elite players. In fact, he seems unstable, not merely eccentric.
And more here. Looks like he decided he wasn't going to get along with people.
Comment: The latter article's claim that Salov was superior to K+K in the mid-90's is a stretch to say the least. The evidence given is that he won back-to-back tournaments in 1994-the same year as Karpov's 11/13 at Linares, a strong contender for the greatest tournament performance of all time.
Comment: Thank you for the articles, however it seems to me that he no longer plays competitive chess, which is actually different than "not getting invitations" or "not getting along with people". Perhaps he found a more remunerative job?
Comment: I now read Salov's recent public posts on Facebook regarding chess being completely manipulated by Masonic and Jewish leaders, Caruana's and Adams' perfect draw results in the 2015 London Chess Classic being a proof of that.


How many digits of Pi are required in physics?

Question: In other words: which physics experiment requires to know Pi with the highest precision?
Comment: I'm quite happy with $\pi\approx 1$ (-;
Comment: Classic quote from Kolb & Turner's *The Early Universe*: "The reader may wish to follow the advice of one of the authors to ignore the various factors of $V$; they play no crucial role. Moreover, the less ambitious reader may also wish to ignore all factors of $\pi$, the so-called small-circle approximation."
Comment: @mbq Your back-of-the-envelope calculations will suffer for it, it's well known that $\pi=\sqrt{10}$ as far as any theorist is concerned.
Answer: 39 digits of pi is enough to calculate circumference of visible universe to a margin of error equal to the width of a proton ( unverified computation, according to http://www.guardian.co.uk/science/blog/2011/mar/14/pi-day CordwainerBird ) .
Comment: Ok, but I would say this is rather maths than physics until we build an experiment to measure the circumference (or surface, or volume) of the visible universe...
Comment: The word 'visible' implies the measurable, known, universe. So, using CMBR as a (physical) basis, a diameter of about 91 billion light-years...
Answer: Pi is very far from being the only number we need in physics. Typical theoretical predictions depend on many other measured and calculated (or both) numbers besides pi.
Nevertheless, it is true that one needs to substitute the right value of pi to get the right predictions. Therefore, the right answer to your question is the most accurately experimental verified theoretical prediction we have in physics as of today, namely the anomalous magnetic dipole moment of the electron

http://en.wikipedia.org/wiki/Anomalous_magnetic_dipole_moment

In some natural units, the magnetic moment of the electron is expressed as a g-factor which is somewhat higher than two. Experimentally,
$$\frac g2 = 1.00115965218111 \pm 0.00000000000074$$
Theoretically, $g/2$ may be written as
$$\frac g2 = 1+\frac{\alpha}{2\pi} + \dots$$
where the $\alpha/2\pi$ first subleading term was obtained by Schwinger in 1948 and many other, smaller terms are known today. The theoretical prediction agrees with the experimental measurement within the tiny error margin; the theoretical uncertainty contains the effect of new species of virtual particles with the masses and couplings that have not yet been ruled out. This requires, among many and many other things, to substitute the correct value of $\pi$ in Schwinger's leading correction $\alpha/2\pi$. You need to know 9-10 decimal points of $\pi$ to make this correction right within the experimental error.
So in practice, $\pi\approx 3.141592654$ would be OK everywhere in the part of physics that is testable. However, theoretical physicists of course often need to make calculations more accurately if not analytically, to figure out what's really happening with the formulae.
Comment: Hm, I would have to remind myself why $\alpha$ is a more fundamental quantity to get from experiments than $\frac{\alpha}{2\pi}$. Not sure if it is worths it, though, as decimals of $\pi$ come extremely cheap with today's computers...
Comment: That was exactly what I was looking for. Thanks!
By the way, anything equivalent for e ?
Answer: 16 digits, for converting frequencies from Hz to angular frequency.  Frequencies can now be measured with a precision approaching 1 part in 10^16, so dealing with those numbers would require knowing Pi to 16 digits or so.
Is this really "which physics experiment REQUIRES to know Pi with the highest precision"?  A purist (or theorist) might disagree that this example doesn't count, and I'd agree that there's nothing fundamental here, just conversion from one convention to another.  But from a practical point of view, it's something people do in physics and it requires knowing Pi to 16 digits.
Answer: In principle you will never reach the accuracy of the numerical value of $\pi$ in an experiment, it is much more important as an analytical tool. The part of the question concerning the most accurate experiment was given by Luboš.
So, just to give a little thing about the importance of $\pi$ as the area of a unit circle and also the ratio of a circle's circumference to diameter,

(from the corresponding wiki-article)
One very famous examples are Fourier transforms where you ask a periodic function to be represented by $\sin$ and $\cos$-terms,
$$\mathcal{F}(f)(\xi)=\int_{-\infty}^{\infty}f(x)e^{2\pi\mathrm{i} \xi x}dx\ \mathrm{with}\  e^{\mathrm{i}\varphi}=\cos(\varphi) + \mathrm{i}\sin(\varphi)\ .$$
This is linked to $\pi$ because of the periodicity of the circle, $$r_1(\varphi) = r_2(\varphi + 2\pi)\ \mathrm{with}\ r_i\in \mathrm{circle}\ .$$
There are much more things to add as the underlying group of rotations is $U(1)$ which is in turn the gauge group for (quantum)electrodynamics explaining why you will almost certainly find the most prominent examples of results linked to the value of $\pi$ in this field.


Anker Keyboard not working with Samsung 10.1 2014 tablet running 4.4.2

Question: The blue tooth Anker key board used to work with my tablet but started behaving weirdly after I upgraded to Android 4.4.2. It connects and appears to work but once I type "n" it will begin to repeat the letter endlessly aftwards. I would think it was a mechanical problem but it works fine with my phone running Android 5.1.
I have seen comments on the web that suggest it is incompatible with android 4.4.2. I tried the External Key helper demo app that people have suggested but that did not help and I have not seen any other suggestions of a work around or a fix. I would upgrade if I could but despite rumours there is a lot of doubt that Samsung will upgrade this tablet ( not impressed with that either).
Can anybody help?
Answer: I don't know if this will help at all, but I had a problem with the Shift Key not working when I had a USB keyboard plugged into my Android phone and I found a solution.  Maybe the solution I found for my problem will fix your problem as well.  If not, I do apologize.
I have a Samsung Galaxy S5 Android phone.  I purchased a USB external physical keyboard that can connect with my Windows computers and my Android devices (via micro USB).  The keyboard worked fine when I plugged it into my Windows computers.  The keyboard worked pretty well Android phone, except for the fact that the Shift Key didn't do anything when I held it down and pressed other keys (to capitalize letters, type symbols found above the number keys, etc.).  I tried a lot of stuff to get the Shift Key to work on my USB keyboard when I had it plugged into my phone. I couldn't get the Shift Key to work when I used the stock Google/Android keyboard app, the Samsung Keyboard app, or the SwiftKey Keyboard app. After a lot of trial and error with apps and settings (and a lot of frustration), I FINALLY came across an app  that DOES solve the Shift key problem: The "Go Keyboard" app on the Google Play app store.
After I installed this app and set it as the default keyboard app on my Android phone (Samsung Galaxy S5), the Shift key  worked just fine when I used it while it was plugged into my Android phone (allowing me to capitalize letters and  type symbols above the number keys).
I hope this works for you, too!


GIT over integers

Question:
Let $G$ be a reductive algebraic group over ${\mathbb Z}$ (or a finite
localization of a ring of integers $R$ in a number field) acting on an
affine scheme of finite type $M=Spec(A)$ over $R$.
We can take the invariants $A^G$, and then reduce
modulo a prime $p$: $A^G\otimes_{\mathbb Z}{\mathbb F}_q$. We can first
reduce modulo $p$, and then take invariants:
$(A\otimes_{\mathbb Z}{\mathbb F}_q)^{G_p}$. Is it true that for almost all
primes $p$ the results coincide?
Let $M^\theta\subset M$ be the open subset of $\theta$-stable
points for a choice of a character $\theta$ of $G$.
Let $M^{\theta,f}\subset M^\theta$ be the open subset of $M^\theta$ formed by
all the points with trivial stabilizers. Let $M//_\theta G$ be the GIT quotient
(the projective spectrum of the ring of $\theta$-semiinvariants of the
$G$-action on $A$). Is it true that the natural projection
$M^{\theta,f}\to M//_\theta G$ is a $G$-torsor? (\'etale locally trivial?)
Comment: @AllenKnutson You can define it algebraically. The group action gives a map $\phi: A \to A \otimes \mathcal{G}$. The invariants are the elements $a$ which satisfy $\phi(a) = a \otimes 1$.
Comment: @AllenKnutson: Similar issues arise to make useful sense of $A^G$ when $G$ is an infinitesimal group scheme in characteristic $p > 0$ (e.g., $\mu_p$), or more generally a non-smooth group (in which case invariance by field-valued points is too limited to be a useful notion).
Comment: For the first one, I definitely get confused in the situation that $G$ doesn't have enough $\mathbb Z$-points. Say $\mathbb G_m$ acts on $Spec\ \mathbb Z[x,y]$ with weights $+1,-1$ on the coordinates. What does $A^G$ mean here, where the $\mathbb Z$-points of $\mathbb G_m$ are just $\pm 1$? Do we first think of the ring $A$ as an algebraic variety of infinite type, on which $G$ is acting algebraically?
Comment: For #2, if $G$ is semisimple but not adjoint type and acts on $A$ through its adjoint quotient then $\theta=1$ and $M^{\theta,f}$ is empty but $M//_{\theta}G$ is generally not empty. Please clarify. Do you mean to ask if $M^{\theta,f}$ is a $G$-torsor over an open subspace of $M//_{\theta} G$?  In other words, since $M^{\theta,f}$ is a $G$-torsor over the algebraic space $M^{\theta,f}/G$, is #2 asking whether the natural map $M^{\theta,f}/G\rightarrow M//_{\theta}G$ is an open immersion?
Answer: The answer to the first question is affirmative if we assume the generic fiber is normal.
First, some general setup (so it is well-posed to speak of "compatibility with any base change" below). Let $S = {\rm{Spec}}(D)$ be an  affine scheme and $X = {\rm{Spec}}(A)$ a finitely presented affine $S$-scheme equipped with an $S$-groupoid $R \rightarrow X \times_S X$ for which the two maps $R \rightrightarrows X$ are flat.  For example, we could have $R = G \times_S X$ with $R \rightarrow X \times_S X$ given by $(g,x) \mapsto (gx,x)$ for a flat finitely presented affine $S$-group $G$ equipped with a left action on $X$.  We define the "naive quotient" $X/R := {\rm{Spec}}(A^R)$ where
$$A^R = \{a \in A\,|\,p_1^{\ast}(a) = p_2^{\ast}(a)\}$$
with equality of pullbacks in the coordinate ring of $R$.  For instance, in the "action by a flat affine group of finite type" this recovers Speyer's comment and when working with connected reductive groups over an infinite field it coincides with what Knutson's comment seems to refer to (since in such groups the locus of rational points in schematically dense, due to unirationality over the ground field).
For any affine $S$-scheme $S' = {\rm{Spec}}(D')$ and associated base change $R' \rightarrow X' \times_{S'} X'$, there is an evident "base change morphism" of $S'$-schemes $X'/R' \rightarrow (X/R)_{S'}$, and we say that the formation of $X/R$ "commutes with any base change" when these are always isomorphisms.  It is clear that the base change map is an isomorphism when $S'$ is $S$-flat (e.g., a localization), as $A^R$ is expressed as a kernel of a linear map between $D$-modules in an evident manner (with the formation of that map compatible with base change in an evident manner, etc.).
We will use a hammer provided by Seshadri to prove:
$\mathbf{Theorem}$:  Assume $D$ is a Dedekind domain with fraction field $K$ of characteristic 0, $X_K$ is normal, and $R$ arises from the action on $X$ by a smooth affine $D$-group $G$ with connected reductive fibers. Then $X/R$ is finite type over $D$, and for some nonzero $d \in D$ the formation of $X/R$ over $D[1/d]$-algebras commutes with any base change on $D[1/d]$ and has geometrically normal fibers.
Localize a bit on $D$ so that the finite type affine $X$ is $D$-flat. Then by standard saturation arguments over Dedekind domains (or see Proposition 3 in section 1 of Seshadri's 1977 paper "Geometric reductivity over arbitrary base" in Advances in Math vol. 26), we can equivariantly realize $X$ as closed in an affine space over $D$ equipped with a linear $G$-action.  Since $K$ has characteristic 0, so $D$ is excellent, it follows by Theorem 2 in section 4 of Seshadri's paper that $X/R$ is finite type over $D$.
By localizing $D$ a bit, we can arrange that all $D$-fibers of $A$ are geometrically normal (since true for generic fiber, as $K$ has characteristic 0, so EGA IV$_3$, 9.9.5(iii) applies). Since orbit closures in $X_K$ lie in distinct connected components, the topological description of $X_K/R_K$ in terms of $X_K$ on $\overline{K}$-points (see GIT, or Theorem 3 of section 4 of Seshadri's paper), there is no harm in assuming $X_K$ is connected, so by some localization on $D$ we may assume that the normal $X_K$ is connected, hence integral, so $A_K$ is a domain and thus $A^R$ is a domain.  In particular, $A_K \cap {\rm{Frac}}(A_K^{R_K}) = A_K^{R_K}$, so $A_K^{R_K}$ inherits normality from $A_K$.  This is geometric normality since $K$ has characteristic 0, so by localizing a bit on $D$ we may arrange that the $D$-flat finite type $X/R$ has geometrically normal fibers.
Now $R$ is $D$-flat (as $A$ is), so we see that the $D$-module cokernel $A/A^R$ is torsion-free over $D$, hence is $D$-flat.  Thus, for any $D$-algebra $D'$, the natural map $(A^R)_{D'} \rightarrow A' := A_{D'}$ obtained by scalar extension is injective. Letting $R' := R_{D'}$, we therefore have $(A^R)_{D'} \subset {A'}^{R'}$ for any $D'$.  By limit considerations in $D'$ as a $D$-module, the proof of equality is reduced to the case when $D$ is a discrete valuation ring and $D'$ is its residue field $k$ which we may moreover assume (by appropriate flat local dvr base change) is algebraically closed.
Theorem 3 of section 4 in Seshadri's paper shows that the natural map $X \rightarrow X/R$ is surjective and describes the induced map on $k$-points in terms that are intrinsic to the $G_k$-action on $X_k$.  It follows from this that the induced map $f:X_k/R_k \rightarrow (X/R)_k$ is bijective on $k$-points, the analogue for the geometric generic fiber being obvious.  A closed set in $X_k/R_k$ "is" a $G_k$-invariant closed set in $X_k$ (by Theorem 3(iii) in Seshadri's paper applied over the base $k$), yet $X_k$ is closed inside $X$ and likewise $(X/R)_k$ is closed in $X/R$, so by that Theorem 3(iii) applied over the base $D$ we see that any $G_k$-invariant closed set in $X_k$ has closed image in $(X/R)_k$.  In other words, $X_k/R_k \rightarrow (X/R)_k$ is closed.
Likewise, if $P_0$ is a polynomial ring over $k$ in finitely many variables and $P$ is the corresponding polynomial ring over $D$ then $f_{P_0}$ is the natural map $X_{P_0}/R_{P_0} = (X_k/R_k)_{P_0} \rightarrow ((X/R)_k)_{P_0}$ under which a closed set in the source "is" a $G_{P_0}$-stable closed set in $X_{P_0}$ and hence is a $G_P$-stable closed set in $X_P$, so its image in $X_P/R_P$ is closed by Seshadri's Theorem 3(iii) applied over the base ring $P$.  But $X_P/R_P = (X/R)_P$ because $P$ is $D$-flat, so we conclude that $f_{P_0}$ is closed for all such polynomial rings $P_0$. In other words, $f$ is "universally closed against affine spaces" (over $k$), so $f$ is closed after base change against curves, so it is proper. Thus, $f$ is a finite radiciel surjection.  The module-finite inclusion $(A^R)_k \hookrightarrow A_k^{R_k}$ is between normal $k$-algebras (as $A_k^{R_k}$ inherits normality from $A_k$), so the radiciel property implies that this is a direct product of normalization maps arising from  some purely inseparable finite extensions of fields.  Thus, it is an equality provided that it is birational.
Now we return to the situation before we passed to local $D$, and have to show that after a bit of localization on $D$ we can arrange that $X_s/R_s \rightarrow (X/R)_s$ is birational for all but finitely many $s \in S$.  We arranged harmlessly that $A$ is a domain. The dominant map $X \rightarrow X/R$ corresponding to an injection between domains of finite type over $D$ is generically flat, so by localizing a bit on $D$ we can arrange that there exists some nonzero $a_0 \in A^R$ such that $(A^R)[1/a_0] \rightarrow A[1/a_0]$ is faithfully flat.  Some more localization on $D$ ensures that $A/a_0 A$ is $D$-flat.  Since $A^R/a_0 A^R \rightarrow A/a_0 A$ is injective, it follows that $A^R/a_0 A^R$ is also $D$-flat.  Thus, $a_0$ is fiberwise not a zero divisor on $X$ or $X/R$ over $S$.  Thus, for all $s \in S$ we get an inclusion $A_s^{R_s} \subset (A_s^{R_s})[1/a_0] \cap A_s$
inside $A_s[1/a_0]$ (algebras over the residue field at $s$) and it is an equality.
By inverting $a_0$ on $A_s$, we conclude that $X_s[1/a_0]/R_s[1/a_0] = (X_s/R_s)[1/a_0]$. In other words, the open locus $\{a_0 \ne 0\}$ is fiberwise-dense in $X/R$ and $X$ over which the formation of $X/R$ commutes with passage to geometric fibers over $S$.
QED
Comment: Dear   user52824,

I'd like to use your answer in a paper and would like to properly acknowledge your input. If that's okay, could you please reveal your identity (say, by sending an e-mail to email@example.com) so I can mention your name in acknowledgments? Otherwise we'll need to thank an anonymous
mathoverflow user.
Comment: As for the second question, your version of the question is what I need. In fact, in the situation I'm interested in (construction of quiver varieties in positive characteristic) the action on the set of stable points is
free, $X^{f,\theta} = X^\theta$. By the way, I used that formulation in the original question because I thought that for irreducible X the subset $X^{\theta,f}$ is either empty or equals $X^\theta$, isn't that right?
Comment: I am sceptical about this claim. Consider for example $G=SO_3$ over $\mathbb Z$ acting on its Lie algebra $M=so_3$ by the adjoint action. Then the invariant ring is $\mathbb Z[c_2]$ where $c_2$ is the coefficient of the char. polynomial of antisymmetric matrices which has degreee 2 in the variables. However after the base change $\mathbb Z\to \mathbb F_2$ the element $c_2$ does not generate the invariant ring. Namely, the determinant is the square of the pfaffian, and the invariant ring now is $\mathbb F_2[c_2,\pi_1]$ where $\mathbb\pi_1$ is...
Comment: ... the coefficient of the "pfaffian polynomial" (⋅−) which has degreee 1 in the variables. See Chaput and Romagny, On the adjoint quotient of Chevalley groups over arbitrary base schemes, JIMJ 2010.
Comment: @MatthieuRomagny, just to have your own remark from [elsewhere](https://mathoverflow.net/questions/176393/git-over-integers#comment1108688_176562) recorded here, your [comment](https://mathoverflow.net/questions/176393/git-over-integers#comment1108608_176452) was based on missing the "almost" in the quantifier "almost all primes $p$".
Answer: The answer to the first question is positive. One does not need normality of the
generic fiber. By the universal coefficient theorem [Prop I 4.18 (a) in Jantzen
Representations of algebraic groups], it suffices to know that $H^1(G,A)$ vanishes
generically on $Spec(R)$. But this is implied by theorem 33 of my paper with Franjou
Power reductivity over an arbitrary base.
Using further suggestions by user52824 we see that the right setting has a Dedekind domain $D$ as base ring. We localize by inverting a nonzero element of $D$.
We first localize to get $A$ flat over $D$, then we localize further to make
$H^1(G,A)$ flat over $D$. This uses Theorem 10.5 of Good Grosshans filtration in a family as the big hammer. Then the universal coefficient theorem implies compatibility with any base change. Notice that we no longer try to kill $H^1(G,A)$. Just its $D$-torsion.
Comment: Thanks for the reference.  Had I imposed "geometric normality" on the generic fiber (equivalent in generic char. 0) then the argument in my answer would have applied verbatim in positive generic characteristic (say assuming the Dedekind domain to be excellent, depending on which reference is used for the finite generation of the algebra of invariants).  Does your Theorem 33 adapt to give an analogous vanishing result on H$^1$ for positive generic characteristic?
Comment: I am not sure what the question is. If your Dedekind domain $R$ is of finite characteristic $p$, then the result just amounts to the trivial fact that you kill $H^1$ when inverting $p$. Our result that you may kill $H^1$ by inverting some integer is of interest only when  $R$ itself does not have this property that you may kill it that way.
Comment: The formulation of the Theorem as in my answer makes sense (and is non-vacuous) when $K$ has characteristic $p > 0$, and I briefly indicated in my preceding comment that the method used in my answer gives such a result for positive characteristic when assuming geometric normality over $K$.  So my question was whether one can expect a version of your Theorem 33 (for positive characteristic) where instead of inverting a nonzero integer, one inverts a nonzero element of the Dedekind domain over which everything is given.
Comment: One may expect it. By inverting a nonzero element one may first kill the $R$ torsion in $A$, then hope to kill  the $R$ torsion in $H^1(G,A)$. One hopes that $H^1(G,A)$ is finitely generated as an $A^G$ module. But I only seem to know that when $R$ contains a field, cf. arXiv:1109.5822
Comment: Ah, Theorem 10.5 of the arxiv link gives that over a noetherian base ring $\mathbf{k}$, the cohomology $H := {\rm{H}}^1(G,A)$ is a noetherian $A^G$-module.  Taking $\mathbf{k}$ to be a domain, for every $c \in \mathbf{k}$ the $c$-torsion $H[c]$ is an $A^G$-submodule of $H$. Clearly $H[c], H[c'] \subset H[cc']$ for nonzero $c, c' \in \mathbf{k}$. So by the usual acc argument, the torsion submodule of $H$ (over $\mathbf{k}$!) coincides with $H[c]$ for sufficiently divisible nonzero $c \in \mathbf{k}$.  So $H[1/c]$ is torsion-free over $\mathbf{k}[1/c]$.  Have I understood Theorem 10.5 correctly?
Comment: I am sceptical about this claim; see my comment to user27920's answer above.
Comment: @Matthieu Romagny I do not get your objection. We all agree there are bad primes.
Comment: Whoops sorry, I missed the word "almost" in the question. Apologies!

GIT over integers


Using a 0.1uF 275V ceramic capacitor for 5V LDO?

Question: i was wondering if it's possible to use a high voltage ceramic capacitor for a 5V ldo, I also will use a 0.33uF 250V ceramic capacitor for the input.
thaanks
Answer: You most certainly can. A ceramic capacitor will actually give you the pretty close to the advertised capacitance if you only apply a small percentage of its rated voltage.
A ceramic capacitor's effective capacitance degrades with voltage so if you were to apply 275V to your .1uF capacitor, you would unlikely get much more than .05uF of actual capacitance. In your case you will get very close to .1uF. However, your design will be very non-optimal as the size of the capacitor is probably enormous and you'd be better off getting a smaller one.
Answer: It will work.
But that is a lot of derating!
It is actually a good idea to use components rating higher than what they are exposed to, it will stress them less, and they will last longer. Now, 2 or 3 times is more usual (e.g. a cap rated 16V on a 5V line is plenty) ... a factor of 50+ might be a little overkill ;)


Is there a reason to cover your yawn?

Question: My 9th grade Rebbi told us that we have to cover our mouths when we yawn to avoid evil spirits entering our bodies. Is there any source that says this? If not, is there any other Jewish reason, besides basic manners, to cover your mouth when you yawn?
Comment: What is an evil spirit in Judaism?
Answer: שלחן ערוך סימן צז סעיף א (titled: "שלא יגהק ושלא יפהק בשעת התפלה," "Not to yawn during prayers")

לא יגהק (מוציא מגופו לפיו נפיחה מתוך שובעו, רייטי"ר בלע"ז). ולא יפהק
  (פותח פיו להוציא רוח הפה) ואם צריך לפהק מתוך אונס יניח ידו על פיו שלא
  תראה פתיחתו.
Do not burp or yawn [during prayers]; and if one must yawn, one should
  cover his mouth with his hand so as not to show the opening of his
  mouth.

That what Shulchan Aruch has to say about it, but in general, I don`t know anything about evil spirits, but I gonna look meforshim on this section of SA.
Comment: I was just about to comment this. +1
Comment: I did a quick survey of the sources and the only explanation I found is out of respect for God.
Comment: @LazerA You must cover your mouth while yawning out of respect for God? Must you cover your backside with your hand while passing gas also? This must be an infinitely more offensive bodily function.
Comment: Daft, one is not supposed to pass gas while praying, and it is indeed worse than yawning. Covering with your hand doesn't help. http://www.torah.org/advanced/mishna-berura/S103.html
Answer: Rebi would cover his mouth when yawning during prayers. Brachos 24a-b:

אמר ר' חנינא אני ראיתי את רבי שגיהק ופיהק ונתעטש ורק וממשמש בבגדו אבל
לא היה מתעטף וכשהוא מפהק היה מניח ידו על סנטרו
Rabbi Ḥanina said: I saw Rabbi Yehuda HaNasi, while he was praying, belch, yawn, sneeze, spit, and remove [a louse] with his garment, but he would not wrap himself [in his prayer shawl] (if it fell during prayer). And when he would yawn he would place his hand on his chin
Comment: During prayers might be different.
Comment: I was about to link to this gemara, and then slickly copy-paste the text from HB....but I couldn't spot where on the page you found this. Sure you have the right amud?
Comment: @Shokhet first line? its a hold over from the bottom of amud alef. Slick.
Comment: Now I see that....you'll have to do the translation yourself ;-)
Comment: @Shokhet thanks, my non-android m.m.m. (maareh makom man) :)
Comment: Yeah....I tried in Android, using FF and Greasemonkey....but my table it out of room and I need to find the time to empty some old stuff out. :P ....whichever of us figures it out first will let the other know, all right? ;-)
Answer: The custom of covering your mouth while yawning is common in several cultures, but so far, from searching secular sources, I have not found any such customs or requirements with Jewish origins. In Yawning: comparative study of knowledge and beliefs, popular and medical, O. Walusinski writes:

According to [Pierre] Saintyves, Islam sees yawning as a
  sign of Satan entering the body, and sneezing as a
  sign of his leaving the body. [...]
  "The Prophet told us that yawning is prompted by
  Satan and gave us the order to avoid it whenever
  possible. When it becomes inevitable, we must
  close our mouth with our hand."

Similar practices and ideas exist in India, and later in Europe during the Bubonic Plague where the practice was instead signing the cross in front of their mouth.
Your Rabbi (or the person he learned it from) likely picked up the idea from a source outside of Judaism such as the culture he grew up in. So far I haven't been able to find any reason in Jewish law why one should cover one's mouth, aside from, as you already mentioned, manners (which is a pretty good reason).
Comment: Awesome. This is totally a useful and constructive answer now.  Thanks! +1
Answer: After a basic review of the sources, I would say that the basic answer to your questions are:

No, there is no source that says that we have to cover our mouths when we yawn to avoid evil spirits entering our bodies. In fact, to my knowledge, there is no source that says that one is required to do so at all except in prayer.
No, the only reason found in Jewish sources for covering one's mouth when yawning is because it is considered bad manners to openly yawn in front of other people. (See Levush and Aruch Hashulchan on OC 77:1, among others.)

Indeed, the reason why we are required to cover our mouths when yawning during prayer (and even this is only permitted if one is unable to stop himself from yawning) is that it is seen as disrespectful to yawn in front of others and we would never do so in front of an important person, so we certainly shouldn't do so in front of God.
Answer: It's a din in Hilchos Derech Eretz. It's manners.
Comment: I think he asked for "besides basic manners."
Comment: @daniel: A source would greatly enhance the quality of your answer.
Comment: @YeZ Cultural manners might be different than what Halacha specifies as derech eretz.
Comment: Is "Hilchos Derech Eretz" the name of a work or just a category?  I assume the latter but your capitalization makes me question that.  But you don't say *whose* Hilchot Derech Eretz and that matters.  Please clarify.
Answer: Rav Aviner writes

Q: Is it true that one must cover one's mouth when he yawns so that his soul doesn't come out of his body?
  A: Nonsense.  It is a superstition with Muslim roots that a yawn comes from Satan.  One should cover his mouth, however, because it suggests boredom and is impolite.  In actuality, there is no scientific explanation why we yawn.  There is, however, an explanation of "Mirror neuron" (why others yawn when they see someone else yawn).  By the way, animals also yawn.

Is there a reason to cover your yawn?


How to show that a limit exists without using an epsilon-delta proof or a graph

Question: Suppose I'm trying to show that $$\lim_{x \rightarrow 2}x^2=4.$$ Obviously this limit exits, but suppose I didn't know that it did. Is there a way I can show that the limit exists without using an epsilon-delta proof or a graph? Would say $\lim_{x \rightarrow 2}x^2=(2)^2=4$ be enough to say that the limit exists or could I say that since $x^2$ is continuous on $(-\infty,\infty)$ then the limit as $x$ approaches $2$ eixsts?
Comment: If you already have proved that polynomials are continuous obviously you know not only that the limit exists, but also that its value is $2^2=4$.
Comment: you can use that $$x^2-4=(x-2)(x+2)$$   and that $$\lim_{x\to 2}(x-2)(x+2)=0$$
Comment: The $\epsilon-\delta$ proof method is a rigorous _definition_ for limit, so I don't think you can really avoid it for a rigorous proof. Any method you use would have it hidden subtly within it.
Comment: @PrasunBiswas You can avoid it by using other theorems that use it (thus, you implicitly use $\epsilon-\delta$, but you avoid using it as a proof method.
Comment: The $\epsilon, \delta$ definition of limits is not a practical method to evaluate limits. Limits are almost always evaluated using theorems meant to evaluate limits (algebra of limits, squeeze theorem, substitution, L'Hospital's Rule, Taylor expansions etc) combined with a certain set of standard limits. The limit in question is very easy and uses two key ideas: the standard limit $\lim_{x\to a} x=a$ (proved easily via definition) and the product rule of limits.
Answer: If you already know:

That $x\mapsto x^2$ is continuous on $(-\infty, \infty)$
The theorem:

$f$ is continuous at $a$ if and only if $$\lim_{x\to a} f(x)=f(a)$$

then sure, you can say $$\lim_{x\to 2} x^2=2^2.$$
But if you don't yet know points $1$ and $2$, then you cannot.
Answer: using epsilon-delta proof method is the way you define limit so for not using it you will have to use a method that use it in the background. In that case, a function is continuous at $a$ iff $\lim_{x\to a}f(x)=f(a)$, and you know that $x^2$ is continuous at $(-\infty,\infty)$ so you can say that for $f(x)=x^2$ you have $\lim_{x\to 2}f(x)=2^2=4$, but if you want to show that $x^2$ is continuous over $(-\infty,\infty)$ you will have to use the epsilon-delta proof


Do English speakers say something like "He pushed him back"?

Question: Do English speakers say something like "he pushed him back", even if they know who this "he" and who that "him" is, referring to two different people with the same pronoun? Or would they say something like "he pushed that guy" or "that guy pushed him"?
Comment: Then the answer is [yes](https://books.google.com/ngrams/graph?content=he+pushed+him&case_insensitive=on&year_start=1800&year_end=2000&corpus=15&smoothing=3&share=&direct_url=t4%3B%2Che%20pushed%20him%3B%2Cc0%3B%2Cs0%3B%3Bhe%20pushed%20him%3B%2Cc0%3B%3BHe%20pushed%20him%3B%2Cc0).
Comment: Yes, in the right context, where the antecedents of the two pronouns were reasonably obvious, that sentence might easily be said.  One does need to use care with such constructions, though, especially when editing the text you wrote yesterday, as it's easy to forget how much it all depends on context.
Comment: So true. If Jim saw John and he told him that he had to leave town, we're in trouble.
Comment: In what context? If Sam pushed John, and then John pushed Sam then I might well say *he pushed him back*. He and him lack antecedents in the sentence, but with *context* the *subjects* may be inferred.
Comment: Any context. What I'm asking is that if anyone would refer to two different people with just one pronoun. The context doesn't really matter here. You can think of anything.
Comment: Lol. Maybe it's just because I'm not native, cause I feel really awkward to string a bunch of different he's and hims in one sentence.
Comment: Then you should hem and haw about it.
Answer: Yes. It's common when someone's telling a story out loud, for example. Context, cadence, and emphasis can all help clarify the meaning. But it's common enough in writing too, when the meaning is clear from context, as in this New York Times article:

Mr. Shultz said the President was ''astonished'' when he told him about the plan in December.


Edit library in hex editor while preserving its integrity

Question: I'm attempting to edit a library in hex editor, insert mode. The main point is to rename a few entries in it. If I make it in "Otherwrite" mode, everything works fine, but every time I try to add a few symbols to the end of string in "Insert" mode, the library fails to load. Anything I'm missing here?
Answer: Yes, you're missing plenty. A library follows the PE/COFF format, which is quite heavy on pointers throughout the file. (Eg, towards the beginning of the file is a table which points to the locations of each section in the file).
In the case that you are editing resources, there's the potential to do it without breaking things if you make sure you correct any pointers and sizes for anything pointing to after your edits, but I doubt it'll be easy. In the case that you are editing the .text section (ie, the code), then I doubt you'll get it done, since the operands of function calls and jumps are relative locations to their position in code - you would need to update the entire code to account for edits.
One technique to overcome this is a "code cave", where you replace a piece of the existing code with an explicit JMP instruction to some empty location (You can do this at runtime, where you have the ability to create new memory) - where you define some new code which can be of arbitrary length - then you explicitly JMP back to where you called from (+5 bytes say for the JMP opcode + operand).
Answer: Are the names you're changing them to the same length as the old names? If not, then the offsets of everything is shifted. And do any of the functions call one another? That could be another problem point. It'd be easier to obtain the source code (from the project's website if it's not in-house, or from the vendor if it's closed) and change them in that, and then recompile it. I'm curious as to why you are changing the names anyway.
Comment: The library is mine, but I lost the source code for it. The length changes, how to make it work with such shifting?
Answer: DLLs are a complex binary format (ie compiled code). The compiling process turns named function calls into hard-wired references to specific positions in the file ("offsets"). Therefore if you insert characters into the middle of the file, the offsets after that point will no longer match what is actually at the position they reference, meaning that the function calls in your library will run the wrong code (if they manage to run anything at all).
Basically, the bottom line is what you're doing is always going to break stuff. If you're unlucky, it might even break it really badly and cause serious damage.
Comment: The "position they reference" in regard to function calls is actually not a problem if all you are doing is editing resources in the file (outside of `.text`) - because call operands are signed integers, pointing relative to their current location - as long as the entire block of code shifts in unison, they will be calling the right place still.
Answer: Sure - a detailed knowledge of the format, and what has to change.  If you're wondering why some of your edits cause loading to fail, you are missing that knowledge.
Libraries are intended to be written by the linker for the use of the linker.  They follow a well-defined format that is intended to be easy for the linker to write and read.  They don't need tolerance for human input like a compiler does.
Very simply, libraries aren't intended to be modified by hex editors.  It may be possible to change entries by overwriting them with names of the same length, or that may screw up an index somewhere.  If you change the length of anything, you're likely breaking pointers and metadata.
You don't give any reason for wanting to do this.  If it's for fun, well, it's harder than you expected.  If you have another reason, you're better off getting the source, or getting somebody who has the source to rename and rebuild.


Neural network got a lucky guess. Can it be trusted?

Question: Say you come across a loss curve as shown below. At which loss should you trust the model? The initial lucky guess or after it has stabilized?
And more importantly, why?
Comment: with lucky guess you mean the peak after the dashed line?
Comment: I mean the peak *at* the dashed line, where the loss is the lowest.
Answer: The loss in the curve suggests that the training can be improved by tuning hyperparameters, especially the learning rate and/or the batch size. Therefore the optimal decision would be to keep refining the model instead of using the already trained model.
If tuning hyperparameters is not an option, at least you should re-split training and validation data or at very least repeat with a different random seed.
If none of those is an option, you should take the best validation loss. The reason is that we are assuming that there is no leak of the validation data to the training data and that the validation data is representative of the data the model is going to be tested with. Without any other evidence, we should assume that the "sweet spot" you found would also lead to better results in a piece of test data the model has not seen before.
Answer: You should always look at validation loss, you don't care about training when evaluating your model's performance.
But your idea is quite in line with the principle of early stopping is: keep training the model, checking its performance at each epoch; once you find a best loss value, save the model; stop training once you don't find any loss improvement for a number of epochs defined by your patience hyperparameter.
However, about your specific problem I agree with @ncasas, i.e. that looking at your image it seems your model can be improved.


How to assign many blockers at the same time?

Question: These days with Field of the Dead it is not unusual to block 40 zombies with 40 zombies. I've sometimes seen my opponents being able to do that very quickly, so I feel like there is some interface trick I am missing. Any ideas?
Comment: Even such a limited set of cards as MTGA already has Infinite Token setups. Shows how many of these there is. For instance, a friend of mine has a Goat deck. Another crammed out his old-ish Withering deck and added Hapatra and Scarab Nest, and literally painted himself some dice saying Infinity. Personally, I once theory crafted a combo with Oath of Teferi and Oath of Gideon to create infinite Jace tokens... I think with a few more cards the meta would be a bit more versatile.
Answer: You can quick-assign blockers by simply clicking both stack indicators when assigning blockers. Note however, that it only works if you have stacks of tokens.

When attacking or blocking with a stack of tokens, you can click on
  the stack indicator ("x4") to issue attack or block commands to the
  entire stack.

When declaring a stack of tokens as blockers against a stack of attackers, clicking on the top creature in the attacking stack
  declares all of the blockers on that creature, and clicking on the
  stack indicator of the attacking stack will declare the blockers 1:1
  with the attackers.

Source


Do all cells produce the same proteins?

Question: If DNA is more or less the same in all cells, and DNA is used to produce proteins from aminoacids, then do all cells produce the same proteins or are they specialised/controlled by something?
Comment: Close-voters - I can't straightforwardly answer this question - what determines the expression profile of a cell? I mean, let's say it's different transcription factors (?), what determines the expression profile of those? I think this is actually a great question. +1
Comment: Direct yourself [here](http://www.nature.com/scitable/topic/gene-expression-and-regulation-15), there's quite a robust survey of the topic.
Comment: @Christiaan In that case the question would be too broad. You have to start from maternal inheritance, morphogen signalling to the structure of the gene regulatory network. I guess question need not be closed and can answered in a very few lines but it is quite trivial (unless you go to the **how** of it, in which case it would be broad).
Answer: Each cell will indeed have the same DNA sequences and ability to produce any given protein. However, there are certain factors (transcription factors) and cellular conditions within a cell that dictate which proteins are produced. If the conditions are right then only certain proteins will be produced depending on what type of cell it is. This process by which a cell continues to express selected proteins and becomes specialized for a specific function, is called differentiation. Expression of proteins that are not required can be prevented by transcriptional repressors (or by epigenetic mechanisms such as methylation of DNA sequences). So to answer your question, while cells contain the instructions (DNA sequences) to produce potentially any protein, not every type of protein will always be produced.
Keep in mind that my answer is very basic; the answer isn't as simplistic as I'm making it out to be.
Comment: Could you add some references & supporting material to your answer please?
Comment: I didn't use any references per se.. everything was straight from memory from what I learned in college. I have two science degrees, one in Biomedical Sciences BS and the other in Medical Laboratory Sciences BS. If you give me a little time I could probably find some supporting data.
Comment: It seems someone edited your post since, just FYI [here](http://meta.biology.stackexchange.com/questions/3334/when-are-citations-needed-in-an-answer) is a useful meta thread about why citations/external material are requested here. Welcome to biology SE!
Comment: I noticed the edits and I like the additions, I think they definitely add to my answer and provide more clarity. I'll definitely include references next time. I quickly answered while I had some free time at work and didn't think to do so.
Answer: Protein expression in cells is majorly governed by a concept called RNA splicing. This also forms the basis of different types of cells which has different proteins expressed at different levels, but from the same nuclear material: DNA, which can be visually seen here. Differential splicing leads to various isoforms of the mRNAs, which are precursors of protein expression in cell. So, based on how the splicing occurs in different types of cells, different proteins are expressed at different levels, which constitute to the different phenotypes. This is just a brief introduction to these concepts following the previous comments, but I thought it would be a good time to mention these as these are pertinent.
I am new to this site, so may be not giving the best and most comprehensice answers, but I hope this is useful.
Answer: if you sequence deep enough and add single-cell sequencing you will also find cell to cell differences in the DNA which will add an other layer of heterogeneity in protein expression between cells.

Do all cells produce the same proteins?


How can I reach a lore text?

Question: I've been trying to get the text from the lore of the item in the main hand and store it as a score value:
execute as @p store result score @s kC run data get entity @s SelectedItem.tag.display.Lore ...

But I have no idea how to continue the path to get the text as an output
Answer: I've found a solution to the problem by developing more steps:

As the text in the lore comes from a scoreboard value, I stored the score as an impossible enchantment for the item (a stick in my case), so that existing ones don't get overwritten, using the item modifier set_enchantments.

Copy-paste the enchantment level in a custom tag (Durability in my case), using the item modifier:
copy_nbt ("source": "SelectedItem.tag.Enchantments.[{id:\"minecraft:Your_enchantment\"}].lvl") ("target":"Your custom Tag"), using replace as the operation.

Remove the enchantment to prevent the unwanted glint on the item by using the item modifier set_enchantments, setting the enchantment level to 0.

And this is all so that you can then access the value stored in the item with the path SelectedItem.tag.YourCustomTag.

How can I reach a lore text?


what does apache (busy workers , idle workers) means?

Question: what is the meaning of Apache busy workers and idle workers? how the statistic of them help me to figure out performance problem with my server?
Answer: If you have only  very few or none idle workers it means Apache is using all the processes it is allowed to use and new incoming requests have to wait for older requests to finish before they can be handled. In this case, increasing the maximum allowed processes in your configuration file might help with performance under certain circumstances.
This is true if your system has reserves to handle additional apache processes. Each of them will need memory, CPU time and disk I/O.
If you don't have these reserves, increasing the MaxClients might be even contraproductive, as more processes will have to "fight" for the resources and it might be that reducing the number of maximum clients will improve performance if you already hit some bottleneck.
Comment: Thanks for the explanation. the graph above is for the Apache stats in non peak time. in peak time, the idle workers reach zero.  how do I increase the number of idle workers? is it by increasing MaxRequestsPerChild parameters? assume that I have enough resource.
Comment: `MaxRequestsPerChild` tells Apache how many requests one child process may handle before it is killed. Maximum concurrent clients is set with the `MaxClients` option, which is the number you will have to increase if you have zero idle workers. The reason is that Apache tries to keep at least `MinSpareServers` as idle so they can react immediately, but this will fail if already `MacClients` server processes exist.


How to know if something is installed?

Question: I purchased the season pass on the playstation store for the game "the Division".
How would I check to see if its installed in the game?
Answer: It should be installed when you bought it or put in the code for it, so when the next map pack is available just start the download that's how all season passes work.
Answer: Season passes are not downloadable, they just unlock DLC's automatically (not free DLC's).
But you should be able to see it: Go to your Library on your PS4 -> select The Division -> You should see the Overview, scroll down untill you see My Add-Ons -> Click on it and it should be listed there.
Answer: Also, since the latest DLC for season pass holders is apparently 8 "free" high-end materials, you could just turn on the game and see if they're present at your rewards vendor.
Comment: Visiting the rewards vendor is the best way I think, as season pass holders will have lots of available items.

How to know if something is installed?


Shaping of outgoing traffic in linux for channel with unknown width

Question: Is there any way to divide outgoing channel between different traffic class, for example, with relation 30/70, if I don't know channel width? HTB requires exact numbers, and CBQ too.
Comment: If you do not know the width, what should 30% or 70% relate to? To the number of connections? Traffic class is QoS-class or do you use different VLANs on that channel?
Comment: Are you working with a link with variable bandwidth?  Or trying to write a script that will work regardless of the (fixed) bandwidth of the system running it?
Answer: I thought this would do the trick but unless it has some mechanism controlling its outflow, the queue empties too fast and it never exhibits drr weightings (not exactly sure why this is). As soon as there is selection pressure, however, it works exactly as it is supposed to.
tc qdisc add dev eth0 handle 1 root drr
tc class add dev eth0 parent 1: classid 1:1 drr quantum 600  # 30%
tc class add dev eth0 parent 1: classid 1:2 drr quantum 1400 # 70%
tc class add dev eth0 parent 1: classid 1:3 drr # everything else....

tc qdisc add dev eth0 parent 1:1 handle 10: sfq perturb 120 limit 1024
tc qdisc add dev eth0 parent 1:2 handle 20: sfq perturb 120 limit 1024
tc qdisc add dev eth0 parent 1:3 handle 30: sfq perturb 120 limit 1024

# outgoing to port 8111 will go to 30% queue, 8112 will go to 70% queue...
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 8111 0xffff classid 1:1
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dport 8112 0xffff classid 1:2
# a default so my connection doesn't die when doing this.
tc filter add dev eth0 protocol all parent 1:0 prio 2 u32 match u8 0x00 0x00 at 0 classid 1:3

If you wrap it all in an HTB with a 800kbps flow rate, you get a nice 70KB/30KB split, tested by running parallel instances of pv -ar /dev/zero | nc differenthost port.
Incidentally, don't try to test this from a remote machine at line speed without out-of-band control mechanisms. (oops)
Maybe this answer will help anyway.

Edit: Searching the internet, it turns out there is no other linux deficit round robin (DRR) qdisc example, other than the manpage-included one, which seemed incomplete to me, omitting the filter rules (and caveats thereof) and being generally non-obvious.
What is DRR
Deficit round robin is a scheduling algorithm which can be imagined as a number of parallel queues. The scheduler iterates these queues in sequence. Each time a queue comes up, if the queue is not empty, it checks the packet size of the next packet in the queue against a number it tracks per queue called the deficit counter. If the packet size is smaller than the deficit counter, DRR removes the packet from the queue and sends it along to be put on the wire and subtracts its size from the deficit counter (hence the deficit). It then repeats with the next packet in the queue until either the packet is bigger than the deficit counter or the queue is empty. If the queue is not empty when the loop ends, the queue-specific value quantum is added to the deficit counter before moving on to the next queue.
This is actually not all that different from HTB, except HTB limits the maximum amount to be added to a given queue in any particular time interval (Pretty sure linux measures this in bytes-per-jiffie, though that might not be true anymore with tickless) and also has a deficit counter for all queues combined (which is also filled with some number of byte per time interval)
Example usage description
So what the above example does is create a drr qdisc as root and add 3 queues to it, one with a quantum of 600 bytes per pass, a second with 1400 bytes per pass, and a third which defaults to the MTU size. For reasons I will explain in a bit doesn't matter too much what the values are, only what the ratio is.
Because I like being fair, I added some sfqs to the leaves; this is not necessary because if you don't, it should default to pfifo fast (or whatever your default scheduler is, I think. I would have to read the sch_drr.c source to be 100% sure). It also doesn't change my tests since I was using a single TCP connection per port.
tc filter rules for testing description
When I was testing the above, it actually gave me some trouble in the filter rules. drr doesn't have a default flow like a lot of the other qdiscs have, nor does it allow you to assign one as a qdisc option (that I'm aware of, if it does, edit this answer). So it's rather amusing in a frustrating way when it starts dropping your packets on the floor because it can't queue things like arp requests or replies and it doesn't say why your interface is spontaneously down.
So the first two rules perform the test activity, match the tcp/udp (it's in the same spot) dport against 8111 and 8112, putting matches in the appropriate queue, stopping matching if an appropriate rule is found.
The third rule says "match any protocol where the first byte (0 offset) matches 0x0 with a mask of 0" and put it in the third queue. It is prio 2 to be evaluated after the first-pass guys and then catch any unmatched packets. If you know a better way to make a default classid, I would surely like to know.
Quantum selection
As I mentioned earlier, the actual values don't matter so much as the ratio, though it'll probably make the queues more bursty (by which I mean stick in one queue for X packets per pass) if they are bigger than they should be, and use more cpu time if they are smaller. For that reason, I chose values near the same order of magnitude as MTU whose relation to the 30/70 target ratio is visible. Since quantum determines the fill-rate per pass, and thus number of bytes per pass, the ratio of quantums will be the ratio of bytes per pass relative to each other. If one queue is empty, the others don't so much absorb its bandwidth as just spend more time skipping the empty queue and filling themselves.
The relative dearth of documentation compared to HTB or CBQ suggests to me that DRR isn't a particularly popular qdisc, so unfortunately, if you do decide to go this route, I expect support will be pretty sparse, which makes it hard to recommend for use.
Comment: Why is HTB around this all required? Didn't work for me. But, still, you made great job. I wanted to give you more bounty, but SF says I can't do it for 23 hours
Comment: Didn't work = both pv instances show equal performance. Kernel module sch_drr is loaded
Comment: I'm not sure why it doesn't work using the link queue instead of some other arbitrary queue. I'm thinking it's because a given queue will be empty while it is waiting for TCP acks to come back; qdiscs don't really understand waiting for packets. Another notable assumption that must be made to use something like DRR is bandwidth congestion is occurring somewhere on a route common to everyone under the qdisc, and that's not always true.
Comment: Here is new question about DRR: http://serverfault.com/questions/539045/linux-qos-tc-drr-qdisc-does-not-work
Any ideas?
Comment: Good idea, thank you :) I'll test this as soon as I have any time
Answer: Did you check this link ?
http://www.tldp.org/HOWTO/html_single/Traffic-Control-HOWTO/#r-unknown-bandwidth
>     8.2. Handling a link with a known bandwidth
>
>     HTB is an ideal qdisc to use on a link with a known bandwidth, because the innermost (root-most) class can be set to the maximum
> bandwidth available on a given link. Flows can be further subdivided
> into children classes, allowing either guaranteed bandwidth to
> particular classes of traffic or allowing preference to specific kinds
> of traffic

Comment: Yes, I'v read LARTC. HTC is for **known bandwidth** :( I need solution for unknown bandwidth
Comment: Sorry. Wrong copy-paste

8.3. Handling a link with a variable (or unknown) bandwidth

In theory, the PRIO scheduler is an ideal match for links with variable bandwidth, because it is a work-conserving qdisc (which means that it provides no shaping). In the case of a link with an unknown or fluctuating bandwidth, the PRIO scheduler simply prefers to dequeue any available packet in the highest priority band first, then falling to the lower priority queues
Comment: PRIO gives only preemptive solution: traffic of class 1 is always higher priority than traffic class 2. If class 1 uses 100% of channel, class 2 is fully displaced.  I want to divide channel with unknown width in some predefined proportion, for example 30/70. But as I can see, it's impossible :(
Comment: You can follow another method but it's more tricky. you can make a custom script to mark the packets {70% label A, 30% label B}. It's up to you to make the logic for that. After that, you can use the labels for QOS in your switch. You can take some ideas from http://unix.stackexchange.com/questions/2259/default-mark-for-packets-using-iptables
Comment: If I have 70% of packets for type A and 30% packets for type B, than I need no shaping, just SFQ. But if I have 90% of packets type A, and 10% of packets type B, how can I remark them to be 70/30?


Ruby on Rails deployment issues with Windows

Question: This is my first website deployment and I'm quite a beginner in web development.
I am using Windows and Ruby on Rails and I am having a lot of trouble deploying my website online.
Also, I'm using FileZilla to send my files to the server.
Ruby version is 1.9.3
Rails version is 3.2.13
The error message that comes up is:
"Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)"
I have tried the suggestion to add:
   gem 'execjs'
   gem 'therubyracer', :platforms => :ruby

to my Gemfile, however the following error arises:
"Could not find gem 'therubyracer (>= 0) ruby' in the gems available on this machine. (Bundler::GemNotFound)"
Furthermore, I've tried adding Node as per some suggestions, however I am having trouble using it to deploy the website, I am not sure how to use it exactly. Through the use of some research I've come across the suggestion to add the following code to my config/boot:
ENV['EXECJS_RUNTIME'] = 'Node'
and
   Node = ExternalRuntime.new(
     :name        => "Node.js (V8)",
     :command     => "/usr/local/bin/node",
     :runner_path => ExecJS.root + "/support/node_runner.js",
     :encoding    => 'UTF-8'
   )

to my execjs runtimes.rb file, but then the following error comes up:
"Node.js (V8) runtime is not available on this system (ExecJS::RuntimeUnavailable)"
I am not sure if this is enough information or not, like I said I am a beginner but I have been struggling with this for a couple of days now.
Any advice would help.
Thanks a lot!
Answer: You need to install Node.js and restart your machine; and you can remove therubyracer gem as Node.js will replace it.
check also this answer on a similar question


Check list of Package names for valid names

Question: I have a relatively grown bash install script I use to install my standard software on fresh debian installations. It mainly consists of apt-get install -f -y lines. I started it in Debain 8 and recently while setting up a Debian 9 i noticed some package names have changed. Is there an efficient way to check all these packages if the package name in my script is still valid or the name has changed? Or do I have to check them all manually?
Answer: You can use the return code of apt-cache show (assuming you have performed apt update first).
$ apt-cache show curl > /dev/null 2>&1; echo $?
0
$ apt-cache show foo > /dev/null 2>&1; echo $?
100

Comment: Great thanks!
Can you explain what the part after `show curl >` does? Or at least say how this technique is called so I can read about?
Comment: It is redirecting the command output to /dev/null (the digital black hole). I use 2>&1 because this redirects stderr into stdout. Both of these pipes now write to 'nothing', so you get no output. The semicolon is just a delimiter for the next command. $? is a special variable that stores the return code of the last executed program.
Comment: that's super useful as it works for other commands too (just tried with `dpkg-query -s`). way better than grepping verbose outputs
Answer: If you're on Debian 9 and it has the packages you want, you can dump them using dpkg and ignore your list entirely,
dpkg --get-selections > packages.txt

You can then restore the system to the exact configuration with,
dpkg --set-selections - < packages.txt
apt-get dselect-upgrade


Where can i correct my work for clarity and grammar issues?

Question: Our eyes are mysterious; driven lenses, full of exposure. The moonlight stood still in the face of adaptation. Looking forward, i saw growth. Her eyes were dull. Iris, like the flower. Her mustard colored skin made her different than all of us. Her haircut was crooked, but in an endearing light. She followed the paths I set out for her. Thin and glass-like, rooting from the ground. Her body followed the current of the ocean. As much as I was warned, i picked her from where she had begun. Fools, trampling over her memories. It was hard to believe she felt more than alive.
Comment: Hello and welcome to Writer's Stack Exchange. You'll find it's quite an useful and friendly place, *but* your question tends toward the "what-to-write" kind (or rather, "how to edit", in this particular case). Those questions are rarely useful for anyone but the original poster and therefore are to be avoided. Can you maybe rephrase it to make it more general, and maybe more clear, of what kind of help you need?
Comment: Requests for proofreading are not on-topic here. You might find more help at someplace like https://www.critiquecircle.com/.
Answer: Copy-paste your work into online services such as the Hemingway app. It will suggest some changes for clarity. You can edit there and then copy-paste into another service and so on if you think you need more "eyes" on your work. Try to learn some general lessons in the process.


Milestone plan for spring roo

Question: I had been persistently trying spring roo since its milestone release until three months ago.
With the new STS release, I am about to try mucking around with it again. But, hold on, I am not about to waste my time again.
Preamble:
The last time I tried Spring Roo, it was a totally dysfunctional, especially the GWT and GAE integration part. Spring Roo was on an advertising path effectively saying "Finally a spring and gwt integration". I feel that that advertisement is misrepresented.
Questions:

Has anyone actually succeeded in creating a working GWT integrated project using spring roo?
It has been six months, and Spring Roo still cannot do GWT beyond a simple example and, therefore, still does not fulfill that advertisement. Is there a road-map towards achieving a GWT deployable spring roo? In agile management, we have road maps we try to think will get us where we want to be in a time frame we hope to conform to. I would like to see a road-map for deployable GAE and GWT integration, because I would like to put in place technology plan for my projects.
Should I abandon considering spring roo due to absence of a publicly available road map and wait for another two years before reviewing roo again?
Should I tell my cooperatives and associates (and anyone interested in my opinions) not to consider using roo as a deployable gwt and gae integration technology until another two years'?
Answer: It sounds to me like you should be considering an alternative.
I'm not sure how you came up with "another two years".  No one of us, Spring included, knows the precise answer.
Comment: 2 yrs was what it took -eclipse, netbeans and .net to be usable. Don't buy a Ford with a new engine design until 2 yrs after its introduction. Two years to make a marriage workable. Two years before your baby stops waking you up at night. Two years ... etc.
Comment: It didn't take IntelliJ that long to be usable.  My marriage worked right off the bat.  My babies both stopped waking me up after nine months.  Your comment is pithy and poetic, but quite wrong.

Milestone plan for spring roo


Plugin license key is lost every time I update Craft CMS

Question: I have licensed the Verbb Navigation plugin, but every time I update Craft I get a notice that the license needs attention. The key field on the Plugins page is empty after the update. Is this a bug, or is there another way to store the key so it will be saved after an update?
Comment: Odd... how are you updating/deploying Craft?
Comment: Update on a local dev machine via control panel, then deploy composer.json and run composer update on production machine.
Comment: We're also deploying a project.yaml file from our local environment, where the plugin is not licensed. Could that be causing the problem?
Answer: @Dalton I would say that's indeed the issue (using the project.yaml file), at least at first glance.
Every time you're pushing the project.yaml file to your server, it'll overwrite your server's project.yaml file. Because the plugin isn't licensed locally, you're basically removing the license each deploy.
Can you register the license locally, then push your project.yaml file? You'll notice locally, as soon as you enter a license key, the file will change to store this license key. Things should stay in sync from then on.


Booting from a USB

Question: Will booting linux (slitaz) from my USB drive damage my original OS (windows vista)?
Answer: Not at all, unless you tell the linux distro to install to your hard drive. If you are simply running from USB, you should be fine. Just don't install or do anything to your hard drive.
Answer: Everything is stored in the RAM (if the usb-distribution is done properly), and thus not affecting anything of your hard-drive OS, unless you (as Drake says) install application to the hard drive, or edit/delete files on the hard drive yourself, as RAMs are volatile memory (meaning that data is lost when power is off) http://en.wikipedia.org/wiki/Volatile_memory
Answer: If you are booting from a live cd version your hard drive should be fine.
Comment: The OP is booting from a USB drive, not a CD.

Booting from a USB


Remove Mood Lighting on 1994 Ford Econoline E150 Magnum van

Question: I will be removing the Mood Lighting . Do I need to disconnect the battery for that? It is possible I might still use some of it and redirect it to my solar energy. I would appreciate any help I can get, as this is my first time converting a van.  Thanks in advance.
Comment: I don't understand what you're trying to do, what do you mean by mood lighting? How are you looking to use solar energy?
Answer: Car batteries have very high amperage, so i would highly suggest you disconnect your battery before doing maintenance or installation on your vehicule. Regarding the energy, you need to check the voltage of the truck battery and the voltage of your solar powering system, you might need to buy a dc to dc converter to have the right voltage powering the lighting. Just be careful with those batteries, you will not be electrocuted but you can get burned by the current.


Uncountable sum of vectors in a Hilbert Space

Question: I am currently reading Hilbert Spaces and confused about a thing. Say, $C=\{e_\alpha : \alpha\in\mathcal{A}\}$ be a complete orthonormal set of a Hilbert Space $H$, possibly uncountable. Is $\sum_{\alpha\in\mathcal{A}}e_\alpha$ well defined ? I think it should be, is there some kind of convergence needed for these sums?
Comment: Even when $\mathcal A$ is countably infinite the sum $\sum e_n$ does not exist either in the norm or weakly.
Comment: If $\sum e_n=x$, say in weak topology, then we have $\sum \langle y,e_n\rangle =\langle y,x\rangle$ for all $y$. You get a contradiction by taking $y=\sum \frac 1 j e_j$.
Comment: Oh, I see if it was a well defined vector, then the norm would be in $\mathbf{R}$, which is not the case here. Is that ok? @KaviRamaMurthy
Answer: In an infinite dimensional Hilbert space the term
$$
\sum_{a\in \mathcal A} e_a
$$
is not well defined.
Even for countable $\mathcal A$ this sum does not converge.
For defining uncountable sums it is usually required that at most countable many summands are nonzero
and that the countable sum over the nonzero entries converges absolutely.
Answer: The sum $\sum_{\alpha\in A} v_\alpha$ does make sense. It is defined to converge to $L \in H$ if
$$\forall \varepsilon > 0 \,\exists F_0 \subseteq A \text{ finite such that }\forall F \subseteq A \text{ finite}, F \supseteq F_0 \text{ we have} \left\|\sum_{\alpha\in F}v_\alpha - L\right\| < \varepsilon$$
However, the sum $\sum_{\alpha\in A} e_\alpha$ of an orthonormal set only converges if $A$ is finite.
Indeed, assume that $\sum_{\alpha\in A} e_\alpha = L$. For $\varepsilon = \frac12$ there exists $F_0 \subseteq A$ finite such that for all $F \subseteq A$ finite, $F \supseteq F_0$ implies $\left\|\sum_{\alpha\in F} e_\alpha -L\right\| < \frac12$.
For any $F_0 \subseteq F \subseteq A$ finite we have
$$\sqrt{|F \setminus F_0|}= \left\|\sum_{\alpha\in F\setminus F_0}e_\alpha\right\| = \left\|\sum_{\alpha\in F}e_\alpha - \sum_{\alpha\in F_0}e_\alpha\right\| \le
 \left\|\sum_{\alpha\in F}e_\alpha - L\right\| +\left\|L- \sum_{\alpha\in F_0}e_\alpha\right\| < 1$$
so $F = F_0$. Therefore it necessarily holds $F_0 = A$ so $A$ is finite.
Answer: The background of your question is how do you define $\displaystyle \sum_{i \in I} c_i$ in a Banach space for any set $I$?
The usual way is to say that the sum $\displaystyle \sum_{i \in I} c_\alpha$ of a set $\mathcal C = \{c_i \ ; \ i \in I\}$ of vectors exists when following Cauchy criteria is met:
$$(\forall \epsilon > 0) \, (\exists J_0 \in \mathcal F(I)) \, (\forall K \in \mathcal F(I \setminus J_0)) \, \left\Vert \displaystyle \sum_{k \in K} c_k \right\Vert< \epsilon $$
Where $\mathcal F(A)$ is defined as the sets of finite subsets of $A$.
This has interesting consequences.

Such a sum $\displaystyle \sum_{i \in I} c_\alpha$ does make sense only if the set of non zero elements of $\mathcal C$ is at most countable.
For a family of uncountable vectors of norm equal to $1$, which is your initial question, the sum cannot exist: take $\epsilon = 1/2$ in the definition above; you'll get a contradiction.


Solving a linear system of ODEs in matrix form

Question: I would like to solve the linear system of ordinary differential equations
$$
\begin{align*}
\dot\mu&=R^\mathrm T\mu \\
\dot\Sigma&=R^\mathrm T\Sigma+\Sigma^\mathrm T R+\mathrm{diag}(R^\mathrm T\mu)
\end{align*}
$$
where $\mu$ is a column vector, $\Sigma$ is a (symmetric) covariance matrix, and $R$ is a square rate matrix. Clearly $\mu(t)=e^{R^\mathrm Tt}\mu(0)$, but is there any way to solve for $\Sigma(t)$?
Answer: The matrix equation to solve reads
$$
\dot{\Sigma} = 2\,\mathrm{sym} (R^\mathrm{T} \Sigma) + \Lambda(t) \, ,
$$
where $\Sigma$ is a $n\times n$ real symmetric matrix, $\Lambda(t) = \mathrm{diag}\!\left(R^\mathrm{T}\! \exp\left(t R^\mathrm{T}\right)\mu(0)\right)$ is a diagonal matrix, and $\mathrm{sym}(M) = \frac{1}{2}(M + M^\mathrm{T})$ denotes the symmetric part. One can note that $\dot\Sigma$ is symmetric, independently from the fact that $\Sigma$ is symmetric or not. In the case where $R$ and $\Sigma$ commute, e.g. $R$ is the identity matrix, then the homogeneous solutions are proportional to $\exp\left(2t\,\text{sym}(R)\right)$. In the general case, it seems hopeless to work on the matrix system itself. A strategy consists in rewriting the differential equation in vector form
$$
\dot{V} = A V + b(t) \, ,
$$
where $V$ is a size-$n (n+1)/2$ vector of coordinates of $\Sigma$, $A$ is a square matrix, and $b(t)$ is a vector. To illustrate, let us consider the case of $2\times 2$ matrices
$$
\Sigma = \left(\begin{array}{cc} \sigma_1 & \sigma_2\\ \sigma_2 & \sigma_3\end{array}\right),\quad R = \left(\begin{array}{cc} r_1 & r_2\\ r_3 & r_4\end{array}\right),\quad \Lambda(t) = \left(\begin{array}{cc} \lambda_1(t) & 0\\ 0 & \lambda_2(t)\end{array}\right).
$$
The differential equation in matrix form gives
$$
\frac{d}{dt}
\left(\begin{array}{c}
\sigma_1\\
\sigma_2\\
\sigma_3
\end{array}\right)
=
\left(\begin{array}{ccc}
2 r_1 & 2 r_3 & 0\\
r_2 & r_1 + r_4 & r_3\\
0 & 2 r_2 & 2 r_4
\end{array}\right)\!
\left(\begin{array}{c}
\sigma_1\\
\sigma_2\\
\sigma_3
\end{array}\right)
+
\left(\begin{array}{c}
\lambda_1(t)\\
0\\
\lambda_2(t)
\end{array}\right) ,
$$
which can be solved with classical methods.
Answer: I have realized that the matrix equation is a continuous differential Lyapunov equation, which is studied in linear-quadratic optimal control. The system above has the following solution:
\begin{align*}
\mu(t)&=e^{R^\text T t}\mu_0 \\
\Sigma(t)&=\int_0^t e^{R^\text T(t-\tau)} \,\text{diag}(R^\text T e^{R^\text T \tau}\mu_0)\,e^{R(t-\tau)}\,d\tau
\end{align*}
assuming the usual initial conditions $\mu(0)=\mu_0$ and $\Sigma(0)=0$.


panic!() and assert!() in runtime

Question: Is there a way, apart from manual code review, to guarantee assert!() and panic!() calls intended for test code not accidentally gets built for the chain runtime.
Answer: And yeah debug_assert! might also be worth keeping in mind. However, you can also do something like:
macro_rules! test_only_assert {
    ($cond:expr $(,)?) => {{
        #[cfg(test)]
        assert!($cond)
    }};
}

// Now you can do like:
fn runtime_function() {
    test_only_assert!(..)
}

And similar for panic too. It will make sure that test will be run even when running with release profile. Eg: cargo test --all --release and wont be included if binary is in debug but not in test.
Answer: Besides the mentioned debug_assert! there is nothing provided by Rust out of the box. However, you could write your own maybe-assert crate or whatever you want to call it.
You would by default export a macro maybe_assert! with the same semantics as assert!, aka you just forward all the arguments to assert!. The trick would be to introduce some feature do-not-assert or something similar to your maybe_assert crate. Then you would enable this do-not-assert feature for your runtime when you build a release that should be put on chain.
Answer: One way of achieving what you ask for is to enclose every assert! statement in a #cfg[test]
#cfg[test]
assert!(...)

Comment: because the code will be less readable and the programmers will forget.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: I think you are looking for debug_assert!(). It is built into debug builds but not release builds
May not directly answer your question, but could be useful
Comment: Could be, it should assert when we run `cargo test` but not break the runtime

panic!() and assert!() in runtime


Smooth cylinder after do kife cut?

Question:
As the image shown I did a cut inside a cylinder, then I want to smooth cylinder but keep the cut sharp. When I did smooth the shape distort around the circular hole :(
Comment: Related - http://blender.stackexchange.com/questions/3260/how-to-cut-a-rounded-hole-in-a-sphere
Comment: this link will give you some ideas on how to deal with this kind of cuts: https://www.youtube.com/watch?v=Bc52fcrHvAA
Comment: If you haven't solved this yet this is pretty good quick tut.
https://www.youtube.com/watch?v=salpctjEdAA
Answer: I suppose you did a Boolean cut. That gets the job done fast, but you'll have a hard time cleaning up the mesh after the fact. You would be better off by first cutting a hole in the cylinder with the Knife Tool, taking care that the topology is correct (quads only). Then select, inset and push the polygons that form the perimeter of the hole inside the cylinder. After that, select the edges surrounding the newly formed hole and bevel them. After you apply the Subdivision Surface Modifier you should have a decent looking mesh.
Comment: While correct, cutting a hole with Knife Project will actually leave nearly the same topology requiring cleaning up as cutting with Boolean.
Comment: Agreed. Maybe a better option would be more planning with the overall shape and poly-count, i.e. Boolean cut with a low-poly cylinder primitive and eventually adding edges with the Knife tool where necessary.
Answer: If the geometry of your model is not super important and you just want it to look the part you can set the shading to smooth on the object under the first tab on the t tray of the 3D view.
Then if you go to the data tab under normals there is an autosmooth option that will tell blender not to smooth edges that exceed the angle you set.

Hope this helps.
Comment: Non of those methods work perfectly, still some distortion after do mesh :(

Smooth cylinder after do kife cut?


Help setting up a solar power system for a lake fountain

Question: I am trying to set up a fountain that will run off grid. I want to use a 100w solar power system to charge a deep cycle 12v battery. I am looking at a 120v 4.8 amp water pump. It will be ran 100 ft from the solar panel system. My question is how long will the pump run, how will it take the 100w solar panel to charge the battery, and how low should I let the battery get before I charge it. I plan on setting a 24h timer to run the pump in intervals of x hrs then letting it charge x hrs and repeating. Hoping to run 3-4 hours in the morning then again in the evening, (something like 5-9 then 2-6). Thanks for any help
Comment: Your pump is around 600 W, so you need 6 times the time charging the battery with a 100 W panel at full power (almost never the case). You would need 48 hours of sunshine a day to get that working like you want.
Comment: You might (just) get 1 hour per day on a sunny day...
Comment: Unless it's a typo and you meant a 12V 4.8A pump, which would be much more practical (and save the inverter)
Answer: First, as has been pointed out in comment, if you really are using a 120 VAC 4.8 A pump, you are simply out of luck. 120 V x 4.8 A is 600 watts. I do hope you see the problem with charging from a 100 W panel.
But let's be optimistic and figure you misspoke, and the proper number is 12 volts at 4.8 A. After all, 600 watts is just under 1 HP, and a 1 HP water pump will provide something like 20 gal/min at 50 psi, which would be a pretty impressive fountain. If you really do want such a fountain, you're going to need a much bigger panel array.
So, 12 volts at 4.8 A is about 60 watts. Can you do this? Sure. Sort of. You need to keep in mind that, particularly near full charge, the charge efficiency of a battery, particularly a lead-acid, starts to drop off, and 60% is not an outrageously low number. Charge efficiency, of course, is simply the ratio of the stored charge out divided by the charging charge in for a given state of charge. Using this number, you can sort of figure that (on a bright sunny day) you'll get about 1 hour of fountain per hour of charge.
Another thing you need to keep in mind is that, although the sun might shine all day, in early morning and late afternoon it won't be very bright, and unless you have a sophisticated tracking panel array, most of the time the panel will not be directly facing the sun and will receive even less energy. The general rule of thumb is that you can count on the equivalent of 6 hours charging per day.
So, as a rough number, assuming perfect weather, you'll be able to get 6 hours of operation per day. In a desert.
As for the battery, you might consider a bit of basic research. Like, you know, Wikipedia? How about this? The general rule is to not discharge below about 50%.


How much XP does a level 3 character receive for defeating a level 16 NPC solo?

Question: If a level 3 character single handily defeats a level 16 NPC (16 level fighter) in combat. How much xp would they receive?
Comment: Wan't there some rule about not gaining more than one level per encounter? That would put a hard cap on the amount of experience that should be given.
Comment: Welcome to the site! Take the [tour]! I think this question would be improved by providing some context. Where did the encounter take place? What kind of PC are we talking about? What did the PC do to win? Did the NPC make reasonable feat and gear choices? A purely technical answer is available to this question, but even the technical answer involves nuance. Consider adding details. Thank you for participating and have fun!
Answer: The thing with Experience Points is that it takes time and several encounters (as a rule of thumb: 13) until you have gathered enough to advance a level. If too many XPs are being awarded too quickly, it unbalances the game and also takes the fun out of it.
The table for calculating XP awards on page 38 of the DMG only covers encounters which are no more than eight Challenge Ratings higher than the character's level. This is because, it is – or at least should be - practically impossible to win a fight against an enemy that much stronger, and also in order to put a limit on the XPs you can get for defeating a single monster or enemy:

As a guideline, the minimum and maximum awards given on Table 2–6:
Experience Point Awards (Single Monster) for a group of a given level
are the least and most XP you should award a group.

(DMG, p 39)
In the same section it says

an encounter in which the PCs defeat something far above their own
level (CRs higher than their level by eight or more) was probably the
result of fantastic luck or a unique set of circumstances, and thus a
full XP award may not be appropriate.

In addition, the PHB (p 59) has a rule that prevents characters from gaining more than one level at a time

If, for some extraordinary reason, a character's XP reward from a
single adventure would be enough to advance two or more levels at
once, he or she instead advances one level and gains just enough XP to
be 1 XP short of the next level. Any excess experience points are not
retained.

So, according to this, the maximum number of XPs a 3rd level character can get in a single encounter depends on the number of XPs they currently have and ranges from 4.000 to 6.999 (given that a 3rd level character has between 3.000 and 5.999 XPs and has to reach 10.000 XPs for 5th level).
Answer: It will have to come down to a GM call.
Table 2–6: Experience Point Awards (Single Monster) in the Dungeons Master Guide on page 38 describes how many Experience Points a character gets for defeating a foe based on it's Challenge Rating.
However the formula breaks down for a gap that large, as the Encounter Difficulty should be Unbeatable.
If such a thing occurs it should probably fall under a Ad Hoc XP Awards (page 39) or Story Awards (page 40) and judged on a case by case basis.
As a GM i would probably judge this based upon the strain upon the player and their resources. The XP Award range for a level 3 character is 300 to 10800, so somewhere appropriate in that range.
There is a handy calculator at d20srd.org for calculating Encounters and Rewards.


Clarification about the definition for polynomial discriminant?

Question: On the wikipedia page about polynomial discriminants, it shows this definition:
$$\Delta = a_n^{2n-2}\prod_{i<j}(r_i-r_j)^2$$
What I'm getting from this is that  $\Delta$ is obviously the discriminant, $a$ is a coefficient, $n$ is the power of the polynomial (not sure on this one), and $r$ is a root of the polynomial. However I don't understand this business with $i$ and $j$. What's with the $i<j$ under the $\prod$? Why doesn't it have an upper bound?
Answer: The subscripts index the roots $r_i$ of the polynomial. Since we restrict to $i < j$ (which we could write as $1 \leq i < j \leq n$), this means that the product (1) runs only over pairs of distinct roots, and (2) counts each pair only once (as opposed to twice, for the two possible orders of two roots). For example, if $n = 3$, the pairs $(i, j)$ of integers such that $1 \leq i < j \leq n$ are $(1, 2)$, $(1, 3)$, and $(2, 3)$, and so the discriminant is
$$\Delta = a_3^4 (r_1 - r_2)^2 (r_1 - r_3)^2 (r_2 - r_3)^2 .$$
Comment: What if $n=1$? How would that work for the product?
Comment: In that case there are no admissible pairs, so the product is empty, and usually we define the empty product to be $1$ (just like we usually define the empty sum to be $0$) and hence the discriminant to be $1$. This isn't so useful, however, since we already know that degree $1$ polynomials cannot have repeated roots. Note that for $n = 2$ this coincides with what we usually call the discriminant of a quadratic.


tempdb log file usage huge by sleeping status sessions but not relased the space

Question: We have a alert threshold of tempdb usage on drive level at 90% and getting lot of alerts. But the first problematic point is the tempdb usage occupied whole drive of 500GB among Log file only occupied 95% and not able to increase the log file for other works on tempdb. While we checked the open transactions we seen sleeping sessions are there 2days and 1day before time stamps and not released the space to other transactions. I think it's worst behavior the sleeping sessions blocked the space and released to the others. We need the script for Is really those sessions are occupieing the LOG file space and not released them. (I came to know jdbc drivers sessions suddenly drops and so that the sleeping sessions are not released the space to other transactions). Can you provide Is there any script to identify the same.
Answer: Use this script to determine tempDB usage per sessions :
<code>--Lists the TempDB usage per each active session.
--It helps identifying the sessions that use the tempdb heavily with internal objects.

;WITH task_space_usage AS (
    -- SUM alloc/delloc pages
    SELECT session_id,
           request_id,
           SUM(internal_objects_alloc_page_count) AS alloc_pages,
           SUM(internal_objects_dealloc_page_count) AS dealloc_pages
    FROM sys.dm_db_task_space_usage WITH (NOLOCK)
    WHERE session_id <> @@SPID
    GROUP BY session_id, request_id
)
SELECT TSU.session_id,
       TSU.alloc_pages * 1.0 / 128 AS [internal object MB space],
       TSU.dealloc_pages * 1.0 / 128 AS [internal object dealloc MB space],
       EST.text,
       -- Extract statement from sql text
       ISNULL(
           NULLIF(
               SUBSTRING(
                   EST.text,
                   ERQ.statement_start_offset / 2,
                   CASE WHEN ERQ.statement_end_offset < ERQ.statement_start_offset THEN 0 ELSE( ERQ.statement_end_offset - ERQ.statement_start_offset ) / 2 END
               ), ''
           ), EST.text
       ) AS [statement text],
       EQP.query_plan
FROM task_space_usage AS TSU
INNER JOIN sys.dm_exec_requests ERQ WITH (NOLOCK)
    ON  TSU.session_id = ERQ.session_id
    AND TSU.request_id = ERQ.request_id
OUTER APPLY sys.dm_exec_sql_text(ERQ.sql_handle) AS EST
OUTER APPLY sys.dm_exec_query_plan(ERQ.plan_handle) AS EQP
WHERE EST.text IS NOT NULL OR EQP.query_plan IS NOT NULL
ORDER BY 3 DESC, 5 DESC
</code>
Comment: Thanks for the script and we have modified the above script and scheduled it through job but it's not giving log file sessions related usage,  It's giving  internal and external objects which are using the MDF file space.   But we are looking for LDF file usage related stuff.  You can go through the another commend in same page.
Answer: Installing and running SP_WhoIsActive should be able to tell you what processes have open transactions and how much TEMPDB space they are using.  A sleeping, but uncommitted transaction will not release the space until committed or rolled back
Answer: what does dbcc opentran(tempdb) return ? This should tell the spid in contention.
dbcc inputbuffer(spid)  should give you what the spid is running.
sp_whoisactive as suggested by Mickael will give you the active transactions.
hope this helps.
Comment: I used the above as initial check list and when we fired the dbcc opentran() got the spid as open tran and the status is in sleeping state, After that we used to inputbuffer(spid) and got the 'FETCH_CURSOR 001010001' command with it.  Strangely the sleeping sessions are there older than 2days once we killed them can able to shrink the log file.  So we need a script for identifying such type of sp's proactively before we are going face those problems.


sort files twice

Question: I have a series of 300+ files that I need to sort twice, once by the date and a second time within that date by part of the filename.
The only standard in the names is that ends with *mmddyyyy<time stamp>.csv, where the first part of the file name can include anything at all.  I know ls -ltr gives me the date sort but I can't seem to capture and sort on a portion of the last keydef.
Comment: Although names can vary, can you still post three full file names, so don't do `` do the actual time stamp for example. That way it makes it possible to see if there is some pattern that can be usable for sorting.
Comment: Maybe a sample input and expected output could help clarify what you want to do.
Comment: They even have spaces in the file names... :(
Comment: These guys were real buggers... the front part of the filename is literally anything at all - whatever a human typed in.  Some of the problem children were names like - "180195-49 (2).hdl.02042015021509.csv" or "15-1 15-2.hdl.03302015064508.csv" but more "normalized" names were "2-17-15.hdl.02172015085537.csv"  as examples.
Answer: Given that when looking at the filenames from the end side they have a predictable format (extension then time then date) one can leverage this fact and use the following command:
ls -1 | rev | sort -t '~' -k1.14,1.14 -k1.13,1.13 -k1.12,1.12 -k1.11,1.11 -k1.18,1.18 -k1.17,1.17 -k1.16,1.16 -k1.15,1.15 | rev

Explanation:
- the filenames are first reversed so we can access the desired format
- the result is then sorted character by character, depending on our needs:
- - the characters 11 to 14 are the year (in reverse order)
- - the characters 17 to 18 are the month (in reverse order)
- - the characters 15 to 16 are the day (in reverse order)
- finally another reversal takes place to display them with original names
I've used the tilde ~ as separator in order to combine the whole filename in one field but you can play around using a different one (it has to be a character never present in the filenames) or just use a . (dot) in order to split the filename in several fields (if their amount is always the same) so that you can specify other parts to be sorted upon - for your second question.

sort files twice


Can I invest C-corp or S-corp profits by purchasing stock, bonds or property to reduce tax liability?

Question: If I own a C-corp or an S-corp in the US ( say for example Delaware ), and I take profits from revenue after expenses for the corporation and purchase stock in the US stock markets, bonds or other investment property without selling any of those investments purchased by the time of tax filing, would that reduce my corporation's total tax liability?
Answer: No, you cannot. Investment is not a tax-deductible expense.
Comment: @MrChrister the other answer doesn't answer the question. The OP wants to reduce tax liability of the corporation by making private investments - cannot be done. You can defer portion of the tax using various retirement vehicles, but that would be the *personal* tax, not the *corporate*.
Comment: Another answer conflicts.  Would you might clarifying your position?  The other answer seems to take a different tack
Comment: Thank you littleadv .. So just to clarify, let's take a food chain as a hypothetical example:  If the food chain takes food profit and purchases property to open additional chains would that not be considered an expense, reducing tax liability?  In other words, is what constitutes an "investment" subjective to the business being operated?  Similarly, if I started an investment company specifically designed to profit from stock investments, would those stock purchases not be considered expenses?
Comment: @sean no, that wouldn't be an expense. That would be an investment, non-deductible. However, putting a capital asset (an investment) into a business use (i.e.: using a real estate property as the chain supermarket, for example) allows depreciating the capital asset over time, thus reducing the tax liability. But you **have to** put the asset into the **business** use. You cannot do that, for example, with stocks or bonds.
Comment: Thanks littleadv - I believe I see your point.  Because you're purchasing a building in the example ( or the stocks ) and it does not lose value per se right away, you're collecting income in the form of an asset and that's not an expense.  Purchasing chicken for sandwiches for example for sale would be however as they immediately lose value from going out the door and drive business value from use ( feel free to correct if I'm wrong ).  Thanks for clarifying!  Too bad the IRS rakes everything
Answer: Yes you can... By opening a pension fund and putting excess cash in there you can protect your cash. While the cash is in a protected pension fund. You can self-direct the funds activities or have someone do it for you.
How ever you do have to make this fund available to all employees.
Comment: What do you mean by "pension fund"? In the US, retirement programs are identified by the sections in the IRC that define them. Which one are you referring to and how will it be able to reduce corporate taxes?
Comment: You will need to consult a professional on setting up fund properly... AND don't take "no you can't do it as an answer" Find someone that will tell you this little secret.


BI in SharePoint 2013?

Question: I started learning BI in SharePoint, I'm not understanding where to start and I do not know what are all the possible options I can try, what I can leverage. I see lot of different categories and terminology when I googled. Do I need to know about MSBI before I start learning? Guide me what are the Trending areas in BI with SharePoint, also I do not want to work on the outdated technology and not going to be used in future SP Releases.
Answer: Great question. There's no good answer.
SSRS (reporting services) is the old man in BI. It produces "traditional" reports, it works with virtually any type of data source, there's lots of documentation, it has robust capabilities in the areas of caching, etc. However, it hasn't been updated in quite a few years, and it doesn't seem like any significant updates are planned. So, while it can produce dashboards, those dashboards will look like they were created in 2007.
Power BI. As in, PowerBi.com. This site (which is a Microsoft Site) allows you to create amazing looking dashboards, as well as allow the users to create charts by typing in english sentences. It's quite amazing. However, it's a bit tricky to get to work with databases that are on prem (as in, not in the cloud), and it's difficult or impossible to create old-fashioned reports. Again, it does cool dashboards, but you're kind of out of luck if you want a report that displays 40 pages of data with 14 columns.
Of course, to the above you need to also add on Power Query, Power View, and PowerPivot, each having their own capabilities, but all involving Excel.
edit:
Power Query: allows you to import data into excel, massaging the data on the way. So with it, you could import data from an OData feed, specifying which columns you want, and then join the result to a previously imported data set. (experienced SQL folks will recognize that this is the role that SSIS plays in SQL Server)
Power Pivot: allows you to work with datasets that have millions of rows. Has functions that allow you to do things like date functions, such as calculating the percent difference of the values from this month vs last month. This is essentially a cube that runs in memory in excel.
Power View: a utility that allows you to create interactive dashboards based on data that has been imported into excel via either power query or power pivot.
So perhaps to start, take a look at Power Query and Power View. Just those two provide a lot of possibilities. Power Pivot is cool, but the learning curve is steeper. So, perhaps after learning Power Query and Power View, check out the PowerBI.com site.
Comment: So, is it correct to start with Power Query, Power View, and PowerPivot involving excel? Do these involve in all areas of BI?
Comment: I don't know if I have an answer for that. You could certainly start with those, and I suppose that MS would certainly want you to start with them. (Or, they may want you to jump right into the PowerBI.com site). But see my edit for more details. Hope it helps.

BI in SharePoint 2013?


Using to different delegate method for the same picker?

Question: Im trying to create a view with two pickers, each with multiple components, one of the pickers has 4 components that are all text based, the other has two components that need to display graphics and two that need to display text.  Is there any way to use the pickerView:titleForRow:forComponent:(NSInteger)component delegate method and the pickerView:viewForRow:forComponent:reusingView: delegate method for the same picker?
I've implemented both, only the viewForRow one seems to ever get called.  Do I need to just use that one and create a view with a label for each row?
Answer: You can create one picker, yes, or you can implement one common method for both pickers and determine what picker is calling it by checking it's tag.
Comment: Im not trying to use one method for 2 pickers, Im trying to use 2 method for one picker.
Answer: The Solution I cam up with was to call pickerView:titleForRow:forComponent: from pickerView:viewForRow:forComponent:reusingView:  and create a UILabel with the string from the first method.  It works, but it seems like there ought to be a better way.