"Save operation failed invalid MIME part type" in Lightswitch HTML Client

Question: When trying to save a record in VS Lightswitch HTML Client I get this error pop up.
"Save operation failed invalid MIME part type"
It does it in the HTML Client but I don't know if it's exclusive to that.
This will happen even if i create a new project, add one table with one field and one screen to add a record so has nothing to do with complexity.
Funny thing is that the record saves but doesn't show up until the page has been reloaded. (Refreshing hangs, you have to hit the url again.)
I'm using VS2012 Premium with update 2. There are no attached datasources, it's just using the basic SQL Express Lightswitch generated data.
Answer: This problem turned out to be only in Opera!


close windows form when users click outside

Question: anybody have an idea how to write a code if the user clicks outside windows form, the form will automatically close? I.e., I had two forms, when i show form2 and then i click outside of it, form 2 will closed.
Answer: Does this help? Try the first two solutions, one of which should work for you.
Winforms: Close modal dialog when clicking outside the dialog
Answer: You can simply utilize the LostFocus built-in event of the Form like this
Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As EventArgs) _
        Handles Me.LostFocus

    Me.Close()
End Sub


"Them are" or "They are"

Question: Are "They are called living things.", "Those are called living things." and "Them are called living things." interchangeable? Do all sentences convey the same meaning?
Comment: In some non-standard varieties of English, "them" is an alternative to "those" (as determiner, not pronoun), so you will hear "them things are ...". I'm not aware of anybody saying "Them are...".
Comment: They're not interchangeable, and thus do not convey the same meaning.
Answer: They're not quite the same, and one of them is incorrect.
They: the things we were referring to earlier.  For example,

My aunt and uncle live in Brixton.  They have a big house.

So you might say, "These things are (whatever).  They are called living things."
Those: the plural of that.  We use it when referring to specific things that are farther away or more removed from our observation or discussion.  For example,

These trees here are apple trees.  The ones down in the valley?  Those are pear trees.

So you might use "those" like, "These are rocks.  They are not living things.  But there are also animals.  Those are called living things."
Them:  Incorrect in this case.  It's the object version of the pronoun they.  You would use it like

My aunt and uncle live in Brixton.  I went to visit them.

You can't say them are, because you need a subject there, not an object.
References:
These, Those, and They
Personal Pronouns
Answer: Your third sentence is not grammatically correct.  Them is never used as a subject. This personal pronoun is used as an object (the same for her, him, me).
So, let's look at your first two sentences.  If you are referring to the same group of things, the two sentences could mean the same but are conveyed differently.

They are called living things

This sentence could be in response to a question:  What is that?  They are called living things.  If you are not referring to the same group of things, this sentence conveys a more general answer.  The group of things is of unknown size and could be a larger population than the second sentence.

Those are called living things.

You could answer the same question with this answer, making the meaning the same.  What is that?  Those are called living things.  However, if it is not the same group of things, this sentence conveys a more specific meaning.  Those refers to a certain group of things, instead of the more general they.

"Them are" or "They are"


Could Dark Energy be a "Cosmic Gravity Background"

Question: Could dark energy (the accelerating expansion of the universe) be the result of gravity from the dense past universe "pulling" outward from all directions? The universe theoretically started out extremely dense and hot, and we can see the light reaching us as the cosmic microwave background. I wonder if that same region and denser portions beyond are exerting a gravitational effect that is stretching out everything within toward it, effectively being a cosmic gravity background. If so, is this the explanation for dark energy?
Comment: Gravity on a universal scale has to be treated in the context of General Relativity and the Robertson-Walker metric. Your question does not make any sense because every place causally connected to us in the universe was coincident in the past.
Answer: There is in fact a cosmic gravitational wave background. These waves are expected to be stochastic, having originated in the early universe (much earlier than the cosmic microwave background). Random fluctuations were subsequently stretched during inflation, making them observable over many wavelengths. A good and reasonably up-to-date introduction I read is Lasky et al. (2016), which gives some of the most recent constraints on the parameters of the frequency spectrum $\Omega_{\text{GW}}(f)$. The great thing about the wide spectrum is that a number of different tools (pulsar timing arrays, interferometers like LIGO, etc.) can be used to constrain different parts of it, both directly and indirectly.
That said, dark energy is almost certainly not a result of the gravitational wave background. First, there's no theoretical mechanism to explain how such an effect would arise. Second, the background is probably not strong enough to have an influence on the current expansion of the universe (see the graph here to see how weak it is). Finally, dark energy is a relatively recent phenomenon, arising several billion years ago. The background was around long before then, and yet had no effects.
Comment: @Jonathan Let me just clarify HDE's statement. Dark energy is certainly a recent phenomenon, but the idea is that the strength of dark energy (whatever that means) is related to the total volume of space. As space expands, dark energy gets stronger, making space expand faster, ad infinitum. Dark energy has always existed (hypothetically) but it's only recently (i.e., the past several billion years) that it has "built up enough" to have a noticeable effect on our universe. As such, it cannot be tied to inflation in the early universe and that inflation was caused by some as-yet-unknown source.
Comment: Are we sure the dark energy effect wasn't around earlier?  It would seem that the inflation near the very beginning would be a strong presence of dark energy.  Thank you for your detailed answer!
Comment: @Jonathan Inflation and dark energy are almost certainly two completely different things.
Answer:
Could dark energy (the accelerating expansion of the universe) be the result of gravity from the dense past universe "pulling" outward from all directions?

No, because gravity alters the motion of light and matter through space. It doesn't make space fall down in some Chicken-Little fashion. You may hear that it does, as per the waterfall analogy, but it doesn't. In similar vein the "reversed" gravity that you're suggesting doesn't make space fall up, as it were.

The universe theoretically started out extremely dense and hot, and we can see the light reaching us as the cosmic microwave background.

I think most people are fairly happy with the CMBR.

I wonder if that same region and denser portions beyond are exerting a gravitational effect that is stretching out everything within toward it, effectively being a cosmic gravity background.

It's good to think for yourself, and it's good to wonder. But I have to say I think this idea is a non-starter. We have galaxies receding faster than light (see this paper). That means it's space expanding, not gravity pulling.

If so, is this the explanation for dark energy?

Sorry, no. If I were you I'd have a look at vacuum energy.
Comment: *"We have galaxies receding faster than light."* A more correct statement is that we *predict* some galaxies are receding faster than light. We have no direct observational evidence for this and thus you can't use this as prove that space is doing the expanding instead of gravitational influences.
Comment: Good point about galaxies receding faster than the speed of light.  I think that might still be plausible in my proposed idea, as I believe it would possibly "stretch space", but it does make me think.


Can I use various grits of sandpaper to sharpen an old dull spade bit / bought for .75 for 1 time use

Question: Using to bore holes in hackle berry tree stump. Used, old, spade bit paid 75 cents for one time use
Comment: Short answer: yes.
Comment: @Graphus how unlike you!  :)
Answer: Yes, you could use sandpaper to sharpen a spade bit. You'd need to attach it to a backer board sized to fit between the spurs and the lip (see the picture below identifying parts of a spade bit). The backer board could be wood or plywood or MDF -- anything with a flat surface sized to fit between the spur and lip. Then you'd set about sharpening, working your way through progressive grits, trying to maintain a consistent angle.
With a little bit of cleverness, you could probably build a jig for this to help maintain the consistent angle. Or you could just eyeball it. But as you can see, this is a lot of effort to go through to sharpen a bit for a single use.
And if you don't already have the materials on hand (sand paper, scraps of wood, some means to fasten sandpaper to the wood -- glue or tape? -- etc.), it's probably cheaper just to buy a new spade bit.
Alternatively, you might try to pick up a set of needle files, and use those to sharpen the bit. You can find a cheap set for $4-$12 USD at various places online. But again, I'm not confident these cheap needle files will last any longer than a single sharpening. And even if they do, a new spade bit is going to be cheaper. The needle files only make sense if you plan on sharpening it over and over (and in that case, you'd probably want a nicer set of files anyway).

Picture credit: Wonkee Donkey Tools
Comment: I'd say you don't necessarily need to attach the sandpaper to anything, if you can hold a sheet on a flat surface (bench top would be fine but ideally something metal or glass) and run the bit over it by hand. A file is going to be better but in a pinch sandpaper can work just fine, especially if it doesn't need to be razor sharp.
Comment: Mostly I was trying to make sure the spurs on the bit don't get in the way. I haven't looked closely at my own spade bits to see if that is a common feature or not.
Answer: I'd use a file rather than sandpaper.  You won't be able to wrap the sandpaper round a block, and free-form sandpaper will just mould to the contours of the surface (rather than giving nice planar surfaces).
If you are desperate, you could wrap the sandpaper round some sort of former, and use it as a make-shift file.
Answer: You can sharpen just fine with sandpaper wrapped around or on just about anything flat and firm. Drilling implements are quite forgiving if you don't care much for the cleanliness of the bore. There is a fair range of sharpness and form that will still effectively poke a hole in wood.


What is the Seal God places on the foreheads of the 144,000 in Revelation 7? Sealed by the Holy Spirit or the word Emet (Truth)?

Question: I am trying to determine exactly what the Seal placed on the 144,000 by God was. I have heard two directions and I want to see what everyone else might say. The word Truth or Emet would be in John's style, but others assume the Holy Spirit is correct based on Ephesians 1:13-14!
Answer: In my book I go with the "Holy Spirit" answer, partly because Ephesians is not the only source. There is also "It is God who establishes us with you in Christ and has commissioned us; he has put his seal upon us and given us his Spirit in our hearts as a guarantee" (2 Corinthians ch1 vv21-22, RSV), echoing the words of the Ephesians ch1 vv13-14 reference. The "guarantee is these verses is being given to us, assuring us of the faithfulness of God's promise.
In the event of ch7, we are surely meant to see an analogy with the "sealing" of Ezekiel ch9 v4, which identifies those who still belong to God and protects them from the judgement being given on the rest of Jerusalem. And also with the blood-anointing of Exodus ch12 vv21-23, which identified the nation belonging to God and protected them from the judgement being given on the Egyptians.
In Revelation ch9 v4, the seal of God has a protective effect against what I take to be spiritual warfare- specifically, the impact on the world of faith-destroying Despair (the argument on this point is too long to be included here).
Therefore I take the "seal" to be the Holy Spirit which identifies the saints as belonging to God, the counterpart of the "mark" which identifies those who belong to the beast.
Answer: There are two sets of 144,000 in Revelation 7 and 14. If they were the same people, than the seal should be the name of Jesus and His Father. Revelation 14:1 read;

