I want to disable printing and saving of a webpage from file menu with JQUERY or JAVASCRIPT

Question: Please help I want a code for disabling printing and saving of a webpage from file menu with JQUERY or JAVASCRIPT
Answer: You can have a CSS style that will only be visible when printing:
<code><link rel="stylesheet" href="print.css" type="text/css" media="print" />
</code>
Then I guess you can do something like:
<code>*{
    color:#fff !important;
    background:#fff !important;
    line-height:0 !important;
    font-size:0 !important;
    height:0 !important;
    width:0 !important;
    /*...*/
}
</code>
Here is also a tutorial.
This won't prevent printing, but should work for what you want.
About preventing the page to be saved, that is impossible, if they are viewing the page, they already downloaded it actually. The best you can is to obfuscate your code to make it unreadable.
Obfuscating/Compressor Tools:

HTML
CSS
JavaScript
Answer: You may be able to disable printing with some clever CSS but I do not believe you are going to be able to prevent a user from saving the page. A web page can't really modify the behavior of the browser to that extent.
To clarify, when I say disable printing, you may be able to cause it to only print a blank page, not truly disable it.


Is every covariance matrix positive definite?

Question: I guess the answer should be yes, but I still feel something is not right. There should be some general results in the literature, could anyone help me?
Comment: @Jingjings: I can see in your profile that you have *never* upvoted or accepted any answers; this is quite remarkable given that you have a lot of good questions with many good answers. I guess you are not really aware of how it works. The idea is that you should upvote any answer that you find useful and accept any answer that you think solves your issue. It looks like you can upvote a lot of answers and also accept some of them.
Comment: Related questions: [Why does correlation matrix need to be positive semi-definite and what does it mean to be or not to be positive semi-definite?](http://stats.stackexchange.com/q/69114/22228); also [Is every correlation matrix positive semi-definite?](http://stats.stackexchange.com/q/125412/22228) and [Is every covariance matrix positive definite](http://stats.stackexchange.com/questions/56832/is-every-covariance-matrix-positive-definite)
Comment: Every covariance matrix is Positive semi-definite. That means every covariance matrix must have non-negative eigen values. If none of the eigen value is zero then covariance matrix is additionally a Positive definite.
Comment: A valuable discussion on this topic can be found in our paper
Stehlik, M.; Helpersdorfer Ch., Hermann,P. Supina,J. Grilo, L. M., Maidana; J.P., Fuders, F. Stehlikova, S. (2017) Financial and risk modelling with semicontinuous covariances, Information Sciences, 394-395, 246-272
Comment: A=[4 1 0;1 0 -1 ;0 -1 8] is positive define
Answer: No.
Consider three variables, $X$, $Y$ and $Z = X+Y$. Their covariance matrix, $M$, is not positive definite, since there's a vector $z$ ($= (1, 1, -1)'$) for which $z'Mz$ is not positive.
Population covariance matrices are positive semi-definite.
(See property 2 here.)
The same should generally apply to covariance matrices of complete samples (no missing values), since they can also be seen as a form of discrete population covariance.
However due to inexactness of floating point numerical computations, even algebraically positive definite cases might occasionally be computed to not be even positive semi-definite; good choice of algorithms can help with this.
More generally, sample covariance matrices - depending on how they deal with missing values in some variables - may or may not be positive semi-definite, even in theory. If pairwise deletion is used, for example, then there's no guarantee of positive semi-definiteness. Further, accumulated numerical error can cause sample covariance matrices that should be notionally positive semi-definite to fail to be.
Like so:
<code> x <- rnorm(30)
 y <- rnorm(30) - x/10 # it doesn't matter for this if x and y are correlated or not
 z <- x+y
 M <- cov(data.frame(x=x,y=y,z=z))
 z <- rbind(1,1,-1)
 t(z)%*%M%*%z
              [,1]
