Determine whether the integral $\int_{0}^{\infty}\frac{\cos(x)\sin(1/x)}{x^p}dx$ is convergent or divergent

Question: Determine whether the improper integral $\int_{0}^{+\infty}\frac{\cos(x)\sin(1/x)}{x^p}dx$ is convergent or divergent for $p\in\mathrm{R}$. According to the Dirichlet test, I find it is convergent when $-1<p<2$. But how can I show its divergence? Applying Integration by parts seems tedious.
Comment: I suggest splitting integral into two parts $\int_0^1$ and $\int_1^{\infty}$, and show that $\int_1^{\infty}$ diverges if $p\leq -1$, $\int_0^1$ diverges if $p\geq 2$.
Answer: As suggested in the comments, the integrand function behaves like $\frac{\cos x}{x^{p+1}}$ on the interval $(1,+\infty)$, hence the improper Riemann integrability over such interval is granted by Dirichlet's test as soon as $p>-1$, and that also is a necessary condition always by integration by parts. In a right neighbourhood of the origin the integrand function behaves like $\frac{\sin(1/x)}{x^p}$, and
$$ \int_{0}^{1}\frac{\sin(1/x)}{x^p}\,dx = \int_{1}^{+\infty}\frac{\sin(x)}{x^{2-p}}\,dx $$
hence here the necessary and sufficient condition for the improper Riemann integrability is $p<2$.
By putting everything together, the given integral is convergent as soon as $-1<p<2$, and by exploiting the (inverse) Laplace transform, Euler's Beta function and the reflection formulas for the $\Gamma$ function its value is given by
$$ \int_{0}^{+\infty}\frac{\cos(x)\sin(1/x)}{x^p}\,dx = \frac{\pi}{4\sin\frac{\pi p}{2}}\left[I_{1-p}(2)+2\,I_{p-1}(2)+J_{1-p}(2)-2\,J_{p-1}(2)\right].$$
Comment: Thanks a lot! I cannot prove that $\int_1^{\infty}\frac{\cos(x)\sin(1/x)}{x^p}$ is divergent if $\int_1^{\infty}\frac{\cos(x)}{x^{p+1}}$ is divergent. Could you show some details or give a hint?
Comment: @user219714: if $x$ is large ($x\geq 1$) we have $$\sin\left(\frac{1}{x}\right) = \frac{1+o(1)}{x}$$ hence that factor matters as a $\frac{1}{x}$.
Comment: For positive function, I am sure that's right. But I'm confused whether $\frac{\cos(x)\sin(1/x)}{x^p}\sim\frac{\cos(x)}{x^{p+1}}(x\to\infty)$ can directly imply that the two integrals will converge simultaneously.
Comment: @user219714: you may simply apply integration by parts in order to deal with a non-negative integrand function; then the same principle applies.
Comment: Should I applying integration by parts to $\int_{0}^{+\infty}\frac{\cos(x)\sin(1/x)}{x^p}dx$ to show its convergence?
Comment: @user219714: you can, for sure.
Answer: Proving divergence when the integrand is nonnegative or nonpositive may be facilitated by the comparison test.
However, when the integrand changes sign, the only recourse may be proving  divergence using the negation of the definition of convergence.   In this way, we prove divergence of the improper integral $\int_a^\infty f(x) \, dx$ by showing there exists $\epsilon_0 > 0$ such that for any $c > a$ there exists $c_2 > c_1 > c$ such that
$$\left|\int_{c_1}^{c_2} f(x) \, dx  \right| \geqslant \epsilon_0.$$
Specifically, for any $c > 0$ choose an integer $n$ such that $c_1 = 2n\pi -\pi/4 > c$ and $c_2 = 2n\pi + \pi/4$. Since $\cos x \geqslant 1/\sqrt{2}$ for $c_1 \leqslant x \leqslant c_2$ and $x \sin(1/x) \geqslant \sin 1$ for $x \geqslant c_1 \geqslant 1$ we have
$$\begin{align}\left|\int_{c_1}^{c_2}\frac{\cos x \sin(1/x)}{x^p} \, dx \right| &= \int_{c_1}^{c_2}\frac{x \sin(1/x)\cos x }{x^{p+1}} \, dx \\ &\geqslant \frac{\sin 1}{\sqrt{2}} \int_{c_1}^{c_2} x ^{-(p+1)} \, dx \\ \end{align}$$
If $p \leqslant -1$ then $-(p+1) \geqslant 0$ and $x^{-(p+1)} \geqslant 1$ for $x \geqslant 1$.
Hence,
$$\begin{align}\left|\int_{c_1}^{c_2}\frac{\cos x \sin(1/x)}{x^p} \, dx \right| \geqslant \frac{\sin1}{\sqrt{2}}(c_2 - c_1) = \frac{\pi \sin 1}{2 \sqrt{2}}, \end{align}$$
and the improper integral must diverge.
The same idea works for proving divergence when $p \geqslant 2$ of
$$\int_{0}^{1}\frac{\cos x \sin(1/x)}{x^p} \, dx  = \int_{1}^{\infty}\frac{\cos (1/x) \sin(x)}{x^{2-p}} \, dx  $$
Comment: Thank you @RRL .That's exactly what I need.
Comment: @username: Glad to be of help.


Does vegan cheese ever melt?

Question: I have a kind of vegan friend and recently made a pizza for her. I went to a vegan shop, bought "vegan mozzarella" (they said it melts ok), and cooked the pizza as usual. Does vegan cheese ever melt? Is it the limit of how much it can melt? Or did I buy a bad sort of vegan cheese?
Comment: i've had a vegan cheese that melted, but I don't know that all do
Answer: Yes, it melts, at least the stuff my friend who can no longer eat cheese uses does. They have a "more complex milk issue than mere lactose-intolerance" before the unsolicited commentary about lactose free cheese rolls in...would that it were that simple.
But it takes considerably longer to melt than real mozzarella. So "cooked as usual" my experience is that the real cheese pizza is done while the vegan cheese pizza is still considering the possibility that it might melt.
Comment: It got singed. The only possibility it was considering by the time I took it out of the oven was to get singed even more
Comment: @SergeyZolotarev some specialty (usually high price) vegan cheeses can melt like real cheese, the vast majority at this point do not.

Does vegan cheese ever melt?


What is the difference between "ransom theory" and "penal substitution"?

Question: Ransom theory and penal substitution are two (of many) views about the exact nature of Jesus' atoning death on the cross.  Both suggest that Jesus in some way paid a price on the cross for the benefit of humanity.  The terminology of the two theories is quite different, but it is not clear to me how much real difference there is and how much is just semantics. So, what exactly are the core differences between the two theories?
Answer: This question is a bit old, but there is an omission in the only answer. fi11222's answer states that both ransom and penal substitution theories of atonement view God as needing payment of some form. I agree with the description of penal substitution, but I believe the orthodox ransom theory generally teaches that the ransom was paid to death and not God the Father; this being a key difference between the two theories.
Wikipedia ("Ransom theory of atonement") says that the theory teaches the ransom was "paid to Satan or to death itself, in some views paid to God the Father".
The Eastern Orthodox church would teach that viewing the ransom paid to Satan or God the Father to satisfy him is wrong and perhaps heretical. I know that Protestants usually vigorously affirm that the debt was paid to God the Father, but I don't know how Catholics view it.
To give some historical perspective, let's hear from the church fathers themselves (taken from Christian Classics Ethereal Library, "De Inc. 4.20"):
St. Athanasius:

He might offer the sacrifice on behalf of all, surrendering His own temple to death in place of all, to settle man's account with death and free him from the primal transgression.

I believe the above quote is from his work, "On the Incarnation": a great read if you are interested in this sort of thing.
St. Gregory of Nazianzus:

To whom was that blood offered that was shed for us, and why was it shed? I mean the precious and glorious blood of God, the blood of the High Priest and of the Sacrifice. We were in bondage to the devil and sold under sin, having become corrupt through our concupiscence. Now, since a ransom is paid to him who holds us in his power, I ask to whom such a price was offered and why? If to the devil, it is outrageous! The robber receives the ransom, not only from God, but a ransom consisting of God himself. He demands so exorbitant a payment for his tyranny that it would have been right for him to have freed us altogether. But if the price is offered to the Father, I ask first of all, how? For it was not the Father who held us captive. Why then should be blood of His only begotten Son please the Father, who would not even receive Isaac when he was offered as a whole burnt offering by Abraham, but replaced the human sacrifice with a ram? Is it not evident that the Father accepts the sacrifice not because he demanded it or because He felt any need for it, but on account of economy: because man must be sanctified by the humanity of God, and God Himself must deliver us by overcoming the tyrant through His own power, and drawing us to Himself by the mediation of the Son who effects this all for the honor of God, to whom He was obedient in everything... What remains to be said shall be covered with a reverent silence. (In sanctum Pascha, or. XLV, 22', P.G., t 36, 653 AB, quoted in Lossky, Mystical Theology, p. 153.)

The important bit of St. Gregory's quote is where he says "the Father accepts the sacrifice not because he demanded it or because He felt any need for it, but on account of economy".
Comment: After rereading this after some seasoning. I'm not 100% sure that Orthodox would uniformly say we cannot conceive of us being ransomed from the Devil or wrath of God, just so long as we don't take this so far as actually conceiving the Devil having power over God, or God actually having a need to be satisfied like a man may. IE - perhaps Orthodox may refer to these ideas poetically, but not technically.
Answer: It is the same difference as there is in modern law between a civil lawsuit and a penal lawsuit.
Ransom theory treats the enmity between God and men as if it were a civil lawsuit, i.e. a legal contention which can only be resolved through the payment of damages, here a "ransom". Men owe God a ransom (damages) in order to compensate for their sins (which of course they are unable to pay) and Christ "foots the bill" by dying on the cross.
Penal substitution treats the same enmity between God and men as if it were a penal lawsuit, i.e. one which will lead to a punishment for the guily party (here all men). Christ is a substitute for men as he takes on himself the penalty for the sins of mankind, which would otherwise have fallen upon men, by dying on the cross.
Both are metaphors (parables), of course. They are not mutually exclusive as they can be more easily understood by different categories of people. For example, in most tribal societies, there is no penal justice because there is no state. In such a context, even murder is a civil matter, to be decided by tribal elders, council, etc. For people of such background, the Ransom theory is more easily understandable than the Penal one. For us who live in a society where penal justice is more prominent than its civil counterpart (how many civil law shows are there on TV?), it is probably the opposite.
Comment: Yes, I understand. I'm simply letting you know that answers here are expected to give sources representing recognized Christian theologians, denominations, and so on—or quotes from the Bible, for Biblical basis questions. If they don't, they tend to get downvoted or deleted.
Comment: Welcome to Christianity.SE. Thanks for taking the site tour. And thanks also for offering an answer. Though your answer *may* be sound, as it is now it reads more like a personal perspective than like a sourced answer, which is what's preferred on this site. See: [How we are different than other sites](http://meta.christianity.stackexchange.com/questions/1808/how-we-are-different-than-other-sites) and [What makes a good supported answer?](http://meta.christianity.stackexchange.com/questions/692/what-makes-a-good-supported-answer). Providing sources for your answer would greatly improve it.
Comment: Hi Lee. Thanks for the helpful comment. In my view, the relevant information can be found quite easily, for example in the respective Wikipedia articles. I was just trying to be concise in order to focus on the gist of the matter.
Comment: As an aside, it is probably interesting to note that the Ransom theory is much older than the Penal substitution theory, which is generally associated with the reformation. There is a sense in which the Ransom theory can ba said to refer to a more "archaic" cultural background (the early church) than Substitutionary atonement, which appeared in early modern times.
Comment: This article disputes the contention that Penal Substitution is a Reformation innovation: https://www.tms.edu/m/tmsj20i.pdf


What is the eyeball icon over the troops in Rome 2 Total War?

Question: What is the eyeball icon over the troops in Rome 2 Total War?  It is over the troops in battle, and it turns on and off.
Answer: The presence of the eye on a unit's banner indicates that unit is not currently visible to any enemy units.  When the eyeball icon is absent from a unit's banner, there is at least one enemy unit that can see that unit of yours.
From twel70's Beginner's Guide to Total War Rome 2 on the Romanian Steam Community page, in the Line of Sight (LoS) section. Link
In some older Total War games, units that could hide in forests would be shown as hidden by a small tree icon.


How to create a memory array in a struct?

Question: I am receiving the "stack too deep" error when compiling my smart contract. I know it has to do with too many variables, and I've heard of creating a memory array to "group" variables together. I'm looking for an example of this in a struct that I can follow. I can post code if it would help. Thanks, Rob
Comment: You should post your code. Someone will probably help you sort it out.
Answer: You can do something like this. But you should be aware that using memory is more expensive than simple stack.
<code>pragma solidity ^0.4.0;
contract Ballot {

    struct Voter {
        uint weight;
        bool voted;
        uint8 vote;
        address delegate;
    }

    function foo(bool d) public pure returns (uint) {
        Voter memory votes;
        votes.weight = 123;
        votes.voted = true;
        votes.delegate = msg.sender;
        votes.vote = 1;
        if (d) {
            votes.weight += 11;
        } else {
            votes.vote = 2;
        }
        return votes.weight + votes.vote;
    }
}
</code>


Adding tension to a model of a Timoshenko beam?

Question: I am interested in modeling a Timoshenko beam.
However, I would also like to add tension to the beam so that it can vibrate like a string as well as a beam.
The Timoshenko beam is described at that link by two coupled equations, where subscripts are derivatives of that variable:
$ρA w_{tt} = κAG(w_{xx}- φ_x) + q\tag{1}$
$ρIφ_{tt} = EIφ_{xx} + κAG(w_x- φ)\tag{2}$
Where $ρ$ is density, $I$ is second moment of area, $E$ is Young's Modulus, $G$ is the shear modulus, $κ$ is the Timoshenko shear coefficient, $A$ is cross sectional area, $w$ is transverse displacement, $φ$ is rotation of a segment, and $q$ is external force/load.
To solve a unified equation of motion, they isolate $φ_x$ from equation (1), take the $x$ derivative of equation (2), and then substitute in various derivatives of the $φ_x$ from equation (1) into (2).
This also helps to eliminate $φ$ which would be hard or impossible to solve for in a finite difference approach.
This gives a final equation of motion of:
$EIw_{xxxx} + ρA w_{tt} - (ρI + \frac{ρAEI}{κAG})w_{xxtt} + \frac{ρAρI}{κAG}w_{tttt} = q + \frac{ρI}{κAG}q_{tt} - \frac{EI}{κAG}q_{xx}\tag{3}$
Now let's imagine a very simple model for a vibrating string:
$ρA w_{tt} = (T + σA)w_{xx}\tag{4}$
where $T$ is basic tension and $σ$ is the extra stress on a given segment from lengthening (strain).
How could I combine these two systems? My idea is to just add these terms into equation (1) so I'd have:
$ρA w_{tt} = κAG(w_{xx}- φ_x) + q + (T + σA)w_{xx}\tag{5}$
Then I could just combine (5) with (2) to create a new version of (3).
But I'm wondering if this makes sense. Wouldn't these tension terms also affect equation (2)? I.e. Wouldn't I have to add something to equation (2) also?
Answer: I guess that you are right. In the case of a stiff string, using Euler-Bernoulli assumptions (see the reference), you end up with the following:
$$ (T + \sigma A)\frac{\partial^2 w}{\partial x^2} - EI \frac{\partial^4 w}{\partial x^4} = \rho A \frac{\partial^2 w}{\partial t^2}\, .$$
You arrive to this equation after doing a balance of normal and shear forces, and moments, using the Euler-Bernoulli assumptions. I think that you could do a similar derivation replacing the hypotheses for the Timoshenko theory ones.
Reference

Fletcher, N. H., & Rossing, T. D. (2012). The physics of musical instruments. Springer Science & Business Media.


Waiving the fees for extension of stay ( I-539) for visitors who are stuck in USA

Question: My parents who are currently here in the US for visiting are not able to go back due to covid-19 flight cancellations. Hence I would have to file for extension, but why is the fees not being waived as its not our mistake. The total fees is more than $500.
Comment: @Jijo Presumably because there are costs associated with USCIS processing your request, and it's not their mistake either https://www.uscis.gov/i-912
Comment: You will need to ask USCIS to understand which reasons they will waive fees for.
Answer: The I-539 fee is not a fine.  The I-539 form is not primarily intended for the correction of mistakes.  The I-539 is the form with which one applies to change or extend nonimmigrant status, and that is what your parents want to do.  To make the application, they need to pay the application fee.
There is a fee waiver available, but it is only available to some filers of the I-539.  Even if your parents are eligible to apply for a waiver, I would not apply for one without first checking with an immigration lawyer, because asking for a fee waiver could reduce the chance of the application being approved.


Webdav credentials OS X where

Question: I can automatically login to webdav server but have forgotten user/password.
Where on OS X High Sierra are these credentials stored so I can access and store them elsewhere?
Answer: These credentials are stored in your keychain, which you can see using Keychain Access, an application in the Utilities folder. Search for the IP address or hostname you use to connect to your WebDAV server.

Webdav credentials OS X where


USB 2.0 Motherboard headers with USB 3.0 Case Compatibility

Question: I want the Corsair Spec-01 mid-tower PC case, with the Asus H81M-A Micro ATX LGA1150 Motherboard. The case has two front-facing USB 3.0 ports. However, my motherboard only has USB 2.0. I realize I wouldn't get 3.0 performance, but if I hooked them up, would they work, even with USB 2/1.0? This is my first PC build, so I would appreciate some explanation on how these things work, along with a concrete answer.
Answer: Your case front panel likely has a standard 20-pin plug, with cables to two front panel USB 3 receptacles. To interface it with the on-board 10-pin USB2 header, you would need an adapter like this one:
https://www.amazon.com/Neewer-Female-Motherboard-Adapter-Converter/dp/B009SJCPO8
The adapter connects only USB2.0 wires, and leaves USB3 set of wires unconnected. When a USB3.0 device is plugged in, it won't find expected termination on loose wires, and falls back into USB2.0 mode.
ADDENDUM1: If you would like full USB 3.0 functionality from your front panel, there are 4-port PCIe controllers, two ports on back, and 20-pin header internally, where you can plug your front panel directly.
http://www.ebay.com/itm/like/252408075871?lpid=82&chn=ps&ul_noapp=true


How does 2 spinning disks and a stationary ball interact in a collision?

Question: Suppose there are two congruent disks that are both rotating on its center axis but in opposite directions. A stationary ball is fed in between the two disks, where it collides with both disks and experiences an acceleration outwards.(This is exactly how automatic Nerf guns work). In what ways would they interact? Is there a general equation that explains this? How does the angular velocity of the two disks translate into the linear velocity of the ball?
Thanks.
Answer: Nevermind I got it! I considered the ball as a point mass that was rotating around the circumference of one of the disks as its final angular momentum. I saw the question as a reverse situation of a figure skater changing from skating linearly to rotating around a pole.
Answer: Well I think what you wanted to ask is how a ball at rest suddenly gains velocity when it comes in contact with the two oppositely rotating discs.
The discs have a w(omega) since they are rotating the tangential velocity at any point on a rotating disc or a body performing a circular motion is given by  v=rw[ r=distance from the centre of rotation, w=omega of the disc ] considering the w of both the discs to be constant and equal, the ball will be impacted by the tangential velocities of both the discs simultaneously( hence providing it with an impulse in (dt)time )
Hence rw+rw =2rw the velocity aquired by the ball after coming in impact with the discs


Using PGP keys for SSH

Question: I use a 4096 byte RSA PGP key; since SSH also uses the RSA standard, is it at all possible to use the PGP key as an SSH key without installing additional software on the server (and as little as possible on the client)?
Answer: There are several ways, which may or may not work:

MonkeySphere
openssh-gpg, a patch for OpenSSH
SSH.com has built-in support
gpg2 on Debian comes with a gpgkey2ssh tool, and gpg-agent can act as a ssh agent too, but I couldn't figure out how to actually make ssh use the key for authentication.
Answer: SSH2 Version 2.0.13 introduced support for PGP authentication.
excerpt from SSH The Secure Shell
Answer: With the information from the answers on this question and the help of the gnupg-users mailinglist I was able to figure out how to use my GPG key for SSH authentication. There are a few possible methods to do this.
I have written a blogpost about some possible solutions: http://budts.be/weblog/2012/08/ssh-authentication-with-your-pgp-key
To summarize:
Either you use GnuPG 2.1, which is currently in beta. When using this version, you can simply start gpg-agent with the --enable-ssh-support option and add the keygrip for you GPG key (or subkey) into ~/.gnupg/sshcontrol.
When you are using the current stable GnuPG version (2.0.x) you can use monkeysphere to add your key to gpg-agent (again, after starting gpg-agent with the --enable-ssh-support option).
It is also possible to use GNOME keyring (or even the regular ssh-agent) with the help of monkeysphere. The only problem in this case is that you will have to re-add your key when logging on again (into Gnome or XFCE). To solve this you can manually export your key and convert it.
Answer: This document shows how to do it on the SSH.com client; I am not sure that it works on OpenSSH but it might be worth a shot.
Answer: Export private SSH key from GPG without additional software installation
Find a keygrip of desired private key
gpg --list-secret-keys --with-keygrip

Import it into a new temporary gpgsm keyring
gpgsm --gen-key -o /tmp/keyring

2 #select existing key
keygrip_id
3 #key purpose encryption, this is probably irrelevant
C=dummy, ST=dummy, L=dummy, O=dummy, OU=dummy, CN=dummy #Enter dummy X.509 subject name
firstname.lastname@example.com #email as well
The rest of the options are optional so just Enter through them, confirm the information, and enter the decryption password of key selected.

Convert the key to pkcs12 format
gpgsm -o /tmp/key.p12 --export-secret-key-p12 '&keygrip_id'

Enter again the encryption password as before to decrypt it. Then enter new password which should be used to protect .p12 file. If your /tmp folder resides on RAM like mine, you can leave it blank as it will be safely wiped after reboot.
Convert it to ssh friendly format
In addition it requires stripping first 4 lines of the output, so that it starts with ---BEGIN PRIVATE KEY---
openssl pkcs12 -in /tmp/key.p12 -nodes -nocerts | tail -n +5 > /tmp/sshkey
chmod 600 /tmp/sshkey

There you have your sshkey ready to use by ssh client. Hope this helps, for me it was neccesary as I was not able to install monkeysphere.

Using PGP keys for SSH


Do Smart Contract wallets using ERC4337 allow wallet export?

Question: From what we see in the ERC4337 documentation, SCW allow different architecture for transaction approvals. Unline EOA where we use ECDSA for signing transaction, with ERC4337, wallet developers will allow different ways for signing which enables new methods also for wallet recovery like Finger print, Social recovery, etc. My question now is, since we don't need to have any private keys, how can we change from one wallet provider to another. For example I want to change my Account from Metamask and export it to a new wallet. What do I need to have in order to login to same account from different wallet provider? I can not find information about that transition.
Answer: ERC4337 is a complete game changer. It won't work with the current version of Metamask(or any of the existing wallets that I know of).
In fact, based on this article, ERC4337 wallets don't interact with the mainnet directly. Instead, the "transactions"(AKA UserOperation) are sent to the userOperation mempool, not the usual blockchain mempool.
UserOperation gets picked up by bundlers from the special mempool, and some magic happens before it is relayed to your wallet contract on the main chain.
Your wallet contract then does the usual stuff(send a transaction, buy tokens, mint tokens, etc) on your behalf.
Each UserOperation is attached with a "signature" for verification purposes. But this signature is not generated using a private key like before. Each abstract account contract may accept different kinds of signatures as proof, it is defined by the user.
Edit:
The "Export wallet" option is likely to work with the smart wallet contract on mainnet though.
Comment: There is no standard for wallet provider standards Thus you may or many not be able to export, there might or might not exist another wallet that is compatible. We do not know yet, but a safe assumption is that there is no way to do it.
Comment: Yes, all you said makes perfect sense to me, however my question is whenever you try to export your signature from one wallet provider to another, how do you do it. With private signatures is clear but how is it working now?
Comment: There won't be an export wallet option before there is a standardization signature system.


Is Lord Jagannath an incarnation of Vishnu?

Question: Lord Jagannath is worshiped along with Balbhadra and Subhadra in the famous temple at Puri. I want to know is Lord Jagannath an incarnation of Vishnu?
Comment: Not incarnation. God almighty himself
Comment: Jagannath is a form of Lord Krishna. The story goes that once Rohini and yashoda were reciting Krishna's pastimes of Vrndavan to His wives in Dwarka. Subhdra was made a door keeper so that Krishna and Balaram don't enter the hall. But some how they happened to reach the doorstep and heard the story and all 3 immediately assumed a form that is there in puri as jagannath, Baladev nd Subhdra.
Comment: Related or a possible duplicate of [Why lord venkateshwara name not listed in avatar of vishnu?](https://hinduism.stackexchange.com/q/5381/5212) and [What are exact ten avatars of Lord Vishnu?](https://hinduism.stackexchange.com/q/927/5212)
Comment: Purna avatara of God is the same as God. Archa avatara (vigraha murthi) also same. Incarnation does not automatically mean less - It depends whether svarupa or avesha avatara.
Answer: Yes he is. Section 1.2.11 of the Skanda Purana mentions the same:

While describing the majesty of Purushottam kshetra, goddess Laxmi revealed to lord Brahma--' In the coming satya yuga there would be a king named Indradyumna and would be famous for his unflinching devotion in lord Vishnu. Being pleased by the king's devotion, lord Vishnu would ultimately manifest himself from a wooden structure to bless him. Vishwakarma would then carve out four idols (Jagannath, Balbhadra, Subhadra and Sudarshan chakra) from the wooden block all of which would be installed by none other than you (Brahma).'

The rest of the story is detailed in Skanda Purana Vaishnava Khanda - Purushottama Kshetra Mahatmya

Introduction: In Kritayuga, there was a great king named Indradyumna. He was righteous and belonged to the Solar dynasty, and was the fifth descendant from Lord Brahma. He was a devotee of Lord Vishnu and very truthful. His capital was Avanti in the Malava country.
Enquiry about visible manifestation of Lord Jagannatha: Once in an assembly of learned brahmanas and pilgrims he asked his priest whether Lord Jagannath exists visibly in any place. The priest asked the assembly of pilgrims. A certain widely travelled pilgrim told about Sri Purushottama in Odhra desa on the southern shore sea of Bharata. There is a mountain names Nilagiri surrounded by forests. In the middle of the forest there is a kalpa tree extending a krosha whose shade dispels sins. To the west is a holy pool named Rauhina filled with primordial waters which bestows salvation. On the eastern bank Lord Jagannatha visibly exists holding conch, discus and club. On the western side the sabaras (hunter community) live in hermitage known as sabara dipika. The place is so holy that heaven dwellers come there every night to worship the Lord. There is also a legend about a crow getting liberated there. Saying this the pilgrim vanished.
Vidyapati travelling to Sri Purushottama: Hearing this the king intended to settle there with his entire kingdom and worship Lord Jagannatha. In consultation with the priest he sent the younger brother of the priest named Vidyapati to locate the place and also find a suitable place of residence. On an auspicious day Vidyapati left in a chariot with emissaries.
Vidyapati reaching Mahanadi: Vidyapati considered himself highly fortunate to be able to see the Lord with his own eyes. Towards the end of the day he reached the bank of river Mahanadi at Odhra. He performed his evening rites meditating on the Lord and spent the night in the chariot.
Vidyapati crossing Mahanadi and reaching Ekamraka vana and Nila mountain: Early in the morning Vidyapati crossed the river Mahanadi and saw the villages of Vedic brahmanas. He then crossed the Ekamraka forest and came to the Nila mountain. He climbed the top of the forested mountain but could not locate the path further. He spread darbha grass on the ground and meditated on the Lord. Then Vidyapati heard some voices discussing about the Lord. He saw Sabaradipika surrounded by the house of Sabaras.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 7 - 8): Vidyapati meeting sabara Vishwavasu and seeing the Lord: Then Vidyapati approached a sabara named Vishwavasu who welcomed him and asked about his purpose. Vidyapati told him about the mission of king Indradyumna and his own eagerness to see the Lord. Vishwavasu was initially worried because the sabaras were secretly worshipping the Lord. But he remembered a traditional legend that in future the Lord will vanish and a king named Indradyumna will perform hundred horse sacrifices and install the wooden form of the Lord. Thinking that the time has come for this legend to come true, he took Vidyapati through rugged mountain forest to the holy pool Rauhina. To the east was the great Kalpa banyan tree and between these two was the presence of the Lord. Vidyapati took his bath in the holy pool and eulogized the Lord with ecstasy. Towards the evening they returned to the hermitage of Vishwavasu. Vishwavasu offered a warm hospitality to Vidyapati with the Nirmalya (remnants of the worship of the devas) of the Lord. Vidyapati was surprised. Next day in the early morning, they took bath in the ocean and Vishwavasu showed the idol of Nilamadhava to Vidyapati.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 9 - 10): Vidyapati returning and the Lord vanishing: After deciding about a place of residence for the king, Vidyapati left for Avanti. In the meantime a violent gust of wind raised the sands of the sea shore and submerged the Lord along with the Rauhina kunda. The devas became highly sorrowful and lamented. Vidyapati returned to Avanti and reported everything to the king. The king was overjoyed. At the sametime sage Narada visited the king and stayed with him to guide the king in the great journey.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 11): Indradyumna starting for Purushottama Kshetra: Indradyumna proclaimed to his entire kingdom to get ready to go to Purushottama Kshetra. The king departed on the auspicious day of Jyestha Shukla Paksha Panchami (a Wednesday). The entire kingdom accompanied him.
Indradyumna reaching the shrine of Carcika on the boundary of Utkaladesa: The king passed through various lands and forests and reached the shrine of Carcika (Goddess Durga) at the boundary of Utkaladesa. At the behest of sage Narada, the king got down the chariot and eulogized the Devi.
Indradyumna camping at the bank of river Chitrotpala and meeting the king of Utkala: Later on, the king camped at the bank of river Chitrotpala (Mahanadi) and performed his evening rites. During this stay the king of Utkala came to meet him with various gifts. King Indradyumna welcomed him and in the course of the conversation came to know that the idol of Madhava has been covered by a sandstorm. When the king left, Indradyumna was highly dejected but sage Narada consoled him saying that he will certainly see the Lord.
Indradyumna crossing river Mahanadi and going towards Ekamravana: Next morning after performing the religious rites the king started the journey. He crossed the river Mahanadi and proceeded towards Ekamravanaka (modern Bhuvaneshwar). The king of Odhra showed the way.
Indradyumna reaching the river Gandhavaha and the shrine of Kotilingeshwara: After travelling some distance the king reached the river Gandhavaha and heard the sound of the forenoon worship of the Kotilingeshwara shrine. The Nila mountain was three yojanas from there. The king took bath in the Bindu Tirtha and worshipped the idol of Purushottama installed on the bank. Then he visited the temple of Koteshwara and sang devotional songs accompanied by Veena. Lord Koteshwara through a voice told the king that his desire will be fulfilled. Through another voice the Lord Koteshwara told sage Narada to guide the king to perform the horse sacrifices as per the command of the Lord.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 12 - 14): Indradyumna reaching Kapotesha and Bilvesha: The next day the king reached the shrines of Sri Kapotesha and Bilvesha and worshipped them. Proceeding further the king reached the boundary of the holy place of Nilakantha. Then bad omens began to appear before him. Sage Narada told the king that the deity had vanished below the sand and he will not be able to see Nilmadhava. The king fell on the ground unconscious. Bringing back his consciousness, sage Narada told the king about the prediction of Lord Brahma and urged the king to perform the horse sacrifices at Purushottama Kshetra. Indradyumna's grief was dispelled.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 15): Indradyumna climbing the Nila mountain; seeing the idol of Nrisimha and the former place of Nilamadhava: The king left the chariot behind and worshipping Mahadeva and Devi Durga climbed the difficult terrain of the Nila mountain. Sage Narada guided the king to the place where the Lord was residing as Nrisimha. The idol was of extremely terrible form and the king bowed to the Lord from a distance. Then he enquired the sage about the former place of Nilamadhava. When sage Narada showed him the spot, the king prostrated on the ground and eulogized the Lord with deep devotion. An ethereal voice assured the king that the Lord will be visible to him later and urged him to carry out the direction of Brahma as mentioned by Narada. King Indradyumna was assured and decided to perform the horse sacrifies.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 16): King Indradyumna building a shrine and sage Narada installing Nrisimha at the place of the horse sacrifice: Then sage Narada invoked the celestial architect Vishwakarma, and instructed the king to build a shrine for Nrisimha at the place of horse sacrifice with the help of Vishwakarma (this was completed in four days). Narada himself got a second idol of Nrisimha built by Vishwakarma and meditating for five days infused this idol with the prana of the original Nrisimha idol. Then he installed this idol of Nrisimha on Jyestha Shukla Paksha Dwadashi in conjunction with the Swati Nakshatra. King Indradyumna eulogized Nrisimha with various hymns.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 17): King Indradyumna performing thousand horse sacrifices: Then the king constructed sacrificial halls and the houses for the guests and invited all the devas and thousand of sages and brahmanas. He made elaborate arrangements for them and extended a grand hospitality. He beseeched the favour of Indra deva to ensure that the sacrifice is completed without obstacles. The devas assured their full support for this work of Madhava. The king started performing the horse sacrifices as per the prescribed rules of the scriptures. Gradually all but the last sacrifice remained to be performed. The king had a vision of Lord Vishnu in the milky ocean. He eulogized the Lord with tears of joy.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 18): Emerging of a celestial tree: On the last day of the last sacrifice when the Sutya rite (extraction of Soma) was being performed, the servants reported to the king that a celestial tree was seen at the sea shore whose fragrance spreads across the whole surroundings. Sage Narada told the king that the hair of Sri Vishnu had incarnated as the tree. He instructed the king to complete the horse sacrifice and install the tree in the sacrificial altar. When the tree was installed, an ethereal voice told the king to conceal the sacrificial altar for fifteen days during which time a carpenter will build the divine idols of the Lord. Music should be played during this time to hide the sound of carving.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 19): Carving of the idol of Purushottama: Sri Vishnu assumed the form of an old carpenter and started carving the idol of the Lord. During this work divine fragrance, divine music and shower of parijata flowers took place. After the work was over, an ethereal voice gave instructions about how the idols should be painted and decorated. When the king unveiled the altar he saw the divine idols of Krishna (Jagannatha), Balarama and Subhadra. The king was immersed in a joy of bliss and stood there motionless. All his exertions had finally became fruitful. The king eulogized the Lord and prostrated before Him. Sage Narada and other sages also eulogized the Lord.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 27): Lord Brahma installing the deities: When all the arrangements for installation of the deities were completed, Lord Brahma Himself came down from Satyaloka. He eulogized Narayana, Balarama, Subhadra and Sudarshana and ceremoniously installed the deities from the chariots inside the shrine. The installation was performed on Vaisakha Shukla Paksha Ashtami on a Thursday in conjunction with the Pushya nakshatra.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 27 - 28): Lord assuming the form of Narasimha: After installing Madhava, Lord Brahma repeated the Mantraraja a thousand times. By the power of that Mantra, the Lord assumed the terrible form of Narasimha with a blazing tongue as if licking the entire universe. Upon enquiry by sage Narada, Lord Brahma said that this mantra was used previously by Brahma when the Lord killed the demon Hiranyakasapu. Then Lord Brahma eulogized Narasimha and initiated king Indradyumna in that mantra.
Skanda Purana (Vaishnava Khanda - Purushottama Kshetra Mahatmya 29): Granting of boon to Indradyumna: Thereafter Lord Brahma took away the Narasimha form and idols were seen as before. Lord Brahma requested Madhava to bless the king to be able to continue His worship with devotion. The wooden body of Lord Madhava then directly blessed king Indradyumna with boons. Madhava blessed that his devotion will be steady and He (i.e. Madhava) will never abandon that place even if the shrine crumbles.