Then I looked, and there before me was the Lamb, standing on Mount Zion, and with him 144,000 who had his name and his Father's name written on their foreheads. (NIV)

The next question is, are they the same people? For in Revelation 7, it explicitly are Jews, unlike those in Revelation 14. Let us read again who are in Revelation 7. Twelve tribes of Jews are listed.
1 - Judah    - the 4th son  - meaning "I will praise the Lord" (Gen 29:35)
2 - Reuben   - the 1st son  - meaning "The Lord has looked on me" (Gen 29:32)
3 - Gad      - the 7th son  - meaning "good fortune" (Gen 30:11)
4 - Asher    - the 8th son  - meaning "How happy I am" (Gen 30:13)
5 - Naphtali - the 6th son  - meaning "won a great struggle" (Gen 30:8)
6 - Manasseh - Joseph son   - meaning "make me to forget" (Gen 41:51)
7 - Simeon   - the 2nd son  - meaning "the Lord heard me" (Gen 29:33)
8 - Levi     - the 3rd son  - meaning "attached to me" (Gen 29:34)
9 - Issachar - the 9th son  - meaning "reward me" (Gen 30:18)
10- Zebulun  - the 10th son - meaning "honor" (Gen 30:20)
11- Joseph   - the 11th son - meaning "taken away my disgrace, may he add" (Gen 30:23)
12- Benjamin - the 12th son - meaning "son of my right hand" (Gen 35:18)
Review the list, if said it is literally the 12 tribes of Israel, they are not exactly, neither follow the order nor the names. It is obviously missing Dan and has Manasseh replaced, but without Ephraim. However if we look closely to the meaning of the names, we will find they combined to form a message of the Gospel.

I will praise the Lord for He has looked on me and give me good fortune. How happy I am, because I won a great struggle, God is making me to forget. God hears me and is attached to me. He reward me with honor and take away my disgrace, and may He add to me the son of His right hand.

As such, both 144,000 in Revelation 7 & 14 are the same, and the seal should be the name of Jesus and His Father.
Comment: Comparing with the lists of tribes by territory (e.g. in Joshua), two names known for idolatry (Ephraim and Dan) are missing. They have been replaced by the names of Joseph and Levi, both famous for their faithfulness.
Comment: Thanks for the answers. I have found, looking at some other texts that the name, "Emet" Hebrew for Truth will be written on the foreheads of both groups, and the names of God and Y'shua are translated to mean the same thing at that time.
Comment: @StephenDisraeli - Ephraim and Manasseh were only sons of Joseph. Replaced Ephraim by Joseph left only the Manasseh descendants, making the list has double Manasseh. Note Jacob put his right hand on Ephraim (Gen 48:14).
Answer: Only the New Testament discusses the Seal of God.  Literal seals were made of wax and impressed with a unique image to certify ownership, authority or origin.  They were used on letters and legal documents and also on objects such as the tomb of Jesus (Matt 27:66) to prevent unauthorized interference or tampering with the contents.
When applied to people, the same concept applied – the seal of God was used to certify ownership

2 Tim 2:19 - Nevertheless, the firm foundation of God stands, having this seal: "The Lord knows those being His," and, "Let everyone naming the name of the Lord depart from iniquity."

Paul suggests that circumcision used to act as God's seal (Rom 4:11).  Seal or sealing is used to describe the gift of the Holy Spirit:

2 Cor 1:22 - the One also having sealed us and having given the pledge of the Spirit in our hearts.
Eph 1:13, 14 - And in Him, having heard and believed the word of truth—the gospel of your salvation—you were sealed with the promised Holy Spirit, who is the pledge of our inheritance until the redemption of those who are God's possession, to the praise of His glory.
Eph 4:30 - And do not grieve the Holy Spirit of God, in whom you were sealed for the day of redemption.
John 6:27 - Do not work for the food that is perishing, but for the food enduring unto eternal life, which the Son of Man will give to you; for God the Father has sealed Him."

Thus, when we seek the bread of life that endures to eternal life (John 6:27).  By this gift we, in turn, also certify that God is true (John 3:33).
This, God's seal of the Holy Spirit signifies a complete change of life beginning at conversion which should be conspicuous as a Godly life to those around us.
This idea is used frequently in the book of Revelation (Rev 5 – 9) and also denotes the protection enjoyed by God's faithful people:

Rev 7:2, 3 - And I saw another angel ascending from the east, with the seal of the living God. And he called out in a loud voice to the four angels who had been given power to harm the land and the sea: "Do not harm the land or sea or trees until we have sealed the foreheads of the servants of our God."
Rev 9:3, 4 - And out of the smoke, locusts descended on the earth, and they were given power like that of the scorpions of the earth. They were told not to harm the grass of the earth or any plant or tree, but only those who did not have the seal of God on their foreheads.
Rev 14:1 - Then I looked and saw the Lamb standing on Mount Zion, and with Him 144,000 who had His name and His Father's name written on their foreheads.

Thus, God's people are miraculously preserved who have the seal of God, the Holy Spirit, which denotes the Name of the Lamb and the Father written on the forehead (Rev 14:2; compare Ex 13:9, 28:38, Eze 9:4).
[NOTE: If one wish to make a connection between "Emet" (= Hebrew word for "truth") and the seal of God, then that would be a stretch - I could find no explicit connection between Emet/truth and Seal in the Hebrew OT - "seal of God" only occurs in the NT.  Nevertheless, one might make a NT case for the seal being the truth that we are sealed by the Holy Spirit for God's service??]
Comment: See Ezekiel' vision in Ezekiel 9, for another seal. The seal of "Tav."
Comment: @Michael - I referenced that already in my answer.
Answer: Note that they are sealed 'in', not 'on' their foreheads.  Reading this verse with the obvious definition of 'receiving' given in Romans 15:28, it appears that the 144k Jews have received Christ as their messiah. This is a change from what Paul tells us in Romans 11:7 that the Jews have been blinded. Likewise when the false prophet institutes the mark of the beast, mimicking the seal of God, its recipients will be true believers that the Antichrist is the messiah, or in kind to the Jewish church receiving an offering in their hands, those who do not really believe may be bribed to act like it.
Revelation 7:3
"Saying, Hurt not the earth, neither the sea, nor the trees, till we have sealed the servants of our God in their foreheads."
Romans 15:28
"When therefore I have performed this, and have sealed to them this fruit, I will come by you into Spain."
Romans 11:7
"What then? Israel hath not obtained that which he seeketh for; but the election hath obtained it, and the rest were blinded"
Answer: Thanks for the answers. I have found, looking at some other texts that the name, "Emet" Hebrew for Truth will be written on the foreheads of both groups, and the names of the Lamb and His Father (Rev. 14:1-my Greek New Testament) are translated to mean the same thing (Truth) at that time. So with the answers here and the other results of my research, it appears Emet/Truth, AKA the Lamb's (Y'shua)name and that of(God) His Father is overwhelming to be the Mark placed on the foreheads of both groups of 144,000! So, thank you for your input. It is much appreciated!
Comment: This answer claims to have the definitive answer to this question, but doesn't provide any references, making it useless to anyone else that wants to know the answer.  It claims to be the result of research, but none of that research is shown.


Myth where one twin pulls the other out at birth

Question: I am trying to find the story where the first born twin reaches back in and pulls his sibling out at birth. I believe it was a Greek myth, but it could have been from another culture.
Answer: If it is indeed Greek, you may be referring to the birth Artemis (Diana for the Romans) and Apollo. Leto gave birth to Artemis, Artemis then helped her mother give birth to Apollo. Here is a quote from Pseudo-Apollodorus, Bibliotheca 1. 21:

... Leto had relations with Zeus, for which she was hounded by Hera all over the earth. She finally reached Delos and gave birth to Artemis, who thereupon helped her deliver Apollon."
Comment: was it said that Artemis pulled Apollo out? (Rather than just assisting in the delivery, feet first if I remember)
Comment: @BillyNair I do not remember that specific detail, maybe it depends on how the source was telling the story?
Answer: Might you have it backwards? There's the Biblical myth of Jacob and Esau. From Genesis 25.26:

After this, his brother came out, with his hand grasping Esau's heel; so he was named Jacob. Isaac was sixty years old when Rebekah gave birth to them. (NIV translation)

The idea is that the name Jacob and the Hebrew word for ankle are similarly spelled. See this article for the explanation:

The first twin emerged both red and hairy. His name, Esau, somehow describes his hairiness. The second twin is neither red nor hairy, compared to his twin, but he is also named for his first impression on his parents. He comes into the world grabbing his brother's heel. The Hebrew word for heel is 'aqeb, and so this child is named Ya'aqob, or Jacob, literally meaning "he clutches the heel." Interestingly, though, and also important, Jacob can mean "may God protect or reward," or—unfortunately for Esau—it can also mean "usurper."


Why is $x(x-9)=x^2-9x$ and not $x^2-9$?

Question: the expression $x(x-9)$ is resolved in the manner
$$x(x-9)=x^2-9x$$
but why not like this?
$$x(x-9)=x^2-9$$
where does the $9x$ come from?
Answer: Remember the distributive law
$$
a(b+c) = ab + ac .
$$
In your expression, $a=x$, $b=x$ and $c = -9$.
Then $x$ times $-9$ is rewritten as $-9x$.
Answer: $$x(x-9)$$
By the Distributive Law
$$x^2-9x$$
Here's a short "proof" to show that you can't derive $x^2-9$ from $x(x-9)$.
$$\text{Proof by Contradiction}$$
Assume that
$$x(x-9) = x^2-9$$
Further, we will say that
$$f(x)=x(x-9)$$ and $$g(x) = x^2-9$$
If $$x(x-9) = x^2-9$$
then $$f(x)=g(x)$$
Because $$f(x)=g(x), f(0) = g(0)$$
This, however, is not the case
$$0(0-9) \neq 0^2-9$$
$$ \therefore f(x) \neq g(x)$$
Comment: Your "short proof" could be just one line long: the equation fails for $x=0$.
Comment: Ha, note taken.
Comment: You don't need all that stuff defining $f$ and $g$. Just the next to last line.
Answer: What's the area of the dark green rectangle? The area of the light green rectangle is $A = x(x-9)$, but it's also the difference between the square $x^2$ and the dark green rectangle. What is this difference? Can you see where the distributive property [e.g. $a(b-c) = ab - ac$] comes from?