[1,] -1.110223e-16
</code>
This happened on the first example I tried (I probably should supply a seed but it's not so rare that you should have to try a lot of examples before you get one).
The result came out negative, even though it should be algebraically zero. A different set of numbers might yield a positive number or an "exact" zero.
--
Example of moderate missingness leading to loss of positive semidefiniteness via pairwise deletion:
<code>z <- x + y + rnorm(30)/50  # same x and y as before.
xyz1 <- data.frame(x=x,y=y,z=z) # high correlation but definitely of full rank

xyz1$x[sample(1:30,5)] <- NA   # make 5 x's missing

xyz1$y[sample(1:30,5)] <- NA   # make 5 y's missing

xyz1$z[sample(1:30,5)] <- NA   # make 5 z's missing

cov(xyz1,use="pairwise")     # the individual pairwise covars are fine ...

           x          y        z
x  1.2107760 -0.2552947 1.255868
y -0.2552947  1.2728156 1.037446
z  1.2558683  1.0374456 2.367978

 chol(cov(xyz1,use="pairwise"))  # ... but leave the matrix not positive semi-definite

Error in chol.default(cov(xyz1, use = "pairwise")) :
  the leading minor of order 3 is not positive definite

 chol(cov(xyz1,use="complete")) # but deleting even more rows leaves it PSD

          x          y          z
x 0.8760209 -0.2253484 0.64303448
y 0.0000000  1.1088741 1.11270078
z 0.0000000  0.0000000 0.01345364
</code>
Comment: Of course it only occurs when it's not of full rank (or very close to it). Look at the definition of PSD (and @sjm.majewski's mention of the relation to variance), and this much is clear. But to define it as pathological seems odd, since these non-full rank situations happen all the time in practice. This is not simple pedantry - it affects real data sets every day, and as a result generates regular questions here. I'll talk about missingness and pairwise deletion above, because there's not room for it here.
Comment: I think it would be great to add to this answer an explicit remark that in the $n<p$ situation the sample covariance matrix will be guaranteed to fail to be positive-definite (it will be low rank, i.e. will have some zero eigenvalues). I was searching if we have a thread that this Q http://stats.stackexchange.com/questions/198488 can be closed as a duplicate of, and I think this would be a good candidate but you don't seem to be mentioning the $n<p$ case.
Comment: +1: But as a comment mostly for you wording: As you present it, it looks like that PSD-ness is not guaranteed in the general case. As shown in sjm.majewski's answer you need a "pathological" case (non-full rank) and you end up with that issue. (I fully agree with the numerics comment) Can you elaborate a bit more missing values problem where you can't even guarantee PSD even if you account of numerical errors? (I assume you aren't concerned with sparsity of measurements etc. when saying that)
Answer: Well, to understand why the covariance matrix of a population is always positive semi-definite, notice that:
$$
\sum_{i,j =1}^{n} y_i \cdot y_j \cdot Cov(X_i, X_j) = Var(\sum_{i=1}^n y_iX_i) \geq 0
$$
where $y_i$ are some real numbers, and $X_i$ are some real valued random variables.
This also explains why in the example given by Glen_b the covariance matrix was not positive definite . We had $y_1 =1 , y_2 = 1, y_3 = -1$, and $X_1 = X, X_2 = Y, X_3 = Z = X+Y$, so $\sum_{i=1}^{3} y_iX_i = 0$, and the variance of a random variable which is constant is $0$.
Comment: This ought to be the accepted answer. The question just asks about "covariance matrices" which generally refer to the population covariance matrix of random variables, not the sample.
Comment: where was this formula derived $\sum_{i,j =1}^{n} y_i \cdot y_j \cdot Cov(X_i, X_j) = Var(\sum_{i=1}^n y_iX_i) \geq 0$?
Comment: May I ask what is the formula you used in your answer?
Comment: If you mean the formula with variance and covariances, then you can derive it from the formula for the square of the sum (that is square of the sum is equal to the sum of products for all pairs).
Answer: As the other answer note, the covariance matrix is positive semi-definite (which I prefer to call non-negative definite), but not necessarily positive definite.  We can show that the covariance matrix is positive semi-definite from first principles using its definition.  To do this, suppose we consider a random vector $\mathbf{X}$ with mean vector $\boldsymbol{\mu}$ and covariance matrix $\mathbf{\Sigma}_\mathbf{X}$.  For any conformable vector $\mathbf{z}$ we can define the corresponding vector:
$$\mathbf{Y} = (\mathbf{X} - \boldsymbol{\mu}_\mathbf{X})^\text{T} \mathbf{z}.$$
Since $||\mathbf{Y}|| \geqslant 0$ we then have:
$$\begin{aligned}
\mathbf{z}^\text{T} \mathbf{\Sigma}_\mathbf{X} \mathbf{z}
&= \mathbf{z}^\text{T} \mathbb{E}((\mathbf{X} - \boldsymbol{\mu}_\mathbf{X}) (\mathbf{X} - \boldsymbol{\mu}_\mathbf{X})^\text{T}) \mathbf{z} \\[6pt]
&= \mathbb{E}(\mathbf{z}^\text{T} (\mathbf{X} - \boldsymbol{\mu}_\mathbf{X}) (\mathbf{X} - \boldsymbol{\mu}_\mathbf{X})^\text{T} \mathbf{z}) \\[6pt]
&= \mathbb{E}(\mathbf{Y}^\text{T} \mathbf{Y}) \\[6pt]
&= \mathbb{E}(||\mathbf{Y}||^2) \geqslant 0. \\[6pt]
\end{aligned}$$
This establishes that the covariance matrix $\mathbf{\Sigma}_\mathbf{X}$ is positive semi-definite.  Moreover, we can see that $\mathbf{z}^\text{T} \mathbf{\Sigma}_\mathbf{X} \mathbf{z} = 0$ if and only if $\mathbf{Y}=(\mathbf{X} - \boldsymbol{\mu}_\mathbf{X})^\text{T} \mathbf{z}=\mathbf{0}$ almost surely.
Answer: As the other answers already make clear, a covariance matrix is not necessarily positive definite, but only positive semi-definite.
However, a covariance matrix is generally positive definite unless the space spanned by the variables is actually a linear subspace of lower dimension. This is exactly why in the example with X, Y and Z=X+Y the result is only positive semi-definite, but not positive definite. Although the variables span a three-dimensional space, they actually describe only a two-dimensional linear subspace (because they are not linearly independent).
Answer: $$\begin{array}{l}theory:\left\{ {{{\bf{\Sigma }}_{\bf{X}}}{\rm{ is positive semi - definite}}} \right.\\proof::\\set:\left\{ {{\bf{a}} = {\rm{vector }}\left( {p \times 1} \right){\rm{ }}\left( {{\mathop{\rm const}\nolimits} } \right) \ne \vec 0} \right.\\{{\bf{a}}^T}\Sigma {\bf{a}} = {\left[ {\begin{array}{*{20}{c}}{{a_1}}\\{{a_2}}\\ \vdots \\{{a_p}}\end{array}} \right]^T}\left[ {\begin{array}{*{20}{c}}{{\sigma _{11}}}&{{\sigma _{12}}}& \cdots &{{\sigma _{1p}}}\\{{\sigma _{21}}}&{{\sigma _{22}}}& \cdots &{{\sigma _{2p}}}\\ \vdots & \vdots & \ddots & \vdots \\{{\sigma _{p1}}}&{{\sigma _{p2}}}& \cdots &{{\sigma _{pp}}}\end{array}} \right]\left[ {\begin{array}{*{20}{c}}{{a_1}}\\{{a_2}}\\ \vdots \\{{a_p}}\end{array}} \right]\\ = \left[ {\begin{array}{*{20}{c}}{{a_1}{\sigma _{11}} + {a_2}{\sigma _{21}} +  \cdots  + {a_p}{\sigma _{p1}}}& \cdots & \cdots &{{a_1}{\sigma _{1p}} + {a_2}{\sigma _{2p}} +  \cdots  + {a_p}{\sigma _{pp}}}\end{array}} \right]\left[ {\begin{array}{*{20}{c}}{{a_1}}\\{{a_2}}\\ \vdots \\{{a_p}}\end{array}} \right]\\ = \left[ {\begin{array}{*{20}{c}}{\sum\limits_{i = 1}^p {{a_i}{\sigma _{i1}}} }& \cdots & \cdots &{\sum\limits_{i = 1}^p {{a_i}{\sigma _{ip}}} }\end{array}} \right]\left[ {\begin{array}{*{20}{c}}{{a_1}}\\{{a_2}}\\ \vdots \\{{a_p}}\end{array}} \right]\\ = \left[ {\begin{array}{*{20}{c}}{\sum\limits_{i = 1}^p {{a_i}{\mathop{\rm Cov}\nolimits} \left( {{X_i},{X_1}} \right)} }& \cdots & \cdots &{\sum\limits_{i = 1}^p {{a_i}{\mathop{\rm Cov}\nolimits} \left( {{X_i},{X_p}} \right)} }\end{array}} \right]\left[ {\begin{array}{*{20}{c}}{{a_1}}\\{{a_2}}\\ \vdots \\{{a_p}}\end{array}} \right]\\ = \sum\limits_{j = 1}^p {{a_j}\sum\limits_{i = 1}^p {{a_i}{\mathop{\rm Cov}\nolimits} \left( {{X_i},{X_j}} \right)} }  = \sum\limits_{j = 1}^p {\sum\limits_{i = 1}^p {{a_i}{a_j}{\mathop{\rm Cov}\nolimits} \left( {{X_i},{X_j}} \right)} } \\\left[ {rule:\left\{ {{\mathop{\rm var}} \left( {\sum\limits_{i = 1}^p {{a_i}{X_i}} } \right) = \sum\limits_{j = 1}^p {\sum\limits_{i = 1}^p {{a_i}{a_j}{\mathop{\rm cov}} \left( {{X_i},{X_j}} \right)} } } \right.{\rm{ }}\left[ {see{\rm{ }}below} \right]} \right.\\ = {\mathop{\rm Var}\nolimits} \left( {\sum\limits_{i = 1}^p {{a_i}{X_i}} } \right) = {\mathop{\rm Var}\nolimits} \left( {{{\bf{a}}^T}{\bf{X}}} \right) \ge 0\end{array}
$$

Following is followed by the answer from sjm.majewski
$$\begin{array}{l}rule:\left\{ {{\mathop{\rm var}} \left( {\sum\limits_{i = 1}^p {{a_i}{X_i}} } \right) = \sum\limits_{j = 1}^p {\sum\limits_{i = 1}^p {{a_i}{a_j}{\mathop{\rm cov}} \left( {{X_i},{X_j}} \right)} } } \right.\\proof,eg:\\\left\{ \begin{array}{l}{\mathop{\rm var}} \left( {{a_1}{X_1} + {a_2}{X_2} + {a_3}{X_3}} \right) = {\mathop{\rm var}} \left( {\sum\limits_{i = 1}^3 {{a_i}{X_i}} } \right)\\ = {\mathop{\rm var}} \left( {{a_1}{X_1} + {a_2}{X_2}} \right) + 2{\mathop{\rm cov}} \left( {{a_1}{X_1} + {a_2}{X_2},{a_3}{X_3}} \right) + {\mathop{\rm var}} \left( {{a_3}{X_3}} \right)\\ = \left( {{\mathop{\rm var}} \left( {{a_1}{X_1}} \right) + 2{\mathop{\rm cov}} \left( {{a_1}{X_1},{a_2}{X_2}} \right) + {\mathop{\rm var}} \left( {{a_2}{X_2}} \right)} \right) + 2\left( {{\mathop{\rm cov}} \left( {{a_1}{X_1},{a_3}{X_3}} \right) + {\mathop{\rm cov}} \left( {{a_2}{X_2},{a_3}{X_3}} \right)} \right) + {\mathop{\rm var}} \left( {{a_3}{X_3}} \right)\\ = \left( {{a_1}^2{\mathop{\rm var}} \left( {{X_1}} \right) + 2{a_1}{a_2}{\mathop{\rm cov}} \left( {{X_1},{X_2}} \right) + {a_2}^2{\mathop{\rm var}} \left( {{X_2}} \right)} \right) + 2\left( {{a_1}{a_3}{\mathop{\rm cov}} \left( {{X_1},{X_3}} \right) + {a_2}{a_3}{\mathop{\rm cov}} \left( {{X_2},{X_3}} \right)} \right) + {a_3}^2{\mathop{\rm var}} \left( {{X_3}} \right)\\ = {a_1}^2{\mathop{\rm var}} \left( {{X_1}} \right) + 2{a_1}{a_2}{\mathop{\rm cov}} \left( {{X_1},{X_2}} \right) + {a_2}^2{\mathop{\rm var}} \left( {{X_2}} \right) + 2{a_1}{a_3}{\mathop{\rm cov}} \left( {{X_1},{X_3}} \right) + 2{a_2}{a_3}{\mathop{\rm cov}} \left( {{X_2},{X_3}} \right) + {a_3}^2{\mathop{\rm var}} \left( {{X_3}} \right)\\ = \sum\limits_{j = 1}^3 {\sum\limits_{i = 1}^3 {{a_i}{a_j}{\mathop{\rm Cov}\nolimits} \left( {{X_i},{X_j}} \right)} } \end{array} \right.\end{array}%
$$


Are large passenger aircraft steered during taxi by changing the angle of the front landing gear?

Question: When moving to and from the runway, does a large passenger aircraft turn by changing the thrust difference on its side engines, or by turning the front landing gear to a different angle? If it is by turning the front landing gear, through what device does the pilot control the angle?
Comment: And sometimes the nose gear jams at some awkward angle at takeoff and can't be retracted and is unusable for landing. This leads to some spectacular fireworks that makes the evening news, and some aircraft damage, but rarely injury.
Answer: During taxiing aircraft turn using their nose wheel.
The nose wheel is usually hydraulically controlled. The pilot operates it through a tiller. The nose gear can rotate usually quite far, sometimes to almost 90 degrees.
At high speeds, directional control is achieved using the rudder pedals. The nose gear is often linked to the rudder pedals, however the maximum rotation is limited. The nose gear steering does not exactly match to the the rudder steering at all speeds. At low speeds the rudder is ineffective so the nose wheel steering is dominant. For sharp turns the tiller is always used because of the limited rotation by the pedals.

A320 Nose wheel tiller

B747-400 Nose wheel tiller
Comment: Does the tiller automatically reposition itself to the straight position, or does the pilot have to straighten it?
Comment: Also, although the tiller is named after the device on a boat, physically it is moved nothing like it! In Boeing aircraft, typically it rotates like the arms of a clock, with "straight ahead" being sprung to return at 12 o'clock, and "90º" left or right at about 7 or 5 o'clock. Airbus (and other) aircraft typically have it mounted about a shaft, rotating like a corkscrew or wrench.
Answer: While turning the nose gear is the primary means of turning while taxiing, differential thrust can be used when necessary. Offhand I can think of three instances where differential thrust should be used on an airplane such as the 747:

If for whatever reason you are taxiing very slowly, and you're on narrow taxiways and need to make a 90 degree turn, you'll need differential thrust to keep the airplane from stopping in the turn.
If your center of gravity is near the aft limit, there won't be much weight on the nose gear, and it might start skidding when you try to turn significantly without differential power.
If the asphalt is hot and/or you're on reverted rubber, the nose gear won't have a lot of traction, and you really need to think about using differential power. I almost slid off a taxiway at Jeddah one day in such a situation even though my taxi speed was only around 8 knots. A general rule of thumb for the 747 in making 90 degree turns was to have your taxi speed down to 10 knots or less, otherwise the nose wheels might just skid.


visualisation of the universe's expansion

Question: in physics we were learning about the universe and the big bang. we were being told that everything came from one point and 'exploded' outwards, and is continuing to expand. I felt that this explanation was unclear, so I said that it was more like everything being one the surface of an expanding 'balloon', but with an extra dimension, a space which is the hyper surface of the expanding universe. my teacher disagreed and said it was just like a big explosion. I think this is wrong-it implies that there is an edge of some description, or that the universe is just an expanding sphere of stuff inside infinite space. what is the best way to visualise the universe?
Comment: For a bit of context (from a similar but different question), here is a post I wrote comparing the balloon analogy to the *explosion in space:* **[Do we know the exact spot where big bang took place?](http://astronomy.stackexchange.com/a/882/58)**
Answer: You were correct, you teacher was incorrect.
It is the space that expands - much as a surface of a balloon does.
An explosion is a poor analogy in contrast because - as you suggest - it implies something to expand into.
For another way, not as accurate as the balloon analogy but maybe helpful - imagine being trapped inside an expanding loaf of bread in an oven. You have no knowledge of the world outside the loaf - and you may assume the loaf is infinite in extent. But as the dough rises the gaps inside the loaf get larger without the mass of the loaf itself increasing. You could compare our position in the universe to being inside such an infinite loaf.
Comment: +1, but the loaf analogy is no less accurate in general; it's just different. For the case of an infinite flat FRW universe, an infinite loaf is better than the balloon. However, the balloon analogy is more accurate finite positive-curvature FRW universe. ... So it depends on what cosmological model you're trying to describe.
Comment: Bread dough analogy is more helpful if you include poppyseed galaxies in your recipe. Distance between seeds over time will follow a Hubble expansion like law, where the rate of recession between any two seeds increases linearly with the distance between the seeds.


Append html to all requested pages through a specific router

Question: I'm sure some of you have been on free wifi networks where they inject a small ad onto every page you visit.  Basically, how do they do that?
How does one append html to every request that passes through a specific router?
I assume the router itself will have to make the actual request to get the content to then be able to append the html.  This would be costly on the server side.  I'm curious if there's another way to do it via caching or some other method.
Answer: This is usually handled with a transparent proxy that re-writes the server's response.


Why do most Christians call Jesus "Son of God" rather than simply "God"?

Question: We call Jesus the son of God that became the son of man.  And yet, Jesus is God per the doctrine of the trinity.  Why don't orthodox Christians address him as God when talking about him and praying?  Is there a biblical basis?
Comment: That's like asking why people don't always call Mr. Obama "Commander-in-Chief".  This question seems an example of [refute-this](http://meta.christianity.stackexchange.com/q/1264/914).  Has your research turned up any particular reason we should use just one of his titles?  What criteria do you think Christians use for picking one form of address over all others?
Comment: This question seems to have the assumption that God is not a Trinity.  Since the Trinity is a prominent theological position, it seems this question should be specifically directed to those who hold to a non-Trinitarian viewpoint.  Otherwise, it's easily explained that Jesus was speaking to the Father.  Please reword this.  I removed the -1 for now.
Comment: Are you asking for Orthodox Christians as in Eastern Orthodox (Capital "O") or as classic Christianity (lowercase "o")?
Comment: lowercase, "o" - mainstream.
Answer: Trinitarian Christians most often refer to Jesus by name or by the title of "The Son of God" to distinguish between the Three Persons of the Godhead.  (The title of "The Son of Man" is a specific reference to a prophecy in Ezekiel with which Jesus identifies Himself.)
The Doctrine of the Trinity can be explained as such:

Jesus is God
The Father is God
The Spirit is God
The Son is not the Father.  Jesus is not the Spirit.
The Father is not the Son.  The Father is not the Spirit.
The Spirit is not the Son.  The Spirit is not the Father.

Jesus had a specific role in that He is the One who became a man.  Neither the Father nor the Spirit did so.  So, we often reference Jesus specifically because of His role in redemption.
However, we may refer to Jesus as God and be correct in doing so.  Indeed, we often say the "God became a Man," and we mean by this that The Son of God became a Man--not the entire Trinity.
So, to answer your question, we don't refer to Him as God all the time, because we are identifying and distinguishing Him for His Incarnation, Vicarious Sacrifice, and Resurrection.  Yet, we can and do refer to Him as God at times--just not as often as we refer to Him by His Name or His titles.
See this question for more information on the Biblical Basis for the Trinity.
Comment: @DanAndrews This question does not ask for a Biblical basis for the Trinity.  If it had, it would be a duplicate.  The answer to this question should be sufficient reference:  http://christianity.stackexchange.com/questions/72/biblical-basis-for-the-doctrine-of-the-trinity
Comment: Thanks for the answer.  While I believe it would require too much effort to ask for references to support the doctrine of the trinity, you answer has no references at all.  It is as if the readers should assume that you're right.
Comment: I'm not asking for the definition of the trinity.  You're being really defensive about the trinity.  I'm just asking, why wouldn't we just call Jesus "God" all of the time?  Is there an biblical basis for not doing so?  Would the disciples refer to him as God?
Comment: +1 and that should put you over the edge. Congrats on reaching 20k! Hope to join the 20k club myself by spring.  ;-)
Answer: Calling Jesus the "son of God" implies that he is God. This may not be a persuasive argument if it were not for Jesus being the only-begotten son of God. Angels, although sons of God, are not begotten. Christians, although sons of God, are begotten via regeneration, not generation. Only Jesus, the only-begotten son of God, is begotten via generation. He shares the same nature as his Father. His Father is God; therefore, he is God. I am human because my father is human.
Again, Jesus is the "only-begotten son of God." That means that he is the same nature as his father, and his father just so happens to be God Almighty. This means that Jesus is also God Almighty. Hence, in the Athansian Creed, it is written, "Deus est ex substantia Patris ante saecula genitus," that is, "He is God, from the substance of the Father, begotten before the worlds..."
In Oration XXIX, Gregory Nazianzen wrote,

"If you mean that the Uncreated and the created are not the same, I
  agree with you; for certainly the Unoriginate and the created are not
  of the same nature.  But if you say that He who begat (i.e., the
  Father) and he who was begotten (i.e., the Son) are not the same, the
  statement is inaccurate.  For it is in fact a necessary truth that
  they are the same.  For the nature of the relation of Father to Child
  is this, that the offspring is of the same nature with the
  parent."
Comment: Luke 1:35 pretty clearly lays this out. Jesus is called 'Son of God' because he is literally begotten by God in the womb of Mary. It doesn't mean he's of the 'same nature', rather that he is physically conceived by the power of God. ""The Holy Spirit will come upon you, and the power of the Most High will overshadow you. So the holy one to be born will be called the Son of God."
Answer: This is an "ironic" question? The Jews accused Jesus of blasphemy for simply claiming to be the "Son of God." Look at the trial record at Matthew 26:63, "But Jesus kept silent. And the high priest said to Him, "I adjure You (that is swear to us by the living God), that You tell us whether You are the Christ/Messiah, THE SON OF GOD."
At Luke 22:70 Jesus says, "Yes, I am." Then at Matthew 26:65, "Then the high priest tore his robes, saying. "He has blasphemed! What further need do we have of witnesses? Behold, you have now heard the blasphemy."
Can you imagine what would have happened if He just came out and said, "I am God?" Jesus did not just come out and say, "I am God" because He would have been excluding the Father and the Holy Spirit. This is also why at John 8:58 He said, " I am." meaning that He existed before Abraham was even born. The Jews picked up on this and knew exactly that Jesus was referring to Exodus 3:14.
Answer: The evolved and gradual revealing of the deity starts out with the concept of 'God' based on original words that imply power.  God was a word secular society also used.  It seems to mean the divine being, regardless of wether he is the true God or not. The Bible defines this divine being as actually only One, that is in contrast to all the many gods of the pagans. The concept developed at the time of Moses is that this 'God' is Jehovah (or Lord) which means I AM, the One God defined as he who alone is eternally before all things.
As we find the concept of the trinity more fully developed upon the actual appearance of the Son in the flesh, the name Lord is transferred to Christ so that Jesus takes the title Lord, that is the One and only God.  Therefore if we pray 'Dear Lord Jesus' we are praying 'dear the one and only God - Jesus.'
However in the clear light of the trinity the word 'God' is generally used to refer to the initial more ancient conception of God as the original powerful one. God is therefore usually pertaining to the Father.  The reason why the Father is most often associated with 'God' is because the Father is in a sense the 'originating person' of the eternal trinity, whom the Son proceeds from.  The Son is like the word 'proceeding' 'from' the Father.
As our prayers are more frequently made to the Father, we often say 'Dear God' meaning 'Father'.  The Father as the originator within the Trinity is the giver of gifts including the Son and the giving of the Spirit, so it is naturally that the normal pattern is to pray to The Father whom we seek help and aid. But although this is the more common pattern the scripture does refer to Jesus as simply 'God' and so we could also pray to the Lord Jesus and say 'God' if we want, it just probably does not happen frequently because when we think of the Son we think of Him as the incarnate God and so we also think of him as a man also.
As the Son is God the scripture sometimes directly uses the term directly to the Son:

But of the Son he says,
   " Your throne, O God, is forever and ever,
  the scepter of uprightness is the scepter of your kingdom. (Hebrews 1:8, ESV)

In Titus we see  the terms used as synonyms. First God as the Father, then God as the Son:

To Titus, my true child in a common faith:
   Grace and peace from God the Father and Christ Jesus our Savior. (Titus 1:4, ESV)
waiting for our blessed hope, the appearing of the glory of our great God and Savior Jesus Christ (Titus 2:13, ESV)
Comment: @DanAndrews - True. 'Father' usually exists before 'Son' but the words are not meant to be interpreted from the standpoint of time. There are meant to imply a type of two way and equal relation between the Father and Son ... before time was created. Cheers.
Comment: As I recall the Greek Orthodox church split because among other things they wouldn't accept that the Holy Spirit proceeded only from the Father but not from the Son. I don't understand why people feel they need to get these things right when salvation doesn't seem to depend on it. Besides how do we really know any of that for sure?
Comment: "Father as the originator" sounds as if the father existed before the trinity.
Comment: If the Son is Fully God of Fully God, did the Son proceed from Himself? In that case whether you pray to the Father or the Son you are just praying to God. Why not just keep praying to the Father in all prayers, as Jesus taught? Sorry I don't mean to sound blasphemous just asking.
Comment: Both Titus 2:13 and Hebrews 1:8 are grammatically ambiguous. Titus 2:13 can be translated "while we wait for the blessed hope and appearing of our great God and Savior's glory, Jesus Christ" which makes a lot more sense of how Paul talks elsewhere. Similarly, Hebrews 1:8 can be translated as "Your throne is God". If you take the given translation, though, the 'God' being talked about is clearly subordinate (has a God, is an image of God, and so on). 'God' in both Hebrew and Greek has range of meaning, and Jews didn't take the Psalm being quoted in Hebrews 1 as referring to Yahweh having a God.
Comment: "The Bible defines this divine being as actually only One, that is in contrast to all the many gods of the pagans. The concept developed at the time of Moses is that this 'God' is Jehovah (or Lord) which means I AM, the One God defined as he who alone is eternally before all things." That isn't true. It isn't Jehovah, it is יהיה (YHWH) which is God's proper name.  It is replaced with אדני (Adoni, which mean "my Lord") when spoken because God's name is to Holy to speak. The word translated to God is אלהים (Elohim) which means powers (plural intended).
Comment: We don't know why אלהים is plural.
Comment: Those scriptures aren't grammatically ambiguous—they just aren't English, and are hard to translate to English with the accuracy that Hebrew scholars are picky about.
Comment: Gregory Magarshak, the split happened the other way around, and the Romans Catholics excommunicated the Eastern Orthodox for it by sending a messenger to put a bowl on the podium in the middle of Church service (the most inappropriate time). The Eastern Orthodox Church was mad at the Roman Catholic Church because they added the Holy Spirit part to the Nicene Creed.
Answer: The doctrine of the Trinity states that there is one God, who exists in three persons, God the Father, God the Son, God the Holy Spirit.
Son of God is therefore the title for the second person of Trinity. It is a clear identification for the second person of Trinity. When Jesus came into this world, the true nature of One Almighty God was also revealed through His message (NT). God the father was revealed in OT (We though find references to Trinity in OT as well in amorphous manner). Second person was revealed by arrival of Jesus and the third person was revealed after Jesus was glorified. That's how we find most of the references to God the father in OT, God the Son in Gospels and majority of the references in explaining God the Holy Spirit, after Jesus was glorified.
It is not that the term Son of God does not mean that Jesus is God. Just like the term Son of Man means that Jesus is a man, so is the Son of God means Jesus is God. God took a human birth and that's how the title Son came to him though He was Himself is God. God is revealed as human to man.
The Jewish leaders understood exactly what it meant by the phrase "Son of God and precisely this understanding of the phrase led them to ask for Jesus' death sentence.
To be the Son of God is to be of the same nature as God. The Son of God is "of God." The claim to be of the same nature as God—to in fact be God—was blasphemy to the Jewish leaders; therefore, they demanded Jesus' death
Jesus is the image of God to mankind.  God - omnipotent, revealed Himself to mankind, in Christ. There are many verses in Bible where we see that in Christ, the invisible God is revealed.  Jesus was with the Father before the world began.  Christ, as God the Son, is the Creator of all things.  God in all His fullness, dwelt in Christ, reconciling the world.  We see that Christ, as the Son of God - God's representation, is God manifest and revealed to the world. Angels, prophets, and things can reveal to us something about God.  But they could not be said to be Son of God. God alone can reveal God hence Jesus is Son of God, same as God.  It takes God to reveal Himself to mankind.
Comment: "To be the Son of God is to be of the same nature as God." This theory is first clearly articulated long after the 1st century. 'Son of God' is a title probably mostly derived from Psalm 2, and used as a co-referent for the Messiah. Ancient Jews did not appear to think this was a claim of deity. Consider Nathanael's response in John 1:49. ""Rabbi," Nathanael answered, "You are the Son of God! You are the King of Israel!"" Did Nathanael really just out and call Jesus God? Seems unlikely, especially when in the same sentence he calls him 'Rabbi', a term for a human teacher.


Why do trunks for cars typically open upwards?

Question: The other day I saw a car where the trunk's door opened sideways like the other car doors, instead of upwards like they usually do.  That got me thinking; why does the door for a car's trunk usually open upwards?
Comment: Honestly, I don't know why there are so many more top hinged rear doors than side hinged, I personally find the side hinged to be more convenient, as someone who has trouble reaching up high because my shoulder doesn't go up all the way. I would like to see more of them frankly, I would love more choices when car shopping rather than just sticking to the pre-2012 RAV4 models.
Answer: It gives the car more symmetry which has aesthetical, structural and usability benefits. Aside from the symmetry there are some other benefits too.
Aesthetical:
Humans like symmetry, it's that simple. With a top-swing you can put one hinge left, one right, and the handle in the middle. And when opened the (a)symmetry is even more noticeable.

Usability:
Because of the shape of cars, trunks tend to be wider than they are tall. This means that swinging it open like a door means you need more rear clearance:

Having a top-swinging trunk also means you have access from both sides (like erp mentioned).
And I believe it is generally easier to open because the upwards trajectory is smaller (due to the width/height ratio and smaller swing angle), meaning you don't have to move out of the way as much, nor move as much to the end of the swing.
Bonus: it kind of works as an umbrella - I doubt this is a serious design consideration though.

Structurally
Something hanging below two hinges is much more stable than side-hinges. Both in terms of internal structure and in terms of movement. Grab a sheet of paper and try ot both from above and from the side. The top held one will simply hang down, straight. The side held one will flex and try to hang down.
A side hinging door will also put more strain on the hinges due to there being two kinds of forces at work, and because the door is wider than tall which means more leverage. Also relevant here are a smaller hinge arc (about 90 degrees upwards vs about 180 sideways), the angle of many rear windshields meaning your door wouldn't swing vertically, and wind alignment.
In short, it's more structurally solid, and it's less likely to open by accident.

History
Like Andrew Martin mentioned, originally a trunk was literally a trunk strapped to a car, and this influenced integrated designs later on.
However, I strongly disagree on there not being an advantage to changes. A trunk is a completely separate compartment, and the vast majority of cars nowadays don't have that. Instead they have a hatchback trunk design which allows you to foldd down the rear seats. This is much more flexible; you can choose whether you want more people seated or more cargo space.

When upwards swinging doesn't work well:
Tall cars, with straight/square rears. And of course when you need to use the roof.
Without the angle or the width-height ratio, a topswing won't really save rear-clearance. And a taller door means a longer lever on the hinges. Having a top-swing door also means you can't put much on the door in terms of storage (cable spools, screw assortment, etcetera) due to weight and accessibility.
This is why vans tend to have two side-swinging doors. Making the door half width fixes the clearance issue and largely mitigates the hinge issues by having a short lever. It doesn't quite solve the left-right accessibility issues though.
Comment: @AndrewMartin I think you're misreading things? I list the benefit of a hatchback over a traditional trunk in that same paragraph; the hatchback isn't a closed off compartment and by folding down seats can accommodate larger/longer things. The hatchback isn't so much a trunk as it is a fifth door.
Comment: "which allows you to foldd down the rear seats. This is much more flexible; you can choose whether you want more people seated or more cargo space" - as an extension of that, the trunk can be left open while driving when transporting very long objects. While this is possible with both rear door configurations, gravity will help keep an upward-opening rear door secured with a tension belt down, while sideways-opening doors might have to be secured extra-tightly to counteract additional forces while going around curves.
Comment: You say you disagree to there not being any advantage to changing the basic design of the trunk but you don't describe any of the advantages you hint at. You have simply given a single example that confirms the upwards-opening paradigm. What are the advantages to change that are not quoted in my original answer?
Comment: I think you've misread the question which was about the way trunks typically open and not about the configuration of the internal space.
Comment: "It doesn't quite solve the left-right accessibility issues though." - in transporters, this is typically solved by multi-segment hinges that allow for a full 270° turn of each door half, so the doors do not get in the way when approaching the trunk from the side.
Comment: Don't underestimate the usefulness of the umbrella effect.  In wet climates a hatchback keeps your shopping dry.
Answer: It is simply more convenient to open upward as opposed of outward, it can pose as a physical barrier preventing loading from the side and can be impeded from fully opening.
Which small SUVs have a back door that opens to the side?

There are a few design characteristics that, in our opinion, make a swing-gate less desirable than the liftgate alternative, which opens upward.

A swing-gate opens to the side, which takes up a lot of room behind the vehicle. If parked in close quarters, you may find the swing-gate doesn't have enough room to fully open.
If parked on a curb, a swing-gate that's hinged on the passenger side will open toward the curb. This means unloading has to happen from the SUV's street side.
Answer: Why limit the side of the car or the angle at which you can place something in the trunk? You are never going to be on top of the car but you might be on either side/ behind the car reaching into the trunk. My opinion was clearly the car manufacturer that made the sideways trunk was trying to be different or gimmicky and now the user only has 2 directions @ which they can load the trunk.
Answer: Originally, trunks on cars were exactly that: wooden trunks strapped onto the back of the car.
The pattern seems to have stuck to a great extent simply because there don't appear to be any advantages to changing it.
There are some variations:
A few supercars where the trunk is at the front of the car and, although still opening upwards, hinges at the front of the car to prevent it accidentally flying open while the car is in motion.
Some Estate Cars/Station Wagons that have a drop-down tailgate to facilitate loading.
And some 4x4/ORV/SUVs that have a rear gate/door that opens sideways to facilitate loading but with the additional obstacle of a spare wheel.


What's the point of memory limits in VMware?

Question: I've never seen them turned on, except at the end of an extending troubleshooting session where a memory limit turned out to be the problem.  I can't think of any use cases where it would be beneficial.  Why not just assign less memory?
Comment: Alex, welcome to ServerFault.  Please take some time to read our [FAQ](http://www.serverfault.com/faq) for help with getting started.  Your question is not worded in a way we typically accept as it will solicit debate and opinions, not fact.  Try to edit your question to be more objective.
Answer: You really don't want to use them on individual virtual machines, generally, unless you're testing how an application will perform under significant memory pressure to the host. They're much more useful on resource pools and vApps, if you care about ensuring that certain consumers of the system are only getting the total resources they've paid for but don't actually care how many virtual machines they run within those resuorces.
Memory limits on a single virtual machine are an interesting feature, because they serve more of a political role than a technical role, at least according to the instructors of my VCP class a few years back.
Let's say that you work for an IT department that is working on virtualizing all of its older servers. You do an analysis and decide to virtualize some server from your company's Accounting department. Your analysis tells you that even though the server has 32 GB of RAM, it's only ever used 4 GB of RAM at a time, and that was a small load spike. So, you virtualize the system, and to be generous, you give it an 8 GB memory allocation. You don't want to go any higher, because VMware Tools will only balloon out a certain amount of the guest's memory in response to contention and you don't want to go overboard with wasted memory.
That's great and all, but the head of the Accounting department is flippant because his department's budget paid for that server five years ago and damn it, he's gonna get his 32 GB of memory and no, he's not gonna pay for it again because he already paid for it and now you're rambling something about power and cooling and TCO and he doesn't care. Great, chief. Here, check top. See? You've got 32 GB. Great. Leave us alone.
Comment: Interesting example.
Answer: If you're referring to resource reservations, then their value is not when they're assigned per-VM, but rather when they're assigned per resource pool. Overcommitting isn't rare. Using reservations on resource pools helps ensure that tier 1 apps get first dibs at the resources.


4 new tires on 2013 Explorer?

Question: I read through the past article and through others questions on this topic, but I am getting conflicting answers.  I had a flat tire and the tire company put two new tires on the rear of my Explorer.  They were the same make and model as the tires on the front.  The mechanic told me that I should have put 4 new tires on the car because I can start having issues with the drive train.  I went back to the tire company to get the two front tires replaced and they told me the mechanic was wrong.  As long as the tread was the same on the front tires and the tread was the same on the back tires it wouldn't matter.  So now I don't know what to do.  I will say I did start hearing a high pitch noise when I go at highway speeds.  Who is right here?
Answer: Is your Explorer 2 or 4 wheel drive?

If 2 wheel drive there is no issue at all - the two ends are separate.
If 4 wheel drive there is a benefit to swapping all at once, as it reduces any differential slip issues through differing tire diameters, but you can have worse issues from having a tire running at too low pressure. It's not the tread, specifically, it's the effective diameter.

Have a read of this question for some extra info.
Comment: Some clarification might be needed? I believe 2013 Explorer's all have transfer cases and the option of leaving it in 2WD. If you can leave it in 2WD, it's the same answer: no issue having a matching set on the front that is worn more than the back, correct?

Also as a side question: Let's say the OP does have a 4WD with a selector/transfer case. Would running it in 4WD at a lower speed (say to get unstuck from your driveway in the winter), be less of an issue than cruising down the highway in 4WD with mismatched tires front-to-back?
Comment: @maplemale - Edmunds is showing it as either having All Wheel Drive (AWD) or Front Wheel Drive (FWD), so it could have either. Also, I'm not sure about the Explorer, but most transfer cases have a torque bias, where 60% goes to the rear and 40% goes to the front. Only when the rears are going *faster* than the front, would the bias matter and kick in to provide torque. With smaller tires up front they would actually be going faster than the rears, so this would not be an issue. Ultimately, 2/32 tread wear difference isn't a huge deal, if it's indeed even that much. Would not cause any issues.

4 new tires on 2013 Explorer?


Is double-men deadlift or squat or bench-press common?

Question: I'd like to try them out with my gym buddy, is it commonly done in the gym?
Comment: For novelty purposes or as actual exercise? I'm not even sure how you can double-men bench press or squat.
Comment: I've seen a picture of a two man deadlift before, never heard of two men doing the other two. Seems like a very bad idea.
Comment: It's pretty common in CrossFit team events along with synchronized kipping pull ups and a few other activities - See https://youtu.be/AYOr114S85A?t=283 (I've never seen bench or squat done this way though). I couldn't comment on whether it's worthwhile - it does seem quite contrived and an easy way to get injured if your partner lets you down.
Answer: Sounds like an incredibly bad idea. Unless you have an extra long barbell, it'll be hard to both get a good grip, and what's going to happen when your friend suddenly drops the barbell halfway through a deadlift? Is risking permanent, severe damage to your back worth it?
People who injure their backs through improperly performed deadlifts often have pain on and off permanently, and not just pain when lifting but constant pain, the kind of pain that will make it hard to concentrate on doing your desk job.
In addition to being risky, it'll also be much worse as an exercise since you won't have the control to push yourself as far as you can when lifting on your own.
And no, it's not common, I've been lifting for 5+ years and I've never ever seen anyone try either.
Comment: I think the two man deadlift is one of those Internet things.


Where do I start learning about Avionics programming?

Question: I am a student in his last semester going for a B.S. in Computer Science. I would like to eventually transition into the space exploration industry (NASA, SpaceX, Boeing, Lockheed Martin, etc). I know nothing about avionics and i would like to learn more about the subject, specifically the software side. I have found little information online. Please give me reference material (books, websites, etc.) to learn about this area. Your point of view and additional information is strongly welcomed.
Comment: @JonStory: By the way, if you mention air*line*, most of IT they do probably is in Java and HTML. Because airlines don't do avionics. They do ticket reservation systems and flight planning applications and the electronic flightbags and none of that needs real-time. By the way at my former employer one team did system for controlling airport lights (approach, runway, taxiway, stopbars etc.) and even that was in Java. Because it was mainly GUI for the tower to switch the lights and that did not need any real-time either.
Comment: thanks, i've been programming hard real-time for 35 years, and I chose my words carefully
Comment: I'm not convinced Java gets a huge amount of use in an airline - the JVM introduces too much uncertainty to be used in a Real Time application: but if you're competent enough in C/C++ to get this kind of job, you can do Java in  your sleep.
Comment: @JonStory: Hard real-time is always C or non-hosted (limited subset of) C++. But electronic flightbag is an application for showing charts, checklists and doing calculations. It has no real-time requirements and normally runs on standard notebook or tablet, though they are getting built in in new planes like A380. So it can be in Java or even HTML+JavaScript.
Comment: @rbp: "real-time" has very specific meaning completely independent of "fairly quickly". Java is fine for "fairly quick". On the other hand "real-time" systems are often not particularly quick; they just have to be absolutely free of any unpredictable delays (which makes GC out of question; usually even any dynamic allocation at all is).
Comment: I don't have any books/materials or more concrete information, so I'll post this as a comment not an answer, but I'd strongly suggest brushing up on your low-level programming if you're serious about getting into this area.
Comment: @JonStory: Definitely C and C++. Though things like electronic flight bags are probably done with Java and even HTML and JavaScript.
Comment: How is it that this part "Please give me reference material (books, websites, etc.) to learn about this area. " was flagged altogether as primarily opinion-based? Maybe it was edited later...?
Comment: tablet EFB apps that receive data from TIS-B and weather may not be hard real-time, but it would be wise to display the information fairly quickly.
Comment: Sorry yeah, I meant Aviation generally not specifically airlines. EFBs are one thing, but I wouldn't count one as 'avionics' in any way.
Comment: http://programmers.stackexchange.com/a/153267 is a good read on the subject.
Comment: Embry Riddle has a degree program that is exactly what you want.
Answer: Ok, I was posting this as a comment but was becoming ridiculously long...
I worked for most of my professional life in fields that are somehow related.
I can see that there are three areas of study that will help you a lot here.
First: programming languages. Knowing a language used in the industry is a plus.
Now I am working in the automotive/transportation industry; I am not working on safety critical material, so we just use standard C/C++. Even at that level a good knowledge of low-level programming and software (how to write a simple driver, how to interact with a device using ioctl, etc..) are very useful.
Before that, I worked on a field related to programming languages and compilers, especially on the simulation and analysis of concurrent code. Among the others, I briefly interacted with people working for Airbus (professors that are in academia, but help to build real software).
They still see and use a lot of Ada out there, so.. knowing that is good :) I also know for a fact that Java is also used, together with special tools for verification of the code.
Which bring us to the second: everything related to the verification of software, both from a theoretical and a practical point of view, will help you hugely in this industry. Study and practice with runtime monitors and model checkers, at least. Learn about various static analysis techniques, like abstract interpretation. Take classes about that, if you can at your school.
And third: study and practice with embedded systems and with the (more rare) real-time OSes and how they work (and how you do program them).
Get yourself an arduino or a netduino (not a raspberry PI - too high level, too many resources there!) and practice with them. Lear about uboot.
Comment: Verification, test, validation, the formal parts of software engineering are most important. If the code is safety critical - which it will be - you are in an entirely different league, up there with satellites. You need experience in really careful, excruciatingly pedantic requirements engineering. Avionics projects I have worked in were done in big international teams, so you need experience in this too.
Comment: And in your CV you should have plenty of the requirements management and version control tools; Doors, Serena, whatever. Subversion, CVS. It doesn't really matter which, because every company has its own variation, you just have to be used to the idea and willing to submit to the discipline.
Answer: I suspect the only answer is "on the job".
Learn both C and C++ and some embedded programming and try applying for any junior positions in companies doing avionics you'll find.
Mobile phones can't really be considered embedded any more, but you should be able to find a course in robotics or cybernetics (industrial controllers) or an internship involving those. An internship doing consumer electronics could help too.
And don't forget the aircraft manufacturers don't do avionics themselves but either buy standard modules from vendors like Garmin or Honeywell or subcontract it to many consulting companies. And those companies often do other kinds of embedded (automotive, industrial, etc.) too.

Notes: I remotely know someone who did avionics and I don't think he specifically aimed for it; he was just good C programmer and applied for a job. I myself did some automotive, again just applied for (junior; it was right after graduation) C/C++ job in a consulting company that was originally mobile and was shifted to automotive as the original project didn't really get going.
Comment: +1 for your note: I am working in a related field (automotive/transportation) and just applied for it. I had good C/C++ skills and that was what it took.
Answer: For avionics, the following will be essential just to get your CV considered:-

Good skills with C
Control theory, particularly state space and beyond
Related to control theory, a strong foundation in maths
Experience with hard-real-time processing
Experience working to coding standards
Familiarity with review processes

The following would also be useful:-

Experience of Ada, and possibly C++
Some knowledge of safety-related procedures (DO-178B, MISRA, etc.)
Knowledge of test-driven development
Experience of common RTOSes such as VxWorks
Experience of low-level programming on microcontrollers

With a BS (not BEng) in Computer Science (not electronic engineering) then you may be at a disadvantage on some of this.  You MUST choose your projects to get the right experience you want to take to employers.
Of course you're only at the very start of your working life though.  A degree is only the start, and any employer hiring graduates will know that you need training up.  A good employer will look more at generally how bright you seem to be and how well they think you can pick up new skills.  If you're playing with tech in your free time, this is probably a good thing to bring to interviews too.
Answer: I have a friend who works in Avionics software. Including space projects.
He got into it by applying for a job at companies that work in that field or similar, before then he didn't have any special avionics training or experience.
Avionics work tends to make more use of programming languages that are not mainstream. I think there's a lot of embedded C (so general C skills may be useful) but also processor-specific assembly and languages like Ada (perhaps more so for defense avionics).
You are very likely to be targeting a real-time operating system (RTOS) or microcontroller. So knowledge of these may be an advantage. You might need to write device drivers and port them to new platforms (e.g. from one microprocessor to another). You might need to program microcontrollers (e.g. 8051) in assembly or C.
It is likely that you would encounter a much higher stringency in terms of writing and/or using unit-tests, test-harnesses, coverage tools, integration-testing and painstaking formal documentation and review of everything.
Comment: Ada probably has more traction in civilian use than military nowadays, perhaps military contractors still have a knee jerk reaction against the mandate, 20 years late... Airbus and Boeing are big users, as are railway systems and air traffic control. SPARK is gaining traction too.
Answer: Learning C and C++ has already been suggested, and I would also add the Ada programming language to that list. A lot of avionics software is written in those three programming languages.
While learning C/C++, learning how to code properly according to coding standards for aviation software may be helpful, too.
I recommend reading:

Lockheed Martin JSF coding standards
ESA C and C++ coding standards

If you would like to play around with actual avionics programming, you may be interested in getting an open source quadrocopter (such as the one from AeroQuad) as a toy and experimenting with its software.
Comment: This. Play around with open source avionics, ground control systems, stabilizers, trackers, that kind of thing. Ardupilot, Mission Planner, UDB/MatrixPilot, etc.
Answer: I don't work with avionics, but I have worked with remote sensing in the context
of Earth Sciences.
I think these materials could be of some help in addition to what others have suggested, esp. if you happen to be interested in the science aspects (sorry the answer may be somewhat off-topic if you are not).

Programming
In addition to C, Fortran is still used a lot for implementing various
algorithms and models. For smaller tasks and visualisation,
people often use Python (numpy, scipy, pandas, matplotlib) and R (R is an excellent statistical programming language, something you would use instead of Excel for serious things).
With regards to C, nobody seems to mention that secure coding is really
necessary for such high-stake applications. Seacord, 2013 is a great
book for this purpose.

Chapman, Stephen J. Fortran 95/2003 for scientists and engineers. McGraw-Hill, 2008.
Seacord, Robert. Secure Coding in C and C++ (2nd Edition) (SEI Series in Software Engineering). Addison-Wesley Professional, 2013.
Matloff, Norman. Art of R Programming. No Starch Press, 2011.

Physics
Good fundamentals in physics are certainly vital in space exploration.
A lot of measurements done in space have to do with radiation,
so I'm adding a reference to that.

Physics I: Classical Mechanics,
Physics II: Electricity and Magnetism,
Physics III: Vibrations and Waves
video lectures by Prof. Walter Lewin (MIT OCW)
Halliday, David, Robert Resnick, and Jearl Walker. Fundamentals of physics extended. John Wiley & Sons, 2010.
Petty, GW. A First Course in Atmospheric Radiation (2nd Ed.). Sundog Publishing, 2006.

Mathematics
Calculus is probably the most important thing, then linear algebra.
Many problems in design and physics have to do with statistics and optimization.

Linear Algebra video lectures by Prof. Gilbert Strang (MIT OCW)
Wilks, DS. Statistical Methods in the Atmospheric Sciences. Academic Press, 2011.
Probabilistic Programming & Bayesian Methods for Hackers (available online)
Kruschke, J. Doing Bayesian Data Analysis, Second Edition: A Tutorial with R, JAGS, and Stan. Academic Press, 2014.

Unix/Linux
Unix operating systems are used a lot in applied sciences, embedded
systems and supercomputers.

Kerrisk, M. The Linux Programming Interface: A Linux and UNIX System Programming Handbook. No Starch Press, 2010.
Lucas, MW. Absolute FreeBSD: The Complete Guide to FreeBSD. No Starch Press, 2007.
many other books, e.g. ones published by O'Reilly

Some daily reading: phys.org/space-news/ (-;
Answer: I highly suggest looking into a software analysis course and learning a proving system such as PVS.  I went back to graduate school after 14 years in various software industries, and the software analysis course I took has easily been the most eye opening.  It wouldn't have made much sense when I was in school, but after working for many years the material clicked.  It was never a subject I felt I would enjoy, and it can be a bit dry, but once you get it, you'll never look at programming quite the same way,
Answer: From a little search on the net I have found this book: Developing Safety Critical Software: A practical guide fro Aviation Software - Rierson.


What is the etymology of the Russian word "ёлка"?

Question: Is the Russian word "ёлка" related to the English word "yule"? "Yule" is related to Old Norse "jol," which refers to an old pagan feast of midwinter. There could easily be some Norse words surviving in Russian, so it is not too far-fetched. And it isn't hard to imagine the English word "Yule log" referring to a fir wood, as the Russian word does.
Comment: Reminds me of a movie called "Big Fat Greek Wedding"... There was a guy who always looked for Greek origin in words...
Comment: I did not really know the answer until I saw the the one provided by shabunc. However, I saw that you have chosen a word that is not the original word. What I mean is that the original word is "ель". "Ёлка" is derived from it, so it would be more appropriate to try to locate the origins of that word. BTW, why are you so rude? People are trying to help you, I myself was trying to cheer you up. What's wrong with you? Встал не с той ноги что-ли?
Comment: In other words, you don't know the answer...
Comment: My rudeness was in reaction to perceived rudeness, and of course, inexcusable on my part. The Greek fellow in the film you mentioned was a bit of a joke, at least in his pursuit of Greek origins for English words. Of course, there are many English words of Greek origin, so he wasn't a total idiot (just used a word of Greek origin---I think). Anyway, I suggest doing a "reset." As a newcomer to this forum, I was not aware of the "atmosphere" (did it again) that prevails, so I overreacted. The thing is, perhaps all of us learned something. Начнем по на правой ноге. С Новым годом!
Comment: BTW, I did do research, and I knew about "ель," but it made no difference to my question. If "ель" was related to "Yule," then so would be "ёлка."
Answer: Original word is "ель" and in all Balto-Slavic languages there exists a word sharing the same original root and used as a term for the conifers. Here's a quote:

церк.-слав. ѥла (греч. ἐλάτη), русск. ель, укр. єль, їль, яль, болг.
  ела́, сербохорв. jе́лa, словенск. jêl (род. п. jelȋ), др.-чешск.
  jedla, чешск. jedle ж. «пихта», словацк. jedľa, польск. jodła, в.-луж.
  jědla, н.-луж. jedła. Первонач., вероятно, древняя индоевр. основа на
  -о ж. р. Родственно др.-прусск. addle, лит. ẽglė, латышск. egle «ель»

As for "jol", here's another quote:

From Old Norse jól, cognate with Danish, Norwegian, Swedish jul,
  Icelandic jól, Old English geōl and English Yule, from Proto-Germanic
  *jehwlą, perhaps from Proto-Indo-European *yekə- ("joke, play").

As you can see, the answer to your question is "no, these words are not related".
Also I want to noticed that both quotes can be found very easily and it is always better to try to google such things before asking questions here.
Just like on any Stack, the attempt to take some actions before producing a question is welcome.
Comment: How do you know I didn't spend a couple of hours searching the Internet before asking the question? As far as I'm concerned, the question was legitimate, and similar to other questions posted on this forum. But I am not a professional linguist. If I were, I wouldn't have needed to ask for help. Anyway, thanks for the info, and don't worry, I don't think I will be inclined to trouble you further.
Comment: @AntonMostiy your Russian friends are wrong by the way - гусь and goose are indeed connected  - the argument about soft sign is invalid and counter-linguistical)))
Comment: Of course my Russian friends are wrong about goose and гусь. But if you know Russians, you know that it was impossible for me to convince them. But the larger point is that it is related to a Germanic word. Knowing that made it seem more possible to me that Yule and ель might be related. In fact, I still wonder if there might not be a connection in Proto-Indo-European (which is where the goose-trail leads, after all). I am like a bulldog, it is hard for me to let go of something once I get hold of it. So I will likely revisit this question. Perhaps soon.
Comment: @AntonMostiy please, don't get me wrong and don't be offended. I guess the majority of people here (including me) are not linguists. The question is 100% legitimate, nobody down votes it or trying to delete it. All I'm trying to say is that (once again, sorry for misunderstanding) that question that show an attempt of research is a priori more valuable with than a question without a trace of such research.
Comment: Thanks for the clarifications. The truth is, I realized that my question was a little "different," but the further truth is that it bothers me every year about this time, when Russians mention the ель. So, I am glad I got an answer to it. Nevertheless, it will probably bother me again next year when I hear "Yule" and "ель" mentioned. I have to admit I was hoping to find a connection, in order to confound my Russian friends, some of whom insist there is no connection between English "goose" and Russian "гусь." Their argument is that the Russian word ends in a soft sign, and the English doesn't.


What is the meaning of the lotus?

Question: On the altar when entering a Buddhist temple I see the Buddha sitting on a lotus, but frankly I do not understand the symbolic meaning of the lotus image? Everywhere you look in the temple you see lotuses. Can anyone explain this to us?
Answer: Well there are more than one meaning to the lotus image. It is a multi-layered symbol.
http://buddhists.org/buddhist-symbols/the-meaning-of-the-lotus-flower-in-buddhism/
the meaning of the muddy waters, physicality being the ground out of which the nirvana experience grows.

The lotus flower represents one symbol of fortune in Buddhism. It
  grows in muddy water, and it is this environment that gives forth the
  flower's first and most literal meaning: rising and blooming above the
  murk to achieve enlightenment.

and the second meaning refers to how the pure flower is when its roots are in the mud and the earth

The second meaning, which is related to the first is purification. It
  resembles the purifying of the spirit which is born into murkiness.

Rather than faithfulness to a doctrine, what it implies is faith in the process so that at all points of development from a shoot out of the mud, to blooming, it is the process of awakening.
The third meaning refers to faithfulness. Those who are working to rise above the muddy waters will need to be faithful followers [of the process] (note added by soulsings)
Each color implies a different quality of the buddha mind.

The color bears importance in the meaning of the lotus flower in
  Buddhism. A white lotus flower refers to purity of the mind and the
  spirit. If a lotus flower is red, it refers to compassion and love.
  The blue lotus flower refers to the common sense; it uses wisdom and
  logic to create enlightenment. The pink lotus flower represents the
  history of Buddha and the historical legends of the Buddha. A purple
  lotus flower speaks of spirituality and mysticism. Finally, the gold
  lotus flower represents all achievement of all enlightenment,
  especially in the Buddha.
  and regarding colors also see
  http://www.buddhanet.net/e-learning/history/b_lotus.htm

and the symbolism of the stages of growth.

The stage of growth the lotus flower is in represents a different
  stage of enlightenment. A closed lotus flower represents the time
  before a Buddhist follower found Buddha or enlightenment. A lotus
  flower fully bloomed and open represents full enlightenment and
  self-awareness.

Rising out of the mud of materiality into the emotions (represented by the water)
the path of awakening eventually leads to the opening of the lotus flower before the sun of compassion and wisdom.
Answer: The lotus flower blooms in muddy water and spreads its leaves and petals out just centimeters above the surface of the dirty water.
Buddhist renunciates, saw themselves as being outside of the muck of the world they had renounced, or at least, in the mud but not dirtied by it.
Answer: The lotus flower sits atop the water but is not moistened by it. It gets its water from roots embedded below the water.
The analogy implies we can be in this world yet free of worldly desires.
Answer: The already submitted answers explain the symbolism of the lotus very well. I'd like to add some important references to the lotus in Buddhism.
I'd often seen the lotus used in Mahayana Buddhist art such as this painting of Amitabha:
The Lotus Sutra is an important Mahayana sutra studied by numerous schools.
Om mani padme hum is a well known mantra which is translated various ways but a well known translation is "Praise to the Jewel in the Lotus."
The lotus holds an important place in Pure Land Buddhism as seen in this excerpt from the translator's introduction to The Three Pure Land Sutras:

The Buddha told Ānanda to worship Amitāyus. At once Amitāyus manifested
  himself with a majestic appearance and his light shone everywhere, so
  that Ānanda and all the others in the assembly clearly saw the Pure Land. They
  witnessed two types of birth: 1) that of those born from within the lotus flowers,
  and 2) that of those remaining in the lotus buds. Those aspirants who have
  accepted the Buddha's wisdom with pure faith are to be born by instantaneous
  transformation and fully enjoy the highest bliss, but those with doubts must
  remain in the lotus buds for five hundred years (section 43).

But I wondered about the importance of the lotus in my own tradition of Theravada and whether there were references to the lotus in the Pali Canon. Here's what I found:
From AN 4.36

"Just like a red, blue, or white lotus — born in the water, grown in the water, rising up above the water — stands unsmeared by the water, in the same way I — born in the world, grown in the world, having overcome the world — live unsmeared by the world. Remember me, brahman, as 'awakened.'
"The fermentations by which I would go
  to a deva-state,
  or become a gandhabba in the sky,
  or go to a yakkha-state & human-state:
      Those have been destroyed by me,
      ruined, their stems removed.
  Like a blue lotus, rising up,
  unsmeared by water,
  unsmeared am I by the world,
  and so, brahman,
  I'm awake."

From Samyutta Nikaya 22:94:

"Just as a water-lily or a blue lotus or a white lotus, born in water, growing in water, having arisen above the water stands unwetted by the water, similarly, bhikkhus, the Tathaagata, brought up in the world and conquering the world,[64] lives unsullied by the world."[65]

This poem by the Elder Udayin from the Theragatha

As the flower of a lotus,
Arisen in water, blossoms,
Pure-scented and pleasing the mind,
Yet is not drenched by the water,
In the same way, born in the world,
The Buddha abides in the world;
And like the lotus by water,
He does not get drenched by the world.

The translator's note from the above poem states:

Awakening (represented by the lotus blossom) is something that happens again and again in all different places and times, and is not limited to a single occurrence of it among the Sakya's of ancient India.

The various Buddhist traditions don't agree on everything. But the usage of the beautiful lotus flower as a symbol for enlightenment cuts across traditions.
Comment: This is very comprehensive. Thank you for this.

What is the meaning of the lotus?


Adding a logo to our Stackexchange

Question: Many other StackExchange sites have a logo on the traffic page. How can we go about getting one of our own, as opposed to the default blue chatbox and M we have now?
Answer: Monero Stack Exchange is still in public beta. A site goes through several stages from proposal, definition, commitment, private & public beta, to finally the graduation (explained that on reddit a while ago).
We are currently in public beta, this is the last and most important step before graduation. Your follow-up question will be probably, what do we have to do to succeed and graduate? It basically breaks down to a strong community both in terms of active users and frequently questions asked per day, about 10 per day on average.
Custom site themes and logos will be applied after graduation.
Answer: At first glance it looks like the sites with a logo all have graduated beta. If that is a requirement then we probably do not have the option yet.

Adding a logo to our Stackexchange


Resources about Gibbs sampling in hybrid Bayesian networks

Question: I've been trying to get my hands on a substantial resource for using Gibbs sampling in hybrid Bayesian networks, that is, networks with both continuous and discrete variables.
So far I can't say I have succeeded. I'm interested in hybrid networks where there are no constraints regarding discrete children having continuous parents.
Gibbs sampling is a very widely employed method in approximate inference in Bayesian methods, and yet, I can't seem to find detailed resources that focus on hybrid networks
Answer: Short answer: Gibbs or Metropolis-Hastings-within-Gibbs (MCMC) should work just fine on joint distributions and full conditional distributions that are mixed products of pmfs and pdfs. If you're doing MCMC, just make sure that sampling from the candidate distributions gives you values in the right domain.
Long answer:
The most comprehensive way we know of to account for probability is to use measure theory. In measure-theoretic probability theory, there is little difference between pmfs and pdfs.
In measure-theoretic probability, pmfs and pdfs are both called "densities." More precisely, they are both Radon-Nikodym (pronounced "RahDOHN-NickohDEEM") derivatives. The only difference is that a pmf is a derivative with respect to a counting measure, and a pdf is a derivative with respect to Lebesgue ("LehBAYG") measure (i.e. n-dimensional volume). When you integrate under a pmf, you integrate with respect to counting measure: you sum over part of its domain. When you integrate under a pdf, you integrate with respect to Lebesgue measure. In every case that Bayesians tend to care about, the latter is equivalent to regular old Riemann integration.
Because pmfs and pdfs are the same kind of thing, they obey the same laws, such as Bayes' law and the product rule. Thus, you can use both pmfs and pdfs in a model and get a meaningful joint density and meaningful conditional densities. But these densities won't necessarily be pdfs or pmfs. In general, they will be Radon-Nikodym derivatives with respect to products of counting and Lebesgue measures.
Riemann integration can't handle Radon-Nikodym derivatives with respect to mixed spaces like that, but Lebesgue integration can. Sampling methods approximately carry out Lebesgue integration, so they just work.
You might be wondering, then, what doesn't just work. Well, the only thing I've mentioned so far are products of densities and integrating under those products. A random variable with a distribution that is the sum of a distribution with a pmf and a distribution with a pdf can cause problems.
Any easy way to get a sum like that is to use an "if." For example, say you have this model:
$X \sim \mathrm{Normal}(0,1)$
$Y \sim \mathrm{Geometric}(1/2)$
$B \sim \mathrm{Bernoulli}(1/2)$
and you define a new random variable $Z$ by $Z = X$ if $B = 0$, otherwise $Z = Y$. The distribution of $Z$ can't be represented by a pmf or a pdf: its cdf has a discontinuity at each positive integer.
You can still approximate $Z$'s distribution using samples. You can even use $Z$ as a parameter for another random variable's distribution, and answer conditional queries with a Gibbs sampler. But conditioning on $Z$ in a query will not work without measure-theoretic tools. Also, you might find your current tools, like the density version of Bayes' law, inadequate. (I haven't looked into it enough to say when.)
Another easy way to get a non-pmf/non-pdf distribution is to truncate a random variable; something like $W = X$ if $X \le 0$, otherwise $W = 0$. (Note that truncating $X$'s distribution won't give you $W$'s, because $P[W=0] = 1/2$. Truncated distributions and truncated random variables are very different things.) $W$ would give you the same problems as $Z$.
Other things off the cuff:
You might have a hard time getting good n-dimensional KDEs that have discrete axes, if you want them.
If you're doing Metropolis-Hastings, you might have a hard time coming up with candidate pmfs for categorical random variables.
--
If you want another way to think about it, consider what would happen if you transformed your model. Convert your pmfs into pdfs and floor the corresponding discrete random variables before using them as parameters in other random variables' distributions. The joint distribution that includes the un-floored random variables (but not the floored ones) obviously has a pdf.
The easiest way to get an equivalent model is to define each new pdf $d$ so that, if its corresponding pmf is $m$, $d(x) = m(\lfloor x \rfloor)$. Now suppose you created an MCMC sampler from the transformed model. It shouldn't take too long to convince yourself that the fractional part of a candidate sample for any originally discrete random variable contributes nothing to the accept/reject decision.
Comment: Thanks for the comprehensive answer. I can go out and hunt for resources for details of the second part, where you outline the problematic cases, but if you could provide me a couple of pointers, that'd be fantastic. Books, or even keywords for resources to get a better handling of the problems would be fantastic. Unfortunately, you don't get to see these in most books about Bayesian statistics, networks etc.
Answer: I think this is still an open research question and there has been little consensus on the best way to do this.


Why use a Top Level Domain

Question: I am trying to understand the use of Top Level Domains.  Do they help from a SEO perspective?  Lets say I have a US site and a Canada site.  For US, I create www.foo.com and for Canada I create www.foo.ca.  Does this provide better functionality, or is it better practice, than www.foo.com/us/ and www.foo.com/ca/?
Comment: "foo" in `foo.com` is the second level domain; "com" is the top level domain.
Answer: TLDS do not affect search results in Google.com. However, TLDs do affect your search results for country specific searches. For example, a .me or .tv domain will not rank as well as a .us website in a google.us web search. Also, a .co.uk site will rank better then a .us site in a google.co.uk search. This is because country specific searches give precedence to local websites.
As for using subdirectories for each region, Google posted a very informative blog post about that that you should read as it will answer many of your questions.
Answer: Functionality-wise, it would be easier to manage with www.foo.com/us/ and www.foo.com/ca/. Having www.foo.com for US and www.foo.ca for Canada would be 2 completely different sites. Plus, if you had www.foo.ca for Canada technically the appropriate domain for US would be www.foo.us.
It's debatable, but to top domain doesn't seem to make that much of a difference. But, the .com domain is what everyone is familiar with. I can't recall off hand any sites I visit with a .us domain.

Why use a Top Level Domain


Packet sent to the default gateway addressed to the same subnet. What happens?

Question: Just a theoretical question (out of curiosity). If a host sent a packet to its default gateway and the packet has a destination address within the IP range of the subnet, what should the gateway do in such case? Is there a rule for it in any RFC?
Answer: The router should route it back to the correct interface.
Answer: The gateway should have the same kind of rules that a host has to determine a packet destination.  So, usually a host will not send a packet to the gateway if it is in the same subnet.  The term 'gateway' implies 'access to the outside'.  You don't need to go through it if you can send directly to the target.  So even if your host has bung rules and DOES send that packet to the gateway, the gateway will have correct rules that say "any packet with a destination on the subnet for this interface will go to that interface".  In this case it simply forwards it on, provided it has been configured correctly.
Answer: Packets get to routers from hosts who have no idea what the router's IP address is all the time. They don't necessarily know there's a shorter path because they don't necessarily know the router and destination reside on a common subnet. This is one of the reasons we have ICMP redirect messages.
As just one way this can happen, consider if a host is temporarily reachable through a VPN. The router has to do proxy ARP for the host to get the packets to the router. If the host shortly later connects directly to the network (or through a VPN to a different host), the packet may get to the router and the router will have to put it back on the LAN to get to its destination.
Another common way is if two different IP ranges share the same physical network. A router may have two different IP addresses, on in each range. And a host may only know the router by one of its IP addresses. If it sends out a packet bound for a destination other than the router in the other IP range, this will happen.


Why did Aquaman and Mera need a boat?

Question: In Aquaman, after defeating Black Manta in Italy, Arthur and Mera use a boat to travel to the Missing Kingdom. Presumably, Mera uses her power of controlling the water to drive the boat as there is no one else. My question is, why did they need a boat if both of them - with their Atlantic abilities - can swim much faster underwater than Mera can push the boat with her power?
Answer: At that time Arthur was wounded by Black Manta and lost consciousness.
Even Mera was exhausted due to the fight, She cannot carry Arthur and swim. Hence they used boat.

Mera : Arthur! Stay with me. Wake up.
  Arthur : You steal the ship. Boats in the harbor is not public.
Comment: Quote seems off, but the explanation works.
Comment: Furthermore, they didn't know what they were getting into, but it was near the Trench, and Mera might've known that. Boat offers a bit of protection.
Comment: @elbrant Added the quote to let OP know that Arthur fell unconscious and Mera had to wake him up

Why did Aquaman and Mera need a boat?


How to write multiple xtabs in a CSV file?

Question: For writing a single xtab, I have used:
write.csv(xtabData1, "analysis.csv")

For appending one more xtab to the same csv file, I tried:
write.csv(xtabData2, "analysis.csv", append=T)

But this throws a warning "attempt to set 'append' ignored" and overwrites the csv file.
Answer: One solution would be to join the tab data first using rbind, e.g.
write.csv(rbind(xtabData1, xtabData2), file="analysis.csv")

Answer: The append option is disabled in write.csv(). write.csv() is just a wrapper function for write.table(). Here;s more from the help file.

write.csv and write.csv2 provide convenience wrappers for writing CSV
  files. They set sep and dec (see below), qmethod = "double", and
  col.names to NA if row.names = TRUE (the default) and to TRUE
  otherwise. write.csv uses "." for the decimal point and a comma for
  the separator. write.csv2 uses a comma for the decimal point and a
  semicolon for the separator, the Excel convention for CSV files in
  some Western European locales. These wrappers are deliberately
  inflexible: they are designed to ensure that the correct conventions
  are used to write a valid file. Attempts to change append, col.names,
  sep, dec or qmethod are ignored, with a warning.

Use write.table() instead (with sep="," and whatever other settings you'd like).


How to load external JavaScript files into app.js - Truffle?

Question: I am new to truffle and webpack. Currently, I am writing all my code into this one app.js file. Suppose I would like to have an external js file which is used to do some initializations.
Currently, my app.js is something like:

// Import libraries we need.
import { default as Web3} from 'web3';
import { default as contract } from 'truffle-contract'

// Import our contract artifacts and turn them into usable abstractions.
import user_artifacts from '../../build/contracts/User.json';
var User = contract(user_artifacts);
var accounts;
var g, c;

window.App = {
  start: function() {
    var self = this;
    User.setProvider(web3.currentProvider);

    web3.eth.getAccounts(function(err, accs){
      if (err) {
        alert("Error loading accounts");
        return;
      }
      if (accs.length == 0) {
        alert("Couldn't get any accounts! Make sure your Ethereum client is configured correctly.");
        return;
      }
      accounts = accs;
    });

    // Load/Initiatize these variables from an external js files
    g = document.getElementById("government-register");
    c = document.getElementById("customer-register");
  },
};
window.addEventListener('load', function() {
    window.web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
}

App.start();
});

I want to load the variables g & c from an external js file and use them anywhere in app.js. Similarly how to use functions from an external js file in app.js.
Answer: A function cannot be called unless it was defined in the same file or one loaded before the attempt to call it.
A function cannot be called unless it is in the same or greater scope then the one trying to call it.
You declare function fn1 in first.js, and then in second you can just have fn1();
1.js :
function fn1 (){
    alert();
}

2.js :
fn1();

index.html :

It works fine :)


Port forwarding for pooled mining?

Question: It does not seem to be necessary but does it help to use port forwarding for pooled mining? I mean forwarding the same port as the pool port on the incoming side of my router to the rig.
Answer: When the miner needs work, it contacts the pool. So the miner makes the connection.
The only time the pool needs to contact the miner is when a new block is found, to invalidate existing work units so the miner doesn't waste time finishing a work unit when the block wouldn't be accepted anyway. But this case is handled with long polling -- the miner keeps an open outbound connection to the pool manager at all times to receive this notification.
So there is no need to forward the port, and such a forward would never be used anyway. The mining program isn't listening for inbound connections.
Comment: I wonder if anyone has looked into using an open inbound port for server -> miner communication.  Some users seem to have trouble with long polling.  One common problem is router closing long polling connection.  I wonder if a direct inbound port would improve overall stale rates.
Comment: @theUnhandledException: Yeah, some routers will close a connection that's idle for ten minutes. A common fix is for mining pools to 'dribble' some data on the connection to stop it from being idle.
Answer: Port negotiations for mining occur via the same protocols as connecting to a web server, which means the port on which your system listens for return data is not the same as the port the pool is listening on, nor is it the same port every time. Forwarding the pool's port to a single machine will do absolutely nothing.

Port forwarding for pooled mining?


Mechanism for Friedel-Crafts Acylation in Synthesis of Sertraline

Question: In the first step of the synthesis of Sertraline, aluminium chloride catalyst was used in a Friedel-Craft's reaction to give the following product. My question is how does the exact mechanism work? 1-napthol does not seem look like an electrophile to me, and I do not understand how AlCl3 is able to turn 1-napthol into an electrophile. The best guess I have is that the phenol tautomerise to give a ketone, and AlCl3 forms a complex with it. Yet again, I do not understand how the γ carbon is made electrophilic using AlCl3. Any help would be appreciated.
Comment: Also, very importantly, look at the severely reduced unsaturation of the ring. You're going to need a hydride from somewhere.
Comment: Even if we assume that the $1$-napthol is getting attacked somehow by $1,2$-dichlorobenzene, instead of substituted $\alpha$-tetralone in the product, shouldn't the product contain $\alpha , \beta$-unsaturated ketone ? The only plausible mechanism generates that by a conjugate addition.
Comment: Note that this is not a Friedel-Crafts acylation. In that reaction, the Lewis-acid is a catalyst. 2 equiv. of aluminium chloride here is definitely not catalytic. In other words, you need a superstoichiometric amount of the Lewis acid to get this reaction to go. Almost certainly coordination of the OH is involved as the first step. But the aluminum chloride is likely not regenerated in this reaction.
Answer: The alleged original RSC source for this reaction was not accessible online.1. However, Olah et al. have reported2 that α-naphthol 1 in superacid medium forms a dication species 4. The use of excess AlCl3 provides a mechanism for the formation of superacid 3. Benzylic dication 4 undergoes substitution of o-dichlorobenzene 5 which ultimately forms the sertraline precursor, tetralone 8. For reaction conditions, see ref. 3. No reducing agent is required.

1) Kavitha, C. V.; Mantelingu, K.; Sarala, G.; Naveen, S.;
Anandalwar, S. M.; Prasad, J. S.; Rangappa, K. S. J. Chem. Res. 2006,
11, 730.
2) Koltunov, K. Y.; Chernov, A. N.; Prakash, G. K. S.; Olah, G. A. Chem. Pharm. Bull. 2012, 60, 722.
3) Lee, S. H.; Kim, I. S.; Qing, R. L.; Dong, G. R.; Jeong, L. K.; Jung, Y. H. J. Org. Chem., 2011, 76, 10011.


