Should not we apply pseudo-forces all the time as the Earth is a non-inertial frame of reference?

Question: Clearly, the Earth is accelerating (as it has centripetal acceleration), and thus it is a non-inertial frame of reference. Then, why don't we use pseudo forces all the time? My teachers told me that the effect produced by the centripetal acceleration of the Earth on our calculations is negligible and hence we can safely neglect pseudo force. But how? I want rigorous proof with examples that show exactly how much we are compensating in exchange for neglecting that the Earth is a non-inertial frame of reference.
Comment: Related: https://physics.stackexchange.com/q/551843/195139
Comment: This is a good question. Hint: What would be the pseudo force on a rock on earth due to earth's revolution around the sun and what would be the force of gravity due to the sun on the same rock?
Comment: @RIPANBARUAH - Just as an reminder, if an answer solved your problem or was the most helpful in finding your solution you could accept it by clicking on the checkmark.
Comment: Have you tried this first? https://en.wikipedia.org/wiki/Tide
Comment: Also related: https://physics.stackexchange.com/q/97743
Comment: Related: pseudo-forces due to rotating frame in quantum mechanics https://physics.stackexchange.com/q/630781/226902
Answer: The way to properly answer your question is, for lack of a better word, by enumeration. Consider all the ways the Earth moves, compute the fictitious forces corresponding to them and check that they are negligible for the problem at hand.
"All" is a strong word, but we can do quite well by looking at what goes into the expressions so that we can tell which ones are the most relevant.
The various motions can be all interpreted as compositions of rotations, so we can use the expression listed at the end of this Wikipedia section: the three kinds of fictitious force acting on a body of mass $m$, moving at velocity $v$, at a distance $r$ from the origin of the rotation (which happens at angular velocity $\Omega (t)$) are

the Coriolis force, whose maximum magnitude is $2m \Omega v$,
the centrifugal force, whose maximum magnitude is $m \Omega^2 r$,
the Euler force, whose maximum magnitude is $m \dot{\Omega} r$ (the dot denotes a time derivative).

I'm saying "maximum" so we have an upper bound, which is attained when the vectors appearing in the vector products are perpendicular.
Now, what is left is to take the system at hand, estimate the forces, and finally see how they compare to the precision of your experiment.
As an example, consider the rotation of the Earth around its axis. An upper bound for $r$ is the radius of the Earth, $r \approx 6400 \mathrm{km}$. The angular velocity is typically $\Omega \approx 2 \pi / (1 \mathrm{d}) \approx 7\times 10^{-5} \mathrm{Hz}$.
The typical value of the variation of $\Omega$ is harder to estimate - it fluctuates a lot, from a quick look at the data here it seems like the variation of the length of a day to the next can be of the order of $100\mathrm{ms}$ at most. This relates to a variation of angular velocity of the order of $ 2 \pi (100 \mathrm{ms}) / (1 \mathrm{d})^2 \approx 10^{-10} \mathrm{Hz}$, therefore the quantity $\dot{\Omega}$ will be $\approx 10^{-10} \mathrm{Hz / d}$.
The velocity is dependent on your specific experiment: for concreteness' sake, let us assume we are considering things moving at $10 \mathrm{m/s}$ at most (as much as a fast cyclist, for instance).
With these numbers, let us compute accelerations instead of forces (removing the $m$, so that our considerations generalize for any mass):

the Coriolis acceleration will be at most $\approx 10^{-3} \mathrm{m/s^2}$,
the centrifugal acceleration will be at most $\approx 3 \times 10^{-2} \mathrm{m/s^2}$,
the Euler acceleration will be at most $\approx 6 \times 10^{-9} \mathrm{m/s^2}$.

This procedure can be applied for any other kind of rotation you are worried about --- for example, the rotation of the Earth around the Sun will have $\Omega \approx 2 \pi / (1 \mathrm{yr})$ and $r \approx 1 \mathrm{AU}$; this leads to a Coriolis force of the order of $\approx 4 \times 10^{-6} \mathrm{m/s^2}$ and a centrifugal force of the order of $\approx 5 \times 10^{-3} \mathrm{m/s^2}$.
From this analysis we can already tell that the most significant force to consider is the centrifugal one from the Earth's rotation, followed by the centrifugal one from the Earth's revolution, et cetera.
If you had large velocities (for example, if you were doing ballistics) then the Coriolis contribution might be the largest.
So, take the experiment you want to perform, make some Fermi estimates like these, and see whether you can experimentally detect these effects!
If it turns out you can, you should look at how exactly they affect your object since they are quite different: the full aforementioned expression shows how to determine their direction as well, and sometimes you might not be able to disentangle their contribution from something else. For example, if you are on the Equator the centrifugal force points radially outward, so it is equivalent to a decrease in the effective gravity at that point.
On the other hand, the Coriolis force deflects the motion of a particle, so it is easier to detect - it is the driving principle behind the Foucault pendulum.
This experiment also illustrates the point that, while the accelerations are generally small, if you let them act for a long time their cumulative effect can be rather large.
This procedure (estimating the typical size of the corrections) is quite general: it can also be applied to check whether it makes sense to use Newtonian mechanics in your case, or if you should account for general relativity, quantum mechanics or some other more complicated theory.
Comment: A thorough answer!  Is there some case to make that the centrifugal force from the Earth's rotation is already taken into account by reducing the effective force of gravity?  Eg: if I calibrate a set of scales using a calibrated mass, that mass was subject to the centrifugal acceleration during calibration, and so will be everything it is used to weigh.  Does using an adjusted value of g much further reduce errors, and is this done in practice?
Comment: I agree with @Jacopo Tissino.  The force of gravity is typically modified by subtracting the centrifugal force.  The centrifugal force depends on latitude; maximum at the equator, zero at the poles.  See the text Simon, Mechanics, for details.
Comment: @TomV I must admit I'm not an expert in gravimetry, but it looks like the answer is yes: it is more convenient to define the [gravitational field of the earth](https://en.m.wikipedia.org/wiki/Gravity_of_Earth) by including the centrifugal contribution.
Answer: There's two things you might mean by "centripetal acceleration of the Earth", but it turns out that you don't really need to worry about either one under most circumstances.
Orbital motion
If you're referring to the fact that the Earth is accelerating towards the Sun due to its orbit, then this would give rise (in a frame accelerating with the Earth) to a fictitious force pointing away from the Sun.  In this reference frame, we might expect that objects would be pushed away from the Sun by this fictitious force.  But any object would also be attracted to the Sun; and the magnitude of this gravitational attraction towards the Sun is (more or less) the same as the fictitious force away from the Sun.  So the two effects cancel each other out (more or less) and we can safely ignore them both.
(Aside:  the two only "more or less" cancel out because at most points on the Earth, you are actually slightly closer or slightly farther from the Sun than the center of the Earth is, and so you accelerate at a slightly smaller or larger rate than the Earth does.  These small differences are the basis for understanding tidal forces.)
Rotational motion
If you're referring to the rotation of the Earth, in a frame rotating with the Earth there would be a centrifugal force of magnitude $- m \vec{a}_\text{rot}$ pointing away from the rotation axis (where $\vec{a}_\text{rot}$ is the centripetal acceleration of a point on the surface), and a gravitational force $m \vec{g}_0$ due to the gravitational attraction of the Earth (what the gravitational force would be if the Earth wasn't rotating.)  The net force on an object due to these effects would be
$$
\vec{F} = m \left( \vec{g}_0 - \vec{a}_\text{rot}\right).
$$
But importantly, there is no way to disentangle these forces.  Every object will get an acceleration of $\vec{g}_0 - \vec{a}_\text{rot}$ due to these effects.  Since they are not distinguishable from each other, we can define the effective gravitational acceleration of an object near some point on Earth's surface to be $\vec{g} \equiv \vec{g}_0 - \vec{a}_\text{rot}$;  and then the force on such an object is $\vec{F} = m \vec{g}$.
(Aside:  this implies that the gravitational acceleration $|\vec{g}|$ actually varies from point to point on Earth's surface, since the magnitude of $\vec{a}_\text{rot}$ is larger near the equator and smaller near the poles.  This effect is amplified by the oblateness of the Earth—which is itself due to the rotation of the Earth—with the result that $|\vec{g}|$ varies by about 0.03 m/s2 over various points on the Earth's surface.)
Answer:
the pseudo forces are:
$$\vec F_p=\underbrace{m\,\left(\vec \Omega\times (\vec \Omega\times \vec R)\right)}_{\text{Centrifugal force}}+
\underbrace{2\,m\,(\vec \Omega\times {\dot{\vec{R}}})}_{\text{Coriolis force}}$$
with:
$$\vec R=\begin{bmatrix}
  x \\
  y \\
  z \\
\end{bmatrix}\qquad,{\dot{\vec{R}}}=\begin{bmatrix}
  v_x \\
  v_y \\
  v_z \\
\end{bmatrix}\\
\vec \Omega=\Omega\,\begin{bmatrix}
  0 \\
  \cos(\lambda) \\
  \sin(\lambda) \\
\end{bmatrix}$$
$\Rightarrow$
$$\vec F_p=\left[ \begin {array}{c} m{\Omega}^{2}x-2\,m \left( \cos \left(
\lambda \right) v_{{z}}-\sin \left( \lambda \right) v_{{y}} \right)
\Omega\\ -m\sin \left( \lambda \right)  \left( \cos
 \left( \lambda \right) z-\sin \left( \lambda \right) y \right) {
\Omega}^{2}-2\,m\sin \left( \lambda \right) v_{{x}}\Omega
\\ m\cos \left( \lambda \right)  \left( \cos \left(
\lambda \right) z-\sin \left( \lambda \right) y \right) {\Omega}^{2}+2
\,m\cos \left( \lambda \right) v_{{x}}\Omega\end {array} \right]
$$
with $~\Omega=7.27\,10^{-5}~[\frac 1s]$ and $~\lambda=\frac{\pi}{2},~\vec\Omega=[0~,0~,\Omega]^T$
$$F_p=\left[ \begin {array}{c}  5.2 \,10^{-9}\,mx+ 1.4 \,10^{-4}\,
mv_{{y}}\\ 5.2 \,10^{-9}\,my-
 1.4 \,10^{-4}\,mv_{{x}}\\  0.0\end {array}
 \right]