Lakshmi's mention of Lord Vishnu appearing as Jagannatha and the repeated association of Narsimha to the idols testifies that it was Lord Vishnu Himself who appeared as Lord Jagannath.
Comment: My pleasure completely
Answer: Yes, Lord Jagannath is Krishna, and thus an avatara of Vishnu!
This is the legend of Puri Jagannatha temple -
After the demise of Lord Krishna at the tail end of Dwapara yuga, and towards the commencement of kaliyuga, his heart alone kept throbbing and panchapandavas threw this heart in the ocean. One tribal king called Vishwavasu Sabara found this heart when he was fishing deep in the ocean, and amazingly, as soon as he found it, it turned it into an idol worthy of worship and he kept in a sacred spot calling it 'Neela Madhava' and worshiped it!
In the meantime, there was an eminent king of the North, Orissa area who was on the lookout for a suitable idol for his newly constructed temple and sent his knights in all four directions looking for the same! One minister of his, called Vidyapathi, reached the place of Vishwavasu Sabara, stayed with Sabara, fell in love with his daughter and married her. After that, he noticed his father-in-law, Sabara, was mysteriously going and returning from some place each morning and on pestering, learnt from Sabara, about the neelamadhava idol. Deciding that this idol is the one that would most certainly please his king, after visiting this idol and making sure of its eminence, he went to his king and informed him about the idol!
The king immediately set out to the place of Sabara. He tried to go see the statue of Neelamadhava, but the statue, upon him reaching the sacred spot, had disappeared. He felt very sad. But an echo from the sky reassured that he will get a different form of a statue for a compensation.
Soon, on the shores, a large sandalwood block washed ashore. Nobody could sculpt it, it just could not be pierced. But, divine sculptor Viswakarma visited the king in the demise of an old sculptor and promised to sculpt elegant statues of the Lord, if promised nobody would peek into what he was doing. The king agreed.
After sometime, the queen became impatient, and took a peek through the doors to see what the old sculptor was doing. Immediately, the sculptor vanished. When everyone came in to see what happened, they found the statues of Balabadra, Subadra and Jagannatha!
This is the story of Lord Jagannath. As you can see, from the facts that Neelamadhava was Lord Krishna's heart and the divine voice assured to give the new statues in replacement for the lost Neelamadhava statue, it can be assured that Lord Jagannatha is none other than Krishna!
Updated:
This is the legend, as I read it in the internet. One such site, which explains about Lord Krishna's heart is :
The story of Nilamadhava
Comment: Do add some [references and citations to confirm the accuracy of your answer](https://hinduism.meta.stackexchange.com/a/793/4459). Note that we have a strict [Back it up!](https://hinduism.meta.stackexchange.com/a/2/4459) rule on this site. Do go through the [Guidelines for new users answering questions](https://hinduism.meta.stackexchange.com/a/126/4459). Good luck!
Comment: This is the legend, as I read it in the internet. One such site, which explains about Lord Krishna's heart is http://thehindus.org/the-story-of-nilamadhava/.
Answer: Yes, Lord Jagannath is normally described as a form of Lord Vishnu as already mentioned above by @Dr. Vineet Agarwal from the Purushottama Kshetra Mahatmya of Vaishnava Khanda of Sri Skanda Purana.
But again, this place is also a Shaktipeeth where the naval of Mata Sati fell. So, while describing the 51 Shaktipeeths, the Pīṭhanirṇaya, one of the most important Shakta texts described

उत्कले नाभिदेशञ्च विरजाक्षेत्रमुच्यते ।
विमला सा महादेवी जगन्नाथस्तु भैरवः ॥१३॥
13.1: At Utkala, the portion of My Nabhi (Navel) fell, and the place is known as Viraja Kshetra (Viraja Kshetra),
13.2: The Mahadevi (Great Goddess) there is known as Vimala (literally meaning stainless, spotless, pure), and the Bhairava there is Jagannatha (literally meaning the Lord of the World).

Sri Ishwara Gita 1.32.:

निरीक्ष्य ते जगन्नाथं त्रिनेत्रं चन्द्रभूषणम् ।
तुष्टबुर्हृष्टमनसो भक्त्या तं परमेश्वरम् ॥ १.३२॥
Sages eulogise Parmeshwar Shiva – who is Lord of all the worlds (Jagannatha), having three eyes and wearing the crescent moon on his head.

So, the same Puri Jagannath idol is worshipped in a tantrik way by Shaivas and Shaktas as Lord Bhairava and Vaishnavas as Lord Vishnu.
https://m.facebook.com/photo.php/?photo_id=1506972869627884&locale=ms_MY
This shows the oneness as the Rigveda 10.164.46 states.:

ekam sad viprA bahudhA vadanti |
The sages describe the one truth (brahman) by many various names/ways.

I hope this helps. Prd..
Answer: Yes. Jagannatha is a form of Lord Krishna himself -

The idols of Kṛṣṇa, Balarāma, Subhadrā the bestower of boons, were brought on the divine chariots. They were rendered beautiful and
wonderful by the adornment of jewels and gold coverings. With shouts
of victory and auspicious slogans the intelligent king accompanied by
his ministers and priests brought the images there. With the
accompaniment of sounds of different musical instruments and
auspicious chanting of vedic Mantras, he installed them in a holy,
beautiful auspicious place.

Brahma Purana, chapter 48
As seen above, the idol of Jagannatha is of Lord Krishna himself.


Distance traveled equals area under velocity time graph

Question: I know that for the particular case where the velocity of an object along a straight line is constant, the area beneath the velocity as a function of the time passed curve equals to the distance traveled.
That really makes sense, it derives from the fact that the distance traveled equals to the product of the constant velocity and the time, which derives immediately from the physical definition of velocity.
But why is that true in any case?
Why if I'll take any curve of velocity as a function of time and compute the area beneath it I'll get the distance that was traveled?
Any intuitive and rigorous proof for that?
Thanks in advance :)
Comment: You answered your own question : *distance traveled equals to the product of the constant velocity and the time*.
Comment: Why did I answer it? Every point on any velocity- time graph has to be the product of the velocity and the time?
Comment: If you take a small enough time interval, the velocity is approximately constant. (As the interval becomes smaller, the approximation becomes better.) The formula $\text{distance = velocity x time}$ applies to each small interval, and the areas add up.
Answer: The relationship you are referring to is
$$ v = \frac{\Delta x}{\Delta t}, $$
which gives you the area under the velocity curve (the displacement) when you rewrite it as $\Delta x = v\Delta t$. This is the discrete form of this relationship; it only works for large time intervals. If you wanted to know the velocity at any instant, you have to take the limit of this equation:
$$\lim_{\Delta t \rightarrow 0} v = \lim_{\Delta t \rightarrow 0} \frac{\Delta x}{\Delta t} = \frac{dx}{dt}.$$
Separating variables, you get $dx = vdt.$
If we solve this with bounds, we get a numerical answer for the displacement:
$$ dx = vdt$$
$$\int_{x_0}^x dx = \int_0^t v(t) dt $$
$$x = x_0 + \int_{0}^t v(t)dt. $$
However, if we were to solve it without bounds, we would get a function that describes the position as a function of time:
$$dx = vdt$$
$$\int dx = \int v(t)dt$$
$$x(t) = \int v(t)dt $$
In each case, you a numerical displacement or a formula for the displacement, respectively.
Comment: Your comment is appointed to be the most helpful good Sir.
Comment: Although I'd be happy if you'll elaborate more on the transition between dx=vdt and the integral itself. And I have another question regarding notations , V stands for velocity and T for time, why does the displacement is being notated with X?
Comment: I've edited my response to provide more detail. $x$ is a common symbol for displacement because you are often dealing with motion along the $x$-axis. For similar reasons, you will also see it notated with $y$, $z$, and also $r$. We tend to not use $d$ for displacement because it is ambiguous, i.e. v = dd/dt is confusing.
Answer: To convince yourself that this works even when the speed varies widely, break up time into lots of small intervals.  Over any one interval, you can approximate the speed as linear.  If that approximation isn't good enough, then you haven't broken time into small enough pieces.
The distance traveled during any one little slice of time is the average speed times the length of the time slice.  For linearly varying speed, the average speed is the middle speed, which is also the average of the two end speeds.
The total distance traveled is the sum of all the little distances traveled.  Now realize that the distance traveled during any one slice has nothing to do with the average speed during other slices.  Another way of saying that is that the speed can vary up and down, and this method still works.
Congratulations.  You have just re-discovered the integral.
Answer: I think there is a rigorous proof, yes, and it's essentially the derivation of the Riemann integral, which is something that is covered in a course on real analysis.
A very rough (and very non-rigorous) sketch of how this works is to take the function $v(t)$ and claim that it can be approximated as a sequence of constant values:
$$
v(t) \approx
 \begin{cases}
   v_0 &t\in[t_0,t_1)\\
   v_1 &t\in[t_1, t_2)\\
   \cdots \\
   v_{n-1} &t\in[t_{n-1}, t_n)
 \end{cases}