Why is $x(x-9)=x^2-9x$ and not $x^2-9$?


What do we mean when we write SCSI(0,0,0)?

Question: I came across this when I was trying to install a new operating system and the partition manager in the disk showed me all the partitions. This was with a corresponding partion which already existed...
Answer: It can vary from OS to OS but in general it means controller 0, disk 0, partition 0 - i.e. the first disk controller, the first disk on that controller and the first partition on that disk.


Social Network Activity Feed + Groups

Question: I'm working on an social network app and want to create an activity feed so people can keep up to date with all of their connections (classic facebook stream).  I have a DB table called activity setup for this like so:
activity_id (int)
user_id (int)       //who posted it
group_id (int)      //the group of connections that have permission to view
type (enum)         //the type of activity performed
time (datetime)     //the time the activity was performed

I would then do a select * from activity where user_id in (connections) to get the latest news.
Here's the catch. User's activities do not always have visibility to the complete set of connections. Users can create groups of user ids to form smaller sets within their super set of connections. Its like how facebook allows you to specify who sees a particular post instead of allowing all friends to see it.
I have a separate groups table setup with the following schema:
group_id (int)
connection_id (user_id, int)
user_id (group creator)

I have a group_id in my activity table. The group_id is the link to the subset of connections that have permission to see the post.
My question is, what is the best way to do this type of feed, and is there an optimal single select statement that will get me the output desired (a list of my connections activities that I have been granted permission to see)?
Thanks.
Comment: Did you end up figuring this out?
Comment: I shelved the project for a bit so I stopped hunting. Let me know if you figure it out.
Answer: If you're open to offloading your activity stream functionality to a service via an API, Collabinate (http://www.collabinate.com) may be useful to you.

Social Network Activity Feed + Groups


Center-of-mass frame for massless particles

Question: Given a scattering event where a photon and electron go in and a photon and electron come out, what is the center of mass frame?
I'd say, since the photon has no mass, it's the rest frame of the incoming electron.
Answer: By the Newtonian definition, the photon wouldn't count due to its zero mass, but this is a relativistic collision, so you need a relativistic definition of the center of mass. Relativistically, the c.m. frame is the one in which the total momentum four-vector of the system is purely timelike. No, this does not coincide with the electron's frame.
What you're describing is Compton scattering. In the c.m. frame, both the electron and the photon are scattered at 180 degrees with an energy the same as that with which they came in.
To determine the c.m. frame, add the momentum four-vectors and normalize the result. This is the velocity four-vector of the c.m. observer.
There are cases where this definition fails. For example, if the system consists of a single ray of light, then the momentum four-vector is lightlike, so you can't normalize it; there is no frame of reference in which it's at rest. But, e.g., if your system consists of two rays of light moving in different directions, then there is a c.m. frame.
Comment: And this is why various authors say "center-of-momentum frame" instead, where conveniently/confusingly it has the same acronym.
Comment: Wrong. By the Newtonian definition, the photon would count if only because of non-zero momentum.
Comment: @IncnisMrsi: I suppose it depends on what you take as the definition of the Newtonian center of mass and Newtonian center of mass frame. Newtonian mechanics doesn't actually apply to light, so it's not surprising that the definitions don't apply cleanly.
Answer: The reference frame of the center of mass is, by definition,  the one where the total $3$-momentum vanishes. It exists almost always also for massless particles as I go to discuss.
The total $4$-momentum $P$ of a system of $N$ free particles is the sum of their $4$-momenta of the particles, i.e.,
$$P = \sum_{a=1}^N P_{(a)}\:,$$
where each $P_{(a)}$ is a non-vanishing, future-oriented, causal $4$-vector (i.e., it is  either timelike or lightlike).
By standard properties of sums of causal vectors for $N\geq 2$, one realizes that $P$  is causal as well, and it cannot be lightlike unless all  $4$-momenta of the system $P_{(a)}$ are parallel and lightlike. If at least one particle is not massless, like in the case you consider, $P$ turns out to be timelike and thus the center of mass is well defined.
Indeed, when the total $4$ momentum $P$ is timelike and future directed (up to $4$-translations and spatial rotations which do not change kinematic) there is a future oriented Minkowskian reference frame (*) whose temporal axis $\partial_t$ verifies $P = k \partial_t$ for some $k>0$.
In that reference frame, $P$ has no components perpendicular to $\partial_t$. In other words, the $3$-momentum vanishes. That is the center of mass reference frame of the physical system.
The fact that even a system of massless particles has a center of mass (excluding the case pointed out above) should not be surprising because the (invariant) mass of the particles does not matter here. Differently form the classical case, it is the energy which matters and it is strictly positive also for photons. Let us illustrate this fact. In the classical picture, one has to look for a reference frame where
$$\vec{0} =\sum_{a=1}^N  m_a \vec{v}_a\:.$$
Instead, in the relativistic realm, instead, the relevant equation is
$$\vec{0} = \sum_{a=1}^N \vec{P}_a = \sum_{a=1}^N  E_a\vec{v}_a $$
where the $4$-momentum is decomposed into its energy (temporal) component and its $3$-momentum (spatial) components as
$$P_a = (E_{(a)}, \vec{P}_{(a)})$$  (I assume $c=1$)
and consequently the $3$-velocity is $$\vec{v}_{(a)}= \frac{\vec{P}_{(a)}}{E_{(a)}}\:.$$
You see that, also if some of the particles are photons, we have $E_{(a)}>0$, because $E_{(a)}^2 - \vec{P}^2_{(a)}=0$ and $P_{(a)}\neq 0$ in that case.

(*) This is consequence of the fact that, up to dilations, the orthochronous Lorentz group $O(3,1)_+$ acts transitively in the interior of the future lightcone.
Comment: **One** massless particle never has a CoM frame. But you can consider several massless particles travelling in non-parallel directions and find the center-of-mass frame of a "system" of these particles.
Comment: Sure! I make more precise my answer, I was referring to $N\geq 2$ particles...
Answer: The "photon has no mass" argument is inherently flawed for at least two reasons. First, exact formulation is "photon's invariant mass equals to 0". It does not mean that the quantity is undefined. It is defined, but has zero value.
Second, invariant mass in relativity does not sum (is not an extensive quantity) even for non-interacting particles. Invariant mass of a system of several non-interacting particles is greater or equal than the sum of mass of constituents, and the "equal" case happens only when all 4-momenta are parallel (centers of mass of constituents have zero velocity in some reference frame for massive constituents, travelling in parallel direction for massless ones, and never happens when there are both massive and massless constituents). Yes, a massive particle and an emitted photon always have together greater mass than the particle alone. Not relevant to current case, just for the record: for interacting (namely, attracting) bodies this mass defect may have either sign.
Another approach: you do not need to speculate how photon's mass is small (if any) while its momentum is definitely non-zero.
So, throw the "photon can be ignored" thought away and calculate the momenta.


Formatting transactional emails

Question: How can I replace our store name with the customer's name in the "From" field when we receive new order emails? Makes more sense for us to see an order coming from a customer rather than our store name each time.  Thanks.
Comment: There is no question mark in your question. What exactly is your problem?
Comment: Edited the question to include a question mark.
Comment: And what is your problem?
Comment: I think my question is pretty clear. I dont know how else to explain it, so while I appreciate your interest, I don't think you can help here.
Answer: Since the email you get is a BCC (email copy) of what is sent to the customer editing the code would result in the customer seeing his own name in the order mail.
However in case you might want to change it. Check the class Mage_Sales_Model_Order method sendNewOrderEmail. On line 1329 you will see the following code.
$mailer->setSender(Mage::getStoreConfig(self::XML_PATH_EMAIL_IDENTITY, $storeId));

This is where the sender of the email is set.

Formatting transactional emails


Why is AJAX pager in Views not recording the history

Question: I have a listing of news, used with Views module in Drupal 7. I have activated Use Ajax in advanced section. So now the pager loads the content smoothly, without loading other page. That is nice, but the pager is not recording the history of the browser, so when I hit several pages of the same listing, it loads all the content perfectly but when I hit the Back button of the browser, instead of going to the last page clicked on the listing, goes to a previously visited site, even a different website, depending on my browser history. This happens, aparently, because there seems to be no built-in mechanism to record website history or at least change the toolbar address with "#" so it can have a behaviour similar to what be expected. Is there some way of circumventing this?
Answer: I have not used but you can take a look
Statehandler module and History.js module
Comment: Thanks. I will give it a look. I am very surprised that it is not standard behaviour. This one and the "click enter twice" issue of the Autocomplete input fields do put Drupal sites behaviour to the final user as if the pages had been made 5-10 years ago!
Comment: @Cesar did you get any success in integrating Ajax page with history.js?


Imbalanced Classes: Random Forests w/ individually balanced trees?

Question: Assume you're dealing with an imbalanced dataset. I know I can do things like upsampling, downsampling, and synthetic sampling to build out my train and test split. My question is: if I'm using a random forest classifier, are there any implementations in R or Python that would force each of the randomly generated trees that it will be evaluating against such that it has balanced classes?
Answer: Apparently what this is describing is called "Balanced Random Forests."
There is a separate stack page that mentions a corresponding R package:
Implementing Balanced Random Forest (BRF) in R using RandomForests
Answer: sklearn.ensemble.RandomForestClassifier accepts an argument class_weight that allows you to control how the samples are weighted, either globally or for each tree. In particular,

The "balanced_subsample" mode is the same as "balanced" except that weights are computed based on the bootstrap sample for every tree grown.

which seems to be exactly what you're asking about.
Answer: Maybe you can try to make trees subample balanced
def set_rf_balanced_subsampling(y_tt_labels):
    """ Changes Scikit learn's random forests to give each tree a balanced random sample of
    n random rows.
    """
    each_tree_class_samples = y_tt_labels.value_counts().min()

    indices = {}
    for tt_label in ["H", "S", "BC"]:
        indices[tt_label] = y_tt_labels[y_tt_labels == tt_label].index.values

    def balanced_sampling(rs, n_samples):
        return np.concatenate([forest.check_random_state(rs).choice(indices["BC"], each_tree_class_samples, replace=True),
                               forest.check_random_state(rs).choice(indices["H"], each_tree_class_samples, replace=True),
                               forest.check_random_state(rs).choice(indices["S"], each_tree_class_samples, replace=True)])

    forest._generate_sample_indices = balanced_sampling

Also, I recommend you to check the Imblearn library and combine the Pipeline methods with RandomOverSample methods.


