Condensed Pontryagin duality

Question: Has Pontryagin duality been extended to condensed abelian groups? The obvious approach being to define $\hat M$ as the internal hom to the circle group. Is it true that $\hat{\hat M}=M$ with this definition?
Answer: This cannot be true for all condensed abelian groups. Indeed, in this answer to Are there (enough) injectives in condensed abelian groups?, Scholze explains that there are no nonzero injective condensed abelian groups. So it suffices to prove the following:
Lemma. Let $\mathscr A$ be an abelian category and let $\mathbf D \colon \mathscr A^{\text{op}} \to \mathscr A$ be a left exact functor such that $\mathbf D^2$ is faithful and preserves monomorphisms (e.g. $\mathbf D^2 \cong \mathbf 1_{\mathscr A}$). Then $\mathbf D$ is exact.
Indeed, this would prove that $\mathbf T = \mathbf R/\mathbf Z$ is injective if $\mathbf D = \mathbf{Hom}(-,\mathbf T)$ is an auto-duality.
Proof of Lemma. If $0 \to A \to B \to C \to 0$ is an exact sequence in $\mathscr A$, then
$$0 \to \mathbf D(C) \to \mathbf D(B) \to \mathbf D(A)$$
is exact by hypothesis. Let $M$ and $N$ be the image and cokernel of $\mathbf D(B) \to \mathbf D(A)$ respectively, so that we get exact sequences
$$\begin{array}{ccccccccc}
0 & \to & \mathbf D(C) & \to & \mathbf D(B) & \to & M & \to & 0,\\
0 & \to & M & \to & \mathbf D(A) & \to & N & \to & 0.
\end{array}$$
Dualising again gives exact sequences
$$\begin{array}{ccccccc}
0 & \to & \mathbf D(M) & \to & \mathbf D^2(B) & \to & \mathbf D^2(C),\\
0 & \to & \mathbf D(N) & \to & \mathbf D^2(A) & \to & \mathbf D(M).
\end{array}$$
The composition $\mathbf D^2(A) \to \mathbf D(M) \to \mathbf D^2(B)$ is injective by hypothesis, so the second sequence gives $\mathbf D(N) = 0$. Faithfulness of $\mathbf D^2$ gives $N = 0$, so $\mathbf D(B) \to \mathbf D(A)$ was surjective to begin with. $\square$
Presumably there is a direct example showing that $\mathbf T$ is not injective. If you want to work with $\mathbf{Cond}_\kappa$ instead of $\mathbf{Cond}$, then the same argument doesn't work (because $\mathbf{Cond}_\kappa$ does have enough injectives), and I don't know if $\mathbf T$ is injective in $\mathbf{Cond}_\kappa$ for any strong limit cardinal $\kappa$. (Surely not, right?)
Comment: @Echo be careful, the category $\mathbf{LCA}$ of locally compact abelian groups is not abelian, so you have to think about what you mean by injective and so on. The inner RHom is actually not inner: it goes $D^b(\mathbf{LCA})^{\text{op}}\times D^b(\mathbf{LCA}) \to D^b(\mathbf{TopAb})$, and is computed in a cumbersome way (see the Hoffman–Spitzweck reference in the Clausen–Scholze notes). For this RHom, the torus is of course injective, because Pontryagin duality holds! The point is that only *strict* short exact sequences in $\mathbf{LCA}$ are sent to exact sequences in $\mathbf{Cond}$.
Comment: I used to think that the notion of injective object exists for any category. And as LCA embeds into Cond, where the notion of monomorphism is preserved, the torus being not injective in LCA implies that it is not injective in Cond, or did I miss anything?
Comment: Thanks for the nice answer! I think the non-injectivity of the torus $\mathbb T$ can already be seen in the category of locally compact abelian groups. You map $\mathbb Z$ injectively to $\mathbb T$ and you also map $\mathbb Z$ injectively to $\mathbb{Z}_p$ for some prime $p$. Since any continuous homomorphism from $\mathbb{Z}_p$ to the torus has finite image, the map from $\mathbb Z$ to $\mathbb T$ cannot be lifted.
Comment: Oh right, I was using the "Hom is exact" definition which exactly doesn't work in this setting. The usual categorical definition indeed immediately shows $\mathbf T$ is not injective. If $A\to B$ is the map $\mathbf Z\hookrightarrow\mathbf Z_p$, then $\mathbf D(B)\to\mathbf D(A)$ is $\mathbf Q_p/\mathbf Z_p\hookrightarrow\mathbf T$. If $N$ is the cokernel, running the argument above shows $\mathbf D(N)=0$ but $N \neq 0$. This makes sense as the image of $\mathbf Q_p/\mathbf Z_p\to\mathbf T$ is dense, somewhat similar to my [second answer](https://mathoverflow.net/a/440287/82179).
Comment: So the point is that $\mathbf{Hom}(-,\mathbf T)$ only turns *strict* monomorphisms into surjections, not arbitrary injections.
Answer: Here is an attempt to give a more concrete example.
Let $V$ be a condensed $\mathbb R$-vector space. Then we have
\[
\DeclareMathOperator\RHom{RHom}
\newcommand\iRHom{\underline{\RHom}}
\iRHom_{\mathbb Z}(V,\mathbb R/\mathbb Z)\simeq\iRHom_{\mathbb R}(V,\iRHom_{\mathbb Z}(\mathbb R,\mathbb R/\mathbb Z))\simeq\iRHom_{\mathbb R}(V,\mathbb R),
\]
where we used the fact that the Pontryagin dual of $\mathbb R$ is itself. It follows that, if the underlying condensed abelian group $V$ satisfies the Pontryagin duality, then the map from the condensed $\mathbb R$-vector space $V$ to its double $\mathbb R$-dual is an isomorphism. Such $V$ seems to be closely related to stereotype spaces in functional analysis. In particular, it seems that, for non-locally-convex spaces, this map is far from being an isomorphism.
Comment: Ah, you're absolutely right, it's not even an isomorphism for topological groups! I have worked out another example in my [second answer](https://mathoverflow.net/a/440287/82179).
Answer: In fact, the evaluation map $M \to M^{\vee\vee}$ is not even an isomorphism for all topological groups $M$. If we take $M$ such that the topologies on $M$ and $M^\vee$ are compactly generated¹⁾, then Proposition 4.2 in Lectures on Condensed Mathematics shows that the formation of $M^\vee$ and $M^{\vee\vee}$ is preserved by the passage from $\mathbf{TopAb}$ to $\mathbf{Cond}(\mathbf{Ab})$.
Here is a simple and concrete example.
Example. Let $M = \mathbf Q$ with the subspace topology from $\mathbf R$. This is not locally compact, but it is compactly generated: suppose $S \subseteq \mathbf Q$ is a subset such that $S \cap K$ is closed for any compact subset $K$. If $x_1,x_2,\ldots$ is a sequence of elements in $S$ with limit $x \in \mathbf Q$, then $K = \{x\} \cup \{x_1,x_2,\ldots\}$ is compact as it is closed and bounded in $\mathbf R$. Since $S \cap K$ is closed and contains $\{x_1,x_2,\ldots\}$, we conclude that $x \in S$.
But the inclusion $M \hookrightarrow \mathbf R$ induces an isomorphism $\operatorname{Hom}_{\text{cts}}(\mathbf R,\mathbf T) \stackrel\sim\to \operatorname{Hom}_{\text{cts}}(M,\mathbf T)$, for instance because continuous group homomorphisms are automatically uniformly continuous (for the left or right uniformity ― they agree in the abelian case), so they factor uniquely via the completion. Thus, $M^{\vee\vee} = \mathbf R^{\vee\vee} = \mathbf R$ as well. $\square$

¹⁾ Beware that some authors use the separate and unrelated notion that a Hausdorff abelian group $A$ is compactly generated if there exists a compact subset $S \subseteq A$ that generates $A$ as a group. I stress that I am using the topological notion here.
Comment: It seems worthwhile to note that $\underline{\operatorname{RHom}}_{\mathbb Z}(\mathbb Q,-)$ is easier to compute a priori since $\mathbb Q$ is a filtered colimit of $\mathbb Z$, while $\underline{\operatorname{RHom}}_{\mathbb Z}(\mathbb R,-)$ seems nontrivial (using Breen–Deligne resolution, etc.).
Comment: @Z.M that is for the discrete topology on $\mathbf Q$, which is usually what the topological abelian group $\mathbf Q$ means. But I'm using the subspace topology from $\mathbf R$. Also, I'm just computing in $\mathbf{LCA}$ rather than $\mathbf{Cond}$ (which for underived inner Hom doesn't matter). Even for derived inner hom, I would probably use Hoffman–Spitzweck's weird construction of the inner hom in $D^b(\mathbf{LCA})$ to compute it.

Condensed Pontryagin duality


Geometric construction of hyperbolic trigonometric functions

Question: If we have a circle we can geometrically construct the trigonometric functions as shown. The functions all derive from sin and cos. If we say that the circle is a conic section and imagine it on the cone we can draw a hyperbola perpendicular to it. I believe that the hyperbolic trigonometric functions can be plotted geometrically as well but I cannot find and representation of it. What do the hyperbolic trigonometric functions actually tell you about a hyperbola?
Comment: Thee is a similar question here: http://math.stackexchange.com/questions/321343/geometric-definitions-of-hyperbolic-functions?rq=1 , but no answer.
Comment: It's worth noting that the line tangent to the point with coordinates $(\cosh x, \sinh x)$ on the unit hyperbola has slope $\cosh x/\sinh x = \coth x$, echoing the fact that the line tangent to the unit circle at $(\cos\theta, \sin\theta)$ has slope $-\cot\theta$.
Comment: (Whoops, timed-out.) So, the line through the origin, *parallel* to that tangent line, meets the vertical line through the appropriate hyperbola vertex, at a point that *happens* to be $\coth x$ units away from the hyperbola's axis. There's a construction of $\coth$.
Answer: If you consider this alternative rendering of the circular trig diagram ...

... then there's this hyperbolic analogue:

In each case, the point where the inclined ray meets the curve determines sine and cosine, and the points where it meets the vertical and horizontal tangent lines determine tangent and cotangent. (In the hyperbolic case, the "horizontal tangent line" is actually tangent to the (invisible) conjugate hyperbola.)
What about the secant and cosecant segments? In the circular case, these are the portions of the inclined ray that form hypotenuses of the $1$-and-$\tan$ and $1$-and-$\cot$ right triangles. In the hyperbolic case ... well ... there don't seem to be direct analogues to the circular arrangement.
Edit (7 April, 2018). But, there is this:

Here, the (now-visible) conjugate hyperbola fittingly hosts the cosine as well as cotangent ... though not cosecant, which, like secant, is introduced via an interesting ---if non-obvious--- reciprocal construction. (In an arbitrary hyperbola, the construction relates two segments whose geometric mean is the conjugate radius.) Still, there's a nice balance across the two hyperbolas.
The hyperbolic figure isn't as identity-rich as its circular counterpart, but we see that it covers the essentials. For instance, we have
$$\sinh \cdot \operatorname{csch} = 1 \qquad \cosh \cdot \operatorname{sech} = 1 \qquad \tanh \cdot \coth = 1$$
the last of which is implied by similar triangles; similarity also yields
$$\frac{\tanh}{1} = \frac{\sinh}{\cosh} \qquad\qquad \frac{\coth}{1} = \frac{\cosh}{\sinh}$$
Moreover, since the hyperbola has equation $x^2-y^2=1$, we have these hyperbolic Pythagorean relations
$$\cosh^2 - \sinh^2 = 1 \qquad\qquad \coth^2 - \operatorname{csch}^2 = 1$$
while a guest appearance by the unit circle $x^2+y^2=1$ shows
$$\operatorname{sech}^2 + \tanh^2 = 1$$
Comment: +1 for the new diagram added on April 7th, 2018, almost five years after the initial post.
Comment: In the last paragraph, you'd said "and doesn't provide much guidance about the corresponding placement of sech"; on the bright side, at least {sec(x) = 1/cos(x)} sees analytic continuation to {sech(z) = 1/cosh(z)}. http://mathworld.wolfram.com/HyperbolicSecant.html
Comment: I've been looking into this lately, and I'm wondering if the best way to bring sech and csch into your second diagram is just to measure distances along the arm of the angle using a Minkowski metric instead of a Euclidean metric. Then all the same line segments can be used between the circle diagram and the hyperbola diagram, and you can even say the distance from the origin to the circle/hyperbola is always 1 in both cases.
Comment: @Blue ... FYI: I have put a version of the diagram onto [a t-shirt (via Teespring)](http://teespring.com/hyperbolic-trigonograph). (I'll delete this comment if there are objections.)
Answer: $$
\begin{align}
&\int_1^{\cosh(u)}\sqrt{x^2-1}\,\mathrm{d}x\\
&=\int_0^u\sinh(t)\,\mathrm{d}\cosh(t)\tag1\\
&=\sinh(u)\cosh(u)-\int_0^u\cosh(t)\,\mathrm{d}\sinh(t)\tag2\\
&=\frac12\sinh(u)\cosh(u)-\frac12\int_0^u\cosh^2(t)\,\mathrm{d}t+\frac12\int_0^u\sinh^2(t)\,\mathrm{d}t\tag3\\[3pt]
&=\frac12\sinh(u)\cosh(u)-\frac u2\tag4
\end{align}
$$
Explanation:
$(1)$: substitute $x=\cosh(t)$
$(2)$: integrate by parts
$(3)$: average $(1)$ and $(2)$
$(4)$: $\cosh^2(t)-\sinh^2(t)=1$
Consider the diagram

Subtracting the area of the violet region, which by $(4)$ is $\frac12\sinh(u)\cosh(u)-\frac u2$, from the area of the violet and green right triangle, which is $\frac12\sinh(u)\cosh(u)$, we get that the area of the green region is  $u/2$.
This is reminiscent of the situation with circular functions when the angle is measured by the area of its sector:
Comment: If you rotate everything by $45^\circ$, the integration becomes significantly easier, since the hyperbola becomes (a multiple of) $y=1/x$. See, for instance, [this answer of mine](https://math.stackexchange.com/a/757241/409), which scales lengths by $\sqrt{2}$ to provide a diagrammatic derivation of the exponential definitions of $\sinh$ and $\cosh$. (The answer also observes that measuring angles by twice the sector area is the key to bridging the circular and hyperbolic functions.)


What does 'That is' mean here?

Question: "Very sorry, sir. I didn't mean to, er..."
The embarrassment was still reddening Jackson's cheeks when he found the paper-knife at the bottom of the case.
"I think I'd better keep this though, if you don't mind, that is, sir."
Answer:
I think I'd better keep this though, if you don't mind, that is, sir.

That refers to the suggestion of keeping this; the sentence could be rewritten as

If you don't mind, sir, I think I'd better keep this.

The reference to "sir" not minding comes as an afterthought after the suggestion. The person doesn't seem to be too sure of himself while speaking, and when he suggests keeping "this", he immediately thinks of adding that his suggestion is subject to the approval of the person he's talking to. This construction is quite common:

Maybe we should attack right away, if you approve, that is, commander.
  This would make a perfect gift, if you agree, that is, milady.
Comment: I agree about the afterthought, but I strongly disagree that _that_ refers to the suggestion, or to anything else. As in the reference given by Andrew Lasher in his answer, _that is_ is an idiom. If you claim that _that_ refers to something, you'll need to explain what _is_ is doing.
Comment: @ColinFine I'd think _is_ is simply existential: _that suggestion is made (exists) on the premise that you don't mind_.
Answer: At dictionary.com, that is definition 16 under the idioms. The sentence you use just changes the word order a bit, but it is explaining, clarifying or giving more information.  If we simplify the word order, it would be as follows:

I think I'd better keep this though, that is if you don't mind, sir.

The person is clarifying their intent to keep the knife, they will keep it only if Jackson doesn't mind.

What does 'That is' mean here?


How is Big Bang as a starting point possible?

Question: I have a man-in-the-street question that was probably "predetermined".
If everything around us is co-interacting particles whose source is some infinite small point that started their expansion into nothing due to the Big Bang, how come those particles have any interactions? They should become further with every second, just as grenade fragments that can only meet each other after the explosion only if there are some external preexisting obstacles on their way that cause their bounce.
Comment: Although this comment's too vague to serve as an answer, my impression's that the Big Bang concept has, except within the "local universes" of a "multiverse", been dealt a death blow by the discovery of new galaxies thru the James Webb Space Telescope, which are covered in many YouTube videos at various levels of sophistication.  One possible exception, that's applicable to a "single universe" by application of the "Weyl Curvature Hypothesis", is Roger Penrose's much-discussed "Conformal Cyclic Cosmology", that has endlessly (and beginning-lessly) iterations (AKA "past- & future-eternality).
Answer: The main reason that some of the initially separating particles came back together is their mutual gravity. Within some parts of the expanding universe, the density of matter was high enough that gravity stopped the expansion. These regions collapsed under their self-gravity to (eventually) form galaxies. Everything around you formed inside a galaxy.
Answer: At the beginning, those particles were indeed interacting fiercely with one another but the energy they carried was sufficient to propel them apart.
At the same time, gravity was trying to bring them back together, but it was too weak then to do the trick.
Note that as the original particles expanded freely, they were cooling off, and at some point their initial energy was diluted enough by expansion that gravity could take (feeble) hold and begin very gently urging them into clumps.
The weakness of gravity meant that this initial clumping required something like a hundred million years to produce goodly-sized clumps. These were destined to later form black holes, galaxies, and stars.


Research at Public University vs Private University: A perspective for a data science enthusiast!

Question: I'm wondering about the difference between public and private universities in terms of the research explorations a professor doesn't mind their students working on. In my case, it turned out to mean that I cannot work on my interests alongside my professor's. I have industry experience and private university professors who know otherwise about my multi-tasking. This has to do with the differences between being a researcher in data science and being a data scientist. I was sure that academia would be a safe space to explore such differences, especially given that a professor showed interest in considering working with me knowing my background and research interests. The fact that I wasn't able to work on research into neural networks alongside its outcome-driven progress in another area of interest reminds me of what I've read about the 80's wrt artificial neural networks research. What are the criteria for being able to work on related problems at once if the fact that I worked for a public university was the only difference between whether or not I was able to work with this professor who didn't mind simultaneous mathematical explorations?
Comment: Both public and private universities range from the very best (e.g., Harvard and Berkeley) to the purely teaching oriented at the community-college level. There is nothing useful you will get if you ask about differences between such diverse groups.
Comment: Would I be right in guessing that your experience is based on a very small sample size?
Comment: There are good groups turning out good students at either.
Comment: Will be quite different state to state as well.
Comment: The sample size was intentionally restricted to the groups I have interacted with at Public universities. Most of the people at the lab in the public university work on their area(s) of interest more than me, the data scientist trying to help them with work on neural networks that relates to their area of interest as a great application area for me.
Answer: By "creating research directions for its students" I suppose you mean the success of faculty in suggesting and supporting research topics that turn out to be approachable and/or impactful.
I don't think there is any distinction between public and private universities that would significantly influence this one way or the other.  It would have much more to do with the particular faculty member involved.  The university as a whole has very little influence on how faculty work with students on a day-to-day basis; it is largely up to the individual professor's experience, advising style, skills, etc.
There could be university-level aspects that have some broader effect: available internal funding and research support, priority that faculty are expected to place on student research mentoring, emphasis on quantity versus quality of publications, and so on.  But private and public universities can both be all over the spectrum in any of these respects, and systematic differences in one category of the other are fairly minor in comparison to the individual variation.
Comment: I think it might be related to data scientists being able to interact with scientists from other disciplines based on the factors that were brought up here.
Comment: I have since modified the question a little bit. If you can spare the time, I'd like to hear about what you might have to say wrt the modified question.


"New request is not allowed to start because it should come with valid transaction descriptor" using linked server

Question: I have a simple query in a stored procedure that LEFT JOINs a local temp table with several tables across a linked server (the same linked server).  This query is resulting in the following error:

Msg 3989, Level 16, State 1, Line 1
New request is not allowed to start because it should come with valid transaction descriptor.

The stored procedure is called by a .NET application.  The temp table is populated with values from an OPENJSON operation to deserialize a NVARCHAR(MAX) input parameter.  The deserialization works just fine and the temp table is populated with the correct values at the time the problematic query begins execution.
Here is the relevant code:
DROP TABLE IF EXISTS #t;
CREATE TABLE #t (
    Balances VARCHAR(255),
    [Cost Centers] VARCHAR(255),
    Days VARCHAR(25),
    Measures VARCHAR(255),
    Operations VARCHAR(255),
    Paycodes VARCHAR(255),
    Periods VARCHAR(255),
    Products VARCHAR(255),
    [Reason Codes] VARCHAR(255),
    Scenarios VARCHAR(255),
    Data NUMERIC(18,6),
    ID VARCHAR(500)
);

INSERT #t
(Balances, [Cost Centers], Days, Measures, Operations, Paycodes, Periods, Products, [Reason Codes], Scenarios, Data, ID)
SELECT
Balances, [Cost Centers], Days, Measures, Operations, Paycodes, Periods, Products, [Reason Codes], Scenarios, Data, ID
FROM OPENJSON(@Data)
WITH (
    Balances VARCHAR(255) N'$.Balances',
    [Cost Centers] VARCHAR(255) N'$.CostCenters',
    Days VARCHAR(25) N'$.Days',
    Measures VARCHAR(255) N'$.Measures',
    Operations VARCHAR(255) N'$.Operations',
    Paycodes VARCHAR(255) N'$.Paycodes',
    Periods VARCHAR(255) N'$.Periods',
    Products VARCHAR(255) N'$.Products',
    [Reason Codes] VARCHAR(255) N'$.ReasonCodes',
    Scenarios VARCHAR(255) N'$.Scenarios',
    Data DECIMAL(18,6) N'$.Data',
    ID VARCHAR(500) N'$.ID'
);

SELECT *
FROM #t i
LEFT JOIN dbo.syn_adp_ds_scenario s ON i.Scenarios = s.Scenario
LEFT JOIN dbo.syn_adp_ds_scenario sa ON i.Scenarios = sa.Alias
LEFT JOIN dbo.syn_adp_ds_period per ON i.Periods = per.Period
LEFT JOIN dbo.syn_adp_ds_balance b ON i.Balances = b.Balance
LEFT JOIN dbo.syn_adp_ds_product p ON i.Products = p.Product
LEFT JOIN dbo.syn_adp_ds_product pa ON i.Products = pa.Alias
LEFT JOIN dbo.syn_adp_ds_costcenter c ON i.[Cost Centers] = c.CostCenter
LEFT JOIN dbo.syn_adp_ds_costcenter ca ON i.[Cost Centers] = ca.Alias
LEFT JOIN dbo.syn_adp_ds_paycode py ON i.Paycodes = py.Paycode
LEFT JOIN dbo.syn_adp_ds_paycode pya ON i.Paycodes = pya.Alias
LEFT JOIN dbo.syn_adp_ds_reasoncode rc ON i.[Reason Codes] = rc.ReasonCode
LEFT JOIN dbo.syn_adp_ds_reasoncode rca ON i.[Reason Codes] = rca.Alias
LEFT JOIN dbo.syn_adp_ds_operation op ON i.Operations = op.Operation
LEFT JOIN dbo.syn_adp_ds_account a ON i.Measures = a.Account
LEFT JOIN dbo.syn_adp_ds_account aa ON i.Measures = aa.Alias
LEFT JOIN #day da ON i.Days = da.Day;

(Note the SELECT * is for debugging purposes, the production query specifies columns but the error does exist in either situation.  Also, the JOINS as shown use synonyms to the linked server objects but the error still exists if I use the fully qualified server.database.schema.object notation.)
I have seen several posts about a similar error being resolved by updating .NET in the application or setting something additional in the connection string but I can reproduce the error in SSMS independent of the application code.
I've seen several other posts where others have run into this due to time outs on the remote side so I have tried rebuilding all indexes for all tables and updating statistics on all tables in the remote database.
I have also tried creating a temp table for one of the JOINs, populating it with a separate query across the linked server and then using the temp table in the JOIN instead of using the linked server directly.  This did not help either.
Something else I found is that if I reduce the number of JOINs in the query I do not get the error.  If I comment out 3 of the JOINs the query returns successfully with the correct results.  It also does not matter which JOINs I comment.  I can comment out any of them and as long as there are no more than 13 JOINs the query returns.
The production query will run in a transaction which I originally thought might have something to do with it.  I do have XACT_ABORT set to ON, but I commented out the transaction and the error persists.
I use this same pattern in several other stored procedures and they are all working fine with as many as 20 JOINs.  The only difference other than the specific tables is that all of stored procedures that work fine operate solely on local databases.  The one with the error is the only one that uses a linked server and that is the only difference in the stored procedure.
Has anyone seen this before?  Is there a linked server or provider limitation here that I'm not aware of?  Or is there a setting I can configure or tune?
Local server is SQL Server 2017 Enterprise on Windows Server 2012 Standard
Remote server is SQL Server 2017 Standard on Windows Server 2016 Standard
Linked Server Config:

Product = SQL Server (Microsoft OLE DB Provider for SQL Server)
Collation Compatable = false
Data Access = true
Dist = false
Pub = false
RPC = false
RBC Out = false
Sub = false
Connect Timeout = 0
Collation Name = NULL
Lazy Schema Validation = false
Query Timeout = 0
Use Remote Collation = true
Remote Proc Transaction Promotion = true

EDIT
I was able to work around this for now by removing the redundancy in the JOINs (when having 2 JOINs to the same table).  This reduced the number of JOINs and it's now working.  But we make heavy use of linked servers so if anyone does know the answer here I'd still love to see.  I am going to try and see if the issue is maybe locks on the same table from multiple JOINs to the same table or something like that.
Answer: I had similar problem and worked around it by using TSQL OpenQuery instead.
See also Linked Server in SQL Server, the good, the bad, and the way to make it perfect.


Why is null in JavaScript bigger than -1, less than 1, but not equal (==) to 0? What is it exactly then?

Question: From the Google Chrome console:
var x = null;
undefined
x > 0
false
x < 0
false
x > -1
true
x < 1
true
x == 1
false
x === 1
false

Comment: Note `null >= 0`, etc. is true
Comment: Even more strangely, `null <= 0` is true, but both `null < 0` and `null == 0` are false
Comment: Not a number, so the assessment is inherently false?
Answer: When you compare null for equality to 0, the result is false. If you force null to be interpreted in a numeric context then it is treated like 0 and the result becomes true.
You can force it to be numeric by putting + in front, or by using numeric operators like <, <=, >, and >=. Notice how null >= 0 and null <= 0 are both true.
> null == 0
false
> +null == 0
true
> null >= 0
true
> null <= 0
true

The ECMAScript Language Specification defines when a so-called "ToNumber" conversion is performed. When it is, null and false are both converted to 0.

§9.1 Type Conversion and Testing:
Table 14 — To Number Conversions

Argument Type     Result
-------------     ------
Undefined         Return NaN
Null              Return +0
Boolean           Return 1 if argument is true. Return +0 if argument is false.
Number            Return argument (no conversion).
String            See grammar and note below.

Knowing when the ToNumber conversion is applied depends on the operator in question. For the relational operators <, <=, >, and >= see:

§11.8.5 The Abstract Relational Comparison Algorithm:
The comparison x < y, where x and y are values, produces true, false,
  or undefined (which indicates that at least one operand is NaN). Such
  a comparison is performed as follows:

Call ToPrimitive(x, hint Number).
Call ToPrimitive(y, hint Number).
If Type(Result(1)) is String and Type(Result(2)) is String, go to step 16. (Note that this step differs from step 7 in the algorithm for
  the addition operator + in using and instead of or.)
Call ToNumber(Result(1)).
Call ToNumber(Result(2)).

The == operator is different. Its type conversions are described below. Notice how null and false follow different rules.

§11.9.3 The Abstract Equality Comparison Algorithm
The comparison x == y, where x and y are values, produces true or
  false. Such a comparison is performed as follows:
1. If Type(x) is different from Type(y), go to step 14.
...
14. If x is null and y is undefined, return true.
15. If x is undefined and y is null, return true.
16. If Type(x) is Number and Type(y) is String, return the result of the comparison x == ToNumber(y).
17. If Type(x) is String and Type(y) is Number, return the result of the comparison ToNumber(x) == y.
18. If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y.
19. If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).
20. If Type(x) is either String or Number and Type(y) is Object, return the result of the comparison x == ToPrimitive(y).
21. If Type(x) is Object and Type(y) is either String or Number, return the result of the comparison ToPrimitive(x) == y.
22. Return false.

If you read carefully you can see why false == 0 is true but null == 0 is false.

For false == 0, Type(x) is Boolean. This means Step 18's type conversion is applied, and false is converted to a number. ToNumber(false) is 0, and 0 == 0 is true, so the comparison succeeds.
For null == 0, Type(x) is Null. None of the type checks match so the comparison falls through to Step 22, which returns false. The comparison fails.
Comment: If someone does not know `null >=0`; that could lead to some very troubling bugs. Suppose one allowing a user to do something when their balance is greater than zero; but got null for some reason from API; & they did not check for null (` x != null`)
Answer: null casts to 0 as a number: (+null) is 0. > and < cast null to this value, so when compared to numbers it acts as zero. == doesn't cast null to a number, so null == 0 is false.
Comment: Yes - + can be used to quickly cast things to numbers: `(+new Date())` is a common trick to get millisecond time. For instance, `4 + '4' = 44`, while `4 + (+'4') = 8`


How to Handle Two-Center Bipolar Coordinates?

Question: In my problem, I want to integrate a $2D$ function $f(x,y)$ which explicitly depends on the vector $ \vec{r}_1=\vec{r}-\vec{R}_1 $ and $\vec{r}_2=\vec{r}-\vec{R}_2$, where $\vec{R}_1=(a,0)$ and $\vec{R}_2=(-a,0)$ are two fixed points. I found that the two-center bipolar coordinate maybe helpful which you can find some information about it here in Wikipedia.
However, I am not clear how to apply the integration exactly. The question is general (and maybe stupid): Since the two coordinate $r_1$ and $r_2$ are not orthogonal, would there be any problem when doing the change of variables $(x,y)$ to $(r_1,r_2)$?
Furthermore, how to express differential operators, like gradient, curl, in the new coordinates?
Any useful reference are welcome.
Answer: For such a function elliptic coordinates might be better suited since they are easy enough to handle, orthogonal and better described on the Internet.
As for gradient, curl etc., see this page: Differential operators in three dimensions


What is a good name for a character who loves money?

Question: His name is going to be Mr. Price. What should his first name be?
Comment: Welcome to Writers.SE! I'm sorry; Writers.SE doesn't accept questions which ask the community to make story choices for writers. We handle Q&A, but this type of question has no "good" or "bad" answers, only arbitrary opinions, and it is so specific it will not be useful to other users. If you'd like to learn more about Writers.SE and what types of questions are appropriate here, take a look at our [site tour](http://writers.stackexchange.com/tour) and our [on-topic summary](http://meta.writers.stackexchange.com/questions/875/writers-se-on-topic-summary).
Comment: Did his parents already knew he would grow up to be a capitalist? Unless you want your character to be a parody, too obvious names are really stretching the suspension of disbelieve (Nicknames they acquired *because* of their main character traits are of course an exception).
Comment: This question appears to be off-topic because it is a brainstorming/"what-should I write" question.
Comment: I'd avoid giving characters names that too obviously describe them, unless the story is intended to be a comedy or a very blatant allegory. In real life, greedy people are not all named "Mr Cash", violent people are not all named "Mr Fist", etc., and seeing names like that in a story just seems ... silly.
Answer: Characters really ought to be multifaceted.  If the last name is "Price" exposing a facet of his personality, then the first name should be random (exposing nothing else) or about another characteristic.  Say, for instance he is loose with is money, "Lax Price" or tight "Hardy Price" or, perhaps, inconsiderate of the value "Shorty Price".
Now, going a non-money relationship, perhaps he's conniving and you want to be obtuse going off of "machinate" and call him, "Mack Price"... That's how I go about doing names... innuendo, abbreviation, and oftentimes reference to the latin/Greek/origin of the word -- Meet "Ergo Lars" (derived from "ergo" and "dol-lars"). ;)
Hope that helps!


Should I charge the Magic Keyboard 2 only when needed?

Question: I have a new Magic Keyboard 2 and I was wondering if keeping it connected all the time to the USB port can somehow damage the battery
Comment: What research have you done that has proved inconclusive?
Answer: In general, keeping it connected all the time will not damage the battery.  Apple has designed these peripherals to only accept a charge when it's needed.  When it doesn't need the power, it simply will not use it.
However, it's a good practice to periodically, every month or so, unplug the keyboard and let it run on its battery until it gets very low (below 10%) or stops working.  Then you can plug it back in and leave it alone while it charges.  Apple has a nice section on batteries and their maintenance here.
Answer: I believe Apple devices use 'smart' charging, where the device will only charge when it needs it, and won't be continuously subjected to charging (this only makes sense).  The energy needs of the device, above maintaining the battery, will most likely come through the power connection (charging cable).
But as for running the battery down low to preserve it?
That is a bit more dubious.

I believe the biggest question here is whether the device is EVER intended to be used intermittantly or frequently disconnected from a power source (in other words: run off of the battery).
If the answer is 'no', then leaving it plugged in all the time will probably allow the battery to last the longest.

Remember, ANY rechargeable battery has a maximum or finite number of charge/discharge cycles.
If it's ALWAYS going to be tethered to power, there's no need to disconnect and discharge it (only to then reconnect and recharge it).  By doing that, you would DEFINITELY use another one of the (finite number of) cycles (and for no reason).
References to battery 'health' pertain only to batteries that will be regularly 'cycled'.
If the battery is not going to be cycled, then avoiding using up those discharge/recharge cycles will allow that battery to last longer than purposely discharging it for 'health'.
I have a Macbook from May 2012, with the original battery.
It's been tethered nearly permanently since then (only a few times running on battery during power failures, or accidentally knocking off Mag-Safe connector).
The Macbook  charge icon always shows 100%, and there're never any battery warnings.
(When the Macbook has very infrequently discharged and went low, it has always recharged back up to 100%; and that happened even within the last half-year... remember, the battery is going on 9 years old.)
I'm not sure of the algorithms used by Apple in determining 'battery health'.
It could be that one of them is simply a clock; if the battery is so many years old, or if the device has been 'on' for so many hours, it may flag it as needing replacement. Another algorithm could calculate the number of equivalent full cycles, and compare to a some finite assigned number to that battery.


Why choose anything but highest compression for PNG?

Question: I just installed LibreOffice for the first time. In the Impress
application for presentation slides, when I choose to save an image on
a slide, the file type is PNG and there is a slider for compression,
positioned approximately midway at 6. Internet searching reveals that
PNG compression is nonlossy.  Why would anyone choose anything but the
highest compression?
Answer: Simply because the highest compression typically is significantly more CPU-intense (it tries out multiple different approaches to represent successive lines).
This really shouldn't make much difference on a modern PC for saving a few images. Then again, in practice, libpng seems to be pretty slow, so this might make a difference, especially for people working on older devices.
Comment: OK.  Thanks.  I'll stick with the default middle-of-the-road.  I can't upvote, and I need 5 minutes to accept the answer, apparently.
Answer: Lossless or non-lossy compression is, by nature, a bijection between "a raw data" and a "compressed binary". The fundamental consequence is that it CANNOT compress every file.
In other words: suppose we consider all possible 3 MB binary files. No lossless compressor can effectively compress all files to a smaller size. There are several way to fathom this assertion.
One is to realize than you cannot fit 45 socks in 44 drawers with every sock remaining single.  THere is no bijection for a finite set onto a strict subset. This concept is SO fundamental that it can be used to define infinity: a set is infinite if and only if it be in bijection to a strict subset.
Another is: suppose that you have a compressor that can reduce the size of every file. Then, if you apply it again, we could shrink the initial file, bit after bit, to a zero-sized file. Unlikely.
This means that lossless compressors have a limited range of action. Yet, a lot of nature- or man-created files (sounds, pictures) have a structure, some predictability. This depends a lot on their acquisition, etc. However, it is generally admitted that classically, you can compress files like images and sounds by a factor from $3/2$ to $3-4$ at most (we can debate other that), this is what you can get with FLAC, APE, PNG, etc.
You can achieve a better lossless compression by fine tuning prediction, packing, etc. at the price of more computations, and that other "more random" files will be inflated. But around halving the size of a file, fine tuning can improve a bit, but not that much. For a practical point of view, compressing a 3 MB by about 2, to 1.5 or 1.4 MB (6.6% imporoved) does not change your life a lot, nowadays. It used to in the past, when we had 1.44 MB floppy disks. But now, for small files, it is not a game changer. So:
Why would anyone choose anything but the highest compression? > Because this is not much difference
However, in massive data applications, where HPC and memory cost a lot (in energy, price, CO2), saving 7% more of data can be useful, or save tons of Watts, hydrocarbons or money. Using compression not only as an end-storage  format, but to alleviate transmission, visualization, management, and even processing is becoming a trendy topic.
There is for instance a resurgence of lossless compression effort in HPC simulation because giga-models are becoming increasingly costly. But the challenge differs from multimedia data: there are more heterogeneous, bigger, etc. [Shameless plug: our current line of research for 3D hexaedral meshes, called HexaShrink]


How could i calculate the voltage induced in a detector circuit by picking up RF signals from a Mobile phone?

Question:
Is there any formula/equation i could use to estimate the voltage induced at the input from the RF signals?
Comment: What antenna? What frequency?
Answer: This circuit depends on the MOSFETS, in the first differential pair of the CA3130, acting as rectifiers albeit not very good rectifiers, because the fundamental MOSFET bandwidth depends upon channel-spacing from source-to-drain but the rectification depends upon the junctions of the MOSFET, such as the source-bulk isolation-junctions and not on the channel-spacing.
And the part number ---CA3130--- is a part number from the 1970s (thus 40+ years ago). To presume the same process is used today is not a good presumption.
Summary ---- you are asking about the UHF (30-300MHz) and SHF (300 to 3,000MHz) rectification efficiency of isolation-diodes of unknown doping profile and of unknown biasing condition (both voltage and idling currents).
Answer: no.


Objects not showing in viewport on Solid view

Question: Greetings fellow blenders.
I got tired of looking around for a fix and writing here is my last resource. I updated Blender from 2.80 to 2.81, and surprise: All objects in the viewport are displaying transparent in both eevee or Cycles. I am able to select them, and the outline of them shows up (see images for reference). Here is the strange thing, even the start up document (the general default with the cube) opens messed up.
That is in object mode. Whenever I change to edit mode, the object appears and shows correctly (see image)...
I was thinking maybe it was related to the fact Blender 2.81 might no longer support my video card, but how come it shows using edit mode?
Am I missing something here?
Images for reference:
Answer: Have you tried updating your GPU drivers? If not, try doing it. I can't think of anything else than old drivers. If that doesn't help you - you can try installing blender again. If that doesn't help too, go and report it here. It can be a bug.
Comment: Thanks for the input. Going to report it as well.
Answer: I had a similar problem when at objects with two materials attached to different faces, those faces got invisible in solid mode, while being selectable and showing up in rendered(Cycles) mode. Only in 2.81, not in 2.80. Solution: new graphics card capable of OpenGL >3.3.
Another problem occurred simultaneously, but with different reason: some objects shaded completely transparent, making other objects behind them also transparent. This could be solved only by re-modelling the objects and creating a new material.


I was never sent an e-mail verification e-mail for Pokemon Go. Is that going to be a problem?

Question: This is my second time creating a Pokemon Go account through Google. My first account stopped working after about 2 days. I tried to figure out why that happened and a friend asked if I had verified my e-mail account. But I never received an e-mail from Pokemon Go requesting verification. And, on the second time around, I have again not received that e-mail. Will that be an issue?
Comment: What do you mean by your account stopped working?
Answer: I didn't receive a verification when loggin in with google and I don't think anyone else did.


What things do I need to become expert ASP.net MVC

Question: I graduated in computer science. I had pretty good knowledge in Java. I have about a year experiences in ASP.net C# Web form. What other things do I need to know if I want become expert in ASP.net MVC which I able to do a complex eCommerce website?
Answer: If you really want to become an expert in ASP.NET MVC, you'll first need to understand exactly what the MVC pattern is, how it's implemented in this case.
Next, I would get your head around stuff like:

The ASP.NET MVC routing engine - in particular, I'd look at how you can extend it!
How the framework passes parameters to your actions and how it decides which values to assign to which parameters and such
How the strong typing of parameters works, especially with reference types - this is quite a cool feature of ASP.NET MVC
How to implement form and model validation - look at the the client-side scripting that the framework generates for form validation and other stuff
Loosely- and strongly-typed views their partial counterparts
What kinds of data types the framework can send and receive, and how to do that
Error/exception handling - the way this is done in ASP.NET MVC is quite different to any other framework I've experienced
How ASP.NET MVC plays with tools like Entity Framework and LINQ-to-SQL
How Javascript (and jQuery\prototype\other) work with the framework and vice versa - in my experience, they work quite nicely together

Once you've really got your head around these things, the rest is pretty much like any other implementation of the MVC pattern.
As a side note, spend some time learning the Razor syntax. It won't be anything particularly new if you already know Java (and presumably C#), but I always find myself forgetting little things with it!
If I've missed something crucial, add it to the list!
Comment: @andybursg even i am at a learning curve of MVC and your answer is even more useful first to me(+1 for that) and then OP :)
Comment: ASP.NET ships with jQuery, I would suggest that understanding how ASP.NET uses jQuery for core elements like client side validation, as well as the concept of progressive enhancement would be useful.
Answer: start from having a basic knowledge of M V C. go through exhaustive tutorial series.What actually they are i.e M, V & C.
you should implement which kind of code How and where.
Go through exhaustive tutorials available here. Watch Videos Available for making the concept clear by watching them implemented here
Get the more insights of MVC by watching some more advanced and detailed videos over here.
Download Sample MVC Applications from asp.net MVC site and try to observe the convention which is followed in those application
i will personally advise you to make sample applications along when you complete learning a concept
of course it will take time but learning is something which should be given time.
Comment: +1 for the fantastic tutorials provided. The PluralSight ones are fantastic!
Answer: In my opinion, what is your main purpose of your project, is that to conquer a very complex eCommerce website, if so, you should try another server side technology like JSP, Django or Ruby on Rails. They are more suitable. ASP best appropriate for small and medium project.
If you still decide to learn ASP.NET with MVC Pattern.
First, you should understand basic info about HTML, CSS, XML (if any), Client Side Scripting like JavaScript (these are the very important thing you need to know about web technology).
And then, you should know about MVC Pattern (supposed you know basic about ASP.NET) You can loo kup more closely the MVC Pattern in any Design Pattern Books to understand how it works.
After that, you should try to take part in more and more projects, with real practice, you gradually become an expert in ASP.NET. Just remember: "Practice makes perfect"
Comment: "you should try another server side technology like JSP, Django or Ruby on Rails." That he did not ask!


jquery URL driven content management

Question: So I am very new to jquery and need some help on a little project. Perhaps there is a script already in existence that I could use, if not I am hoping to find some direction.
I have found a few URL parsing scripts that allow me to dig through the query string and capture the value. Now what I want to do is take that variable and have it define what content is rendered on the page.
Here is an example, www.site.com renders normal site. But www.site.com/m/default.aspx?img=img1 would hide a parent div that contains all the sites content and .show a hidden div containing a supplemental image. But, www.site.com/m/default.aspx?img=img2 would show an alternative div with yet another image.
Seen something like this done before? Any resources that might help me out?
Thanks a million to all and any that help.
-Travis
Answer: I have written some code, I hope this solves your problem: http://jsfiddle.net/fNjCk/
And yes,i do like nyan nyan cat :)