Only show future entries for specific channel in multi-channel entry loop

Question: I have a channel entries loop where I am pulling data from multiple channels. These entries are then mixed together in the sort order they are returned in. With all but one channel I'd like to restrict it to not show future entries. However, I do need to show future entries for that one remaining channel. What are my options.
Comment: My guess is you need a custom query for this.
Answer: how about
<code>{exp:channel:entries channel="alpha|beta|gamma"}
    {if channel_short_name == 'blah'}
        show me
    {if:else}
        {if entry_date > current_time}
            show me
        {/if}
    {/if}
{/exp:channel:entries}
</code>
Comment: I think you need to filter on the date first because in your example 'blah', which shouldn't show future entries will do, and the other channel will *only* show future entries, not all of them.
Answer: You can only do that kind of conditional retrieval by using a custom SQL query that does some checking of dates for you. Fortunately it's a pretty trivial query - only a little bit of logic required. Without knowing more about what your data looks like, etc, it's hard to provide more details information, but I'd suggest you run something like the (totally untested, probably broken, and  and likely to corrupt your DB) SQL below through the Query Module.
<code>SELECT
  exp_channel_titles.entry_id AS id,
  exp_channel_titles.title AS title,
  exp_channel_titles.entry_date AS date_published
FROM
  exp_channel_titles