How to find (or numerically find) a solution to a system of 10 equations with 14 variables?

Question: I am trying to construct a counterexample in $\mathbb{R}^4$. There are 10 relations, each of which is given as the vanishing set of a determinant. There are 14 variables in total. Is there a way to find a solution easily, possibly with the help of some computer program?
Comment: Yes, this sounds underdetermined perhaps you could post your system?!
Comment: https://bertini.nd.edu/
Comment: If I understand you correctly, you have 10 equations of degree 4 in 14 variables. This looks too complicated for a Computer approach using Gröbner bases or Macualy determinants, unless there are some unexpected simplifications. If your problem has some structure, unexpected things are more likely to happen, so you should try e.g. http://www.math.uiuc.edu/Macaulay2/ .
Comment: I second the suggestion that you should post your actual set of equations (in a form that can be cut and pasted into a computer programme; do not LaTeX them).  If they are very big and you do not have a convenient way to put them on the web then you can email them to me (firstname.lastname@example.com)
Comment: you can try minimising a nice function, say, linear, on your algebraic set. Then the Langrange multipliers method will give you more equations (that only hold where an optimum is reached).
Answer: If the system is too complicated for symbolic solution, you might try some numerical experimentation.
Since there are more variables than equations, the system is likely to be
underdetermined as Moritz Firsching commented.  In this case, if you choose
 values for $4$ of the variables (hopefully the nature of the problem gives you some idea of likely orders of magnitude for them), you may be able to numerically solve the $10$ equations for the remaining $10$ variables, using
something like Maple's fsolve, and have a good chance of success.  It may even be possible to prove that a true solution exists near that numerical solution.
Answer: Mathematica has FindInstance for this.


How can I insert records from one sandbox to another sandbox?

Question: I have sandbox shared for my team and I have personal sandbox. How can I insert records sandbox shared for my team to my personal sandbox? I have required objects and fields.
I don't need to insert all records. Mainly I need insert records only for one object.
Comment: Have you tried using data loader?
Answer: If you're comfortable with the command line and have the Salesforce CLI installed, try using sfdx force:data:tree:export and import commands.
See an end to end example here
Update Oct 2020
I've also recently discovered that the Salesforce inspector Chrome extension has a Data Export and Data Import button.  Simply write an SOQL query in Data Export in the source org, use the copy as CSV button, and paste into Data Import in the destination org, and you're done!
Answer: You can try using dataloader or workbench to insert/export records from the sandbox to your personal sandbox.
First, try to export records in .csv format from your team sandbox and you can filter spreadsheet as per the records list which you want to insert in your personal org.
Since you have same fields and object name in both org's you can auto-match fields directly.
Review below links and steps involved using Dataloader.
Using Dataloader
Thanks,


Removing certain files from Drive folder based on name

Question: I have about 600 photos in a shared Drive folder. However, my camera uploaded both the ".RW2" files and the ".JPG" files, so I have a double of each photo. I want to delete all of the .RW2 files in the folder, but can't seem to find a way to do it without removing each file individually. Is there some sort of automated process I can use to do so?
Answer: One could write a script for this, but with 600 files, it seems easier to use the interface:

Search for .RW2 using the search bar on top of screen:

Scroll down in the list of search result so that it loads more... and more... and more...
Press Ctrl-A or its Mac equivalent to select all these items.
Click on the trash icon to move them to trash.

Step 2 can be slightly annoying with many files. Drive uses infinite-scroll layout instead of fixed-size pagination of Gmail. It also lacks Gmail's capability to select all search results, even those not shown on the page. But still, the process is manageable and takes less time than writing an Apps Script and then worrying about whether it deleted the right things.
Comment: Did you skip step 1? After step 1, you should only see .RW2 files. I just tested this in my folder by pressing Ctrl-A and deleting files: the ones that don't match the string are not shown, not selected, and not deleting.
Comment: When I push Ctrl-A, ALL of the files are selected, not just the RW2 ones.
Comment: I might be confused on how to search in Drive. Right now I'm just using Ctrl-F to search for rw2 files
Comment: There's a search bar for that; I added a screenshot.
Answer: If you have Google Drive downloaded to your computer, you could use either 1) Windows's search function by searching "*.rw2". then pressing Ctrl+A and Del.
2) A command line to delete all files in the Google Drive Photos directory with the .rw2 ending. <
    del /s /q /f c:\.Users\...\Google Drive Photos\*.rw2
Answer: I know two lovely programs that can help with this problem.  File Locator Lite and Auslogics' Duplicate File Finder.
Comment: Those would only be effective if OP syncs all of the images to a computer; the programs you mentioned only work on offline files.


Why did this table tennis ball rise to the sky?

Question: The nozzle makes the water flow through the upper part of the table tennis ball. If the angle and velocity of the water jet are well controlled, the table tennis ball will rise to the sky. The string is used to hold the table tennis ball and prevent it from being washed away by water. Someone told me that it's because of Bernoulli's law, because the water above table tennis is is moving, and the air below table tennis is is static. But I don't believe that explanation. Because of the relativity of movement, I can also say that the air under table tennis is is moving, while the water is static.
Comment: Possible duplicates: https://physics.stackexchange.com/q/69731/2451 and links therein.
Comment: @Qmechanic See my answer to your question?
Answer: It is the combination of two effects: Newton's $\dot{m_1}\overrightarrow{v_1}= \dot{m_2}\overrightarrow{v_2}$ , conservation of momentum. And Bernoulli's law.
The water stream washing off the top of the table tennis ball gets narrower around the ball and also deflects down.
By Bernoulli law the presser is reduced in the back of the ball because water moves faster. And by deflecting down because of viscosity, we have a $\dot{m} \overrightarrow{v}  $ change downward, which creates equal and opposite and upward momentum in the ball. Similar to an airfoil.
Comment: It seems that Bernoulli's law is wrong to explain it. Because force is the cause of the change of speed,there must be an increase in pressure first,and then there will be an increase in speed.The pressure increases and the ball goes down,not up. Can't it deflect without viscosity?think the real reason for the deflection is atmospheric pressure,not water viscosity.
Comment: @enbin zheng, the impact of the stream will mostly by adding to the speed of the ball along. So I still think Bernoulli effect is helping. I have seen in creeks when there is a structure protruding into the path of water, like a concrete pier, downstream low pressure has created cavities and removed material away. As to deflection of the water due to viscosity i see your point, but in the situations where there is no air like a boat's rudder it happens because of viscosity.
Comment: Because atmospheric pressure acts on the surface of the water, the pressure at the bottom of the water contains atmospheric pressure. Water Pressure + Atmospheric Pressure = Bottom Pressure
Comment: Without the increase of pressure, the velocity of water will not increase. So you see that the water level in front of the rock increases (the pressure increases); the water level in behind of the rock decreases (the pressure decreases). There is a pressure difference, so the velocity of water on both sides of the rock increases. Therefore, without the increase of pressure, there will be no increase of velocity.


How to Detect a Player Jumping In Mid Air

Question: Im trying to do a command project, and I am trying to detect if someone presses space while mid air. Does anyone know how to do this with commands?
Thanks.
Comment: Does it have to be space? Or can it for example also be Q? I'm pretty sure that the only way to even have the action of pressig space sent to the server is with elytra, but that would jitter and move the player a bit forward, even if you remove the elytra immediately.
Comment: You should probably take a look at the Minecraft scoreboard objective `stat.jump` which seems to be made exactly for that purpose.
Comment: @JulianLachniet Does that actually work, did you try it?
Answer: The best approximation of this that you could do would be detecting when a player starts flying with elytra. For this, you need to store the entries in the "Motion" NBT tag to scoreboards and compare them to the values of the last tick. This is nothing exact, because players can move while falling without elytra and can change direction quickly with elytra to not gain much speed, but it might work in some cases.
What does not work: minecraft.custom:minecraft.jump only tracks actual jumps, minecraft.used:minecraft.elytra does not seem to trigger ever.
What I recommend instead: There are lots of things that are much easier to detect, for example dropping an item (minecraft.dropped:minecraft.<id> together with the presence of an item entity with custom data nearby), activating an item (like an unbreakable carrot-on-a-stick), selecting a slot (NBT tag SelectedItemSlot) or pretty much everything that has a statistic.
Answer: I'm pretty sure that's not possible, but you could maybe try to test if they are shifting? I am not sure how but I do know there is a scoreboard objective for that, you could probably look it up. Another option is to give them an item in which when dropped, the player receives the action by using testfor and execute commands. If you're curious how, look it up because I can't get to my world in which I did this kind of thing, but I got it so you can too.
Comment: You got down votes because your answer doesn't answer the question.  'Pretty sure' is not good enough for an answer.  If you don't have the time/want to test your idea, put it in the comments like Fabian did.  Also, you suggest two sort of alternatives that are maybe possible which you don't explain very well and suggest the OP looks it up.  'Look it up' is also not an answer.  Arqade is supposed to be where you come to ask a question after you have already looked it up and can not find an answer.


Using TCA9548A for multiple MQ-X gas sensors