jquery URL driven content management


windows 2000 DNS to windows 2003 DNS **NO AD INVOLVED**

Question: I've been looking for some best practice instructions on how to do this, but everything I have found thus far refers to an internal/AD-based DNS migration. This project is public-based DNS, no AD, primary DNS hosting is on Windows 2000 and I want to migrate it to Windows 2003 (secondary DNS is already Windows 2003.) At the moment, there are nearly 300 zones (domains) in the hosting environment. Thanks in advance.
Answer: Here's a way you can do it. It's old school and may not be the best method but it will work:
Since your current DNS is not AD integrated that means that all of the zone files are stored at %systemroot%\system32\dns. Copy all of the zone files on the old DNS server to the same location on the new DNS server. On the new DNS server create new non-AD integrated zones with the same names as the zones on the old server (which will be the same name as the filenames, such that: a zone named test.local will have a zone file named test.local.dns, just leave out the .dns when you're naming your zones), select the option to use an existing zone file (rather than creating a new zone file) and the DNS server will create a new zone from the file with all of the records intact.
Try it with a single zone file as a test and see if it works for you.
Answer: If your secondary already is running Windows 2003, and all the domains are setup then all you should have to do is switch your 2003 'secondary' server to primary for all the domains.  Reinstall or replace your Windows 2000 server, and then set the new server up as a secondary.
Comment: Thanks for the heads-up, but that's not the current plan. In short, server B (the Win2003 secondary DNS server) is to remain "untouched" as part of the project. Basically, the only two players are server A (the current Win2000 primary DNS server) and server C (the new Win2003 sitting, waiting to become the primary DNS server.) Again, thanks for the note, but any advice you have for my scenario would be great.

FYI: In short, server B cannot be "bothered" as it's doing secondary things, and has to remain doing them, during this migration process.
Comment: Can you setup a third server temporarily?  Setup a third server, set it to be secondary for everything.  After the zones are replicated  Reinstall/Replace original server.  Set it up as secondary for all the zones, after zones are transfered, switch the new server up as primary and remove the temporary box.
Comment: I can't. I also forgot to mention that server A goes away completely after this mess. It won't remain as part of the equation.
Comment: So where have I lost you?  The point is you can simply switch a zone from secondary to primary.  If all you are worried about is DNS, then just figure out the best order of events in your situation that allows you to roles.
Comment: Well, apparently I lost you somewhere along the way:

1) Current Primary DNS is a Windows 2000 Server box. This box is going away, for good.