$$
hence the pseudo force components (unit [N])  are very small  and can neglected
Answer: I don't think there is rigorous proof as these things depend more or less on the experiment, you are performing and the accuracy you needed. If you need more accurate results or it might possible that your experiment is a long time range, So you want to include these effects.
But Less talks few examples, Maybe we wanna look at gravity that is effective gravity due to centrifugal force.

Quoting Wikipedia:
The surface of the Earth is rotating, so it is not an inertial frame of reference. At latitudes nearer the Equator, the outward centrifugal force produced by Earth's rotation is larger than at polar latitudes. This counteracts the Earth's gravity to a small degree – up to a maximum of $0.3$ % at the Equator – and reduces the apparent downward acceleration of falling objects.
The effects of the surface centrifugal force due to rotation mean that sea-level gravity increases from about $9.780$ m/s$^2$ at the Equator to about $9.832$ m/s$^2$ at the poles, so an object will weigh approximately $0.5$ % more at the poles than at the Equator.
Recall that:
$$g_\text{eff}=g-R\Omega^2\cos\phi$$
$$\frac{\Delta g}{g}=\frac{R\Omega^2\cos\phi}{g}$$
For $\phi =0$
$$\frac{\Delta g}{g}=3.44\times 10^{-3}$$

One more example can be the Coriolis force. You can look for my answer which does the calculation (it's too approximate but convey the thought).

Does the Coriolis force act on all objects?

For more accurate calculation look for Exercise 9.9 Train on Track in Introduction to Mechanics by Klepner.

A 400-ton train runs south at a speed of 60 mi/h at a latitude of 60◦ north. What's the magnitude of horizontal force?

Which turn out to be $277 \ lbs$.


Is it possible to download PHP script from a web page with wget?

Question: If I try wget <url> it downloads the resolved page. But I want to download the original script. Is this possible?
Comment: possible duplicate of [Possible to view PHP code of a website?](http://stackoverflow.com/questions/2995360/possible-to-view-php-code-of-a-website)
Answer: No, and thank goodness for that.  The server is completely in control of how it responds to your HTTP requests.
Strictly speaking, you can't tell whether it's PHP on the other end of the wire in the first place.
Answer: No this is not possible, and would be a huge security issue if it was.
The only way this would be possible is if the web server (Apache) was not configured correctly
Answer: This is not possible, the webserver doesn't output the PHP script. The webserver parses it serverside and writes the response of that to the client.
Answer: "Officially" - no.
Through "hacking" - yes. If a website allows to download some content via /download.php?src=path_to_file script, AND it was poorly coded, then you could request to download, say, index.php file.
Check this out: https://owasp.org/www-community/attacks/Path_Traversal


How can i integrate a section in Related Lists with the standard Lead Page

Question: Could you please help me to know, how can i integrate a section with the standard Lead Page. I have tried to embed a visual force section into a standard page layout, I can add that section in "lead detail", but looking for a way to add the same section outside lead detail or  in "Related Lists".
Is it possible?
I have been searching for this from couple of weeks,Your time and help is cordially appreciated....!
Answer: You cannot insert Visualforce customizations in the Related List portion of the page layout. Visualforce pages may only be embedded in the Details section.
Your only option would be to fully reimplement the View action for this object in Visualforce, which would take a great deal more code.


Packaging script source files in IronPython and IronRuby

Question: Does anyone know how to add python and ruby libs as a resource in a dll for deployment?  I want to host a script engine in my app, but dont want to have to deploy the entire standard libraries of the respective languages in source files.  Is there a simple way to do this so that a require or import statement will find the embedded resources?
Answer: You could add custom import hook that looks for embedded resources when an import is executed. This is slightly complex and probably not worth the trouble.
A better technique would be to fetch all of the embedded modules at startup time, execute them with the ScriptEngine and put the modules you have created into the sys.modules dictionary associated with the engine. This automatically makes them available for import by Python code executed by the engine.
Answer: You can create StreamContentProviders for example
In the ironrubymvc project under IronRubyMVC/Core/ you will find what you need.
AssemblyStreamContentProvider
Usage of the ContentProvider
Answer: IronPython 2.0 has a sample compiler called PYC on Codeplex.com/ironpython which can create DLL's (and applications if you need them too).
IronPython 2.6 has a newer version of PYC under Tools\script.
Cheers,
Davy


ListView WebPart

Question: Is there any option to display sharepoint list which is in one domian on the sharepoint site which is on other domain? I'm not interested in solution which use iframe.
Answer: You could use a BDC model to support an External list from the respective domain's database.

ListView WebPart


Are there Christians that believe that God is a substance?

Question: If there are groups that believe God is a substance, where is such a belief based? When did this belief started?
Comment: No, I cannot, since I am not a god.
Comment: Sub-stance means under-standing, as in (under-lying) base or foundation; thus, the term signifies that which up-holds one's (way of) being or (mode of) existence, as a foundation up-holds the rest of the edifice, and the building stands on its base or foundation. Concrete or specific knowledge of the divine substance belongs to actual divine beings, which humans made in their image are not literally part of. God relates to his own substance, whatever it might be, in the same manner men relate to their own flesh or blood or spirit (breath).
Comment: If something exists or subsists, then it possesses substance or subsistence.
Comment: @Lucian.  If you say" If something exists or subsists, then it possesses substance or subsistence", what do you believe is God's substance? Do you believe God is a substance?
Comment: @Lucian.  Your comment "God relates to his own substance, whatever it might be" seems ambiguous to me. Can you please clarify by answering the question.
Comment: This question needs to clarify what is meant by substance. If it's the typical philosophical meaning of the word, the answer is trivial as all denominations would necessarily believe God is a substance.
Answer: Swedenborgian Christians believe that God is substance. This is stated explicitly in the writings of their primary theologian, Emanuel Swedenborg (1688–1772). For example:

The one God is substance itself and form itself. Angels and people are substances and forms from him. To the extent that they are in him and he is in them, to that extent they are images and likenesses of him. Because God is the underlying reality, he is also substance. Unless the underlying reality becomes substance it is a figment of the imagination; but as a substance it becomes an entity. And one who is substance is also form, for substance without form is another figment of the imagination. We can attribute both of these to God, provided he is seen as the sole, the only, and the archetypal substance and form. (True Christianity #20)

God is substance itself and form itself, and is therefore the first and only substance and form, whose essence is love and wisdom. All things that were made, were made by God [John 1:3]. It follows, therefore, that it was from love by means of wisdom that God created the universe and each and every thing in it. As a result, divine love together with divine wisdom is present in every single entity that has been created. Furthermore, love is the essence that not only forms all things but also bonds and unites them to each other; therefore love is the force that holds all things in connection. (True Christianity #37)

Everyone who thinks rationally and clearly also sees that everything has been created out of a substance that is substance in and of itself. This is the essential being from which everything that exists can arise. Since only God is substance in and of itself and is therefore essential being, it follows that there is no other source of the arising of things. (Divine Love and Wisdom #283)

The substance of God, according to Swedenborg, is love:

This makes it clear that Divinity, being substance in its own right or the unique and sole substance, is the source of absolutely everything that has been created. This means that God is the sum and substance of the universe, in accord with what was presented in part 1: divine love and wisdom is substance and form (40-43); divine love and wisdom is substance and form in its own right, and is therefore wholly itself and unique (44-46); everything in the universe was created by divine love and wisdom (54-60 [52-60]); the created universe is therefore an image of him (61-65 [61-64]); and [in part 2,] the Lord alone is the heaven where angels live (113-118). (Divine Love and Wisdom #198)

And from the first of the sections Swedenborg refers back to here:

Divine love and wisdom is substance and is form. The everyday concept of love and wisdom is that they are something floating around in, or breathed out by, thin air or ether. Hardly anyone considers that in reality and in function they are substance and form.
Even people who do see that love and wisdom are substance and form sense them as something outside their subject, flowing from it; and they refer to what in their perceptions is outside the subject and flowing from it as substance and form even though they sense it as floating around. They do not realize that love and wisdom are the actual subject, and that what they sense as floating out from the subject is only the appearance of the inherent state of the subject. (Divine Love and Wisdom #40)

Divine Love and Wisdom was first published in Latin in 1763. True Christianity, traditionally titled True Christian Religion, was first published in Latin in 1771.
In short, Swedenborgian Christians believe that God is substance, and that that substance is love. This is in accordance with the Apostle John's statement:

Whoever does not love does not know God, for God is love. . . . God is love, and those who abide in love abide in God, and God abides in them. (1 John 4:8, 16, emphasis added)
Answer: Are there Christians that believe that God is a substance?
St. Thomas Aquinas believed that God is substance: Divine Substance.
The Catholic Church teaches it as thus:

In the Aristotelian thought of St. Thomas Aquinas, essence is synonymous with nature and substance. Therefore this teaching holds that God's nature (his Godhead) is exactly who he is: there is nothing added to the substance of God. Whereas all living things have a substance (the primary mode of being) and accidents (the secondary modes of being), God is only a substance.
This teaching may be confusing to those who are unfamiliar with the philosophic terminology of Aristotle and Aquinas. Essentially, Aristotle held that all created beings are defined not by their constituent parts (such as atoms) but by substance. Substance is the nature of the being. Additionally, all created beings have accidents which inhere in the substance. An accident is a secondary mode of being which involves change. Typical accidental modes of being are quantity, quality (such as color, texture etc), action, posture, time, state and relation to something else. In this sense we can say that a man is composed of a substance (humanity) and a list of accidents which make him a unique person (such as height, weight, color, position, time of existence, etc.). In this light, we can see that the phrase, "God is the same as his essence" implies that God has no accidental modes of being and is defined only by his substance (his Godhead).
Definition of the Dogma:
This teaching is not a defined dogma of Catholicism, but rather a speculative theological teaching of St. Thomas Aquinas. However, since this teaching is drawn from the dogma of God's simplicity is at least a Sententia Communis doctrine. - God is the Same as his Essence

Here is how St. Thomas in his Summa Theologiae (The simplicity of God) puts this metaphysical subject:

Whether God is the same as His essence or nature?
God is the same as His essence or nature. To understand this, it must be noted that in things composed of matter and form, the nature or essence must differ from the "suppositum," because the essence or nature connotes only what is included in the definition of the species; as, humanity connotes all that is included in the definition of man, for it is by this that man is man, and it is this that humanity signifies, that, namely, whereby man is man. Now individual matter, with all the individualizing accidents, is not included in the definition of the species. For this particular flesh, these bones, this blackness or whiteness, etc., are not included in the definition of a man. Therefore this flesh, these bones, and the accidental qualities distinguishing this particular matter, are not included in humanity; and yet they are included in the thing which is man. Hence the thing which is a man has something more in it than has humanity. Consequently humanity and a man are not wholly identical; but humanity is taken to mean the formal part of a man, because the principles whereby a thing is defined are regarded as the formal constituent in regard to the individualizing matter. On the other hand, in things not composed of matter and form, in which individualization is not due to individual matter—that is to say, to "this" matter—the very forms being individualized of themselves—it is necessary the forms themselves should be subsisting "supposita." Therefore "suppositum" and nature in them are identified. Since God then is not composed of matter and form, He must be His own Godhead, His own Life, and whatever else is thus predicated of Him.
God is not only His own essence, as shown in the preceding article, but also His own existence. This may be shown in several ways.
First, whatever a thing has besides its essence must be caused either by the constituent principles of that essence (like a property that necessarily accompanies the species—as the faculty of laughing is proper to a man—and is caused by the constituent principles of the species), or by some exterior agent—as heat is caused in water by fire. Therefore, if the existence of a thing differs from its essence, this existence must be caused either by some exterior agent or by its essential principles. Now it is impossible for a thing's existence to be caused by its essential constituent principles, for nothing can be the sufficient cause of its own existence, if its existence is caused. Therefore that thing, whose existence differs from its essence, must have its existence caused by another. But this cannot be true of God; because we call God the first efficient cause. Therefore it is impossible that in God His existence should differ from His essence.
Secondly, existence is that which makes every form or nature actual; for goodness and humanity are spoken of as actual, only because they are spoken of as existing. Therefore existence must be compared to essence, if the latter is a distinct reality, as actuality to potentiality. Therefore, since in God there is no potentiality, as shown above (Article 1), it follows that in Him essence does not differ from existence. Therefore His essence is His existence.
Thirdly, because, just as that which has fire, but is not itself fire, is on fire by participation; so that which has existence but is not existence, is a being by participation. But God is His own essence, as shown above (Article 3) if, therefore, He is not His own existence He will be not essential, but participated being. He will not therefore be the first being—which is absurd. Therefore God is His own existence, and not merely His own essence.
Answer: This depends on what you mean by substance.
If you mean physical material that can be touched or seen then God is the all-pervading spark of creation and destruction in all its material and immaterial forms.
Perhaps you mean substance as in something that exists? Then yes, from a trinitarian and non-trinitarian view God is THE substance. The final question and answer.
It's a difficult question because your trying to define that which is indefinable but from my own research the closest thing I have found to answer your question is Spinozism. This is Baruch Spinoza's philosophy of god that delves quite deep into the idea of god and substance.
His definition of substance as it pertains to God is that "By substance I understand what is in itself and is conceived through itself, i.e., that whose concept does not require the concept of another thing, from which it must be formed. Basically that substance is whatever that can be thought of without relating it to any other idea or thing.
I believe that of course God is a material substance but he is also everything that is not substance. The Father is life and death, creation and destruction, the matter and anti-matter. There is nothing you can imagine that isn't of the Almighty. Of course there are sects of Christianity that believe all types of different ideals and dogma far surpassing the idea of God as physical form, but pinpointing the exact creation of said offshoots is near impossible.
Comment: Welcome to Christianity SE and thank you for your contribution. When you get a chance, please take the [tour] to understand how the site works and [how it is different than others](https://christianity.meta.stackexchange.com/a/1809/50259).


Show icon to indicate microphone and/or camera are being used

Question: For privacy reasons I'd like to know when the camera and/or mic are being used by an app. Is there an app or a built-in feature to shows an icon to indicate that?
Comment: The camera will show a green light when in use. It's (now) hardwired to the camera, so it can' be bypassed.
Also, in Mojave and later, you have to explicitly grant permission for an app to use those devices. Admittedly, once whitelisted, those apps can use it freely.
Answer: There's a product called Oversight that does this. It's a donation-ware product meaning it's completely free but donations to support development are encouraged.
It's accessed through the menu bar, but if something accesses a device, it will post a notification

I've used this before for users who who were concerned about malware accessing their camera and it worked well.  I haven't tested in Catalina, but it should work though (IMO) it's not necessary due to the security permissions model in Catalina. If you don't grant an app access to a device, it can't use it.
Answer: Micro Snitch by Objective Development:
https://www.obdev.at/products/microsnitch/index.html


Query optimization - order of expressions in WHERE clause

Question: Lets say I have a table named numbers:
userID  ColA  ColB
------------------
25      10     11
25      10     16
28      10     11
28      10     16
29      12     14
29      10     16

I want to find all rows which have userID 28 and colA = 10 and colB = 16
My question is of query structure. If I look for the userID first, and then the colA and colB values e.g.
select * from numbers where userID=28 AND (colA=10 AND colB=16)

is this faster than looking for values first e.g.
select * from numbers where (colA=10 AND colB=16) AND userID=28

Or is there really not much difference? I guess I'm asking about how the engine reads the query results as there are more results for (colA=10 AND colB=16) than there are userID=28. Therefore I would assume least possibles first?
I understand about indexes etc too.
Comment: There is no difference.  SQL Engines compile the query to an internal representation.  The entire `where` becomes one conditions -- or perhaps several, depending on the use of indexes.
Comment: Note that the () would be useful if one of those conditions was an OR, in fact they would be needed to ensure the correct results in one of the two cases.
Comment: @HLGEM I just added them for emphasis actually for the question
Answer: Your RDBMS will figure out the best execution plan for that query. You won't be able to change the order of those clauses to improve performance because the RDBMS will already consider things like that when coming up with a plan.
You can use the EXPLAIN command to see more information about the actual execution plan the RDBMS decided to use.
Comment: More specifically, your RDBMS will *try* to figure out the best execution plan, but sometimes it gets it horribly wrong. That's why there's things like `EXPLAIN` to see what it's trying to do.
Answer: Your whole question doesn't make sense:

My question is of query structure. If I look for the userID first, and
  then the colA and colB values e.g.

Absent indexes or partitions, the database is simply scanning the table row-by-row.  It looks up the values within a row and does all the comparisons on a row "at the same time".  It is possible -- but by no means guaranteed -- that the order of expression will be the order of evaluation.  That would be deep in the internals of the MySQL code, and could change from version to version.  SQL definitely does not specify the order of evaluations.  I know that MySQL explicitly does not specify the order of evaluation in a select clause.  But I don't know about the where.
The order of evaluation could have a microscopic effect on performance, if we assume short-cutting.  That is, first a comparison is made.  If it is false, then no more comparisons are made.  I'm not aware that MySQL does shortcuts.  Even if it did, the effect on performance would be minuscule on a where clause with three simple comparisons..  The time to evaluate the condition is nothing compared to the loading of the data into the page table.
The situation becomes a bit more complicated with indexes.  In theory, you could have a separate index on each column and MySQL would need to select which, if any, of the indexes to use.  In that case, the query engine would be looking at statistics to estimate how selective each condition is.  It would not be using your order of evaluation.
Comment: But by my asking for an explanation surely says I don't understand it as fully as I would like to. Saying my question doesn't make sense is the whole point of the question.


Matlab *.mat files associated with MS Office

Question: When MATLAB creates a binary file with extension .mat on my Windows 7 (64 bit) computer, Windows declares it in a directory as a "Microsoft Office Access Table Shortcut". Windows also does not provide the option to "Open With" any other program in the right-click menu.  The file works properly if it is dragged and dropped into MATLAB. How can I change the file association to properly open the file with MATLAB?
Answer: Start->Default Programs->Associate a file type or protocol with a program.
Answer: Right click an example file.
Choose 'Open With' on the menu then 'Choose Program'.
In the new window, choose MatLab & click the "Always use the selected program to open this kind of file" and click 'Open'.
The program should now be associated..
Comment: For this particular problem, windows does not provide the "Open With" option.  I don't know if that's because it thinks that the .mat file is a shortcut or what, but it doesn't provide that option.
Answer: In Windows 7, go to control panel, Default Programs, Associate a file type with a specific program
This should give you a list of file extensions and their associated applications. Select the .mat extension, then click change program (button at upper right) and browse to select the 'matlab' executable.
Here's the MS ref
Answer: With Windows 10 it is currently (29.04.2020) not possible to set in system-control so:
If you have access to registry-editor

export key:
Computer\HKEY_CLASSES_ROOT.m

export key (backup):
Computer\HKEY_CLASSES_ROOT.mat

delete key:
Computer\HKEY_CLASSES_ROOT.mat

open the export of "Computer\HKEY_CLASSES_ROOT.m" with your favorite text-editor and change ".m" to ".mat"

now double-click on the edited export of "Computer\HKEY_CLASSES_ROOT.m"

==================================================
What a mess Microsoft, shame on you for that.
Answer: There's an official utility function from MathWorks that is included in MATLAB itself that will fix this issue. See this MathWorks technical support solution for details.
Comment: That's no utility function, it's a checklist for using Windows Explorer to change the file association.
Comment: @BenVoigt Looks like they've changed the content of that page since I linked to it. The utility function always used to just do basically the same things that other answers have suggested, in any case.


How does an optical spatial filter work?

Question: As I understand, a spatial filter is a lens followed by a small hole and is used to clean up non-Gaussian modes in a beam of light. Wouldn't the light diffract through the small hole producing an Airy pattern, which would just add non-Gaussian modes back into the beam and defeat the purpose of the spatial filter?
Comment: The Gaussian portion you want has a beam waist that passes through the aperture. If the pinhole is adding in more crud you are doing it wrong.
Answer: The principle behind the use of a pinhole in the way that you describe is simply to create a subresolvable source of light, thus destroying all wavefront information. You are correct that the exact diffraction pattern from a subresolvable point source is not Gaussian, but it is very nearly so and indeed Gaussian modes are the eigenfunctions of an approximation to the wave equation that holds for paraxial fields, i.e. fields of very small numerical aperture and with wave vectors all directed to within about 0.1 radians of the nominal beam propagation direction.
So in practice the beam will become more Gaussian after passage through a subresolvable pinhole, i.e. one of diameter that is smaller than approximately $\lambda/NA$, where $NA$ is the beam's numerical aperture.
Comment: Could you perhaps explain what you mean by a subresolvable source of light?
Comment: @flippiefanus One whose spatial extent is smaller than the minimum, diffraction-limited spotsize of a focussed beam with the numerical aperture (beam divergence) as the beam in question. The smallest resolvable feature by a beam with NA is of the order of $\lambda/NA$.
Answer: Although I am not an expert on this, I would like to share some thoughts.
I think a pinhole is often used to remove gross imperfections of the beam.  Since the pinhole necessarily truncates the beam,  what comes out can not be Gaussian any more, since the Gaussian function extends to infinity.  What comes out of the pinhole depends upon the variation of phase and amplitude of the wave inside the pinhole, and the computation of this is quite complicated.  If you are not afraid of a mouthful, I can recommend the book "Waves in focal regions" by J.J. Stamnes.  Here is explained theory and algorithms for accurate computation of diffraction patterns.  If the phase and amplitude are constant over the aperture of the pinhole, I believe you get something like the Airy pattern.  Another interesting fact is that the gaussian beam is not a solution of Maxwell's equations, it is only an approximation. I believe that the following papers discuss this topic although I have no longer access to them and may not remember correctly.
Geometrical representation of the fundamental mode of a Gaussian beam
in oblate spheroidal coordinates
B Tehan Landesman
JOSA A 6 (1) January 1989 pp 5-17
Gaussian amplitude functions that are exact solutions to the scalar
Helmholtz equation
B Tehan Landesman, H H Barrett
JOSA A 5 (10) October 1988 pp 1610-1619
The diameter of the pinhole is of course important, and if it is too large, aberrations of the input beam may be transmitted.  But this I feel is a question of degree, and the permitted error depends on the use of the beam afterwards.  If the pinhole is to be the source in a Twyman-Green interferometer, for instance, the question is if the size of these errrors is so small that they do not affect the accuracy of the interferometer.
Answer: A spatial filter is not a lens followed by a pinhole. It is the pinhole itself. It is used to filter out high frequencies of the laser light. Typically, a spatial filter should pass only the central Airy disk. The Airy diameter can be calculated to be A = 2.44 lambda F/#, where lambda is the wavelength in microns and F/# is the focal length divided by the entrance pupil diameter (of the lens imaging the light onto the pinhole).The pinhole passes the light contained within the Airy diameter only. There is a dark ring where the edge of the pinhole resides so you don't get diffraction from the edge of the pinhole. The Airy pattern is formed by the microscope objective you are using to image the laser light onto the pinhole. It makes for a very clean beam.
Comment: Although the pinhole is the spatial filter, the lens is important, because the spatial filter needs to be placed in the Fourier plane.


Solenoid valve backup

Question: I am designing a Scissor lifter and I am operating my hydraulics using solenoid valve but I want my system to be ready for every possibility so what should be the backup system if my solenoid valve stops working
Comment: how are the things connected? can you share the diagram? and also the electronics you are using?
Comment: @Umar  (http://www.sukanmarketing.com/blog/hydraulic/cnc-repair-and-troubleshooting-hydraulic-solenoid-valves-and-simple-circuit-diagram)  you can find circuitry there I just want to add some option in case of emergency or if solenoid valve stops such that the cylinder rod can be operated manually
Answer: 'Every possibility' is not a specification. It's quite difficult to allow for meteor strike for instance.
You need to decide what failure modes are permissible, and what not permissible. With a hydraulic lifter, moving is more dangerous than stopped, at least in my book. That means you should make sure it's always possible to stop the platform.
You need to decide what component failures are likely, and what unlikely. Perhaps a valve sticking open is something you want to guard against.
Stopping the lift even in the event of an open valve implies having two valves in series wherever you might use one, the likelyhood of them both sticking open is then much smaller than the failure of one.
If they are driven by the same power supply, this could be a point of common mode failure. If you think the supply sticking 'on' is a possibility you want to guard against, through a failed short output device for instance, then you need to duplicate supplies.
You can make a 'majority voting' valve with 3 parallel paths each of 2 valves in series, driven with 3 skew circuits, so (ab, bc, ca). That way, if 0 or 1 of abc is driven, the flow will be off, if 2 or 3 are driven then the flow will be on. Do you want such complexity for protecting a tiny part of your system?
For a full manual overide, a manual valve in series with the solenoid will stop the flow if it is stuck on, and a manual valve in parallel with both will operate the lift if the valve is stuck off.
Comment: thanks for replying. Actually I am a trainee Engineer in a private organization and we are developing a scissor lifter for an aircraft company for transferring of their luggage to aircraft and my boss wants me to give him some options for backup purpose that if unfortunately solenoid valve stops working then how to operate it manually
Comment: make sure you read the industry regulations for safety of hazardous load handling systems. A hydraulic scissor lift is quite capable of killing or delivering life-changing injuries. I'd hate the thought of operating a machine that had been designed by somebody who went on a public, amateur, help forum for design advice rather than researching industry standard practice. A manual valve in series will isolate an open solenoid. A manual valve in parallel will bypass a closed solenoid. Result, full manual control.
Comment: you have been very helpful and all the works that my organization is doing are after a proper research but to be frank I have just started working here and my boss want to know what are the possible solutions I can provide him without knowing what they are actually going to do so it is time to give him response that can I would say impress him
Comment: Never trust a software interlock to do the job of a hardware failsafe. Otherwise you're just designing a new Therac 25

Solenoid valve backup


phrase request-'Luckily, it could have been worse'

Question: It's like you just don't have money, but suddenly you realised you did put a note somewhere deep in your bag and you grab that out and just feel the mixture of being lucky and relief and pessimistic about how it could be if you hadn't put that note in. What phrase can be used to desribe this feeling?
Comment: The *'Luckily, it could have been worse'* in your question title is close, but actually I doubt anyone would actually say that. Common in such contexts is, for example, *'**At least it wasn't any worse**'*.
Comment: There are at least two dozen different things you might say in such a situation. I would probably just say, "Phew", "Thank god", "Oh, that was lucky", "Could have been worse, then", or any combination of those.
Comment: I would not use the sentence in your title though. The expressed relieve that somehow there was a worse possibility does not seem appropriate. I do not normally feel the tendency to express that _luckily, I could have died in an accident today_ - even if that is true, and even if I am relieved that my bad day was not _that_ bad.
Answer: "Phew!"
But that's not a phrase..
"Thank God!" is common.. and should pass for an acceptable applicable expression, anywhere..
"Hurrah!" or "Luckily!" are also obviously relevant.
"I knew it!" would refer back to why or what (or both) you had been been fumbling in the bag for in the first place..
Me I'd say "Yes!!!" in such a situation, on any normal earth day, at any instant of caesium decay
Comment: but you have in fact added the condition of "worse" in probability.. In relief, the Human mind normally ignores the flip side. But it's less than naive.. It will come around but at the moment the phrase is in fact uttered, only words or phrases with positive connotations are "commonly" used.

In contrast:
Comment: but you have in fact added the condition of "worse" in probability.. In relief, the Human mind normally ignores the flip side. But it's less than naive.. It will come around but at the moment the phrase is in fact uttered, only words or phrases with positive connotations are "commonly" used. A remarkably awesome subconscious measure..

In contrast:
1. "Ahh luckily!" is the only phrase I can think of, because it states this probability of luck going "either way" which could mean "better" or "worse"..
(hope I can add another comment)
Answer: Consider:

Thank God (it wasn't any worse)!
Thank God: (spoken) be pleased or happy: Thank God no one was in the way or on the sidewalk when the bus went out of control

Or

Thankfully (it wasn't any worse)!
thankfully: (Informal) fortunately: Thankfully she wasn't injured

Or

Phew(, it could have been worse)!
Phew: used to express relief

Or

Am I ever lucky!

Or

Lucky me! (can also be meant sarcastically depending on context)

Or

Lucky me -- and lucky you, too! (Here's the money)

Or

All's well that ends well!

Or

Thankfully, it looked worse than it actually is!
Answer: Thank heaven/god for small mercies
Be thankful/grateful for small mercies
Used to acknowledge the avoidance of the worst case of a bad outcome.
Comment: 2. In my Mother tongue ("Tamil", the root of "language" itself) -my native is English though, but please don't ask me how- this situation is addressed in (translated) "good time" -which could address the situation going either way. "Good time" got adapted in English (as the same) centuries ago but there sure must be a better translation.


Star Wars Armada: does a squadron command give a squadron an extra turn?

Question: When I move / fire one or more squadrons using the squadron command of a ship do the squadrons still get to move / fire in the squadron phase or is their activation over for the round?
Answer: TLDR: Squadrons only activate once per turn
Per the Armada Rules Reference on page 12, squadrons Activate when one of these happens:

In the Squadron Phase (with the limit of either Moving or Attacking, but not both)
In the Ship Phase when a ship resolves a [squadron] command (with the ability to both move and attack)

But at the end of any activation you toggle the Activation Slider for the squadron to indicate that it has been activated.
Further, you cannot activate a squadron if the color of its Activation Slider does not match the Initiative Token. This includes squadrons with the Rogue keyword as that keyword applies when they Activate.
The net result of this is that you can either activate during the Ship Phase or during the Squadron Phase, but not both.


Effect of weight on cruise gas mileage

Question: Given that acceleration is inversely proportional to mass, assuming constant wind resistance for a given speed, would a heavier truck be more efficient at cruise than a lighter truck, all else equal?
Comment: Heavier would use more fuel going uphill, but less going down... Is cruise horizontal?
Comment: @HandyHowie - ever tried even walking uphill/downhill?!
Comment: Gravity is a myth, the earth sucks... uphill against gravity...
Comment: @tim what is the physics behind heavier using less fuel going down hill?
Comment: @HandyHowie, I think what Tim was saying is that the heavier vehicle uses less gas going down a hill than they use going up, not less than another vehicle going down a hill.
Comment: @computercarguy ahh, ok.
Comment: @tim Were you saying that a heavy vehicle will use less fuel than a light vehicle to go down hill?
Comment: @HandyHowie - the **same** vehicle, heavily laden, will use more fuel going uphill, less going down, is what I believe - all other factors being equal. (Same driver, same driving technique, same windspeed and direction, same a/c on, same weather coditions, same) - well, you get it.
Comment: @tim. Sorry, just misunderstood what you were saying.  Yes, all vehicles will use more fuel going uphill than downhill.
Answer: As you said, if you ignore wind resistance, you have 2 remaining forces on a vehicle, gravity and friction.
On a level surface, you can ignore gravity to some extent because it is acting perpendicular to the direction of movement.  Of course gravity will be having an effect on the vehicle causing friction between the tyres and the road.  So discounting gravity, the only force remaining is friction.  It is more than likely the case that a heavier vehicle will have greater frictional forces acting on it - between the tyres and the road and in the other moving parts.  So at a constant velocity the lighter vehicle will be more efficient.
Answer: In practical reality, "all else equal" means next to nothing.
With a heavier vehicle, you have a larger tire meaning you have a larger contact surface with the ground, meaning more friction with the road. You also have a larger engine, which usually means it also has more friction and is generally less efficient. Part of this is because the parts are larger and have a higher inertia to overcome.
A heavier vehicle also tends to have a larger body, causing more air resistance. You mention "constant wind resistance", yet you don't mention which direction it's coming from. It makes a difference if it's head on or a from the rear, since a tailwind can help a large vehicle more than a smaller vehicle, just as a headwind will hurt the mileage of a large vehicle more than a smaller car. Even a side wind will affect a large vehicle's fuel mileage differently than a smaller vehicle.
As mentioned in a comment by Tim, does this "cruise" include hills? That changes mileage on most vehicles significantly.
And does "cruise" mean letting off the gas completely? Even for short periods?
Anecdote
Before I get into real world examples, I'll talk about two trips I took about 2 years ago, which happen to be the same trip, excluding an accidental wrong turn.
I moved to Las Vegas from Iowa. It was almost exactly 2000 miles, going through Oklahoma to avoid snow and ice in the mountains during the time of year I moved. The moving truck was a Ford F650, with a 26 ft bed and towing one of my cars. I didn't have the back completely filled, but there was significant weight back there, with all the tools and other stuff I had in it.
Every 2 hours or so, I had to stop to fill the tank. I don't remember exactly how large it was, but I promised my dad to fill it when it got below half a tank. There were times when I put $70-100 of gas into the truck after those 2 hours. I also had to had to keep my foot pressed into the gas the whole time, when I wasn't going down a steep hill, anyway. I also had to up and downshift regularly when dealing with hills. There were hills I had to downshift just to use the engine as a brake so I didn't burn up the actual brakes.
Fast forward 3 months later when I flew home to get my other car. Gas prices hadn't changed much and I drove my other car the same route, except for that accidental 30 mile detour.
I was able to easily go 3-4 hours without having to refill a 14 gallon tank. Granted, I didn't obey the "half a tank" rule, but refilling that was $30-40 dollars for the 3-4 hours, rather than +$70 for 2 hours.
I also didn't have to downshift for hills. Downshifting means that you have a higher RPM and are using more gas for the same distance, since you are trading lower mileage for higher power to the wheels.
Efficiency
What does that mean to you? Does that mean more work done for less effort or more product hauled for less gas per pound/kilogram? Or does it mean something else? Does it mean fewer trips for a larger vehicle than a smaller one? I doubt the last one based on your Question, but it's something some people might be thinking about.
Real world numbers

On average, semi-trucks get only 6.5 miles per gallon. Their efficiency ranges wildly between 3 mpg going up hills to more than 23 mpg going downhill.

https://www.arrowtruck.com/blog/2016/06/21/manage-your-semi-trucks-fuel-use-with-these-tips/
This link lists mid-sized pickup trucks that are around 22 mpg. It also has full sized pickup trucks 21-25 mpg, and diesel trucks from 21-27 mpg.
https://www.edmunds.com/truck/articles/best-gas-mileage-trucks/
This site lists a variety of car styles with a range of 26-142 mpg, with typically the smallest cars getting the better mileage.
https://www.fueleconomy.gov/feg/best-worst.shtml
These are all tested "empty", except for the semi trucks. They are also all estimated, since the actual use of the vehicle determines what the actual mpg is at any given time.
And then there's trains, which take the cake when it comes to ground travel and fuel economy. There's a lot of differences between a train and a typical road vehicle, though.

The 2018 CSX system-wide train efficiency metric equals:
208,712,027,000 ton-miles / 423,998,863 gallons = 492 ton-miles per gallon.
In other words, CSX trains, on average, can move a ton of freight nearly 500 miles on a gallon of fuel, based on our 2018 revenue ton miles and 2018 fuel use.

https://www.csx.com/index.cfm/about-us/the-csx-advantage/fuel-efficiency/
Government statement on weight of vehicles

Let's start with the easy and simple numbers. The EPA says that for every 100 pounds taken out of the vehicle, the fuel economy is increased by 1-2 percent. Based on a gallon of gasoline costing $2.58, this translates to savings of between $0.03-$0.05 a gallon. Of course, 100 lbs. in a small hatchback is going to make a bigger difference than those same 100 lbs. in a Tahoe, so make reasonable assumptions about what going lightweight can offer you.

For a more detailed look at what's possible, consider a report issued by the Aluminum Association, Inc. based on research by Ricardo. The chart below shows that for a small car with a 1.6-liter engine, reducing weight by five percent led to an increase in fuel economy of 2.1 percent on the EPA combined rating. Eliminating ten percent of the weight provides a 4.1 percent mileage boost and a dramatically significant twenty percent weight decrease improved fuel economy by 8.4 percent.
https://www.autoblog.com/2009/10/29/greenlings-how-does-weight-affect-a-vehicles-efficiency/
So the EPA says that not only will weight reduction help your vehicle's fuel economy, it will depend greatly on your vehicle's engine: A smaller engine will have a greater difference for weight added or reduced than a larger engine.
The article even says that automakers are getting in on reducing vehicle weight to increase fuel economy. This is earlier in the same article as above.

Over the last few decades, the average weight of a vehicle sold in the U.S. climbed steadily after surviving the oil embargoes of the 1970s. Today, however, auto companies are putting a lot of effort into reducing weight – Lotus set up an entire lightweight structures division, BMW is investing millions in the production of carbon fiber and Jaguar loves aluminum – because every ounce you take out of a car improves the vehicle's performance and fuel economy. Options for weight savings that automakers are investigating include installing things like plastic fuel tanks and using carbon fiber instead of steel. As we discovered in a previous Greenlings, carbon fiber is a remarkable, lightweight substance that will begin see wider use as prices (invariably) come down.

Inertia
Oh, there are quite a few things to be said about this. Some are true and many are misunderstandings.
First off, a semi truck running a red light because they can't stop in time is partly due to inertia, but there's a lot of other factors involved, even when ignoring driver error.
Semi trucks could have the ability to stop in the same amount of time as a car, but it would significantly larger brake pads. It would also need significantly wider tires to make the bigger brakes effective, since even with the current brake system, semi's will lock up their tires and still not be able to stop. There's lots of physics that go into that, including the fact that a rolling tire has more friction with the road than a sliding tire, but that's not what you're looking for in an Answer. It's also plenty complicated.
But that inertia, that idea of the semi going through a red light, is where your idea is based, whether you know it or not. Maybe not, since I'm just guessing here, but it seems like a "normal" conclusion.
Getting into physics a bit, the equations for force are a great place to start:
F = ma; Force equals mass multiplied by acceleration
or another way to state it, meaning the same thing is:
F = (1/2)mv2; Force equals one half of mass times velocity squared
The Force (F) is the amount of force it'll take to move an object. Just looking at those 2 formulae, you should notice that mass is a significant factor in them. If you double the weight of something, it'll take double the Force to move it. The caveat here is that it's assuming a frictionless plane.
In the example of trucks, there's considerable amount of friction. The rolling friction of the wheels, the internal friction of the engine and transmission, the air friction, and many others that are getting off topic. As I mentioned earlier, a larger truck has a lot more friction to worry about than a smaller truck, but what if we simply used the same truck with different weight in it? Well, the rolling friction is still altered because the tires will deform and the suspension will have changed it's height, causing air resistance/friction to be different, including the ground effect under the vehicle.
There's just so many reasons/variables why it's extremely difficult to determine how weight affects gas mileage that without actual test cases, you're not going to get any answers. Along with that, different vehicles will have different results, as will different drivers, and different weather on different days.
Conclusion
There are probably college courses specifically on fuel efficiency, due to how complicated the equations of inertia, friction, and the other variables are and how they interact with each other. I went through physics in college many years ago, and I sure don't know how it all fits together well enough to give you anything close to a definitive answer.
But as the EPA states (mentioned earlier), a lower weight means better fuel economy, but there are a lot more factors to fuel efficiency than just weight. And there's plenty that can be said about EPA mileage estimates, but I was just using that as baseline numbers for comparison, not as absolute empirical proof.
Because of all the reasons I stated previously, you aren't likely going to get a good answer for your question. You'd likely get an answer on Physics, but that's likely only going to be of limited value, too, since it likely won't deal with more than just a few specific cases.
Comment: 1/2mv^2 is a unit of *energy*, not *force*. I don't really understand the point of the anecdote section, in which you drive two vehicles with different fuel economies, gas tank sizes, weights, and aerodynamics. There's too many moving parts there to be able to assess the contribution of weight alone - all it shows is that an F650 is less fuel efficient than a car, but sheds no light at all on the reason why. You say having two cars of different weight with "all else being equal" is difficult to achieve, but it's actually *very easy* - just use one car and throw some sandbags in the back.
Comment: @NuclearHoagie, I put in that story to show just how difficult it is to calculate fuel economies based on weight alone. Also, "throwing sandbags in a trunk" is exactly what I was talking about when I mentioned how the suspension would cause a difference in air resistance and the tires deforming causing differences in the test that will affect the results, not just the added weight.
Answer: "All else being equal", a heavier vehicle will use more fuel at level cruise when compared to a light one. There is more friction between the tire and road surface, effectively increasing the rolling resistance. You would be able to see this visually as deflection in the sidewalls of the tire on each revolution. Heavier vehicle means more deflection, more resistance.
You would also get an incremental increase in friction at other components that support the weight, such as wheel bearings, but the tires would cause the majority of the increase.

Effect of weight on cruise gas mileage


why One-Hot Encoder can avoid the situation that the model will misunderstand the data to be in some kind of order if the data has been Label Encoding

Question: We know that we prefer to using One-Hot Encoding not Label Encoding when processing with non-ordinal data.
And I real a blog which give the difference between Label Encoding and One-Hot Encoding.
So I am wondering why One-Hot Encoder can avoid the situation that the model will misunderstand the data to be in some kind of order, $0 < 1 < 2$ if the data has been Label Encoding.
Does it have some provements and theories?
Or anyone just can explain it in intuition.
Thanks in advance.
Comment: To be honest I haven't seen any difference
Answer: From the blog, one hot encoding resolves the issue by explicitly showing that 1 category is true, while all others are false (1 vs 0). One column is turned into 3 columns which describe all categories as either true or false.
As opposed to letting a model see one column with 0, 1, and 2. One column to show this data with label encoding does make it seem as if the data is numerical so 0 < 1 < 2.
Answer: Good question!
This might help:
Let's say you have three countries: USA, Germany, and China. No ranking.
Label Encoding turns the countries into numbers.
For example, 1 (USA),2 (Germany), and 3 (China).
If you don't One Hot Encode, the theory states (source: Sebastian Raschka "Machine Learning with Python"), that you create ordinality.
In other words, USA is better than Germany and Germany is better than China.
As you have no ranking (order), you don't want that. Thus, we One Hot Encode.
Personally, I have tested this several times and only Label Encoded (not ranking features) with Logistic Regression and have NOT seen a difference. But I've only done it a few times. And, if an ML expert like Sebastian Raschka says we should One Hot Encode for non-ordinal numerical data than I trust him.


"It was possible for me to proceed to the..... "

Question: "It was possible for me to proceed to the US for my graduate studies because I was offered a scholarship". Is this sentence grammatically correct?  Should it be "It became possible..... " Or are they both ccorrect?
Comment: This is a non-idiomatic usage of "to proceed". If you already traveled to the US, say "to come". If not, say "to go".
Comment: I'd suggest the more concise, "I was able to come to the U.S. for graduate school because I was offered a scholarship."
Answer: "It became possible..." means that "it began to be possible" according to the definition of become from the OED. If the "scholarship" was what initiated the allowance of your "proceed[ing] to the US" then this would be a the more applicable wording; i.e. become would indicate a development of some kind and that the "scholarship" functioned as a contingency in determining the outcome of the situation while other factors are also present.
"It was possible..." suggest that the "scholarship" alone accounted for you ability to move "to the US." This also does not imply any change or development, whereas the word become does.
In this particular scenario, "became" would be the more suitable word; although both are grammatically correct. This is because at one point it was not possible for you to "proceed to the US" and through the development of the "scholarship" it "became" possible.
Answer: If it was possible, is it still possible now? It might be a slightly better choice to say "it became possible" in this particular case since something happened that change its possibility for the better, although both are grammatically correct.


arcpy cannot extract a subdataset from a .3D file

Question: I am working with data which represents the atmosphere as rasters at 29 different altitudes. This data is stored in a ".3D" file. When I drag and drop into ArcMap it asks me to select the layer I want. When I use arcpy's "extractsubdataset" tool it says "ERROR 000840 The value is not a raster layer". I'm pretty sure it is because the tool only accepts ".HDF" and ".NITF". Is there any other way to automatically extract the data?
I need to extract over 100 subdatasets from over 100 ".3D" files so I can't do it manually. If I do multiple subdatasets at the same time from drag and drop they all get the same name and it is hard to distinguish them apart.
The data is the National Centers for Environmental Prediction North American Regional Reanalysis
Not sure if I am allowed to have links, but here is a link to the data: https://rda.ucar.edu/datasets/ds608.0/index.html#cgi-bin/transform?xml=/datasets/ds608.0/metadata/wfmd/3HRLY%252017%25NARR3D_201708_1012.tar.GrML
For syntax I have the input and output as strings to where the file is located and the subset index as an int.
arcpy.ExtractSubDataset_management(filepath,outputfolder+"test.tif",1)
Does GDAL work? If it does I can get IT to install it on my workstation (I've never used GDAL).
Answer: I just found a solution for anyone else who comes across this issue. Simply change the file name to be .hdf (do it on a copy first to make sure it works for you). Then it should work perfectly


How do I make a macro to generate a record number based on the fiscal year? (Access 2013)

Question: I would like to create a record number that is based upon the fiscal year and automatically advances...  Something like:  2015001, 2015002, 2015003, 2015004; 2016001, 2016002, etc.
I already have a [FiscalYr] field (calculated data type) in my table [Projects] based upon the following expression:
IIf(Month([EntryDate])>=10,Year([EntryDate])+1,Year([EntryDate])).

The [EntryDate] field is a Date/Time field with a default value of Date().  This is working as I would like it to.
Is there I way I can take that [FiscalYr] number and put it on the front of a 3-digit number that starts with 001 and increments by 1 based upon the previous record, with the number re-setting to 001 at the start of each new fiscal year?  Our fiscal year starts on October 1 and ends on September 30.
I want the number to be generated whether the information is entered in the table [Projects] or the form [Projects Form].  I don't want it to only generate if info is entered in the form.  I saw some posts online suggesting the best way to do something like this would be to use a Before Change macro, but most of the examples I can find base a significant part of their macro code on a date, and I've already gotten the date issue sorted out (I think).
I would be fine with a macro that both created the Fiscal Year from the [EntryDate] and created the number at the same time, if that is easier than working with my existing [FiscalYr] field.  I am only a casual Access user, so if I'm speaking gibberish I am so sorry – I think I know just enough to be dangerous.
Many thanks,
Andrea

Update 12/9/2015:
I have given up on the macro idea.
Using the tips on Scottgem's blog (https://scottgem.wordpress.com/2009/11/25/sequential-numbering/), I have been able to get a sequential numbering system up and running, but I am still struggling mightily with getting the number to re-set to 1 at the start of a new fiscal year.  I am not sure if the problem is how I'm generating my fiscal year value, or something else entirely.
Here's what I've got:
Table Name:  Projects
Within Projects, I have the following fields related to this issue:

ProjectNo:  number - long integer
Sequence:  number - long integer
EntryFiscalYr:  calculated - long integer; expression reads as follows: IIf(Month([EntryDate])>=10,Year([EntryDate])+1,Year([EntryDate]))
EntryDate:  date/time; default value:  Date()

Form Name:  Projects Form
Within my Projects Form, I have the following controls:

Sequence:  text box, control source is Sequence field in Projects table, set to not visible
CreateProjNo:  button, event on click:
 Private Sub CreateProjNo_Click()
    Me.Sequence = Nz(DMax("[Sequence]", "Projects"), 0) + 1
    DoCmd.RunCommand acCmdSaveRecord
 End Sub

ProjectNo:  text box, data control source:
 =[EntryFiscalYr] & Format([Sequence],"000")

This is displaying as I would like it to:  2016001, 2016002, etc.
I have tried various iterations of the codes on Scottgem's blog to bring the EntryFiscalYr field into the DMax statement to look and see if the Sequence number should continue incrementing for the current fiscal year or start over for the new fiscal year, but none of my attempts are working.
I have tried:
 Me.Sequence = Nz(DMax("[Sequence]", "Projects","[EntryFiscalYr]) = " &(Me.[EntryFiscalYr])),0)+1

 Me.Sequence = Nz(DMax("[Sequence]", "Projects", " [EntryFiscalYr] = '" & Me.[EntryFiscalYr] & "'"),0)+1

I have also tried with Me.[txtEntryFiscalYr] instead of Me.[EntryFiscalYr].  None of these attempts have worked.
I am guessing my issues might be due to how the EntryFiscalYr is generating for each record but I am clueless as to how to address this.  I have tried with the date generated by EntryDate and that does a great job with the calendar year, but it is important to get this based on fiscal year and have it re-set at the start of each new fiscal year.
Also, the ProjectNo that is generated in the Projects Form is not updating to the ProjectNo field in the Projects table, but it is my understanding that this the point.  Is this correct?
Any assistance in getting this to work correctly with the fiscal year would be greatly appreciated.
Thanks!
Comment: Welcome to Superuser. What have you tried so far?
Comment: Hi Andi,
I have updated my question to reflect what I have tried so far.
Thanks!
Andrea
Comment: Afraid I don't have enough knowledge of Access to answer your question but I've applied some formatting to make your code a tad more readable for others.
Answer: This is the code I finally settled on.  It uses a button within my form.  Hope this helps others out there who may be struggling with the same issues.
Private Sub CreateProjNo_Click()
Me.EntryFiscalYr = IIf(Month([EntryDate]) >= 10, Year([EntryDate]) + 1, Year([EntryDate]))
Me.Dirty = False

If IsNull(Me.Sequence) Then
Me.Sequence = Nz(DMax("[Sequence]", "Projects", "[EntryFiscalYr] = " & Me.[EntryFiscalYr]), 0) + 1
Me.Dirty = False
End If

End Sub

For more information on how I got to this solution, I would suggest visiting this link:  http://answers.microsoft.com/en-us/office/forum/office_2013_release-access/access-2013-how-do-i-generate-a-record-number/22fa42e1-dd89-4683-b1d0-72b112281c1c


Can an irrelevant variable be significant in a regression model?

Question: I'm reflecting about statistical significance and I think a variable can be irrelevant and significant at the same time. But, how do I explain that? And if that were the case, should I include that variable to my regression model?
Comment: A useful and interesting exercise is to generate an explanatory variable independently at random and re-fit a regression.  Repeat many times. When, say, your standard for "statistical significance" is an $\alpha=0.05$ level, then you will observe that your random variable is "significant" in close to a fraction $\alpha$ of such fits.
Comment: An unintended lesson from this question seems to be that "statistically significant" has a precise definition but "irrelevant" means different things to different people. So poorly defined statements might not be very relevant (= "to the point").
Comment: It very well may be that such an irrelevant-yet-significant Variable is actually portraying statistical significance of 'Inverse Relationship' of the context.
Answer: Here is a good example.  Suppose you are interested in modelling the effect of ice cream sales on incidence of shark attacks.  Now, clearly there is no association; buying ice cream in no way affects the incidence of shark attacks.  However there is a third variable which affects both, namely the temperature outside.
On hot days, people will want ice cream and might also want to go swimming.  Hence, hot days see increases in both ice cream sales and shark attacks (by virtue of more people going swimming and hence being at risk for an attack). This is known as confounding.
So clearly, ice cream sales is irrelevant when studying shark attacks but were we to regress shark attack numbers on ice cream sales we would find a significant result.  However, that statistical significance is confounded by temperature, and so the result is meaningless.
EDIT: Because this has generated conversation around the interpretation of "irrelevant" I feel the need to make some additional comments and concede I should have said "it depends" (even though I object to the arguments made).  If "relevant" is understood to mean "closely connected or appropriate to what is being done or considered" then "irrelevant" should be taken to mean "not closely connected or appropriate...".  In this case, ice cream sales could be considered "relevant" since they would be correlated -- but I find interpreting "relevant" in a purely statistical sense to be an extremely narrow (and irregular) way to attach meaning to "relevant".  None the less, it is an interpretation one may have.
If, however, you interpret relevance or "closely connected..." in a mechanistic sense -- i.e. how closely connected are ice cream sales and shark attacks in the sense that I could change the former and affect the latter or vice versa -- then ice cream sales would be considered irrelevant and my original comment applies.
Comment: Re "So, clearly:" if you are truly interested in predicting shark attacks and you found that ice cream sales had predictive value, why dismiss that as "irrelevant"?? Sure, there's no direct connection, but if ice cream sales is at least serving as a proxy for other variables you cannot measure, then wouldn't including them (with this interpretation) have *some* meaning?
Comment: "Interpreted as causal" is an extremely narrow way to attach meaning to "relevant."  Moreover, that contradicts what you write at the outset, where you characterize your understanding in terms of an "association" only.
Comment: Nice example and +1. What I find so interesting about this is that, if we didn't know to look at temperature and only cared to predict shark attacks, we might be perfectly content to regress on ice cream sales, if such a model gives acceptable performance for our task.
Comment: I was hoping for clarification from you, but implicit in your comment is that you accept that your post is problematic.  On behalf of future readers, I am content to have pointed out the inconsistencies and potentially confusing statements that currently appear.
Comment: @whuber I didn't say "predicting", I said something which could be interpreted as causal.  And while ice cream sales may be related to shark attacks, banning ice cream is not going to remove the threat of shark attacks.
Comment: "the result is meaningless", no, it is meaningful in the sense that there's correlation between the two. Statistical significance is "significance" only in the sense of correlation. And correlation is not causation. If your goal is to judge causation, then it's highly misleading to say that statistical significance of the result is meaningless -- _performing the regression in the first place_ was meaningless, as that's not the way to determine causation.
Comment: @whuber it isn't problematic, it is perfectly consistent even with the inclusion of the word association, your bar is perhaps too high.  You're free to add a more nuanced and lengthy comment, but I am perfectly happy with this answer.
Comment: "interpreted as causal" it seems rather risky to use the word "causal" when talking about regression.  Regression can say "Y *can* be explained by X" but not "Y *is* explained by X" because it is a correlation based analysis not a causal one.  "Causal questions can be most certainly answered with regression" I strongly disagree, you can define "statistical causality" with regression, but it won't match the normal everyday idea of causality and will lead to misunderstanding.
Comment: @Dave True, however I was very deliberate in my language to *not* use the word "predict" so as to not be subject to this counter argument.
Comment: @whuber Then I suggest you write your own answer to supplement where you think mine is deficient.
Comment: This example is not very clear. It is typical for explaining the 'correlation does not imply causation' situation, but relating to 'irrelevance' of a variable it is not clear whether this is the case. In the example *"Suppose you are interested in modelling the effect of ice cream sales on incidence of shark attacks"*, it is important to know the context *why* one is interested in modelling this. Without it one can not know why the significant correlation would be considered irrelevant. When we suppose that we are interested in this modeling, then indirectly we state that there's relevance.
Comment: In short: Why are we interested in modelling if the modelling is irrelevant? This is a contradiction.
Comment: @R.M.  I'm not sure wha you mean by "performing the regression in the first place was meaningless, as that's not the way to determine causation".  Causal questions can be most certainly answered with regression, but more to your point performing the regression on the data in question would be meaningless, which is what I intended to say.  The result [of the regression] is meaningless [as an answer to the causal question].
Answer: "Relevant" and "irrelevant" are not well-defined statistical terms that everyone agrees on.
Case in point: the answer by @Demetri Pananos interprets "relevant" as "causal" and the answer by @Sextus Empiricus interprets "relevant" as "included in the model that we assume is the true — or at least a valid — model for the data". Both interpretations are meaningful but they are not equivalent.
Consider for example a (correctly specified) model for the response to a medical treatment vs placebo that includes gender and age effects: $E(Y) = \beta_a\textrm{age} + \beta_g\textrm{gender} + \beta_t\textrm{treatment}$. The effect of the treatment, $\beta_t$ is causal: it's the difference between the outcome if a patient is given the treatment vs if the patient is given a placebo. However the patient doesn't "cause" the outcome of his/her/their own treatment with personal biological and genetic characteristics. A better term for age and gender in this model is "covariates" or "effect modifiers". They are certainly relevant in order to prescribe each patient the most appropriate treatment.
Another popular attempt to specify what "relevant" means is to make a distinction between "practically significant" and "clinically significant" on one hand and "statistically significant" on the other hand. For example, an effect size might be statistically different from 0 but very small in magnitude  (absolute value), so perhaps not particularly useful in understanding phenomenon X, the argument goes.
Practical vs Statistical significance
Is there a colloquial way of saying "small but significant"?
There are subtleties with this interpretation of relevance has as well:
Stop talking about "statistical significance and practical significance"
So one takeaway is: If someone uses the term "(ir)relevant", "(in)significant", etc. to discuss their analysis, ask them "What exactly do you mean when you say your result is [a generic term hinting at importance]?"
Comment: The *Stop talking about "statistical significance and practical significance"* article treats practical significance as a binary statistical measure as opposed to a continuous practical / real-world one, and then proceeds to use that to argue that a practically significant result wouldn't be practically significant (although even the example of heart attack deaths may arguably not be all that practically significant, depending on the specifics). Very strange, and the strawmanning gets much worse when he gets to "the other reason".
Comment: @NotThatGuy I read your description and conclude -- it's naive to believe that that there is one definition of "important" / "relevant" that make sense for all the projects/studies in the universe. Hence, just be explicit at the start what "relevant" means in the particular case and there won't be need for a long discussion and people talking over each other to argue their point.
Answer:
I think a variable can be irrelevant and significant at the same time. But, how do I explain that?

This can be explained by using the concept of type I errors.
Below is an example by repeating a t-test 1000 times where we test whether the random number generator has a mean different from zero. Say that we consider a p-value below 0.05 significant, the we find 41 times that the mean of the number generator is significantly different from zero.

p = rep(0,1000)
for (i in 1:1000) {
   set.seed(i)
   p[i] = t.test(rnorm(100,0,1))$p.value
}

plot(p, bg = 1 + (p<0.05), col = 1 + (p<0.05), pch = 21, cex = 0.5,
     main = "p values in 1000 simulations of a t-test with different seed\n 41 cases of significant p<0.05 level", xlab = "seed number", ylab = "p-value")
lines(c(0,1000),c(0.05,0.05), lty =2)

Significant observations may happen even when there is no true effect (the null hypothesis is true) because sampling is subject to random statistical variations.
The point of 'significance' is to tell whether some observation is extreme and express it in terms of a probability, but an extreme/significant observation does not mean that it is not able to occur when there is not a true (relevant) effect. An extreme/significant observation can happen by chance. (Like in the figure above it happened 41 times out of 1000 experiments)
So that is what significant means from a statistical point of view

an extreme observation that falls outside the range of likely statistical variations that might be expected.

Significance does not directly mean a 'relevant' variable.
This is a bit of a language problem as well. Statistical significance relates to probability of observations. It is not 'significance' as in 'important' as it is used in common language.
Significance is also mostly important when it is absent. Significance is more like a minimal condition for some observation/variable to be important, and it is not like a sufficient condition.
Answer: Complementary to Demetri's nice answer (+1):
Aside (unmeasured) confounding, we might have spurious associations that are not the same an unmeasured confounding. Two variables X and Y might be independent but have with similar covariance matrices that looks indistinguishable to confounding due to network or spatial structures. A reasonable fresh reference on the matter is: Network Dependence Can Lead to Spurious Associations and Invalid Inference (2020) by Lee & Ogborn where the authors refer to this phenomenon as "spurious associations due to dependence".
Answer: The definition of significance is that there is a certain probablility (not more than $\alpha=0.05$) that the wrong conclusion was drawn. The result of a statistical test can be significant, i.e. it can state that whatever the respective test tests for holds with high probability.
For example, the test result can state that there is a high probability that the weight of individual apples follows a Gaussian distribution. Or that there is a high probability that the weight of individual apples does not follow a Gaussian distribution. (Note that one of those two cases is wrong, i.e. the test yielded a wrong result. The probability for a wrong but significant result is not more than $\alpha=0.05$.) Or the test result might state that there is a high probability that ice cream consumption and shark attack frequency are correlated. Or that there is a high probability that ice cream consumption does not cause shark attacks. Or that there is a high probability that shark attacks do not cause higher ice cream consumption. Depends on which statistical test is applied to what data.
However, I don't know what you mean by a variable being "significant". The result of a statistical test can be significant. One variable can play different roles in statistical tests.


Does anyone know the .net odbc driver connection string for excel 2003's xml spreadsheets?

Question: I know this has a certain "send me teh codes" quality, but the internet has really been letting me down on this one.  I have an excel file in excel 2003's xml format that I want to attach an odbc connection to.
And I can't seem to find the right connection string.  connectionstrings.com has let me down, and other questions here on SO (such as this) also don't cover this file type.  And, of course, neither the binary xls connection nor the new xlsx connection seem to work?
Does anyone out there know the right syntax?  IS there an odbc driver for excel 2003 xml?
Thanks, all.
Answer: Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\MyExcel.xls;DefaultDir=c:\mypath;


Advantages of using 2 NPN transistor NOT gate

Question: Is there any benefit using 2 NPN transistors for a NOT gate rather than one NPN transistor?
Comment: Oliver, I'd recommend that you study [this site](https://www.nutsvolts.com/magazine/article/understanding_digital_logic_ics_part_2), as it contains a great deal of expert knowledge contained within the schematics for TTL logic. If you follow the first cases and then see the progressions that took place over time, you will learn a great deal about the pros and cons. You may see some similarity in what you drew up, too.
Answer: The single-transistor inverter has a quick turn-on, where collector current goes from near zero up to near 5mA (and collector voltage falls from +5V to near zero volts).
However, turn-off is quite slow in comparison, due to base storage of charge. That base resistor drains away base charge too slowly for a logic-high-to-low input transition.
The two-transistor version has turn-off time more commensurate with turn-on time, because base charge is actively drained away to ground by the collector-emitter part of the saturated input transistor.
Both of these versions suffer from a low threshold voltage, where noise immunity for a logic-low input is poor compared to noise immunity for logic high input.

For low-speed logic inverters, the simpler one-transistor version might be OK, but noise-immunity might favour having a higher threshold voltage than +0.6V. Separating the base resistor into two (a voltage divider) could raise threshold, and speed up the slow edge too, by lowering the resistance-to-ground:

If more complex logic connections are required, fan-out should be considered...how many of these simple inverters could be driven from a similar inverter? Not many. In this answer's schematic, a larger base-series-resistor combined with a smaller collector resistor improves fan-out a little. However, turn-on time versus turn-off time disparity still exists.


Question about stem play

Question: I screwed the top cap screw clockwise to remove play in the stem but I wonder if the stem has to be never moving or theres a point the headset is softly moving like rubber I assume bearing is still moving so what should I do of either of them?
Comment: "Top cap" suggests this is a threadless steerer on a steering tube?  Or do you have a quill stem?     Are you referring to the headset bearings ?
Comment: The title refers to play in the stem. I think you may mean play in the *headset*, although you do fix this by adjusting the headset's preload via the stem cap. Consider editing the title if you feel that this conveys your meaning better.
Answer: When it's properly adjusted, there should be no perceptible play or movement.
Sometimes the above needs to be qualified that imprecision or imperfection in the parts can still allow some play, particularly under heavy load. Examples could be a cheap headset with an under-engineered plastic compression ring or an integrated headset headtube that's distorted such that the conical tapered faces don't work properly to remove play.
Threadless stems and spacers exist where the parallelism of the surfaces is bad enough to cause play, but that's not a common problem.
Answer: There should be zero headset bearing play. At the same time the handlebar/fork should turn freely. To check for play I find it easiest to put a hand around the headset area (i.e. grabbing both the stem/spacers and the frame) and feel for any play when you rock the bike back and forth.
Very bad cases of bearing play you can see and feel by pulling the front brake and rocking the bike back and forth.
Answer: You mentioned "screwing/tightening down the top cap," which I am assuming to be a threadless steerer.
However, you did not mention that you loosened the bolts/screws that clamp the stem to the steerer tube. If you don't loosen the clamping force of the stem to the steerer tube, tightening the top cap will have no effect. The top cap adjustment is to pre-load the bearings in the fork-headtube-stem-topcap "sandwich." Once the play in the bearings is just removed while still retaining free flowing steering movement, you then tighten the screws that clamp the stem to the steerer tube to the torque spec. (with the stem aligned with the front wheel).
This adjustment sometimes takes a few tries to get it "just right."
Weiwen suggested a link to describe preload, so if that could be helpful, you can find it here:  Crank preload question and answer
Comment: Feel free to link this answer on what is preload. It is about crank preload, but the answer was written to describe headset preload also. https://bicycles.stackexchange.com/questions/29659/what-is-crank-preload

Question about stem play


iPhone+Difference Between writing @classname & #import"classname.h" in Xcode

Question:
Possible Duplicate:
@class vs. #import

I am Really confused with this,Whats the difference between writing @classname & #import"classname.h" .When Do we go for @classname?
Comment: Look at http://stackoverflow.com/questions/322597/class-vs-import
Answer: You can find a good answer here and in the Objective-C Programming Language documentation on ADC
Answer: @classname is a forward declaration. Nothing gets imported, it just informes the compiler, that the class will exist on runtime.
#import will actually import the other class -> you can imagine it as a copy it into the file. so the imported classes will get compiled before the one, that it is written in.
Answer: @classname just tells the compiler that the class classname exists.
#import really imports the header file so that the compiler not only knows that it exists, but also how it looks. (like ivars, methods etc...)
Answer: The @classname just let's the compiler know that the class exists however you'll still need to import the corresponding .h.  You can use the @classname in the .h and then import the class in the .m and this will allow you to avoid circular references.  You can read more about it here Apple Docs
Answer: @className directive is introduced to overcome cyclic reference of classes, it is also known as Forward Declaration
@class will just inform the compiler that there is a class named "@className yourClass" no need to worry about that class and in runtime it just refer that class and executes.
#import "className" will keep a copy of that particular class.


Approaches to Testing a Scientific Library

Question: I'm quite interested in the Scipy/Numpy project which is basically a Python scientific computation/numerical methods library. I'm also interested in testing. What are some good approaches for testing such a library, or any software library? There already are extensive unit tests, which run pretty well. But what would an acceptance test look like? Thoughts?
Answer: An acceptance test is supposed to actually simulate the actual functionality a user would use. For example the acceptance test of using an email application would involve both logging in and opening the inbox. You may have a unit test on logging in, and a unit test on opening the inbox, but the acceptance test says that the two actually work together to give the user some functionality.
Key point: acceptance tests are written by the customer (or at least from the customer's point of view.)
So how is the library being used? When I think of most libraries I use, each piece of the public API of that library is independent of the rest of the public pieces of the API (i.e. I'm not forced usually forced to use one part just so I can use another part. Not usually.)
For most libraries (as opposed to applications) the unit tests will give you the same information as acceptance tests will. It would seem strange for extensive unit tests to pass, and yet the library not be in a user-acceptable state. But, like any product, I would find out how your users are actually using the library and try to write a test around it. You might take some open source applications that use your app and compile against them, and run functional tests on those. If your changes break the app, it's a good indicator that the users would actually be displeased with that build of your library.
Comment: Some great points. I would like to add that, yes, if the unit tests are passing, that's a good sign. In fact, one kind of form of user acceptance test would be running all unit tests for a particular module, and seeing if there are any problems.
Comment: It will be good to know whether the unit tests pass, but whether they do so is orthogonal to whether the acceptance test will pass.  The unit test should verify that the library does what the developer intended.  The acceptance test verifies that the library does what the customer intended.  If a unit test fails but the customer doesn't care about that part of the library, the acceptance test may still pass.
Comment: If the Unit Tests are failing the build should never have made it into Test in the first place, the Acceptance Test will tend to be more generic and often times be "Happy Path" since its only going to demonstrate that functionality has been achieved.  glowcoder definitely links the two rightly though, as they are both Tests and may cover the same things but not in the same way.
Answer: Define your view of the term acceptance test first, although it usually agreed to be something like "testing from the customer perspective" each company have variations on it, for example by choosing different customers- a customer can be the end user of a calculator or a developer using the library.


How monochromatic waves can be incoherent?

Question: Is it possible to have a monochromatic wave which is incoherent? On the one hand, it could be obtained by irradiating a laser beam on a strongly scattering medium like white paper. But on the other hand, once the light is monochromatic its electric field is a sinusoidal wave of constant frequency and if we sum a series of such sinusoidal waves with random phases and amplitudes we always get a sinusoidal wave of the same frequency same as in coherent light.
Is it true that if we want to have incoherent light we need an electric field which fluctuates in time in a more complex way than simple sine and therefore cannot be made of plane waves of single frequency but non-zero bandwidth is crucial?
Comment: coherent with what?
Comment: Monochromatic in experimental sense does not really mean perfect sine wave, it means an oscillation with stable intensity over a long time, with concentrated spectrum around single frequency, but not infinitely thin (zero-width) spectral line. The wave may look like a sine wave for a while, but its phase detunes from the perfect sine randomly.
Answer: As you suggest, it can't be. The wave $A \sin(\omega t - \vec{k} \cdot \vec{r} + \phi(t))$ for random $\phi(t)$ is not a monochromatic wave
Answer: A truly monochromatic wave with a delta function Fourier Transform must exist for infinite time. If its amplitude changes over time, it isn't truly monochromatic. It would have an infinite coherence length.
But many waves with a narrow spectrum are called monochromatic. E.G. lasers are monochromatic. They have a finite coherence length. Those with a long coherence length must have a narrower spectrum.
Answer: You can not produce really monochromatic light waves. But you are right , to have incoherent waves, they are in reality wave packets.
So it is not clear, what you want.
Answer: There are different forms of coherence. Leaving aside quantum aspects, we'll focus on first order coherence as seen in classical optics. There one can distinguish between temporal coherence and spatial coherence. Temporal coherence is determined by the temporal frequency spectrum, which is the coherence that the OP seems to be referring to. It is represented by a coherence length which is related to the inverse of the spectral bandwidth. In the monochromatic limit the coherence length grows to infinity, which is obviously just an approximation.
Spatial coherence has to do with the size of the source. Think of the exit pupil of a light source such as a laser and imagine it is a surface consisting of independent point sources. All these point sources contribute to the observed interference. The lack of coherence is thus caused by the different path lengths that are formed by different points on the source to the point where the interference is formed. When these path lengths vary by more than a wavelength then the light would appear incoherent even if the light is monochromatic.


Is it possible to get Adderall or Ritalin in China?

Question: I have ADHD and going to move to China. Is it possible to get Adderall, Ritalin or equivalent ADHD drugs in China?
Answer: Yes both are available in China, you may have to go to a foreign manager hospital but they are plenty specially in the bigger cities, if you are out in the rural areas you might have challenges though