WHERE
  ((exp_channels.channel_name = 'no_future_posts_channel_name_1' OR
    exp_channels.channel_name = 'no_future_posts_channel_name_2') AND
    exp_channel_titles.entry_date <= NOW()) OR
    exp_channel_titles.channel_name = 'future_posts_ok_channel_name'
ORDER BY
  date_published DESC
LIMIT
  15;
</code>
Comment: This is the approach I am going to take. Your query is a good start. Thanks for the help.
Answer: You could maybe do this:
<code>{if entry_date > current_time}
   {if channel_short_name == "channel-that-should-show-future-entries"}
      show stuff
   {/if}
{if:else}
   {if (channel_short_name == "channel-that-should-show-future-entries" && entry_date <= current_time) OR channel_short_name!="channel-that-should-show-future-entries"}
      show stuff
   {/if}
{/if}
</code>
Comment: Ah right, yeah a fixed limit will throw that out. Query module should do it.
Comment: This assumes you've got show_future_entries="yes" on your channel entries tag.
Comment: Thanks Tyssen. The only issue with that approach I think is that I need to return a set number of entries. If I am showing/hiding entries inside the c:e loop, the count is not going to stay accurate. I think it's going to require a custom SQL query to grab the right entry ids and then feed those into the c:e loop. That is the path I'm heading down, but wanted to make sure I wasn't overlooking something first.
Answer: I think a custom query in a simple plugin would be the most straightforward approach. However, it may be possible using just a template without a custom query if you:

Ran an entries loop that allowed future entries, ultimately returning more than you needed
Added those entries you wanted (filtered by channel short name and date conditionals) to Stash's set_list tag
Used Stash's get_list tag to display the results, specifying your overall limit there


Is there something similar to WoW raids in TESO?

Question: For me, raids in an MMO is most fun.
This is why I always loved WoW, however, I wondered if theres something like raids in TESO? Like really really hard bosses which you can waste your whole sunday on even if you have a team of experts :D
Answer: This sounds like adventure zones will be exactly what you're looking for:

Craglorn will be the first adventure zone offering content for grouped players. They'll introduce the so far hardest content in the game in the form of so-called Trials, which will be encounters for groups of up to twelve players. There's also some kind of leaderboards (time based), so you can compare your own performance to that of others if you really want to. Those encounters won't last that long, but you can repeat them at any time and they'll have randomly picked enemies, so it's not like you've got the same content over and over again.
Besides that, if you're into PvP, I bet that the Alliance War would be something for you. It's a lot more dynamic than classic PvE raids and it will always offer you different challenges, different enemies, etc.
As an example, have a look at Angry Joe's PvP impressions:

You can do PvP alone or in a group - it's your choice and you'll never know what you're up against next (so if you like challenges, you can try to take on larger forces with your group and make yourself a name).
Comment: thanks, that was really informative :)
I think I have to give this game a try, even if I'm afraid of changes because I kept playing WoW too long :D
Comment: @RandomDisplayName. Don't expect too much, though. Most if not all MMORPGs tend to be weak in the beginning. I'm sure the 10 year-old WoW will feel more polished (if not quite as fresh and much more bloated) than TESO.
Answer: I found It really surprising that it was this hard to find some Information about raids in TESO but I finally found an article that should describe it. Unfortunately I can't tell these things from personal experience in TESO but rather from 5 years of Progress-Raiding in WoW and Research about TESO raids.
If you're asking whether or not raids like in WoW are in Teso the answer is NO.
If you're asking whether or not raids or something similar exits the answer depends on your view of a "Raid".
Now let me first explain why raids like in WoW can't exist:
TESO uses a completely different and less complex combat system when compared to WoW, but it also uses a much more complex role system.
While the combat is simpler than in WoW, you are not restricted when it comes to class developement. You can play a Healtank/Smiter/Supporter/Offtank well basically everything you want. This offers a lot of different tactics for content while In WoW the only variations you will find are things like "Oh let's try this boss with 1 Heal respeccing for DPS" which doesn't make too much of a difference.
When it comes to something that can compete with WoW raids in terms of length there will be nothing. As Zenimax stated the length of a Trial (which is basically a 12 man "Raid") will be around 0.5 to 1.5 hours which is nothing in comparison to a Real WoW raid. Also a thing is the limitation of resurrections in Trials. Currently you can be resurrected 60 times otherwise the trial will end (Think of it like the Hardmode-Crusader Raid)
For the difficulty I'm not completely sure. The game definitely has the potential to be far more challenging than WoW but as already mentioned... Whether something is difficult or not is a really opinion based thing.
Here I also found an article about endgame content which describes everything a bit more detailed.
Comment: According to their latest AUA the trial won't end once you use up your resurrections. You just can't compete with your time on the leaderboards (but you'd be off based on your time alone anyway).
Comment: +1 thanks for this detailed answer :)
actually the endgame content is the only content I care about in MMO's :D