Question: I have about 8-9 gas sensors I want to use on my Pi but I'm trying to understand how to use The TCA9548A. The TCA9548A Has 8 pairs of SDL and SCL pins to handle multiple I2C devices, but the output from the MQ gas sensors is one line AO for Analog out or DO for Digital out. How would I go about using 8 to 9 gas sensors on a single Pi with the TCA9548A?
Comment: Your gas sensor does not have an I2C interface. Therefore, the TCA9548A will not (by itself) lead to a reasonable solution. Suggest you think this through, and edit your question: either delete it, or explain how you intend to get from a one-wire analog or binary output to an I2C channel. To be clear, there are other techniques available for interfacing your gas sensors to an RPi; [for example a ***Multiplexed A/D Converter***](https://www.analog.com/en/parametricsearch/11008#/p7=10|32&p3062=8|16&p4365=I2C|Serial%20I2C|Serial%20SPI|SPI&ps3=0|3.99). Is this what you meant?
Comment: Sorry I'm still learning when it comes to multiplex stuff. How would you solve this or how do you suggest I wire 8 to 9 gas sensors? For example, I tried wiring 3 PCF8591 to the TCA9548A multiplexer but I was not able to get that to work. I'm thinking there might be an easier/better way to do this? (here is my old post for my first attempt https://raspberrypi.stackexchange.com/questions/124766/using-multiple-pcf8591-on-one-pi)
Comment: Ok I think I might understand, what if I just used something like this? https://www.tindie.com/products/cburgess129/12-channel-1012-bit-adc-hat-for-raspberry-pi/ it would have 12 channels (I just need 9 for the gas)
Comment: Can you read ONE sensor? If so include details in your question.
Comment: This might help: https://raspberrypi.stackexchange.com/questions/105116/how-can-rpi3b-read-mq9-gas-sensor/105219#105219
Comment: This might also help: https://raspberrypi.stackexchange.com/questions/97896/eight-i2c-buses/97898#97898
Answer: It seems to me your earlier question, is a feasible approach. And this one is almost a feasible approach :)  All you need to do here is replace the TCA9548A with a Multiplexed A/D Converter. I'll try to explain how this works in general, and you'll see it's not conceptually difficult at all once you understand what's going on.
Before I do that however, I'll bend the rules here a wee bit and recommend a different A/D Converter: This unit from Adafruit should be enough to meet your objectives: it will handle a max of 8 gas sensors, it is considerably less expensive than the unit you found, and Adafruit supplies software and a tutorial for Raspberry Pi. That's only a recommendation of course; there are many hardware solutions that will get you to a functional solution. You may wish to consider this as your initial prototype, and make subsequent improvements.
So, how does this work? The MCP3008 is an IC that combines an Analog-to-Digital (A/D) converter with a multiplexer in a single package. The A/D converter is needed because the RPi has no analog input. The multiplexer simply connects one of its eight inputs to the single input of the A/D converter. The timing and sequencing for making these connections and performing the A/D conversion are controlled in your software - which runs on the RPi.
Now imagine the analog output of each of your 8 gas sensors being wired to one of the 8 channels of the MCP3008: channel 0 - channel 7. Your software communicates with the MCP3008 over an SPI bus, effectively accomplishing the following steps repetitively:

tell the MCP3008 to do an A/D conversion of the analog input at channel 0.

send the result of the A/D conversion at channel 0 (Step 1) to the RPi as a serial bitstream over the SPI bus.

process the received data in the RPi. This may be as simple as comparing the value of the reading to a threshold, and setting an alarm if the threshold is exceeded.

Repeat steps 1-3 for each of the other 7 channels.

Repeat steps 1-4 repetitively for continuous monitoring.

As far as the wiring interconnections, I'd suggest you forego Adafruit's more elaborate recommendations, and take a minimalist approach - as shown here.
Finally, you will need to enable the Raspberry Pi's SPI bus; this may be done by editing the file at /boot/config.txt or by using the raspi-config software tool. This search should provide explanatory examples for both approaches.
Final recommendation: Learn by doing. If you have questions, please feel free to ask as many as you'd like. Do your homework (read and study the alternatives), and try to ask specific questions.
Comment: Thank you for the detailed explanation!
Comment: I was going to try to use 3 PCF8591 but the pi only has one pair of SDL/SCL pins.
Comment: @Katianie: This should probably be another question, but some Pis have more than 1 I2C bus. And don't overlook the fact that I2C is a ***bus***; that means that you can connect up to 8 PCF8591 chips ***on the same bus*** by using its `A0, A1, A2` bus address inputs.


Is Stockfish 11 SuFi 19 still fallible?

Question: In a Game of SuFi 19 , a Czech Benoni, Stockfish 11 as White could have forced , on move 28 , a line that forced an eight piece endgame on move 59. White would have had Queen , Knight and two advanced pawns vs Queen and Rook . The line was suggested by Stockfish own PV on move 27 , a plan that later abandoned for a small centipawn difference. In the game Stockfish was pressing hard in a pawn up endgame , but cannot overcame the stubborn defense by Leela zero ( at least in that game) and the game ended in a draw. Since I have extensively analyzed the eight piece endgame described above with Houdini 6.02 at d= 38/128 and concluded that it was a win, it should be concluded that Stockfish 11 took the wrong path on move 28. The game was a Czech Benoni defense, and , to be honest , is the only mistake by Stockfish 11 in the current SuFi when Stockfish was not in time trouble. Game 62 SuFi 19. At least even Stockfish 11 is not infallible!
Comment: Did you expect it to be a perfect engine? Yeah, it's the best right now, but Deepmind can come back and crush stockfish
Comment: Note that SF12 is about 100 elo better than SF11
Comment: Which game is it? Can you link?
Answer: Perhaps worth starting by explaining for the benefit of the majority of chess fans who have no interest in computer chess tournaments that a "game of SuFi 19" is not some new chess variant. "SuFi" stands for "Super Final" and "SuFi 19" is the 2019 computer chess super final tournament.

Is Stockfish 11 SuFi 19 still fallible?

It's also worth reminding ourselves of the meaning of the word "fallible" and its opposite, "infallible".
"Infallible" means "never makes a mistake" and "fallible" means "makes mistakes".
We are still a very long way away from the day that chess will be solved and so are still a long way away from the day that a chess engine is infallible. Until then all chess engines are fallible. In particular Stockfish 11 is fallible.

Is Stockfish 11 SuFi 19 still fallible?


How to enable or disable a user?

Question: I'm uing ubuntu 12.04 desktop. I have 3 users: user1(administrator), user2(standard) and guest. I wanted to disable user1 and enable user2 which auto logs on with no password but after I did that I can't login to user1 and user2 accounts except the guest session user. I'm striped off every administrative privileges. I don't know which options are available to me and how do I enable root or user which is an administrator?
Comment: This might help: http://askubuntu.com/q/161074/83046
Answer: Expire Account
Let the account expire to disallowing a user from logging in from any source including ssh:
# disallow peter from logging in
sudo usermod --expiredate 1 peter

This is how you can reenable that account:
# set expiration date of peter to Never
sudo usermod --expiredate "" peter

Lock a Password
To disable / lock the password of user account use below command. This will not disallow ssh-access on Ubuntu. This prepends a ! to the password hash so that no password will match it anymore.
# take away peters password
sudo passwd -l peter

To unlock him:
# give peter back his password
sudo passwd -u peter

Expire a Password
This command seems to differ across platforms. On Ubuntu, expiring a password will command the user to make up a new one once he logs in. This is not suitable for disabling an account.
# make peter think of a new password on login
sudo passwd -e  YYYY-MM-DD peter

Comment: You should merge locking a password and expiring an account into one command as explained in @vorburger's answer (usermod -L -e 1 [username]) and (usermode -U -e "" [username])
Comment: But I think the way you make the ssh distinction is good.
Answer: Use this to lock an account:
sudo usermod -L -e 1 [username]

and this to unlock an account so locked:
sudo usermod -U -e "" [username]

Answer: Note:
(Disabling and locking a user account both mean the same thing.)
To disable / lock the user account use below command:
sudo passwd -l [user_name]

e.g.

sudo passwd -l samual

To put an expire date to an user account so that it automatically gets disabled / locked.
sudo passwd -e  YYYY-MM-DD [user_name]

e.g.

sudo passwd -e  2013-05-31 samual

To re-enable a disabled user, issue the passwd command with the -u option.
sudo passwd -u [username]

e.g.

sudo passwd -u training

To enable the root account and change the root password use below steps.
1) su -
2) passwd

Enter the new password for root account and then exit. if this does not solve the issue let me know.
Please feel free to let me know if you need anything else or any further clarification.
Comment: from the man page: -l Note that this does not disable the account. The user may still be
  able to login using another authentication token (e.g. an
  SSH key). To disable the account, administrators should use
 usermod --expiredate 1 (this set the account's expire date
 to Jan 2, 1970).
Comment: I can confirm that `passwd -l ...` will not stop keyed authentication. Just tested it.
Comment: When I do that it ask for password and root is not enabled, user1 which is admin is also disabled.
Comment: @user150330 I have updated the answer check at the end of it.
Comment: @user150330 Is your problem solved?
Comment: "passwd -e [user]" does not take an argument. Use the "usermod" command as suggested by @abstrakor.
Answer: In addition to previous solutions, another way is to replace bash for the user you want to disable in the /etc/passwd file by /bin/false
Edit the /etc/passwd file, find the line with your user then change /bin/bash by /bin/false.
Don't update any other lines
........
username:x:1000:1000:User:/home/username:/bin/false

Comment: Your answer would delete root. Is this what you intended?
Comment: I didn't say to replace content of /etc/passwd, juste replace /bin/bash for the user you want to disable by /bin/false. I update my anwser to make it clearer
Answer: Tested in Ubuntu 18.04
Use case: disable an account so that user is unable to log in.
with root privileges: "passwd -l -e username"
with that the account is locked and also the old password is expired
to get the user back: "passwd -u username"
after this, the user has to enter the old password and enter a new password to log back in
hope this helps
N.B. when you lock an account, trying to SSH with an identity file, e.g. abc.pem, also fails

How to enable or disable a user?


How to setup a cs:go offline server on which friends can join

Question: When I start an offline match and invite my mate he gets an connection error "Server does not respond".
How may I set up a "Offline with Bots" - Server on which my friend can join?
EDIT :
I meant an offline server within a local area network.
Comment: Yeah right but this option does not exist -.- I wouldn´t post this question if it were that easy :3
Comment: "Offline with Bots" = no connections allowed.  I don't know CS, but it sounds like you need an option that says something like, "Online with/without Bots".
Answer: You can connect with friends with bots added in all modes except classic competitive simply by going to play with friends and sending them an invite.  You can do the same in classic competitive by setting up play with bots game and having your friends connect to your ip address thru the developer console (connect xxx.xx.xxx.xx). You need to port forward to 27015 doing it that way.
Answer: An offline server is exactly what the title implies, an offline server where no one from the outside can join under normal settings.
You can find empty servers with bots in them by using the Community Servers option and searching for servers that way and then inviting your friend to that empty server with bots in it.
If you are on the same internal network as a friend: An "offline with bots" game still creates a local server on port 27015. Get your internal IP and your friend should be able to connect to it. Depending on your firewall settings of course.
Comment: In that case you need to get your IP address and have your friend connect to your server that way. An "offline with bots" game still creates a local server on port 27015. Get your internal IP and your friend should be able to connect to it. Depending on your firewall settings of course.
Comment: Offline server is not implying that nobody from the outside can join. Offline only implies, that there is no connection to the internet. A Local game server is also an offline server, even if you are able to connect another player with a network cable in the Local Are Network.
Comment: Well if your friends are part of the same network that would put them "inside" your network wouldn't it? It was implied that people on the Internet cannot connect to the offline server. Anything outside of your local infrastructure cannot connect.
Comment: Yes, but in this case my friend was in my local area network.
Comment: A local area network, where nobody has access to the internet but we still have a connection to each other using a network switch
Comment: This is the answer I was hoping for when I asked.
Comment: "An offline server is exactly what the title implies, an offline server where no one from the outside can join." That's actually false, I've just played with a mate on my "Offline with bots" server, and we are NOT in the same local network. I've just forwarded port 27015 to my PC on the router, just like @lpack suggested.
Comment: If you want to go with the technical route then absolutely this is possible. But by opening your port and computer up to the internet you are no longer technically "offline". You've made your computer an "online" server. In this example you are playing in the "offline with bots" *mode* while being online.
Answer: You can create an offline server with your friend by creating a private lobby and calling all the friends that you want. Then u can choose going casual or workshop maps. In this case, nobody can log into "your server"! =D
Comment: This works, You go to Main Menu, play game and then play with friends, invite them all and click play, steam will take care of rest.
Answer: Playing offline with bots is exactly what it says on the tin; you're offline, with outside connections being accepted.
To play with your friends, you'll need to set up a private server. Doing this is actually pretty easy, but you will need to know how to forward ports on your router, and you will need to download the CS:GO server files.
If you can't access the admin page on your router, or your router doesn't support specific port forwarding, or if you simply don't want to download a bunch of files, the easier route is to find an empty server. That's right, the simplest way to play with friends is find an empty server through the Community server list, and invite them there. This eliminates any of the hassle of setup, but you may get random players.
If you can get into your router and you can forward ports, here's what you need to do:

You will need to download and install SteamCMD. That link has some more detailed instructions, but basically just make a folder named "steamcmd" somewhere, download the file in the link, and extract it to your new folder.
Once you have SteamCMD, you'll need to download the server files for CSGO. This is basically redownloading the entire game, with some added features for servers. Open SteamCMD, and type the following commands:

force_install_dir c:\csgo-ds\
  force_install_dir .\csgo-ds\

This will create a directory for you to install the files to, and it will then open that directory in SteamCMD.

Once you have the path set, download the files with this command:

app_update 740 validate

Once this finishes, you now have the required files for the game. The next step is to forward your ports.

To forward a port on your router, you'll need to know the make and model of your router. Once you know this, go to this website. It has specific guides for many routers, and will give you a much more detailed guide on the specific process. The basic process, is to log into the router, look for the port section. This will include a number of boxes, and drop down boxes with letters like TCP. Some routers have this area specifically labelled.
Once you have found the port forwarding section on your router's control panel, you will need to put in CS:GO's ports. CS:GO uses UDP and TCP, so make sure it is set to use both. Then forward the ports as follows:

start 27015
  end 27015

These are the standard ports used by CS:GO, however your server may start on a different port for whatever reason. If those ports don't work, move the start and the end up by one for each try; for example, if that didn't work, the next step would be 27016.
Remember to close your ports after shutting down your server.
It can be a security issue to keep ports open and unused. This can open you up to attacks, so make sure you close the router when you're done hosting the server.

Finally, once you have sucessfully downloaded all the files and sucessfully forwarded your ports, use one of the following commands to start your server:

Casual: srcds -game csgo -console -usercon +game_type 0 +game_mode 0 +mapgroup mg_active +map de_dust2
Competitive: srcds -game csgo -console -usercon +game_type 0 +game_mode 1 +mapgroup mg_active +map de_dust2
Arms Race: srcds -game csgo -console -usercon +game_type 1 +game_mode 0 +mapgroup mg_armsrace +map ar_shoots
Deathmatch: srcds -game csgo -console -usercon +game_type 1 +game_mode 2 +mapgroup mg_allclassic +map de_dust

So now your server is running, and your ports are forwarded. Once the server has been started, it should give you an IP to tell you where your server is running; if not, Google "what is my IP?" and that will tell you. Copy that number, and put :27015 on the end (or whatever port you ended up forwarding.) The number will look like this; 192.168.0.1:27015.
To connect to your server, take this full number you now have, open your console in CSGO (the console is opened with the ~ key), and type "connect (your IP/port.)" So again for example, I would put "connect 192.168.0.1:27015" without the quotation marks, into my console.

That covers the basics of it. The initial link I provided will go into details of adjusting specific server configurations, such as grenades that are allowed, disabling certain weapons, setting up a map rotation, etc. It is a little bit complicated and a little bit daunting the first time you do it. But forwarding a port is the most difficult part, and once you learn how to do that on your router, it should be pretty easy from there on.
Comment: My issue is that when someone is playing on my server I see them in game "Playing on community server" but there is now option to join them.
Answer: Firstly, create a offline server then type "status " in the console and you will get a IP address, give that IP address to your friend and type"connect-the IP address" and then you are good to go
Answer: Yes, it is possible.  When you create a server from the main menu, you must input the sv_lan 0 command into the console.  Then type in status to see the IP number. then others can connect using the command connect (IP number). Also you can remove bots using 'bot quota'. You must also have Hamachi.  After it's done, your friend can join.


Using two thermistors instead of one on battery protection IC

Question: I'm making a battery protection board for a 3S1P pack. I wanted to include two thermistors in the pack to monitor the cell temperature because of how I want to position the batteries. The batteries are going to aligned in a straight row, so I wanted a thermistor in between battery 1 and 2, and another one in between battery 2 and 3. My issue is that the battery protection IC that I'm using (BQ77915) only has one channel for a battery thermistor. I wanted to know if there was anything that I could do to have the protection IC only see the temperature of the hottest battery.
Answer: You could feed each Thermistor output into an input of an Analog 2:1 Multiplexer, and also into a Comparator. Then use the comparator output as the Select signal for the Analog 2:1 Multiplexer. Which thermistor goes into the positive terminal of the Comparator and which goes into the negative intput of the Comparator depends on whether the thermistors are Negative Temperature Coefficent or Positive Temperature Coefficient. Feed the output of the 2:1 Multiplexer into your BQ77915 thermistor input.

simulate this circuit – Schematic created using CircuitLab


Fedora 15 with PAE

Question: I installed FC 15 onto a laptop that previously had XP installed. While XP reported that Physical Address Extension was enabled, I am unable to find any reference to it in Fedora. How can I tell if the kernel I'm running supports it, and how can I enable PAE if it's not currently supported?
Answer: Type uname -a or cat /proc/version and see what the kernel string looks like - for example:

Linux aa1.localdomain 188.8.131.52-35.fc15.i686.PAE #1 SMP Wed Jul 6 14:29:06 UTC 2011 i686 i686 i386 GNU/Linux

If 'pae' (or 'PAE') isn't there then your kernel doesn't support PAE
If you do not have the PAE kernel installed, issue the following command (as root):
yum install kernel-PAE

Then reboot
Just to make sure your processor supports PAE, you should do the following first:
cat /proc/cpuinfo | grep -i PAE

If there's no sign of pae (or 'PAE') in the output, your processor doesn't support that mode.
Answer: Try using grep address /proc/cpuinfo, and the output should tell you if PAE is supported.
Comment: What should he look for? Could you provide a sample output?

Fedora 15 with PAE


java: when running jar file from icon Runtime.getRuntime.exec() doesn't work

Question: so I have this problem. I have an aplication, which is using Runtime.getRuntime.exec(adobePath) to run Adobe Reader.
When I run my aplication using NetBeans or from cmd line by using java -jar "MyApp.jar" it does work fine. But when I run jar file by double-click or from cmd using MaApp.jar it doesn't work. I'm using Windows 7.
What can be wrong?
Thanks
edit: Maybe I said it wrong way. When I run jar file by double-click it does run. And it works, but when Runtime.getRuntime.exec(adobePath) is called nothing happens. And It work fine in NetBeans or when I run App by java -jar "MyApp.jar".
Answer:
Right-click on the jar and see under Open With ?
Make  Java Runtime as default program to run with.


Do you get more XP by being stealthy or shooting everyone in the face?

Question: When you get XP for all your kills and takedowns, does it pay off to be stealthy?  If I went around bustin' a cap in everyone, would I gain experience faster?  Ghost = 50 x Man Down, but with all the other bonuses from Marksman or Merciful Soul, you wouldn't need 50 meat popsicles to beat on.
Comment: You can get ghost *and* kill everyone. You just have to kill them before they see you.
Answer: Being stealthy and taking everyone out are not mutually exclusive and you'll get the most XP by doing both. This isn't necessarily fastest in terms of real time because playing stealth is usually slower, but it is fastest in terms of how much XP you will have in line with your point in the game.
Remember that if no enemies see you before they are taken out you will still get the Ghost bonus (500XP for completing an objective without being seen properly), and if you're careful to make sure they don't see the bodies of other enemies then you can still get the Smooth Operator bonus (250XP for completing an objective without the alarm being triggered) as well.
If you are going to try and take everyone out, then remember that non-lethal hand-to-hand takedowns are worth the most (50XP), with ranged non-lethal neutralisation netting you 30XP each, but going non-lethal leaves you exposed to guards being woken up if they are found. If you're going to kill, then make sure you get headshots (they double XP from 10 to 20) or go hand-to-hand (for 30XP each).
These values do not change if that particular enemy has seen you or not, which is to say there is no stealth bonus for each individual kill, only the aforementioned bonuses when reaching objectives.
So, if you're trying to max out your XP, concentrate on staying hidden (the 750 from stealth bonuses is worth at least taking out 15 guards) and take down anyone you are confident that you can without detection (this includes headshotting or tranquillising at range if you can't get close).
Comment: It's usually better to go for the nonlethal takedown since it gets you more XP. You still need to hide the enemy either way, or risk losing Ghost, Smooth Operator, and your cover all in one go. If you really want them dead, well, they don't need to be standing up for that....
Answer: I asked a similar question yesterday.
Am I losing out on XP if I kill someone in Deus Ex:HR and don't accomplish the objective I set?
You should stealth stun anyone that you are able to. And stay hidden as much as you can. If you need to start shooting people then do it, but avoid it for as much as you can.
Ghost which is worth 500 XP obviously pays off to be hidden and pick up a few stealth take downs as you can.
Answer: Doing a non-lethal takedown is worth the most XP.
What actions give XP in Deus Ex: Human Revolution?
The above answer gives a rather complete list of what give you XP in the game.
Answer: Stealth, definitely.  Earn the Ghost and Smooth Operator bonuses for 500xp and 250xp respectively.  Use non-lethal takedowns without being seen for 50xp each.  If you're concerned that they will be woken up, kill them after the non-lethal takedown, so you still earn full XP.  They won't feel a thing.  That said, I think if they're gonna get woken up, you'll have lost your Smooth Operator bonus anyway.
Answer:
Get ghost and Smooth operation.
K.O. EVERYONE. (Don't kill and don't miss anyone.) *Knock 'em out even if you can easily pass them.
Hack everything even if you have the pass code including: -gate security -security panel(people usually miss these) -computers (all of them) etc.
Find all of hidden path and areas (go back if there is more than one).
Persuade everyone and don't choose the alternate path , you can explore them later. (each successful persuasion grants you 1000 XP: Silver tongue).
Do all side missions (obviously).
Find hidden praxis kits (some websites have list of these). You don't need to pay for these.
Go to limb clinic each time you visit a city (there is a hidden limb at the end of the game).
Comment: Half of your answer is out of the scope of the question. The OP wanted to know if K.O.ing was better than killing, not the best way to gin XP during the whole game. Answers should be focused on the question being asked.