$$
Where $(t_0, t_1, \ldots t_n)$ are a monotonically-increasing sequence of values of $t$.
Now, obviously our approximation to $v(t)$ is constant during each of these little intervals, so we can simply use the high-school definition of the distance travelled for each of those intervals.  And we can sum these things to get something we claim is an approximation of the total distance travelled:
$$d \approx \sum\limits_{i=0}^{n-1} v_i(t_{i+1} - t_i)$$
So that's the easy bit: now what you need to do is the bit that needs some mathematical sophistication: you need to show that my claim that this expression for an approximate value for $v(t)$ actually is an approximate value for it, and that you can, in a well-defined way, increase the number of steps (and thus decrease the length of the intervals $[t_i, t_{i+1})$) and show that this sum converges in a well-defined way so long as $v(t)$ is well-behaved, and thus that, in the limit, $d$ is the distance travelled.  Doing this properly is not completely trivial (and the construction you need to use is a bit cleverer than my very slapdash one), but it can be done properly: any introductory text on real analysis should contain the details.
As to whether this is intuitive: I don't know.  I find that it is, but I'm also aware that intuitions vary.


Can I integrate a Discord channel with GitHub pull requests?

Question: I have a programming team that shares code using GitHub, but primarily communicates through Discord. How can I setup my team's Discord to automatically include updates about GitHub commits and pull requests?
Answer: Integrating GitHub updates into a Discord channel can be done with webhook updates.
Via Discord - Intro to Webhooks