2) The new Primary DNS environment is a Windows 2003 Server box. It is currently doing NO DNS related activites.

3) The current Secondary DNS environment is a server that will not be touched as part of this project.
Comment: So, I guess the initial question remains. Looking for steps for migrating a primary DNS hosting environment from one server to another, where the current environment is Windows 2000 and the new environment is Windows 2003. Currently, secondary DNS server will not be touch. Current primary DNS server goes away. No spare box around for temp box inclusion solutions. Hope that helps others in my quest for assistance.


What is the product of a Dirac delta function with itself?

Question: What is the product of a Dirac delta function with itself? What is the dot product with itself?
Comment: @crasic: Why doesn't it seem believable? Convolution with $\delta(x-x_1)$ is translation by $x_1$. Now for any function $f(x)$, compare $(f(x)*\delta(x-x_1))*\delta(x-x_2)$ with $f(x)*(\delta(x-x_1)*\delta(x-x_2))$.
Comment: product with itself / square http://mathoverflow.net/questions/48067/is-square-of-delta-function-defined-somewhere
Comment: @J. M.: To me *special functions* is something completely different - but I can not put my finger on exactly what special functions is.
Comment: @Rajesh D: Could you give more context? I have made an edit to explain that you cannot define $\delta^2$ meaningfully.
Comment: In the standard setup, neither of these is defined.  See http://en.wikipedia.org/wiki/Distribution_(mathematics) .
Comment: Is the tag  relevant?
Comment: You beat me to it TMC.
Comment: On a related note, does anyone know what the convolution of two delta functions is? Mathematica is telling me that $\delta(x-x_1)$ convolved with $\delta(x-x_2)$ is $\delta(x- x_1 - x_2)$, somehow doesn't seem believable.
Comment: Just Fourier transform the delta functions. The Fourier transform of a convolution is the product of the Fourier transforms of the convoluted functions. Then transform back.
Comment: @AD.: I don't think so, but maybe someone has a persuasive argument for retaining that tag?
Comment: You and me both, @AD. You and me both.
Comment: I have never seen special functions being used in this context. This is a pure question on distributions.
Comment: @Jonas: Okay, that makes three of us; I'm not sure about the other tag either, but what should this be tagged with?
Comment: @J.M.: Isn't distribution theory fine? Without any other context, I wouldn't know what to tag it with.
Comment: I want to create $\delta(t)$ such that the product with itself is also $\delta(t)$ and the innerproduct $\int_-\infty\^\infty \delta(t).\delta(t) \mathrm{d}t$ = 1. and retain all other properties of the usual $\delta(t)$.
Answer: A distribution is actually a linear functional on the space of compactly supported infinitely differentiable functions (the so called "test functions"). A function $f$ is compactly supported if $\overline{\{x : f(x) \neq 0\}}$ is compact (the overline denotes the closure).
The $\delta$-distribution is a linear functional such that for all $\phi \in C_c^\infty(\mathbb{R}^n)$ we have that $\langle \delta, \phi \rangle = \phi(0)$.
When you want to compute the product of distributions the problem is that you don't have a property which you would really like to have, that is associativity. So for distributions $\alpha$, $\beta$ and $\gamma$ we usually have that $(\alpha \cdot \beta) \cdot \gamma \neq \alpha \cdot (\beta \cdot \gamma)$. Wikipedia gives an example. However this does not really turn out to be a problem in applications. What we do have is convolution.
When we want to do convolution we prefer a smaller class of distributions (for example because on the smaller class the Fourier transform of a distribution in this class is again a distribution in this class). This actually has a rougher class of test-functions, as test functions here we take the Schwartz functions, that are the smooth functions of which the function itself and all its derivatives are rapidly decreasing. $f$ is said to be rapidly decreasing if there are constants $M_n$ such that $|f(x)| \leq M_N |x|^{-N}$ as $x \to \infty$ for $N = 1,2,3,\ldots$.
To begin defining the convolution we first define what the convolution of Schwartz-function is with a tempered distribution. Let $f$ be our tempered distribution, then we can show that the following definition actually makes sense:
$$\langle \phi * f, \psi \rangle := \langle f, \tilde{\phi} * \psi \rangle$$
where $\tilde{\phi}(x) = \phi(-x)$. Note that the RHS is well-defined. Convolution is a nice thing, we can see that if we start with a tempered distribution and convolute it with a test function, the result will be smooth.
Now, $L_1 * L_2$ is the unique distribution $L$ with the property that $L * \phi = L_1 * (L_2 * \phi)$. We can show that this is commutative.
Fine, now note that $\delta * \phi(x) = \phi(x - y)|_{y = 0} = \phi(x)$. So we see that $\delta * \delta = \delta$.
If you want me to comment on the dot product of distributions, you first would have to explain what you mean with that.
So far for this short digression on distributions.
EDIT: Okay, you want to compute $\delta^2$. Let $\phi_n$ be an approximation to the identity and let it converge to $\delta$ in the sense of distributions, but $\phi_n^2$ does not converge at all since the integral against a test function that does not vanish at the origin blows up as $n \to \infty$.
Comment: [Here](http://en.wikipedia.org/wiki/Dirac_delta#Translation) it is stated that: $\int_{-\infty}^\infty \delta (\xi-x) \delta(x-\eta) \, dx = \delta(\xi-\eta).$ Does the integral make the difference? Or the arguments of the two $\delta$s?
Comment: You don't multiply them in the same point.
Comment: @draks It is some kind of tensor product right?
Comment: What makes you think that? To me it looks like a "standard" multiplication...
Comment: OK, can I square $\sqrt{\delta(x)}$? Or better $\lim_{a \to 0} \sqrt{\delta_a}$, *e.g.* $\sqrt{\delta_a(x)}=\exp(-x^2/\color{red}{2}a^2)$
Answer: Here is a heuristic to suggest that it will be difficult to define the square of the delta function.
The Fourier transform has the property that it takes the convolution of two functions to the product of their Fourier transforms, and vice versa, ie, it takes the product of two functions to their convolution.
Remember that the Fourier transform of the delta function is the constant function($=1$). Now suppose that $\delta^2$ exists. Then its Fourier transform would be the convolution of two constant functions. Such a convolution would shoot to infinity at every point. Even the theory of distributions can't handle such kind of stuff. So how would you imagine the inverse Fourier transform of this? How would it make sense?
Answer: This answer is primarily to expand on this comment. From that comment and the following, it seems to me draks thinks of the delta as a function, and from the title, it seems the OP also does. Or at least, this was true at the time of posting the comment and the question respectively. Eradicate this misconception from your minds at once, if it is there. The delta is not a function, although it is sometimes called "Delta function".
Let me give you a bit of background, a little timeline of my relationship with the Delta.

I first heard of it from my father, a Physics professor and physicist, who introduced it to me as a function equalling 0 outside 0 and infinity in 0. Such a function seemed abstruse to me, but I had other worries up my mind so I didn't bother investigating. This is how Dirac originally thought of the Delta when introducing it, but, as we shall see, this definition is useless because it doesn't yield the one most used identity involving this "function";
Then I had Measure theory, and voilà a Dirac Delta again, this time a measure, which gives a set measure 0 if 0 is not in it, and 1 if 0 is in. More precisely, $\delta_0$ is a measure on $\mathbb{R}$, and if $A\subseteq\mathbb{R}$, then $\delta_0(A)=0$ if $0\not\in A$, and 1 otherwise. Actually, I was introduced to uncountably many Deltas, one for each $x\in\mathbb{R}$. $\delta_x$, for $x\in\mathbb{R}$, was a measure on the real line, giving measure 0 to a set $A\subseteq\mathbb{R}$ with $x\not\in A$, and 1 to a set containing $x$;
Then I had Physics 2 and Quantum Mechanics, and this Delta popped up as a function, and I was like, WTF! It's a measure, not a function! Both courses did say it was a distribution, and not a function, so I was like, what in the world is a distribution? But both courses, when using it, always treated it like a function;
Then I had Mathematical Physics, including a part of Distribution theory, and I finally was like, oh OK, that is what a distribution is! The measure and the distribution are close relatives, since the distribution is nothing but the integral with respect to the measure of the function this distribution is given as an argument.

In both settings, it is a priori meaningless to multiply two deltas. Well, one could make a product measure, but that would just be another delta on a Cartesian product, no need for special attention. In the distribution setting, we have what this answer says, which gives us an answer as to what the product might be defined as, and what problems we might run into.
So what is the product of deltas? And what is the comment's statement all about?
The answer to the first question is: there is no product of deltas. Or rather, to multiply distributions you need convolutions, and those need some restrictions to be associative.
The second question can be answered as follows. That statement is a formal abbreviations. You will typically use that inside a double integral like:
$$\int_{\mathbb{R}}f(\xi)\int_{\mathbb{R}}\delta(\xi-x)\delta(x-\eta)dxd\xi,$$
which with the formal statement reduces to $f(\eta)$. I have seen such integrals in Quantum Mechanics, IIRC. I remember some kind of spectral theorem for some kind of operators where there was a part of the spectrum, the discrete spectrum, which yielded an orthonormal system of eigenvectors, and the continuous spectrum somehow yielded deltas, but I will come back here to clarify after searching what I have of those lessons for details.
Edit:
$\newcommand{\braket}[1]{\left|#1\right\rangle}
\newcommand{\xbraket}[1]{|#1\rangle}$
I have sifted a bit, and found the following:

Spectral theorem
  Given a self-adjoint operator $A$, the set of eigenvectors $\braket{n}$ of $A$ can be completed with a family of distributions $\braket{a}$, indicised by a continuous parameter $a$, which satisfy:
  \begin{align*}
A\braket{n}={}&a_n\braket{n} && \braket{n}\in H, \\
A\braket{a}={}&a\braket{a} && \braket{a}\text{ distribution},
\end{align*}
  in such a way as to form a "generalized" basis of $H$, in the sense that all the vectors of $H$ can be written as an infinite linear combination:
  $$\braket{\psi}=\sum c_n\braket{n}+\int da\,c(a)\braket{a}.$$
  The set of eigenvalues (proper and generalized) of $A$ is called the spectrum of $A$ and is a subset of $\mathbb{R}$.

What happens to the Parseval identity? Naturally:
$$\langle\psi,\psi\rangle=\sum|c_n|^2+\int da\,|c(a)|^2.$$
So this "basis" is orthonormal in the sense that the eigenvectors are, the distributions have as product a family of deltas, or:
$$\langle a,a'\rangle=\delta(a-a'),$$
and multiplying the eigenvectors by the distributions also yields a nice big 0.
The famous identity I mentioned in the timeline above and then forgot to expand upon is actually what defines the delta, or at least what the QM teacher used to define it:
$$\int_{\mathbb{R}}f(x)\delta(x-x_0)=f(x_0),$$
for any function $f:\mathbb{R}\to\mathbb{R}$ and $x_0\in\mathbb{R}$. If the $\delta$ were a function, it would have to be zero outside 0, but I'm sure you know all too well that altering the value of a function in a single point doesn't alter the integral, and the integral in the identity above would be an integral of a function that is 0 save for a point, so it would be 0, and if $f(x_0)\neq0$ the identity wouldn't hold.
Notice how this formal statement is much like an analogous statement for Kronecker deltas:
$$\sum_n\delta_{nm}\delta_{nl}=\delta_{ml}.$$
Imagine taking this to the continuum: the sums become integrals, and what can $\delta_{nm}$ become if not $\delta(n-m)$? So the statement is just a formal analog of the true statement with Kronecker Deltas when going into the continuum. Of course, distributionally it makes no sense, nor in terms of measure.
I have no idea how integrals with two deltas may be useful, and I have found none in my sifting. I will sift more, and perhaps Google, and if I find anything interesting, I'll be back.
Update:
$\newcommand{\lbar}{\overline}
\newcommand{\pa}[1]{\left(#1\right)}$
I decided I'd just stop the sifting and concentrate on my exams. I googled though, and found this.
Another argument I thought up myself in favor of the statement is the following. Let $\phi$ be a functions. It is pretty natural to say:
$$\phi=\int_{\mathbb{R}}\phi(a)\delta(x-a)da,$$
since for any $x$ this yields $\phi(x)$. Now what happens to the $L^2$-norm?
$$N:=\|\phi\|_{L^2}^2=\int_{\mathbb{R}}\lbar{\phi(x)}\phi(x)dx=\int_{\mathbb{R}}\lbar{\int_{\mathbb{R}}\phi(a')\delta(x-a')da'}\cdot\pa{\int_{\mathbb{R}}\phi(a)\delta(x-a)da}dx.$$
The complex conjugation can be brought inside the first integral. Now to a physicist integrals that don't swap are evil, and we surely don't want any evil around, so we assume we can reorder the three integrals the way we want, and get:
$$N=\int_{\mathbb{R}}da\,\phi(a)\cdot\pa{\int_{\mathbb{R}}da'\,\lbar{\phi(a')}\cdot\pa{\int_{\mathbb{R}}dx\,\delta(x-a)\delta(x-a')}}.$$
Suppose the formal statement holds. Then the innermost integral yields $\delta(a-a')$, and the second innermost one yields $\lbar{\phi(a)}$, which then combines with $\phi(a)$ outside it to form $|\phi(a)|^2$, which integrated gives the $L^2$ norm of $\phi$, squared. If the statement doesn't hold, it seems unreasonable to think we can still get the squared norm out of that mess. So the statement must hold, otherwise the integrals won't swap.
Answer: I think the answer provided by Jonas is correct, but Jonas assumed "product" meant convolution as this is normally the only binary operation that usually make sense with the Dirac delta function.
So if by product you mean convolution then: δ∗δ=δ
If by "product" you meant point-wise multiplication, then the answer is: Undefined.
The usual approach is to treat δ as the limit of some nascent delta function.  See Delta Function for examples of these nascent delta functions.  So if you multiply two nascent δ functions and then take the limit, the result will vary depending on the particular pair of nascent δ functions selected.  In most cases the integral of the point-wise product  of two nascent δ functions is zero as the limit is taken, in some cases the integral is 1, in other cases the value of the integral tends to infinity as the limit of nascent δ is taken.
For example
If you multiply the rectangle nascent δ with the nascent δ that is a triangle pulse, then integral of the resulting cubic tends to zero as the interval tends to 0.  If you multiply the sinc version of the nascent δ with itself, then the integral is equal to the frequency of the sinc function.  In this case the integral tends to infinity as the frequency of the sinc function tends to infinity.
Because of this, the original answer given (The question makes no sense) is the best because the term "product" in its common meaning (e.g. point-wise multiplication of two functions) leads to contradictory results for the limit process.  Using the term "product" when you mean convolution (the only operation that  produces meaningful results) is at best confusing.


Angular momentum of a two-body system

Question: I'm confused on the concept of angular momentum a little bit. I understand that it is a vector which is equal to the cross product of the position and the linear momentum. But in the case of a two body system (e.g. star and planet or classical hydrogen atom) where both bodies orbit around the centre of mass of the system. My question is, in this case, is the angular momentum a property of the whole system or a property of each body?
Comment: An angular momentum can be assigned to each of these bodies. But the values depends on the frame of reference, since it's comprised of momentum and position. Adding these in a vectorial way then gives you the total angular momentum of the system. Note that there can be even an angular momentum for free particles if one chooses a frame of reference, whose origin doesn't coincide at any point with the trajectory of this point mass. The crucial thing is the conservation of angular momentum in every frame.
Comment: It depends on what you want to do in the math. So I would say that the answer is 'yes.' If I randomly want $x$ to be 5, I can say $x = 5$. It's just a matter of what you want to define (and what you define is based on what you think is important)
Answer: It is a property of each body and a property of the whole system, because it is an additive property: the kind of property whose total comes from the sum of the parts – like internal energy, kinetic energy, momentum, mass; and unlike temperature, internal pressure, stress.
In classical mechanics, rotational momentum is an additive property of any distribution of mass. Suppose you have mass within a volume element $\mathrm{d}\tau$, with density $\rho$. To define the rotational momentum of this mass element you need to (1) choose a frame of reference, so that you can meaningfully say what the position $\boldsymbol{r}$ and the velocity $\boldsymbol{v}$ of that mass is, and therefore calculate its momentum $\rho\boldsymbol{v}$; (2) choose a point $\boldsymbol{o}$ (at rest in that reference frame) as origin.
Then the rotational momentum $\boldsymbol{l}$ of that mass element in that reference frame with respect to that origin is
$$\boldsymbol{l} := (\boldsymbol{r}- \boldsymbol{o}) \land \boldsymbol{v}\rho.$$
To say that rotational momentum is additive, it means that if you have a distribution of mass $\rho(\boldsymbol{r})$ within a volume $V$, the total rotational momentum is the integral of the rotational momenta of the mass elements:
$$\boldsymbol{L}_V := \int_V \boldsymbol{l}(\boldsymbol{r})\, \mathrm{d}\tau =
\int_V (\boldsymbol{r}- \boldsymbol{o}) \land \boldsymbol{v}(\boldsymbol{r})\,\rho(\boldsymbol{r})\,\mathrm{d}\tau.$$
When you apply this formula to two or more point masses, it says that each mass has its own rotational momentum, and the two masses together also have a total rotational momentum, which is the sum of those of the two masses. So it is a property of the whole system and of each body.
If you're asking "where" the total rotational momentum resides, or "to which point it is attached", the answer is that it isn't really attached to any point; although it can be useful to think of it as attached to the centre of mass of the system. This fact is deeply connected with the Euclidean geometry of space in classical mechanics. In fact, the property of being additive makes no sense for vectors in general relativity: there, it's a problem to sum vectors located at different points, because you need to "move" them, keeping each parallel to itself, to a single point first. But space-time is not Euclidean in general relativity, and the result depends on the trajectories along which you "move" the vectors. So in general relativity it's less meaningful to speak of the total rotational momentum of the whole system (although you can use alternative concepts in special circumstances).
A thorough discussion is given for example in:

C. A. Truesdell: A First Course in Rational Continuum Mechanics. Vol. 1: General Concepts (2nd ed., Academic Press 1991), § I.8,

and, accompanied by historical remarks, in:

C. A. Truesdell: Essays in the History of Mechanics (Springer 1968), ch. V: Whence the Law of Moment of Momentum?.

Angular momentum of a two-body system


How to make mesh follow the shape of the ground plane

Question: How can I place this stone wall so that it would take the shape of the ground plane but would still look like a wall that goes around the house? Using shrinkwrap modifier makes the mesh flat for some reason.
Comment: How did you make this mesh? Did you use a curve? Is the wall's bottom surface flat, before your desired deformation?
Answer: You can bake Displacement from terrane and apply Displace Modifier on your wall.

Bake Displacement by set up shader to present highest and lowest point, black as lowest and white as highest. You can Greater/Lesser Than in Math node to find highest-lowest point then use that value in Map Range node in Min/Max. Then bake as Emit.

Find highest point with Math node (left). Ready to bake (right). Image after bake (top-right)

Create new UVMap for use with Displace Modifier. Unwarp your model from top (numpad7) select Project from View. Then create
new Shader with this UVmap and image from baking, align UVmap to match with terrane on back.

Align UVmap to match black/white on terrane (left). Unwarp from top view (right).

3.Add Displace Modifier to your model with these setting

Coordinates: UV
UV Map: UVMap(from 2.)
Direction : Z

Then move your model to sit tight with terrane, adjust Strength in Displace Modifier to match surface. Use Solidify or Smooth modifier if it look messy.

A torus from bottom (top-left). Place a torus on terrane(left).
PS. If you need more detail about baking Displacement check out this video from Default Cube.
Comment: Thank you for your detailed reply!
Answer: two ways to do that
1.if it's lowpoly.
then copy the cycle line of the bottom(as Cyc),duplicate and seperate it,change a little shape of Cyc as you wish to make it looks real.
Cyc use shrinkwrap to the ground.
linebridge Cyc and the buttom cycle of the wall.
2.if it has many many vertice,I mean it contains many different rocks.
make a bottom cycle box of the wall,add particleSystem.
creat some rocks by Rock Generator,and add the rocks to the particleSystem.


Rotation of rectangles offsets render position

Question: I have an unknown number "Bricks" that must follow a straight, but not always level, path. Each brick is rotated around one central point properly to form a shape of intersecting paths. My problem arises when rendering an image for a rotated brick. By rotating an image the width and height are changed thus altering the relative render point (top left, x/y). I need to find out what render offset would be necessary to make sure each brick is an equal relative distance from the center rotation point. I am using MonoGame (XNA) if that matters, but I don't currently have any code worth sharing (I need to understand this concept before anything else is worth coding). I hope the following image helps to visualize my problem. The example uses 3 bricks but that won't always be the case.
https://i.stack.imgur.com/rO4IT.png
Comment: I'm a bit confused how you're rendering the bricks. Are they pre-rendered sprites of the box rotated to the correct orientation—or are they procedurally generated?
Answer: I haven't tried monogame yet, and mostly work in XNA. However, I'm still pretty sure this also applies to monogame.
Consider the following function (It's built into XNA and monogame):
public void Draw (
     Texture2D texture,
     Vector2 position,
     Nullable<Rectangle> sourceRectangle,
     Color color,
     float rotation,
     Vector2 origin,
     float scale,
     SpriteEffects effects,
     float layerDepth
)

As you can see, this function takes a float for rotation (in radians) and a vector2 for origin, as well as a texture2D and position. Of course, some other things like potential effects, but those are not important right now.
Using this function you can draw a texture2D. Let's say this texture2D of a brick is 20 pixels wide and 10 pixels high. You want to rotate your brick 60 degrees (or 1/3 * Pi), so that's what you fill in for "rotation". The vector2 "Origin" determins the point around which you'll rotate your texture. If you fill in new Vector2(10,10), the rotation point will be the bottom center of the brick.
The fun thing about a vector2 for position is that the ORIGIN of the texture2D will be drawn at this position. So you won't have to worry about finding the topleft coordinate.
You can find this function in the spritebatch class.
Comment: Thank you very much! This will work beautifully. I am still curious as to what the math is, so if anybody does figure that out I would be interested to hear it.


Clearance Gem | Expire a Session after Closing the Browser in Rails 5?

Question: How do I automatically sign out when the user closes the browser ? Is there any configuration changes in clearance gem that would enable this.
Comment: did you solve it?
Answer:
Create A Cookie - Create or set a cookie on user machine having cookie
  name, cookie value and the time when cookie should get deleted
  automatically (EXPIRES atribute, this is optional). If this is not
  specified the cookie is called a session cookie and it expires (gets
  deleted) when user's session ends, i.e. when the browser is closed

Source
In other words, if you don't set an expiration date on a cookie, it should "expire" when the browser is closed.
I've never used Clearance, but the ReadMe shows this configuration option in /config/initializers/clearance.rb:
<code>Clearance.configure do |config|
  config.allow_sign_up = true
  config.cookie_domain = ".example.com"
  config.cookie_expiration = lambda { |cookies| 1.year.from_now.utc }
  config.cookie_name = "remember_token"
  config.cookie_path = "/"
  config.routes = true
  config.httponly = false
  config.mailer_sender = "email@example.com"
  config.password_strategy = Clearance::PasswordStrategies::BCrypt
  config.redirect_url = "/"
  config.rotate_csrf_on_sign_in = false
  config.secure_cookie = false
  config.sign_in_guards = []
  config.user_model = User
end
</code>
If I were you, I'd attempt to set the cookie_expiration to nil. However, if it requires an expiration, you might want to fork the gem and see if the private API here can be altered to your needs.
If you don't want to do that, you can create a guard in Clearance. When a user signs in, set your own cookie with no expiry date. When the user closes the browser, that should delete your custom cookie. Then, in your guard, when the authentication occurs again, you should be able to check for your custom cookie and (upon not finding it) reject the auth and redirect to sign_in.


what's for referring to here? "for her presence of mind" in the lines mentioned below

Question: there's an article i was reading in newspaper and i stopped on this line beacause i couldn't been able to understand it properly,which says  "surender singh hooda said that if not for her presence of mind,jaswant would have not been arrested".
in this line 'for her presence' is used for what,instead it should be 'of her presence' i guess?
please explain!!
i'm very curious to know the meaning of this line.
Comment: Please use proper capitalization, punctuation, etc.
Comment: _For_ isn't referring to anything. _For_ here is part of the fixed phrase _if not for_, as @Bill points out.
Comment: It means: the arrest would not have been accomplished without her quick thinking.
Answer: "If not for her presence of mind" is an alternative to saying
"If she didn't have presence of mind"
or
"If it weren't for her presence of mind".
"If not for" is a complex phrase, does that clear it up?
Comment: It's an idiomatic complex phrase, which makes it even more confusing. It's hard to tell what's been left out, so it's sort of fixed as three words introducing a Noun Phrase: _if not for `NP`_. You could think of it as a complex preposition, if that helps. The point is that it's fixed.


Did the territories officially choose a side to support in the American Civil War?

Question: In studying the history of New Mexico's involvement in the American Civil War, it is unclear to me if, as just a territory at the time, and not a state, it could officially "support" a side? Nearly all maps showing the split of the states, don't indicate which side the territories supported. It seems that unofficially, those living in the southern half of the state tended to support the Confederacy, due to economic ties in the cattle industry with Texas. Yet those in the northern have tended to support the Union. But these trends don't represent the government of the territory picking a side, just attitudes of the people. Then there was the regions taken in actual military conflict, but that still is different from the territory joining a side. I have some history books on this, but I am suspicious the authors are not fully forthright, because admitting a territory joined the Confederacy is controversial. Did the territories pick a side in the war?
Answer: Legally, a territory is directly governed by the federal government, and can't pick a side.  There's no possibility of "withdrawing from the Union" or equivalent.
In practice, things were a bit different:

Colorado Territory: Mixed sympathies, sparse population, and no overt declarations.
Confederate Arizona: The southern portions of Arizona and New Mexico Territories supported the Confederacy and established a pro-Confederacy government in Tucson.
Dakota Territory: Very sparsely populated.
Idaho Territory: The eastern portion sympathized with the Confederacy; the western portion was pro-Union.  This was the impetus for dividing off the eastern section into Montana Territory.
Indian Territories: The tribes of the Indian Territories allied themselves with the Confederacy.
Montana Territory: Confederate sympathies, but no declaration of support.
Nebraska Territory: Strongly pro-Union.
Utah Territory: Anti-Union, but not pro-Confederate.
Washington Territory: Generally pro-Union.

Overall, approximately two territories joined the Confederacy, while Nebraska contributed a large contingent to the Union army.  The other territories had general sympathies towards one side or the other, but didn't explicitly pick a side, becoming Union by default.
Comment: I checked into Oklahoma (Indian Territory), and its really complicated. The "Five Civilized Tribes" owned a lot of slaves (ironically, that was part of what made them "civilized"), so many supported and fought for the Union, but it looks like many did not. Officially it was US Federal territory, but the Union abandoned all the forts at the onset of the war, and it looks like some Confederates (and/or Native units supporting them) took them over. There were battles, and raids, and the kind of stuff you'd expect to see during wartime in a contested area.
Comment: I'm surprised that your list didn't include New Mexico, both because OP mentioned it and because it was the site of one of the most important battles in the territories (Glorieta Pass)
Comment: @JohnColeman, I included New Mexico Territory under "Confederate Arizona", since that consisted (at least on paper) of the southern halves of it and Arizona Territory.


Are there any pros for the waterfall model testing vs agile?

Question: I have read much information about agile and waterfall and I just cannot think of any reason why someone today should do the waterfall. I am concerned especially about testing process.
Do I miss something, is there some clear advantage that I have overlooked?
Answer: There are still cases where waterfall is appropriate.  Canonical examples include military, space, medical and safety-critical systems such as flight control software where you absolutely need to determine the spec first in exact detail, develop it, then thoroughly test the complete product.
Agile works for most business and product software (i.e. the majority of software built) because it allows users to start with a rough idea and refine it as they go along.  If their website or internal line-of-business application isn't quite right (or has bugs) for a few iterations then it is generally outweighted by the business value that's delivered quickly from the bits that do work.  You wouldn't want to start with a rough idea for a nuclear power plant controller system and refine it as you go along.
The trade-off of using pure waterfall is that it is orders of magnitude more expensive to develop software in these scenarios.  However, the cost-benefit is still favourable since you cannot afford for (say) your spacecraft to hit a null pointer exception halfway into orbit.
There are of course shades of grey in between.  It is possible to use Agile techniques within a waterfall framework (see RUP) and the balance can be scaled up and down between pure waterfall and pure agile.
Comment: Working on medical field as a tester I disagree with the idea that you can write detailed specs beforehand and develop it without changing the specs or that testing should come after development. It might be true that some testing can be done only when the whole thing is complete, but for best results, concepts associated with agile depelopment apply equally and work also on regulated areas.
Answer: One of the main pros of the waterfall model of development is that it has been used for years and years to develop.  It works.  Even though there is a large shift and focus on agile, waterfall is a very clear process with start points and end points for each section of the development.
With the introduction of agile programming it is easy to see the falls of waterfall and how it is not as adaptable to the demands of programming these days.
As long as you are careful and plan ahead and test sufficiently I would say testing in agile can be as effective or even more effective than waterfall - it is certainly easier to work with agile when testing throws a few bugs that can cause design changes your way.
Another thing to consider is developing using, test driven development.  http://en.wikipedia.org/wiki/Test-driven_development
Answer: Outsourcing
I have seen many companies stick with waterfall for outsourced projects.  Most vendors will be very specific when it comes to pricing quotes.  Waterfall suits this model quite well - you hand off what you want, they produce it.  I'm not a fan of this, but I can understand the reasoning for executing this way.  I think most outsourcing companies will eventually find a way to become more agile as it becomes more of the industry standard.
Answer: The answer to the question depends on what kind of development methodology you are using for your project. Is it agile/Is it waterfall/etc etc. Over the past three to four years I have been part of projects that involved only Agile or only Waterfall, so will be using them as my reference point.
If the requirements of the project keeps on changing we should never go for a waterfall design , since waterfall methodology assumes that designing/analysis/etc has been finalized while if we go for agile it is based on an incremental approach where we divide our project into incremental stories and building/testing as we go along, so if the requirements change it does not involve to much of re-work from developers as well as the testers.
For example say we have to create four new web pages as part of our project, then waterfall assumes that their design etc has been finalized and that testing will start once all the four pages have been developed while incase of agile what happens is we first develop one page and hand it over to the QA for testing [manual/automation], and so on. Thus we can see that agile adds value to our project by not making it susceptible to requirement changes in addition to finding the functionality flaws/bugs at the time of development.


Django sphinx works only after app restart

Question: I've set up django-sphinx in my project, which works perfectly only for some time. Later it always returns empty result set. Surprisingly restarting django app fixes it. And search works again but again only for short time (or very limiter number of queries). Heres my sphinx.conf:
source src_questions
{
    # data source
    type        = mysql
    sql_host    = xxxxxx
    sql_user    = xxxxxx #replace with your db username
    sql_pass    = xxxxxx #replace with your db password
    sql_db      = xxxxxx #replace with your db name
    # these two are optional
    sql_port    = xxxxxx
    #sql_sock   = /var/lib/mysql/mysql.sock

    # pre-query, executed before the main fetch query
    sql_query_pre   = SET NAMES utf8

    # main document fetch query
    sql_query       =       SELECT q.id AS id, q.title AS title, q.tagnames AS tags, q.html AS text, q.level AS level \
                            FROM question AS q \
                            WHERE q.deleted=0 \

    # optional - used by command-line search utility to display document information
    sql_query_info  = SELECT title, id, level FROM question WHERE id=$id

    sql_attr_uint   = level
}

index questions {
    # which document source to index
    source      = src_questions

    # this is path and index file name without extension
    # you may need to change this path or create this folder
    path            = /home/rafal/index/index_questions
    # docinfo (ie. per-document attribute values) storage strategy
    docinfo     = extern

    # morphology
    morphology  = stem_en

    # stopwords file
    #stopwords  = /var/data/sphinx/stopwords.txt

    # minimum word length
    min_word_len    = 3

    # uncomment next 2 lines to allow wildcard (*) searches
    min_infix_len = 1
    enable_star = 1

    # charset encoding type
    charset_type    = utf-8
}

# indexer settings
indexer
{
    # memory limit (default is 32M)
    mem_limit   = 64M
}

# searchd settings
searchd
{
    # IP address on which search daemon will bind and accept
    # optional, default is to listen on all addresses,
    # ie. address = 0.0.0.0
    address     = 127.0.0.1

    # port on which search daemon will listen
    port        = 3312

    # searchd run info is logged here - create or change the folder
    log     = ../log/sphinx.log

    # all the search queries are logged here
    query_log   = ../log/query.log

    # client read timeout, seconds
    read_timeout    = 5

    # maximum amount of children to fork
    max_children    = 30

    # a file which will contain searchd process ID
    pid_file    = searchd.pid

    # maximum amount of matches this daemon would ever retrieve
    # from each index and serve to client
    max_matches = 1000
}

and heres my search part from views.py:
content = Question.search.query(keywords)
    if level:
        content = content.filter(level=level)#level is array of integers

There are no errors in any logs, it just isnt returning any results. I have set 'indexer --rotate --all' to be run every 5 mins in cron, and searchd is up and running all time.
All help would be most appreciated.
Answer: What's the version of sphinx? django-sphinx? sphinxsearch api? python?
Anyway, try to remove the indexer from the cron & see if this problem persists. Let me know how this goes.


In emacs how can I keep many files open at once?

Question: At the moment I use C-xC-f to open a new file, but it gets quite tedious.
Comment: What's your goal? Opening a bunch of files at once? Or managing lots of already opened files?
Comment: Or do you just want to see multiple files at once?  Because Emacs does keep all these files "open" (in a sense, they are loaded, but aren't "open" in a "file descriptor is open" sense).
Comment: I want to edit several source files of a program
Comment: Go thru [this](https://github.com/shamhub/C_Programming/blob/master/emacs_training/commands.c) before using emacs
Answer: When you load a file in Emacs with find-file (bound to Ctrl-x Ctrl-f by default), it gets put into a "buffer".  As long as you don't kill the buffer, it stays in memory, you don't have to reload it.
You access already loaded files (buffers) with switch-to-buffer (bound to Ctrl-x b).  Press the keys, then type the buffer name you want to switch to (by default that's the basename for any loaded file).
You can also press Ctrl-x Ctrl-b to get a list of currently existing buffers.  And click any buffer there with the mouse to switch to it (IIRC, rarely use the mouse with Emacs ;-))
You can also split the screen in two (or more) parts to see different files (buffers) with Ctrl-x 2.  Initially, this shows the same buffer twice.  Switch to another buffer in one of the windows to see another file.
Comment: C-x 3 can also be used to split screen in two, C-x 0 to show only one buffer at once.
Answer: C-x b and C-x C-b are what you want. Also consider trying iswitchb or ido. Since I started using those I wish every program I used could switch tabs / windows / documents as quickly and conveniently as emacs. Often I have 50 files or more open in emacs, you can find the one you want very quickly with iswitchb or ido.
Answer: Also, if you are using a graphical version of emacs, you can do ctrl-x 5 b to open an existing buffer in a new window (called a frame in emacs-speak), or ctrl-x 5 f to load a new file in a new window.
Comment: c-x 5 b also works in a tty, but switching frames is annoying in tty mode :)
Comment: @Justin Thanks.  I've never played with frames in a tty.  Is there any benefit over just using multiple buffers.
Comment: You can use frames vs windows the way you would use workspaces vs. windows in a Linux window manager - ie. for working on elisp code frame 1 has two windows, one with the info file for elisp, the other with ielm for interactively trying code, frame 2 has only one window, with whichever file you are editing (so you can get as many lines visible as possible it is unsplit). With a decent keybinding for other-frame it could be a very productive arrangement if you for some reason did not want to be running X.
Answer: You can easily open multiple files at once (or act on them in other ways).

Use C-x d to visit a directory (folder), which lists all of its files and subdirectories.
Mark the files you want to open (or to act on in some other way). You can mark files individually or in groups based on various characteristics, including file-name patterns. See the menu-bar menus Mark and Regexp -- it shows you some available marking possibilities, as well as their keyboard shortcuts.

For example:

% m marks files whose names that match a regular expression.
% g marks files whose contents match a regular expression.
* * marks executable files.

To open all of the marked files at once you need to have loaded standard library dired-x.el. Do M-x load-library dired-x or put (require 'dired-x) in your init file.
Then you can use F (dired-do-find-marked-files) to visit all of the marked files at once. Use C-x C-b to see a list of the open buffers, where you can choose among those file buffers.


Is there a way to take an object with a mirror side and make it one whole object?

Question: So I have this model that I retopologized, and it has the mirror modifier applied to it. The entire left side is mirrored. I want to rig this model for animation, and I just wanted to know if this mirror modifier is going to interfere with the posing this figure. If it is, then how do I solve this problem? I would imagine there's a tool that makes it a whole mesh, but I just need some clarification. If no such tool exists, and the mirror modifier is going to be a problem, then what should I do? I'm using 2.93, by the way. I only say that because the mirror modifier seems to work differently with each version.
Comment: On default settings, a mirror modifier *does* make a whole mesh (via "merge" option.)  Applying a modifier has a special meaning in Blender and I think you're probably not using that meaning (see the modifier dropdown, see what happens when you "apply" the mirror modifier.)  It is possible to use an armature modifier with a live mirror modifier; the mirror mod needs to have vertex groups enabled, bones need to be named appropriately (.L, .R), and the mirror needs to be before the armature.  Answering as a comment because this is probably a duplicate.
Answer: Once you're done mirroring you can apply the mirror modifier and the mirrored side will become "real"
Comment: That took care of it. Thanks!


Why do we say "he asked after you" not "he asked about you"?

Question: What are the origins of "ask after" and is it dying out as the way we currently speak?
Comment: We do say both. But, simply, *after* here implies showing some concern for the object of the inquiry, while *about* may do the same or simply be a request for information. The former implies that the person knows you and has some interest in your well being; *about* may be more dispassionate.
Answer: Oxford Advanced Learner's dictionary says that this is a phrasal verb which implies being interested in "how somebody is, what they are doing, etc.", i.e. it's not necessarily about health or well-being, but trying to sound in a general way more personal and more caring, a step closer to the people you mention.
Here is the link: https://www.oxfordlearnersdictionaries.com/definition/english/ask-after?q=ask+after
It seems to me that saying 'ask about' is slightly less personal that 'ask after'. Such differences must exist due to nuances in meanings.
Answer: It is more common today to ask for someone than to ask after them, but it means the same thing.  It means to inquire or make inquiries regarding that person.  The OED says you will still encounter ask after someone in dialect use, but it has for the most part been replaced by asking for someone.
Here are its last two citations for that sense:

1866 G. Macdonald Ann. Q. Neighb. xxx. (1878) 524 – To ask after their health when he met them.
Mod. — Did any one ask for me, while I was out? When you reach that point, ask again.

Asking about someone isn't necessarily asking for them, however.
Comment: It doesn't mean exactly the same thing. From [ODO](http://www.oxforddictionaries.com/definition/english/ask?q=ask+after#ask__13): "**ask after** or *Scottish* **for** *(British)* enquire about the health or well-being of". The phrase **ask about** *can* mean asking about somebody's health, but it could also mean other things, like prying into their affairs.
Comment: I've looked at the OED's entry now, and I see why you answered as you did; I think the OED is too comprehensive to easily deduce the actual current British meaning from.
Comment: I meet with 'asked after you' more than 'asked about you', but it's not what the police do.


Apex Batch Job Chaining Limits

Question: What is the stack depth for apex batch job chaining? I am conditionally calling the same batch job from the finish method..
Also the solution implemented calls a normal batch job from the finish method and we are not leveraging Queueable Apex.
What will be the daisy chaining limits for the above pattern?
Answer: A job may only spawn one other job in the finish method. You would need to design your job to work within this limit, so you might need a different design. There's no limit to the number of times a batch may chain (the stack depth you referred to), although there is a daily execution limit for asynchronous code (see the docs).
Comment: Thanks for the answer.  I am just spawning one job from the finish method.  So it seems there are no limits to the chain length.
Comment: Correct. Aside from daily governor limits, no other limitations.

Apex Batch Job Chaining Limits