Helping a choking person

Question: I live in a sharing house so the door next to me is a women who's not married and she lives alone. My friend also lives in the same sharing house and we all have different rooms I don't talk to the women beside or even see her. But once my friend was outside and the women next to my room started choking so I had to help her I could have called the doctor but I was panicking that I did not think of that even so I went to her than I pressed her chest but then she had fainted so I had to give her a mouth to mouth to save her.
QUESTION: is it ok to press a women breast or chest and give her a mouth to mouth if needed to save her like in this situation
Answer: If there was a woman around who could do abdominal thrusts/CPR then you shouldn't. BUT if there wasn't another woman around then it was perfectly fine for you to do so (as long as you "touch" only as much as needed and no more than that).. inshaAllah. Allah (ﷻ) has always given exception to dire situations, saying "except for one is forced" etc.. [eg, in Qur'an 6:119 and 16:106, etc]. When a person is choking, there is very little time before oxygen deprivation damages the brain or leads to death. Therefore, your immediate response in trying to save her life was good.  But always make sure to call professional emergency responders along with that.

Helping a choking person


Javascript and classes from packages from other bundle

Question: I try to describe my problem. Following configuration:

On Servicemix I have two bundles: one with model, second with service. Model bundle exports model packages, service bundle imports model packages from model bundle.
In the service bundle I have Web Service (CXF) with one service method: execute. This method uses two parameters: the first (String) is the name of javascript file and the second is the map (HashMap) of arguments. The service executes javascript script using javax.scipt.CompiledScript.eval(Bindings bindings). The idea is to have business logic in scripting language.
The javascript script has access to Java objects via:

a/ bindings - without problems. I see in the script all objects' instances which I added using bindings.put(name, object)
b/ importPackage(Packages.my.java.package.from.model.bundle) - now I have the problem: when I try to create in javascript Java object from model bundle with keyword "new" I get following error:
class com.google.code.scriptengines.js.util.ExtendedScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Product" is not defined. (#4) at [4] in file
where Product is my Java class from model bundle and in line 4 i try to create this object with:
var product = new Product();

And, I think, very important information: everything was fine in Servicemix 4.2.0. Now I have to upgrade to 4.3.1 and doesn't work (both version from Fusesource)
Any help?
Regards,
Jacek
Answer: Seems like the script engine bundle does not have package visibility to your Product package.
You can try enable dynamic imports on the bundle with the script engine
list | grep -i javascript

And then find the bundle id for the bundle with the engine, eg for example
And then use
dev:dynamic-import  ID of that bundle

And you may need to restart the ESB if the change is not picked up.
Comment: Its a problem with the javascript bundle. A ticket has been created to fix this in the future: https://issues.apache.org/jira/browse/SM-2200


Putting the CC2541 to sleep

Question: I have a bluetooth module which uses the CC2541 IC. My project is battery powered and so i want to be able to put the device to sleep.i have been looking about trying to find how to do this and it would seem that there is no sleep/wake pin but one has to program the chip itself to put it to sleep. could anyone just confirm this before i start assembling a high side mosfet config. to power the module on/off please? thanks.
Comment: I worked on the CC2650 which is quite similar. These devices have a sleep mode with very low consumption, I don't see any reason not using it. you can wake from an external trigger like a button. Note the CC25XX can only be programmed with an expensive tool suite, while the CC26XX can be programmed with free tools. If you can use a CC26XX device it will make your life easier / cheaper.
Comment: i only have experience programming the atmega from the arduino IDE so i think figuring out how to program these chips may be a stretch for the time i have and so switching with a mosfet is still looking like the preferable option...
Answer: How do you interface with this chip? It seems to have three power modes which you can configure:

Power Mode 1 (4-µs Wake-Up): 270 µA
Power Mode 2 (Sleep Timer On): 1 µA
Power Mode 3 (External Interrupts): 0.5 µA

Maybe this user guide may help you:
http://www.ti.com/lit/ug/swru191d/swru191d.pdf

Putting the CC2541 to sleep


Author list mismatch; should I recommend rejection?

Question: I am reviewing a paper for a journal. However, the author list in the submitted pdf file of the paper is different from the author list in the submission website. One of the authors is not appearing in the online submission website. Though, it is possible that some of the conflicts have been ignored (I am not in conflict with any of the authors). Should I recommend the paper to be rejected or just inform the editor about this (or any other solutions)?
Comment: You cannot reject the paper anyway. That is for the editor to do. You can (and should) point this out to the editor, and it might be an idea to wait on doing more until you hear from them.
Answer: Inform the editors as soon as possible. They will decide what to do. This is probably a minor issue that can be resolved in communication with the authors directly.
Comment: I have been reviewing this for a month. I just noticed this when I wanted to enter the reviews.


Facebook connect

Question: Is there anyway of using facebook connect within an iPad or iPhone application.
The idea would be to sign into this App and then be able to see which of my facebook user's also use the app and its features.
Answer: Yep.
The new version:

Docs: http://developers.facebook.com/docs/guides/mobile/
Code: none, you write it yourself using the Graph API

The old version:

Docs: http://wiki.developers.facebook.com/index.php/Facebook_iPhone_SDK
Code: http://github.com/facebook/facebook-iphone-sdk/
Answer: Please follow the tutorial for Facebook SDK integration for you app from below link:
http://www.raywenderlich.com/77/how-to-post-on-facebook-with-your-iphone-app
Then test the app. If you need to run the same code for iPad also, and if you want to resize Facebook controls for iPad, just follow instructions from:
http://forum.developers.facebook.net/viewtopic.php?id=54307
But take care of few things:
In FBDialog.m
1) for 'postDismissCleanup' function don't comment the line,
[self removeObservers];
Otherwise your application will start crashing.
2) Replace both of these functions
<code>- (void)keyboardWillHide:(NSNotification*)notification {
  //UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
  /*if (UIInterfaceOrientationIsLandscape(orientation)) {
    _webView.frame = CGRectInset(_webView.frame,
      kPadding + kBorderWidth,
      kPadding + kBorderWidth + _titleLabel.frame.size.height);
  }*/

  _showingKeyboard = NO;
}

- (void)keyboardWillShow:(NSNotification*)notification {
  //UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;
  /*if (UIInterfaceOrientationIsLandscape(orientation)) {
    _webView.frame = CGRectInset(_webView.frame,
      -(kPadding + kBorderWidth),
      -(kPadding + kBorderWidth) - _titleLabel.frame.size.height);
  }*/

  _showingKeyboard = YES;
}
</code>

Facebook connect


How to download files from web and save them on the device

Question: I've got a link for a media file on the web that my application usually plays using a MediaPlayer. I want the user to be able to download the file and save it on his device.
How can I download the file and save it on a predefined folder on his device.
I'm actually asking for two things
1) How to download a file
2) How to save a file to the device's memory.
Answer: You may want to do HTTP GET to get a file, start looking at HttpClient class and example, to save, data storage.
Comment: I used the HttpURLConnection to get the file, and then saved it to the data storage.
Answer: You've asked a very general question, so the best I can do is give you a general answer. To actually download the file itself, you'll probably want to use an HttpURLConnection. Make sure not to do this on the main thread UI thread as it will cause your app to freeze. You'll want to do it on separate thread using something like an AsyncTask. To actually have the user kick off the download, you'll probably want to put some sort of button in your UI that allows them to first select a folder and then once a folder is selected, you launch your AsycnTask. Android doesn't really have a builtin file manager, but you can could integrate with the OpenIntents file manager.


Is there an upper velocity limit to obtain benefit of the Oberth effect for a high speed hyperbolic pass around a star?

Question: Is there an upper limit to the speed you can be traveling to obtain any benefit from the Oberth effect?  I'm writing an SF novel and I have two fleets chasing each other around a star at high speed. Since the leading fleet's only objective is to escape the solar system, is there any point in using the Oberth effect if they are already at extremely high speed (e.g. 5 % of light speed)?  Remember, their only goal is to escape the solar system; trajectory is not important (obviously it will be a hyperbolic pass). Assume they have a maximum accel of 300g, no real limit on burn time, and can manage the heat. And yes, it's an unrealistic problem, folks. I just like to try and make my books as believable as possible.
Answer: In most star systems, if you can burn forever at 300 gees, orbital mechanics are things that happen to other people.
Coasting into the Solar System with a hyperbolic excess velocity of about $15\,000 \mathrm{km/s}$, without burning any fuel, you will only gain about $11 \mathrm{km/s}$ before hitting the surface of the Sun.
And your spacecraft can burn at 300 gees the whole way.
With these features, there is basically no point in doing a powered gravity assist on anything that isn't a stellar remnant, and then you have to start dealing with everything that general relativity brings to the table.
Answer: The Oberth effect is a property of the chemical rockets we use.  When a spacecraft is on a highly elliptical orbit, the difference in speed between the highest point (apoapsis) and lowest point (periapsis) is extremely large, with the largest velocity occuring at the periapsis.
It turns out there are significant gains in chemical rocket efficiency if you use the engines at this point rather than at the slower speeds.  Long story short, when you are traveling at the faster speed the chemicals you are shooting out the back of your rocket also have a higher kinetic energy and you can steal some of that to increase the rockets delta v.  It's roughly analogous to how you'd like to launch rockets near the equator because the planet is moving the fastest along that line.
What this means is that depending on the type of technology your spacecraft are using, they might not benefit from it at all.  But besides that, also notice that the benefit comes from the speedup that occurs at the the periapsis of an orbit. When you are already traveling at extremely high speeds the speedup from falling closer to the gravity source is negligible as is the time spent near the periapsis.
TLDR: 0 to near 0 benefit for futuristic spacecraft darting around the galaxy.