Get the webhook URL for the server/channel you want to receive messages:

Open the webhook settings in your GitHub repository settings (Settings > Webhooks)

Click the "Add webhook" button, and enter the Discord-generated
  URL in the "Payload URL" section.
To ensure the webhook displays messages properly, make sure to append '/github' at the end of your URL.
For content type, stick with application/json, then customize which kind of events trigger webhook messages.

Click the last "Add webhook" button beneath the event notifications
  customization option, and you're all set!
Answer: I would like to add that as of now, Discord web hooks can receive Slack notifications.  Simply add <code>/slack</code> to the web hook URL.  This greatly increases the number of apps Discord can receive notifications from.
Comment: How do Slack notifications help set up GitHub notifications?


The other animations are not played when I delete idle animation

Question: I'm using Cyber Monsters 2 asset and found some weird stuff. If I delete idle animation or move it away, the other animations stop working and the monster stays in T-pose. When I check the animator, active animations are marked as playing but the actual animation is not played. What could be the reason?
Comment: A minority of users know how this model is set up. You might want to edit your question to show us how the asset is set up so that you increase your chances of getting more/better answers.
Answer: The prefab in the asset had an animator component with the avatar from idle animation. When I re-assigned another avatar, things started to work again.


Can I combine TextEdit files w/o copying and pasting?

Question: I've kept daily journal entries in Text Edit. Is there a way I can combine them into one file without cutting and pasting? I'm using TextEdit 1.1 on Mac OS El Capitan Version 10.11.6.
Answer: Credit:https://discussions.apple.com/thread/2242153?tstart=0
You can achieve this by opening terminal and typing cd [path of the folder where your journals are located] you should replace [ ] with the the folder where your diary entries are written , just drag and drop the folder into the terminal window.(Remember to hit space after typing cd) Then you can merge all the text edit files into one by typing
cat file1.txt file2.txt file3.txt > file4 The file1.txt, file 2.txt and so on will be your diary entries so if you have more just type the name of the file followed by a space and the > symbol will merge all the documents into one file4.txt you can change the name as per your concern.
Comment: Yes indeed a good answer here and you can improve on this but joining all files together and then sorting the final output list in alphabetical order by using `cat file1.txt file2.txt file3.txt > file4.txt && sort -u file4.txt -o file4.txt`
Answer: By default, TextEdit creates Rich Text formatted files, e.g. filename.rtf, not Plain Text formatted files, e.g. filename.txt and as such, if the default is in play, then you cannot use cat as suggested in the other answers. This is because cat doesn't understand Rich Text formatting in order to concatenate the files.
If the documents are default TextEdit Rich Text formatted, then you'll need to use the textutil command:
textutil -cat rtf file1.rtf file2.rtf -output newfile.rtf

Answer: Not from the TextEdit app but you can from the terminal. You can use the cat command and pipe file1 to a new file. Then use the cat command again on file2 and append to the new file. You may already know this but if not I can show you explicitly how to do it.
Comment: Thank you for answering my question. I don't know about the cat command. Can you tell me more about it or tell me where to find out? Thank you so much!
Comment: cat is a unix command that will print contents of a file. To do what you want you could do the following;  cat file1 > newfile then cat file2 >> newfile. This will combine fille1 and file2 into 1 newfile.
Comment: You can read the manual on most commands using the 'man' command. I.e. 'man cat'


Scheduled Automated Data Export SharePoint Online

Question: We are currently migrating our SharePoint 2010 site to SharePoint O365.  We have a SharePoint list in our on prem solution that takes part numbers out of our ERP systems database.  The users then can use the populated part list in other SharePoint lists for drop down selection of part numbers.  What is the best practice for this on SharePoint 365?  I am assuming we need to export the part list to Azure and then point SharePoint 365 to that table in Azure???  The process needs to be automated and scheduled because the part list can change over time and want the most updated data accessible to SharePoint 365.  I know my assumptions may be way off.  If anyone could just point me in the right direction, it would be very appreciated.  Thanks in advanced.
Tim
Answer: I think your idea sounds right. Schedule a timer based Azure function ( most likely in C# or PowerShell) that will sync the ERP data with the list. The function will run in the context of some service account, so permissions shouldnt be an issue


Comparing linear and nonlinear models

Question: Is it possible to compare between these two types of model? I have a set of data that involves 6 independent variables and 1 dependent variable. It is based of a questionnaire for social science students. I ran the assumption tests for linear regression and the linearity shows vague results, but somehow passes as a linear model. Thus, I would like to propose that fitting it into a modified Gompertz model gives a better fit and better predictions. I calculated the RMSE for both the linear and nonlinear model, and results shows that the Gompertz model has a smaller RMSE. Is this acceptable or is this impossible even to begin with?
Comment: Smaller RMSE is a good signal unless it is due to overfitting. You could compare the AIC or BIC values of your models to get a more objective measure of the improvement in RMSE.
Comment: How many parameters in each model?
Comment: parameters as in unknown? seven.
Answer: I presume the Gompertz model you fitted has more parameters than the linear model (you should be explicit about the exact model, since there's more than one model I might call a Gompertz model).
1) If that's the case you would expect the model with more degrees of freedom to have smaller RMSE.
2) It looks like the form of the nonlinear model was chosen after seeing the data. Even if the number of parameters were the same, you would expect it to have smaller RMSE.
So I wouldn't recommend RMSE for either of those reasons.
If you hadn't seen the data before choosing to fit the Gompertz model, you might compare AIC, or BIC or some similar criterion, but this would still have an issue of model selection which can impact your inference.
You might look to assessing out-of-sample predictive ability -- say via cross-validation (of MSE or RMSE perhaps). That will reduce, but not completely eliminate the effect of having seen the data, and avoid the issue of different numbers of parameters.
Comment: I guess it should be a separate question, but before I post it, maybe I will have some instant luck here.
Curiously, [Diebold (2013 working paper)](http://www.ssc.upenn.edu/~fdiebold/papers/paper113/Diebold_DM%20Test.pdf) (see sections 5 and 6) suggests that full sample should be used on most occasions and out-of-sample assessments are little more than a waste of data. (This sounds like a very general statement and may be misleading, but Diebold puts its very clearly in just a few pages.) I would be very curious to hear your opinion... I will post an excerpt from section 5 in the next comment.
Comment: [Can] any pseudo-out-of-sample model comparison procedure [...] compete in terms of consistency with the full-sample procedures [...][?] The answer turns out to be yes, but simultaneously there are simpler procedures with the same asymptotic justification and likely-superior finite-sample properties (SIC being one example).
A second key question [...] that drives the pseudo-out-of-sample model comparison literature [...] is whether pseudo-out-of-sample procedures can help insure against in-sample overfitting, or "data mining," in finite samples [...]. The answer is no (and the result is not new).
Comment: @Richard Your first impulse is the correct one - it would be a good question to post.

Comparing linear and nonlinear models


Beryllium chloride - Highly hydrolysable?

Question: Beryllium chloride's geometric structure is linear, with a bond angle of 180 degrees. Drawing the Lewis dot structure for this covalent compound, one can see that the compound is electron deficient and requires two lone pairs to achieve stability. As a result it is a strong Lewis acid. Since water has two lone pairs and is a strong Lewis base, mixing beryllium chloride with water results in stability for beryllium chloride and the evolution of energy.
My question is, why don't two lone pairs from either chlorine atom or even just a single chlorine atom make a coordinate bond with beryllium, as can be seen in the case of carbon monoxide where one of oxygen's lone pairs is donated to carbon to achieve nearest noble gas configuration of neon. If such a compound does not naturally exist, why does it not? Is it a theoretical defect or is there some explanation?
Answer: The structures of $\ce{BeX_2}$ where $\ce{X = F}$ or $\ce{Cl}$ can be found in A.F. Wells, Structural Inorganic Chemistry 5th edition, 1984 pages 412 and 1047.  There you will see that while the predicted structures for $\ce{BeX_2}$ are linear (sometimes rationalized with Lewis dot structures displaying double bonds and ignoring formal charge considerations of the halogens).  However, the actual structure of $\ce{BeCl_2}$ in the vapor-phase is a 3-coordinate dimer that converts to the linear structure at higher temperatures.  This behavior supports your 'gut feeling' that the electron deficiency of $\ce{Be}$ should be compensated for by another $\ce{Cl}$ atom.  The dimer network formed in the solid state allows lone pairs from $\ce{Cl}$ to be donated to the $\ce{Be}$ in an attempt to fill the valence shell of beryllium.
The use of a double bond to describe the nature of the $\ce{Be-Cl}$ bond is supported experimental data which shows that the bond length is shorter than expected for a single bond.
The image below is taken from Inorganic Chemistry by Miessler, Fischer and Tarr, 5th edition.
Comment: Thank you very much for this very detailed answer. This is exactly what I wanted. But, if the predicted structure is only observed at higher temperatures, how does the actual structure contribute to its higher hydrolysability?
Comment: The higher hydrolysability of beryllium chloride was explained in a textbook of physical chemistry as being a result of the fact that beryllium chloride is a linear structure with only single covalent bonds. Beryllium requires 2 more pairs of electrons to achieve stability, which when dissolved in water is obtained from water through pi coordinate bonds from two separate water molecules. The lone pairs occupy beryllium-chloride's vacant unhybridised pi orbitals. Can you explain this consistent with your own answer?
Comment: If a source states that the linear structure of beryllium chloride leads to a particular reactivity in the solid state, yet the published structure of the compound is not linear, then I would first make sure you didn't misread the source and, that being the case, disregard its conclusions since they were based on false premises.


In a document library, is there a way to include document views (visible in the information pane) as a column?

Question: In SharePoint document libraries, in Modern view, you can select a file and see, in the information pane, how many times it has been viewed. This is fine if you're only tracking a few documents. But it would be great if it could be included as a column in the list view, along with other document metadata. Is there a way to make that happen--either in Modern or Classic view?
Answer: Per my knowledge, there is no similar feature to page viewed times in list view. You can post this idea in UserVoice for MS team to take a look at.
For what we have now in SharePoint Online, we can check the site usage. You can have a quite clear view with more decent data about the usage of contents in your site.


How to use SQL file streaming win32 API and support WCF streaming

Question: I'm using Sql server file stream type to store large files in the backend. I'm trying to use WCf to stream the file across to the clients.
I'm able to get the handle to the file using SQLFileStream (API). I then try to return this stream. I have implemenetd data chunking on the client side to retrive the data from the stream.
I'm able to do it for regular filestream and memory stream. Also if i convert then sqlfilestream in to memorystream that also works. The only think that doesn't work is when I try to return sqlfilestream. What am I doing wrong.
I have tried both nettcpbinding with streaming enabled and http binding with MTOM encoding.
This is the error message am getting :

Socket connection was aborted. This could be caused by an error processing your mesage or a receive timeout being exceeded by the remote host, or an underlying network issue.. Local socket timneout was 00:09:59....
Here is my sample code
<code>        RemoteFileInfo info = new RemoteFileInfo();
        info.FileName = "SampleXMLFileService.xml";

        string pathName = DataAccess.GetDataSnapshotPath("DataSnapshot1");

        SqlConnection connection = DataAccess.GetConnection();

        SqlTransaction sqlTransaction = connection.BeginTransaction("SQLSileStreamingTrans");
        SqlCommand command = new SqlCommand();
        command.Connection = connection;
        command.Transaction = sqlTransaction;
        command.CommandText = "SELECT GET_FILESTREAM_TRANSACTION_CONTEXT()";

        byte[] transcationContext = command.ExecuteScalar() as byte[];

        SqlFileStream stream = new SqlFileStream(pathName, transcationContext, FileAccess.Read);
</code>
//            byte[] bytes = new byte[stream.Length];
//            stream.Read(bytes, 0, (int) stream.Length);
//            Stream reeturnStream = stream;
//            MemoryStream memoryStream = new MemoryStream(bytes);
<code>        info.FileByteStream = stream;

        info.Length = info.FileByteStream.Length;

        connection.Close();

        return info;

    [MessageContract]
    public class RemoteFileInfo : IDisposable
    {
        [MessageHeader(MustUnderstand = true)]
        public string FileName;

        [MessageHeader(MustUnderstand = true)]
        public long Length;

        [MessageBodyMember(Order = 1)]
        public System.IO.Stream FileByteStream;

        public void Dispose()
        {
            if (FileByteStream != null)
            {
                FileByteStream.Close();
                FileByteStream = null;
            }
        }
    }
</code>
ANy help is appreciated
Answer: I've just solved this for my situation.
My WCF service is set to InstanceContextMode.PerCall.
When I request the stream, I have to leave the transaction/ connection open until the object is used by the client. It's done via the Dispose method of the service (if you implement IDisposable, WCF will automatically call Dispose for you).
Works like a charm for me, the stream is read on the client without issue.
Comment: fixed my problem! just to be clear for anyone unsure, pull out all of your using statements which many WCF streaming examples use (to ensure correct disposal of objects) and dispose of them in the service Dispose function (implementing IDisposable.
Comment: This VB.Net example does what you need - http://petermeinl.wordpress.com/2012/02/20/managing-blobs-using-sql-server-filestream-via-ef-and-wcf-streaming/, easily converted to C# as I have, if anyone needs help just drop me a message/comment as I know how frustrating service errors can be to fix!


The difference in the meaning of the two mentioned sentences?

Question:

That is an actually sufficient account.
That is actually a sufficient account.

What is the difference in the meaning of 1 and 2?
Are both 1 and 2 correct gramatically?
If both mean the same, which one is more idiomatic?
Answer: Sentence #2 is grammatical and idiomatic.
Sentence #1 doesn't sound quite right. I don't think it's really because of the grammar, since an adverb would be appropriate modifying "is" (#1) or the adjective "sufficient" (#2).
The problem is with the meaning of the combination "actually sufficient". Unless you are using some specialized vocabulary where "actually sufficient" has a commonly accepted meaning, I don't think "actually sufficient" makes sense in English. I'm sure people will correct me if I'm wrong, but I think the adjective "sufficient" is a good descriptor by itself, and "actually" doesn't add anything significant. So I would say sentence #1 wasn't idiomatic.
Answer: The difference between the two sentences is simply what the word "actually" is modifying.
In the first first sentence, the modified word is "sufficient", whereas in the second, "is"  is modified. Neither is grammatically incorrect, and the only change is which, the action "to be" or the state "sufficient",  is being described as actual, and as such which is being highlighted or stressed in the sentence.
Also,  noting that the highlighted words in both sentences are "a" and "an", the difference between the two doesn't change anything in the sentence, or the meaning of the sentence. Simply, "a" is to be used before consonants, and "an" before vowels.
E.g.

a giraffe
an apple
a blue handbag
an antique clock


Is it decidable whether a given context free grammar generates an infinite number of strings?

Question: Is the decision problem "Does a given context free grammar generate an infinite number of strings" decidable? In order to test whether a context free grammar generates an infinite number of strings or not, we can write a program that would test this but would not halt. So it should be undecidable. Is this so?
Comment: Hint: are you familiar with the pumping lemma for CFGs? Try to follow its proof, and draw a connection to your problem.
Comment: No, your argument doesn't work. There could be some other way of approaching the problem which works better than the naive algorithm you describe. Think about the situation for regular languages, where such a shortcut does exist.
Answer: Let $G$ be a context free grammar, and let us assume that it is in Chomsky normal form. If it's not, we'll convert it first. An important property of this normal form is that the only way to derive the empty word is with the single rule $S_0\to \epsilon$ (where $S_0$ is the initial variable, which cannot be derived from other variables).
Thus, any other derivation adds some non-trivial part to a word.
Now, let $n$ be the number of variables in the grammar, and let $k$ be the maximal length on the right-side of a derivation rule. That is, $A\to B_1\cdots B_k$ is the maximal length. We are going to show the following theorem:

$G$ generates an infinite word iff it generates a word of length at least $k^{n+2}$.

Consider some word $w$ generated by the grammar, and a derivation tree for it. The derivation tree has branching factor of at most $k$, and thus it needs to be of height at least $\log_k |w|$ in order to derive $w$.
Take a really long word $w$. Just how long? take $w$ of length $k^{n+2}$. Then, every derivation tree of $w$ requires at least height $\log_k(k^{n+2})=n+2$. That means that there is some path in the tree of length $n+2$, and on this part there is some variable that repeats (since there are only $n$ variables). We can assume that the derivation from this variable derives other things besides itself, otherwise we can shorten the tree.
Now, you can "pump" the word $w$ to infinitely many other words that are generated, by repeating the subtree of the variable that derives itself.
If this sounds complicated, take a look at the pumping lemma, it's the same idea.
So now what? Well, take your grammar, and "remove" from it all words of length less than $k^{n+2}$ by intersecting it with a regular language of all words of length at least $k^{n+2}$, and check if the resulting grammar is non-empty. If it is, the original grammar generated an infinite language, and otherwise - a finite language.
Comment: @vzn - I added a more formal statement.
Comment: sounds about right but it would be helpful to phrase this in mathematical language/ proof ie in the form "CFL has infinite strings _iff_ ... [x]"
Comment: "We can assume that the derivation from this variable derives other things besides itself, otherwise we can shorten the tree." Could you please expand on this? Also, when you say $n$ variables in the grammar, that includes both terminals and nonterminals?
If that is the case, then I'm guessing: there is a path from the root of this tree to some leaf and this path has a length of $|n + 2|$. Because this length is greater than $n$, there must be some variable that are repeated along the path (not necessarily one after the other). This particular repetition can be pumped. Am I getting it right?
Comment: By "variables" I only count the non-terminals. In Chomsky normal form, terminals are only derived in a single rule, with a single terminal at a time. As for the derivation tree: if you have a "string" somewhere in the tree, i.e. of the form S->A->B->S, then you can shorten it, since you just had S deriving S and nothing else. So I mean we start by getting rid of these.
Answer: Without loss of generality¹, assume that the input grammar $G$ does not have $\varepsilon$-rules² and is in reduced form. That is,

every non-terminal appears in at least one derivation (starting from the initial non-terminal), and
every non-terminal produces at least one terminal string.

Then, $L(G)$ is infinite if and only if there is a non-terminal $A$ so that $A \Rightarrow^* \alpha A \beta$ for some $\alpha \cdot \beta \in (N \cup T)^+$.
Sketch of proof: For one direction, we have that $L(G)$ is infinite. Assume there was no such non-terminal; then there are only finitely many derivations by the pigeon-hole principle, which is a contradiction.
For the reverse, we have that there is such a non-terminal. Then, we know that $A$ can be derived to $\alpha^i A \beta^i$ for all $i \in \mathbb{N}$, and all these are distinct and derive to distinct terminal strings. Hence, $A$ alone generates an infinite set of substrings of strings in $L(G)$; therefore, $L(G)$ is infinite as well.
It's obvious that this criterion can be decided algorithmically; check for cycles of weight³ $> 0$ in the (multi-)graph made up of non-terminals as nodes, edges from $A$ to $B$ if $B$ appears on a right-hand-side of a rule for $A$, and weights are the number of terminals generated by these rules.
Hence, the given problem is decidable.

We know that there is such a grammar for every context-free language; there are even effective procedures for reducing grammars and removing $\varepsilon$-rules.
Except maybe $S \to \varepsilon$ iff $\varepsilon \in L(G)$, and then $S$ can not appear on the right-hand side of any rule.
If we eliminate chain rules $A \to B$ as well (a standard exercise), any cycle suffices.


How to choose a fixed position to labels in QGIS 2.14.2?

Question: How can I manually position these numbers for a better position in a polygon layer?
Comment: Have a look at this post along with the links: [Move label in QGIS?](http://gis.stackexchange.com/questions/183049/move-label-in-qgis)
Comment: Go with Joseph's answer above rather then the rule based approach below.
Comment: @ndawson Can you expand on why you prefer that approach? I'm genuinely interested
Comment: Jonas it is interesting your suggestion but must be created a rule for each polygon. It might be useful, but the suggestion of @Joseph it's easier because I just have to use one tool directly on the problematic tags and see the result immediately.
Answer: You could use the easy custom label plugin to move them where you want. See my blog post for a longer example of how this works.
Comment: The last one, feel free to edit.
Answer: Following the suggestion of @Joseph, I solved the question by this way:
Assuming that there are already defined labels.
Step 1: created two fields; xLabel and YLabel, decimal type, length 20, precision 4.
Step 2: Layer Properties > Labels > Placement > Data defined, maped the X and Y fields in 'Attribute field' to match with the fields previously created xLabel and YLabel.
Step 3: (the only action to repeat for each problematic label - activate Edit): With the Move label tool dragged the label to the desired position. The new position is automatically recorded in the xLabel and YLabel fields.
Answer: I suggest that you use a custom rule-based placement for each feature label.
You do this by creating a label-placement rule associated a unique value that the feature contains (e.g a id, gid or any other field which is unique).

Go to properties for the layer (right click layer and choose properties) and pick the 'Labels' tab.
Choose rule-based labelling in the dropdown, and press the '+' icon.

Filter on the unique value (in the example it is the field "id" and the integer 1). Choose offset from centroid and play around with the x,y values and quadrant placement until it looks good.

Repeat this for each point for which you want to manually place. With enough fiddling it should work.
Comment: the problem with this approach is that there needs to be one rule per feature. You could use 'single symbol' and add two fields (one for offset, e.g. "10,0" and one for quadrant), then use these as expressions. But both these approaches are more effort than using the built-in Move Label tool. (I've tried this approach, and it does work in some very specific situations, but those could use the new [Cartographic Placement option in 2.14](https://www.qgis.org/en/site/forusers/visualchangelog214/#feature-cartographic-placement-mode-for-point-labels) instead)
Comment: Thanks for the clarification. Was not aware of the 'Move Label' tool until today.
Answer: Create a polygon centroid, and then move the centroids where you want.


Can a woman 48 year old get pregnant

Question: A woman in this age  can be pregnant or not.Only with the pyshic way man and woman with no condom. Not the way with science that can done miracles.
Comment: Don't want to be that guy but this account seems to be a bit of a troll going around...
Answer: Conception (pregnancy) can occur from menarche (the onset of ovulation / menstrual period) to menopause (cessation of the menstrual period). The CDC lists the average age of menarche as about 13 years (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4137967/) and menopause as 51 (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2922699/).
A 48 year old woman, if still having an active menstrual cycle, can get pregnant. However, there are risks of having a pregnancy at that age. Remember that all of the eggs that a woman has are present at birth. This means that a 48 year old woman has kept all of those eggs for her entire life, and that they have been exposed to all of the various stresses that people have over a lifetime. This can include the effects of medications, radiation exposure (which accumulates over time), and other considerations. As a result, the risk of birth defects increases with age of the woman. I strongly recommend consultation with a physician, including special consultation with a fertilization expert. Genetic counseling may also be of particular benefit to help you with family planning.
Finally, I would also espouse getting a triple screen done should a successful pregnancy happen. This will help you to identify some potentially devastating genetic defects well before birth, thus giving you options for family planning.

Can a woman 48 year old get pregnant


Is it possible to separate token payer from service-consumer with special contract?

Question: In general, token-payer(=msg.sender) receives service from smartcontract.
Is it possible to separate token payer from service-consumer with special contract and general smartcontract above?
It means token-payer is user A (or contract) but service-consumer is user B.
Token is erc20.
Answer: In my opinion, yes this is possible but, no, it is not necessary or desirable to add complexity to a token contract or, generally, opinions about how to use it.
Think of the token contract as the defining document that describes the minimum important properties such as supply, symbol, contract address, minimal account (where are they?) and minimal functions such as transfer.
That is, one doesn't redesign the federal reserve note for every novel business idea or vending machine design, but the notes themselves impose any opinions about a business should work - separate concerns.
Contract B can be the consumer that receives instructions from user A.
Hope it helps.
Comment: I dont want to add complexity to token contract. It is just erc20 standard. In this case, I guess it is important to add new smartcontract that makes logic feasible and I am asking how to make smartcontract.
Comment: The design will be simplified with ERC223 which can signal contract B when it receives tokens, then contract B will do whatever it does. ERC223 is backward compatible with ERC20. It has an additional function, the tokenFallback() function.
Comment: "how to make smartcontract" is too broad to know what else about the process to focus on for you.


Prime numbers divide an element from a set

Question: Show that if $p$ is a prime number different from 2 and 5, then it divides at least one of the elements of the set $\left \{  1,11,111,1111,...\right \}$.
Comment: Hint: the decimal expansion of $1/p$ is periodic, since it's a rational number. For example, $1/7=0.\ 142857\ 142857\ 142857\dots$, and $7$ divides $111111$. Can you see the pattern and generalize?
Comment: @Jean-ClaudeArbaut: Wow. Very nice. Why don't you post this as a solution. wonderfull
Answer: Expanding on my comment, here is a direct solution.
Consider the sequence $u_{n+1}=10u_n\mod p$, with $u_0=1$. It can undertake only a finite number of values, so it's periodic, with some period $k$.
You have also that $u_n=10^n\mod p$, so periodicity reads:
$$10^{n+k}\equiv10^n\pmod{p}$$
And since $p$ is coprime to $10$, you can factor out $10^n$, and
$$10^{k}\equiv1\pmod{p}$$
That is, $p$ divides $10^k-1=999\dots999$.
If the prime number $p$ is greater that $5$, you are done, by dividing by $9$. The remaining case $p=3$ divides $111$.
Notice that repetitively computing $10u_n \mod p$, with $u_0=1$, is just another way to write the long division of $1$ by $p$.
Answer: Let $x=0.\overline{a_1a_2a_3\dots a_n}$ be the decimal number with $n$ periodic decimals in base $10$. Then:
$$10^nx=\overline{a_1a_2a_3\dots a_n}.\overline{a_1a_2a_3\dots a_n}$$
$$10^nx-x=\overline{a_1a_2a_3\dots a_n}$$
$$(10^n-1)x=\overline{a_1a_2a_3\dots a_n}$$
$$x=\dfrac{\overline{a_1a_2a_3\dots a_n}}{10^n-1}$$
From this you can see that any number $\overline{a_1a_2a_3\dots a_n}$ is divisible by $10^n-1$ iff $x$ have periodic decimals. There is no positive integer which divided by $2$ and $5$ give periodic decimal number, so for any other number it is divisible by $10^n-1$.
Answer: The transformation $f(x) = 10x + 1$ is invertible in $\mathbb{Z}_p$ for $p$ coprime with 10. Since $f(0) = 1$, 0 and 1 are on the same orbit. The set $\{1, 11, 111, \ldots\}$ is precisely this orbit.


How long did it take Fëanor and his sons to sail from Valinor to Beleriand?

Question: Fëanor tried to avenge his father Finwë's death and the theft of the Silmarils by gathering up a majority of the Noldor and marching to the harbors of Alqualondë to use the ships that lay there.  He was denied, and decided to take the ships by force thus commencing The Kinslaying at Alqualondë, which ended with Fëanor killing alot of Teleri Elves and bogarting their ships.  He then burned the remaining ships so that Fingolfin couldn't cross with him.
How long was the Voyage of the Noldor sailing from Valinor to Beleriand?
Answer: Some sweet maps
I'll try to explain this with maps. Yes, maps. I've found them. Thanks Google.
This is the map of Tolkien's creation made by Karen Wynn Fonstadt:

In the far left, you can see Valinor. If you want to go Beleriand by sea, you have to cross Belegaer and reach Bay of Balar (most optimistic approach).
And this is the map of Beleriand:

It must have been around 19 years (solar years). Too long? Must explain.
Explanation

In The Silmarillion, there is almost no hint of a passage of time
  between the departure of the Noldor from Tirion, and their arrival
  in Middle-earth. The only point where the length of the journey is
  mentioned is in ch. 9, Of the Flight of the Noldor, where we're told that
  they had 'marched for a great while in the unmeasured night' (this
  was after the Darkening of Valinor, so 'night' here just means that
  they were marching in darkness).
The Noldor set out from the central regions of the World, and a very large number of them had to travel thousands of miles into the far
  north. It's reasonable to assume that this journey must have taken
  at least several years.
In fact, we have the Annals of Aman to give us some insight into
  this matter (in Morgoth's Ring, volume 10 of The History of
  Middle-earth). There, the departure of the Noldor is dated 1495,
  and their arrival in Middle-earth is dated 1497. These dates are
  given in Years of the Trees from their first planting, with each
  Year of the Trees being equivalent to about 9½ solar years. The Flight ofthe Noldor from Aman into Middle-earth, then, took
  very roughly nineteen years to complete.
Whether the journey of the Noldor was a 'flight' or a 'return' is
  a matter of perspective. To the Valar, and the Elves they left
  behind in Aman, the Noldor were fleeing into the dark east of the
  World. To the Sindar and other Elves who had remained in the
  Hither Lands, it was the return of long-sundered kin out of the
  unknown west.

Also take a look at Shadowy Seas.
Also related: Nienna.
Bonus Information >> The only hint is in Quenta Silmarillion ch. 9, Of the Flight of the Noldor, where she 'cast back her grey hood'. Given that Gandalf was her student, this might (though somewhat doubtfully) have some relevance to his title, the Grey.
Comment: The Annals of Aman doesn't show them setting sail until 1497, not 1495.
Answer: Seventy-two years

The Valian Year spent in reaching Beleriand via the ice aged all the Exiles about 2 years (it took 144 Sun-years) = 72 (but Feanor reached Beleriand in one half the time = Bel. 50 and so only aged 1 year). As soon as they reached Beleriand the rate quickened to 50 = 1.
The Nature of Middle-earth - "Difficulties in Chronology"

Tolkien says that it took 144 years for Fingolfin to cross the ice, and that Feanor's trip took only half the time. Thus it took him 72 years.
This is all according to Tolkien's later 1959 chronology, where each Valian Year is 144 sun years, and and the first age timeline was massively reworked. According to previous versions of the chronology it was either 1 year, 7 years, or about 10 years.


What is the purpose of the sand/gravel bed under dry-laid flagstone?

Question: I have soil with a lot of clay in it and few stones, so it's not too hard to get level.  I've got flagstone in a couple of small areas.  Some of it is on a bed of gravel and some of it is on bare soil.  I don't see that one is any worse off than the other.  I was just curious if the sand/gravel bed typically installed under flagstone is for drainage, ease of leveling, weed control, pest control or other..
Comment: Drainage, critical to have drainage.
Answer: Leveling, drainage, and protection of the flagstone, especially in freezing climates.  Basically, in heavy soils, water can pool up under the flagstones and produce frost heaves, which will allow the flagstones to break much more easily. The sand and gravel produces an even base that supports the whole stone, and keeps it from cracking.


How Chern-Simons gauge field transform fermion to scalar?

Question: In A.Zee's "QFT in a nutshell"book Page 324, after he wrote down the general Lagrangian, he said "in previous chapter, we learned that by introducing a Chern-Simons gauge field we can transform $\psi$ to a scalar field" However, I didn't found any clarification about this argument in previous chapter. Any comment or references are greatly appreciated.
Comment: Please add more details to your question, not everyone has a Zee lying around: The general Lagrangian *of what*? $\psi$ is any fermion field? A Chern-Simons gauge field is the Chern 3-form [here](http://en.wikipedia.org/wiki/Chern%E2%80%93Simons_theory#Dynamics)? How does Zee couple the Chern-Simons field to the fermion?
Comment: The Lagrangian is just the usual form of describing electron in a magnetic field, since Zee want to argue Quantum Hall effect in that page. However, my question seems like a general argument which is independent of specific Lagrangian setup. The Chern-Simons term is just AdA, no AAA gauge self-interaction term .About the coupling thing, in previous chapter Zee argued the Chern-Simons term can be generated from gauged kinetic term by loop effects. I strongly recommend whoever interested reading Zee's book for explicit detail.
Answer: Yes, this is explained in the previous chapter (Fractional Quantum Hall effect)
Surprisingly, when we have a filling factor $\nu$ of the Landau levels of form $\frac{1}{3}$ or $\frac{1}{5}$, the quantum Hall fluid appears incompressible. This seems curious, because the integer quantum Hall effect appears only for integer values, corresponding to $\nu$ Landau levels completely filled (they have the degeneracy $\frac{BA}{2\pi}$, where $B$ is the magnetic field, and $A$ is the area occupied by the electrons).
So, something happens, calling $N_e$ the number of electrons ,when $\dfrac{N_e}{(\frac{BA}{2\pi})}= \nu$, with $\nu^{-1}$ odd.
Now, you have to notice that $\frac{BA}{2\pi}$ is simply the number of flux quanta $N_\phi$
So, finally, the number of flux quanta by electron, is : $\dfrac{N_\phi}{N_e} = \nu^{-1}$, a odd integer.
Now, if we look at the statistics, exchanging $2$ particles, we have the $(-1)$ term coming from the Fermi statistics, now multiplyed by an other $(-1)^{\nu^{-1}}$ term coming from a Aharanov-Bohm effect.
So, finally, one have a $(+1)$ term, which signals a Bose statistics.
A Dirac spinor in $(2+1)$ dimensions having $2$ degrees of freedom, we simply have to choose a bosonic field with  $2$ degrees of freedom, that is a complex scalar field.
Comment: Oh I see, that argument just sit above the Lagrangian..I should have read more carefully. Thank you very much for pointing that out.


Summing over tensor indices

Question: How can I prove that the product of two rank-2 tensors, one of which is symmetric and one is antisymmetric, must =0 when their indices are summed over?
Comment: For the expression $A^i _j S^j _i$ swap the indices in two ways, once by renaming $i$ and $j$(we are allowed to do this since these indices appear twice), second by using the symmetry properties of the two tensors.
Answer: Let $\omega$ be antisymmetric and $g$ be symmetric. Then applying both symmetries gives
$$ \sum_{i,j} \omega^{ij} g_{ij} = -\sum_{i,j} \omega^{ji} g_{ji}. $$
Now since $i,j$ are both summed over the same range, we can swap them without changing the meaning of this expression, and thus we have shown the sum is equal to its negative; i.e. it is zero.

Summing over tensor indices


Add VAT option for each product

Question: How i can Add VAT option for each product. There are some with VAT and others with no VAT. And if VAT it should show on the order for the customer.
Answer: Magento products have tax classes you need for every tax percentage one tax class.
BE CAREFUL! if you ship in multiple countries and have this country tax, you need a tax class for every product group which has a tax percentage in one or the other country.
Example (only VAT and not 100% sure this is correct in regards of content):
Germany:

cinema ticket 19%
Books 7%
cigaretes 19%

This looks like you need two tax classes.
Austria:

cinema ticket 13%
cigaretes 20%
books 10%

But if you ship to austria you need three!
After creating all the tax classes you need to define all tax rates for each country.
All customers get a tax class too. So you can differ between the ones who pay tax (customers from your country normally) and thos who don't e.g. companies from EU.
Then you need to map all tax classes to the tax rates.
More on this here, with screenshots! Thanks to hostknox
Comment: @FabianBlechschmidt thank you in advance , i've solved.
Comment: I can confirm (to the best of my knowledge) that the AT tax rates are correct to this date.
Comment: Ahhh EU tax rates <3 Great answer!
Comment: thank you for your response but i have one question , when i create a tax class and define all steps needed , can i set **VAT**  fixed value  not in % ?
Comment: No. But Magento supports Fixed Product Taxes.  I have no clue how this works: http://docs.magento.com/m1/ce/user_guide/tax/tax-fixed-product.html

Add VAT option for each product


Android JNI JavascriptCore JSEvaluateScript, JSObjectMakeFunction, JSObjectCallAsFunction give Parse or Range Error

Question: I'm using JavaScriptCore and JNI and i'm trying to use some JS code in my Open GL ES android application.
If i call JSEvaluateScript, JSObjectMakeFunction, JSObjectCallAsFunction in the main loop, without using a timer (so before the first call to on_draw_frame), all is ok.
But if i try JSEvaluateScript, JSObjectMakeFunction, JSObjectCallAsFunction in drawInRest, or/and using an implementation of setTimeout like
setTimeout ( function () {
    console.log("i'm in the callback");
}, 1000 );

I'm getting a Parse Error (but the syntax is correct) or a Range Error : max call stack exceeded (i'm 100% sure that there is no recursive call here).
More info :
i get this between the call of a JSEvaluateScript (outside the on_draw_frame, main loop) and the second one (calling from on_draw_frame, when the trigger the setTimeout callback)
11-08 15:52:03.905: D/libEGL(2916): loaded /system/lib/egl/libEGL_emulation.so
11-08 15:52:03.915: D/(2916): HostConnection::get() New Host Connection established 0x2a1d68d8, tid 2916
11-08 15:52:03.925: D/libEGL(2916): loaded /system/lib/egl/libGLESv1_CM_emulation.so
11-08 15:52:03.935: D/libEGL(2916): loaded /system/lib/egl/libGLESv2_emulation.so
11-08 15:52:03.976: W/EGL_emulation(2916): eglSurfaceAttrib not implemented
11-08 15:52:03.985: D/OpenGLRenderer(2916): Enabling debug mode 0
11-08 15:52:04.026: D/(2916): HostConnection::get() New Host Connection established 0x2a1e5ae0, tid 2929

EDIT :
I find where the errors happens : after the first JNI Call.
I explain :
In the first JNI Call, i create my javaScriptView, which contains a static ref to my JSGlobalContext. Then i call JSEvaluateScript to evaluate my script, which do a setTimeout.
I configure OpenGL ES to, at each on_draw_frame, it call a JNI method to do the on_draw_frame in c++. So after some JNI Call (depends of the timer of the setTimeout), the callback of the setTimeout is call and crash.
Any ideas to how to fix this ?
Answer: Try run JSEvaluateScript, JSObjectMakeFunction and JSObjectCallAsFunction in one thread.
If you call on_draw_frame from onDrawFrame(GL10 gl), this is called from another thread than onCreate() in MainActivity (in which you init js), so it can be cause of your problem.
Try init js once in onDrawFrame(GL10 gl).


Workarounds for Mobile Safari (iOS 7.1) Fixed Position Tap Inaccuracy?

Question: Safari on iOS 7 is exhibiting a bug with a fixed header Nav where the click targets don't seem to map correctly to where the elements are painted.
Demo
Steps to reproduce:

Scroll the page until Safari's address bar shrinks and bottom toolbar disappears.
Tap a button on the bottom row (for example the 'z' button).

This should cause the address bar to expand and the bottom toolbar to reappear.
Notice also that the button click does not trigger.

Now try to tap a button in the top row (for example the '1' button).

A button lower than where the tap occurs will activate.

Some ideas I've had for a workaround would require...

An event that is triggered when the Safari UI state changes. I haven't seen resize or scroll trigger. Is there a mobile safari specific one I may be missing?
An event that I can trigger that toggles this UI state.
Answer: Have you tried adding <code>-webkit-backface-visibility: hidden;</code> to your header buttons?
If that works, it's probably due to layer promotion in WebKit. I can add additional info/links if it does.