Question about decay

Question: So, I already asked a question on the topic, that helped me understand some more.

Now, here i find myself blocked again.
I don't know how to solve the following problem:

In a basement, you notice a radioactive Activity of $A \; Bq\cdot m^{-3}$ of 222Rn nuclids. $A$ is constant.

The question is the following: How many moles of Rn should be added at the end of each day, to keep $A$ constant, assuming no Rn is leaving the Room.

Now, to me it really doesn't make any sense. Since the decay is exponential. Any quantity i add would decay exponentially.

Now, It's clear to me that is i add a small enough quantity with the halflife value of Rn and that activity value, $N(t)$ the quantity of Rn nuclids decreases by such a small amount that i am tempted to just add the quantity that was lost in a day at the start of every new day. Basically saying that on this scale, we can say that $A$ is constant and by replenishing the lost Rn amount, we keep it in that "constant" zone. Is that correct ?

Because mathematically, it really can't be that an exponential process would be kept on a constant level, by adding a constant value at regular intervals.
Comment: If you measure a constant rate of particle decays, it means that the lifetime of particle A is so large, more than a year ( see https://en.wikipedia.org/wiki/Island_of_stability ) ,  so for your basement experiment the rate is constant . . If you measure in day intervals 222Rn has a lifetime of 3.8 days, you should see the decay curve.
Answer: Yes, I think the objective of the question is to see if you can calculate the amount of radon that will decay in one day. It would be better phrased if it asked how many moles of radon should be added to restore the activity to the level it was at the beginning of the day.
Comment: And the next step in the exercise is to add a constant amount during the day. We basically are comparing approximation by a constant vs linear polynomial right ?
Comment: I have answered the question "on this scale, we can say that A is constant and by replenishing the lost Rn amount, we keep it in that "constant" zone. Is that correct ?".
Answer: You are right- it isn't possible to maintain a constant level in a leaking water tank except by constantly introducing water that exactly compensates for the amount lost through the leak. However, if the leakage is sufficiently small, you can top up the tank every day so the water level appears constant when viewed over a long time period ignoring short term fluctuations. I think the question is asking you to say how much of a daily top-up you would need to maintain the value of A from day to day.
Comment: I think that part of the problem is that the people who write the questions don't take sufficient care over their wording. Taken literally the question has no answer, since it is not possible to keep A constant in an unqualified sense. Perhaps physicists are more used to dealing with sloppy language than mathematicians are!
Comment: coming from a mathematical background, these type of approximations and questions always get me.

Question about decay


What will be my Provident Fund withdrawal amount for 8 months?

Question: I have worked with a company for 8 months. Now I want my Provident Fund. I have applied to withdraw my PF, but don't know what amount I will get. My Provident Fund balance is EE-7170 and ER- 2189.
Answer: It would be EE+ER, 7170 and 2189. The PF should apply the interest for the balances at the end of each month. This may already have been reflected, if not you may get some more as interest.


Galaxy editor use unit type for trigger?

Question: I have a trigger using the event Unit Enters/Leaves Range of Unit, but it seems to want a specific unit. For the sake of brevity (and saving time for me), how do i set the trigger to find a unit that enters range of any of a specific type of unit?
Answer: Are you sure you want to use a trigger for this? It sounds like the functionality you're looking for would work much better as an aura-like ability.
I've been fiddling with my SC2MapEditor -- I don't think there's a simple way to implement the ability with that event, as it's designed to work with a single unit. You might could try something with unitgroups, but even that returns only one (rather than all) of the units in the unitgroup.
It might also help if you informed us what you were trying to do.
Comment: I'm designing a map where instead of gathering resources directly, you control beacons which give you resources. Abilities might work, investigating...
Comment: I meant informed us what you wanted the ability to do. Change ownership?
Comment: What i basically want my unit to do is to change ownership then provide mineral production for the player that owns the unit, and also perhaps provide things like defensive buffs to the owning player's units.
Comment: Ok, i've rigged a system that will work for my needs except for 1 part: i need to make my units research an upgrade on command instead of being user-triggered. Is this possible? Edit: looks like that's doable. Now working on disabling a behavior on command.
Comment: All right, after mucking with abilities for several hours last night, i gave up on that for now. I have a couple of trigger-related ideas that I want to try, then if those dont work i'll post on a mapping site (www.sc2mapster.com) to see if someone there can help me.
Comment: @RCIX -- starcraft 2 map editor questions are within the scope of Gamedev.stackexchange also -- perhaps you should try there as well.
Answer: I have been messing around in the editor and have done something similar to what you are trying to do. I found the best way to do this is to take a sensor tower and change nothing but the effect, its rather easy to change the effect to give out a certain number of minerals per minute etc.


exporting gnosis transactions to csv for tax

Question: I need to export my gnosis transactions for tax but I can't get it to work.
I've used this from teh Gnosis support (2) Fetch the data in JSON from the Safe transaction service
The Gnosis Safe transaction service indexes all Gnosis Safe transactions.
There is an endpoint that can be used to return those transactions in a JSON format:
Make sure to use a checksummed Safe address in the URL. For the Gnosis Safe address 0xA063Cb7CFd8E57c30c788A0572CBbf2129ae56B6, the URL would be https://safe-transaction.gnosis.io/api/v1/safes/0xA063Cb7CFd8E57c30c788A0572CBbf2129ae56B6/multisig-transactions/.
it produces a json file and I've tried to use a json csv converter but it isn't working
Answer:
Go to JSON to CSV Converter: https://www.convertcsv.com/json-to-csv.htm

Select "Enter Url" tab

Paste the URL: https://safe-transaction.gnosis.io/api/v1/safes/0xA063Cb7CFd8E57c30c788A0572CBbf2129ae56B6/multisig-transactions/

Optional: Choose a suitable file name and click "Download result"

Here is the CSV version of the url you provided:
https://docs.google.com/spreadsheets/d/1pWe39Ti5EhrG3fmq0YJgKA1Kl8BwdWOXWTNZxyCEOCA/edit?usp=sharing

JSON as CSV


Spring-WebFlux code to save per-user data

Question: I'm using Spring-WebFlux with Spring-Security and I need to save data depending on the currently registered user. In order to do so, in my controller, I need to retrieve the data sent from both the frontend and the principal.
After searching for a solution to my problem on the internet, I didn't find any clear way to do what I wanted, so I did my own stuff but I don't know whether it's correct.
Here's what I did:
public Mono<Order> createOrder(@Valid @RequestBody Mono<OrderViewModel> orderViewModel, Mono<Principal> principal) {
    return principal.flatMap(userPrincipal ->
        orderViewModel.flatMap(order -> this.orderService.save(order, userPrincipal))
    );
}

As you can see, I have two Mono objects in my controller. Then, I kind of nest them one in the other by performing two flatMap() calls in order to return my Mono response.
Well, it works fine but I'm a beginner with WebFlux and I really don't know if this solution is "dirty" or valid. If you guys have any better approach I'll be happy to discuss it. Otherwise I hope this code fragment can help those with similar problems. :)
Answer: There is no problems at all with the supplied code.
Nesting multiple Monos is no problems and flatMaping over them in a nested fashion is somewhat common.


MTB Air Fork Settings

Question: I have a rockshock air fork on my bike and it feels too firm. The compression is on the softest setting I believe so opposite to the lock symbol (see photo) so I think this means that it will compress the most it can but I am not 100%. So I am 45kg (14 years old). So I am asking if it feels too firm do I need to let some air out of it and if so do I need to get a specific shock pump?
Thanks
Comment: The answers have good points on how to proceed. I run on Fox forks and will always run lower air pressure than what is charted by Fox for my weight. Manipulate the air pressure based on achieving your desired sag, which is 25-30% of full travel. Rebound sould be adjusted a few clicks with a change in pressure. Reducing pressure requires an increase in rebound speed. Running a slightly thinner viscosity oil in the damper is another way to change it's characteristics. This is not complicated but likely something that should be tried after air pressure changes.
Answer: Yes, you will need a shock pump.  They have a screw on head that you don't get with a track pump.  They also have a narrower barrel which allows you to deal with the high pressures often found in rear suspension.
It's very likely at 45kg you will need to reduce the pressure in your fork.  I find that even at 60kg it can be tricky to get suspension setup well as it is typically designed around a more 'normal' 75-80kg rider.
Answer: You can indeed somewhat affect the "firmness" feeling of an air fork by changing the air pressure inside it. However, this is not a primary mechanism for controlling compression damping, as it has side effects. Reducing air pressure will also increase static sag  of your fork, meaning that you will end up with less usable travel. The fork will simply become shorter when you rolling on a flat.
The compression damping is primarily controlled by a separate hydraulic circuit in the fork. In simple terms, it is sticky oil that flows back and forth through a hole. A larger hole or less viscous oil will mean that the fork legs can move faster. Closing the hole (with the control knob you see) makes the hole smaller, thus increasing the firmness feeling.
Range of achievable variation in compression for given damper construction is always limited. You cannot make it compress infinitely fast. If you want to set it outside the available range, it can only be achieved by modification to the damper unit. That is quite advanced and expensive fork modification.
A few recommendations.

Make sure you set up the air pressure so that the sag is within manufacturer's recommendations. Aim for larger sag (say, 30%) and check if it fits your needs. There are many tutorials on the web on how to do that.
Yes, you need a special high pressure pump for that. Regular tire pumps are not designed to operate on suspension forks. Attempting to ignore it is like to try towing with a car where a tractor should be used.
The front tire also plays role in how firm the ride feels. Try reducing the front tire pressure a bit.
Make notes to see what adjustments you tried (what pressures in fork, tires and etc. settings) and how they felt. It will take a few iterations to figure out the best settings, or find yourself at the end of the adjustability ranges.

Good luck!
Comment: Yep, there's definitely only so much can be achieved with the stock factory dampers.  Ideally i'd have them swapped both front and rear in my trail bike, but it doesn't get used enough to justify the expense.  Although as a light rider an air fork which i can run 'under-pressured' is still a giant step forward from a coil which are always WAY too stiff for me
Comment: @AndyP The other side of the weight spectrum has similar problems. Allow yourself a bit too many sweet donuts and land on the right side of 80 kg — and the stock dampers will likely feel too soft. Especially in rear air shocks.

MTB Air Fork Settings