Modelling the expected delay of a flight. Should I use logistic regression or linear regression?

Question: I have a dataset of flight information such as carrier, data and hour of flight, I do not have weather on this dataset yet, but I am for an external source to add to it. The dataset contains info of a year, and about 6mi different flights.
I want to predict the expected delay in minutes of a given flight. The delay column contains positive and negative delays (which means that the flight departed earlier).
So my question is, should I simply apply a linear regression to predict the delay? Or should I maybe use a log. reg. to predict the probability of delay and a lin. reg. to predict the expected delay and multiply the probabilities?
Comment: [Please don't cross-post.](https://datascience.stackexchange.com/q/108961/73930) // I think you will get better answers to this interesting question here.
Comment: But you wil need to tell us some more details & context ... sample size, what covariables you do have, ... but the logistic regression idea I do not like here.
Comment: @kjetilbhalvorsen I added some detail
Answer: Logistic regression does not seem like a good fit, because it is intended for Yes/No (or 0/1) outcomes such as delayed vs. not delayed (see this question & discussion for whether you should model the time anyway and then classify the predictions as delayed or not, even if you were only interested in delayed vs. not delayed).
Similar to the classification vs. regression question above, I'd argue that if you have information on change in the departure time (positive or negative), that you should then model that (rather than a strictly non-negative variable, for which you set this number to 0 for on-time or departed earlier). I'd guess that you would find that doing so results in better predictions (you can and should test that using some suitable form of cross-validation - the key bit is to make sure you are evaluating all approaches you compare on the same cross-validation splits and on identical metrics - in this case perhaps something like RMSE of zero-truncated delay?). Whether linear regression (including variations of it such as using splines for some key continuous predictors) vs. other potential prediction models (e.g. tree based methods like LightGBM / XGBoost / catboost / random forest perhaps with some form of target encoding for categorical features, neural networks with embeddings for high-cardinality categorical features like airports and airlines etc., or an ensemble of multiple model types) is a good idea is another question and also worth evaluating.
There is occasionally a value in modeling two questions separately (will there be a delay + how long is the delay), but I'd suspect that in this case you'd be better off just modeling a single variable. That's because the two things are so closely related, which is less the case in some other scenarios where this has been found to be useful (e.g. in some Kaggle competitions that involve modeling amount of USD spent in response to an offer, where it can be useful to first model whether the customer will buy anything, at all, and then conditional on that the amount spent). But, again, you can look at your options and try them out using cross-validation.
Comment: Great answer. I think I ll follow your advice of modelling just as regression. But I would like to be able to justify my choice better. One idea is that if I were modelling amount of USD spent, as you mentioned, I would probably have a bimodal(?) distribution of money spend, with lots of people spending 0 and the remaning ones spending different values, while this is not the case with flight delay. Am I right? Or that is not the point?
Comment: Yes, that's kind of what makes the cases different in my mind. Alternatively, you could say there are simply two consecutive decisions: buy anything yes/no and how much/which items to buy. That makes me consider modelling it separately (of course that's not necessarily the only sensible approach).


Come out of loop and execute Setup again

Question: I want to end loop at a specific time and start setup again. Is this possible? (I can explain reason in case you require).
Comment: As others have suggested, that is not how an Arduino program works. It runs the setup function once, and then calls the loop function repeatedly and forever until it is powered down or reset. You'll have to explain what you're trying to do in order for us to help you get it working.
Answer: You could just call setup() yourself:
void loop() {
    if (some_condition) {
        setup();  // reinitialize everything
        return;
    }
    // etc.
}

But, as Majenko puts it, if you nee to do that it looks like there is
something wrong with your methodology.
That being said, it would be less suspicious if you only need to
reinitialize some specific part of your program. In this case you can
make a separate function for these initializations, and call it both
from setup() and, when needed, from loop():
void init_foo() {
    // ...
}

void setup() {
    init_foo();
    // other initializations...
}

void loop() {
    if (some_condition) {
        init_foo();  // reinitialize foo
        return;
    }
    // etc.
}

Answer: Not directly, no. You can reboot the Arduino though so everything starts from scratch (either through the watchdog timer or wiring a GPIO pin to RESET and pulling it LOW), but if you find you need to do this sort of thing then you should rethink your methodology so that you don't need to do this sort of thing.


The Holy Spirit in 1 Samuel 19

Question: This story is problematic for me.  Does the Holy Spirit overrule people's will? (I don't think so, but
Comment: Are you specifically referring to v23 & 24 about Saul lying naked and prophesying?
Comment: See  https://hermeneutics.stackexchange.com/questions/45133/how-to-understand-1-corinthians-123-in-the-light-of-matthew-721-23
Answer: No, God's Spirit does not overrule people's wills. Evidently, the people whom the Spirit used to prophesy were neither antagonistic to David nor were they antagonistic to God. Even Saul believed in God, despite his backslidden condition. So, then, were Saul and Saul's messengers God's puppets on a string? No.
David, whose righteousness exceeded that of his king, was being supernaturally preserved by God and would be taking Saul's place as king of Israel. For all we know (though the Scripture does not necessarily warrant what I am about to suggest), one theme of the prophecies of God's temporary mouthpieces could have been God's wisdom and grace in choosing and preserving the life of the king-to-be, David.
Another theme may have been the prediction of when and under what circumstances David would ascend to the throne. (The dual function of prophets comprised both the forth-telling of God's message and the foretelling of God's will.)
In conclusion, the story of the prophet Balaam (see Numbers 22-24) is a good illustration of how God's prophets, whoever they may be, have an obligation to prophesy the word of the Lord as it was given to them by God himself (or by the angel of the Lord, who may have been God in human form, as in the incident with Balaam and his donkey in Numbers 22:22 ff.).
Furthermore, God has the right and the authority to inspire whomever he chooses

The Holy Spirit in 1 Samuel 19


Correct white to use in spot color knockout

Question: Should one use Paper White C0 M0 Y0 K0 or 0% of a spot color when doing a full white knock out of said spot color? Also, if the white knockout spans more than one spot color, does the same apply?
Answer: If the production method is spot printing or process +spot, it doesn't really matter if the knockout is 0% of a spot ink* or CMYK White. Any object that is white in appearance and is NOT set to overprint should do the trick, with a few caveats. Be aware that RGB white isn't always translated to CMYK white by all RIPs. Also be aware that black tends to overprint by default so 0% black may vanish when plates are printed. That is because when a 0% object is set to overprint, it prints nothing and knocks out nothing.
*If the ink or objects that the ink is applied to have overprinting attributes turned on, then you need to either disable the overprinting attribute or switch to CMYK white.
Regardless of which method you use, always view the separations either by printing each separation individually or by previewing the layout separations preview mode. Separations preview mode is supported in InDesign and Illustrator (and probably other modern print-oriented layout software) and is a real time composite of all plates as they should appear when printed. Normal view and office printers cannot be depended upon for this.


Socket programming WiFi issue

Question: I am implementing a mobile chat application, I am using socket connection for implementing p2p connectivity. My chat is working fine with android devices. My issue is I can connect a device in 3g network or with in the same WiFi network but the connection is not working when a device form outside WiFi try to connect a device in the WiFi network. I know it's because of the local IP of the device assigned by the WiFi. How can I root and connect a device in the WiFi?
Answer: Sounds more like a router settings issue, than an app issue (meaning that users of your app would need to do this for their own networks as well).
Your wifi router needs to know how to forward communication to your device. So say that your app is connecting on port 1234, then you need to tell your router to forward communication from the outside on port 1234 to the internal IP of your phone in your wifi network.
The phone that is outside of the network should target your network's external IP and port 1234.
Answer: Sajan, your issue is not only an IP mapping issue, but also a NAT traversal issue. It is not always possible to punch holes in NATs. And when it is, it must be done with some sophisticated techniques including a super peer located outside of your wifi/lan which will read the translated address from your inside peer.
Unless you are using UDP and the NAT is friendly, it is not possible to send TCP communication directly to the inside peer. In most case, you'll have to check what is possible with the NAT, and if there is something possible, you'll need to perform mapping prediction and tell both peer to attempt com on predicted IP addresses.
That's valid if you don't want you users to have to configure their NATs. And even in that case, such configuration will not always be enough (if there are cascades of NATs, or proxies for example).

Socket programming WiFi issue


Calculate the slope of a 3D triangle?

Question: I have lots of triangles in 3D space. How do I determine the slope/angle of these triangles with respect to a fixed ground plane? I need pseudo code examples at the very least.
Comment: What do you mean by "angle"? Are you asking how to calculate a [normal](https://en.wikipedia.org/wiki/Normal_(geometry))?
Comment: Maybe he's looking for tangent and bi-tangent
Comment: I'm not looking for a vector. I need the slope of the plane formed by the triangle with respect to the ground plane. The angle between the floating plane and the ground plane will be okay too.
Comment: I guess the angle between the normal and the ground would be okay too. From that I can get the information I need.
Answer: EDIT (added short steps):

get triangle normal vector v1 (normalized)
get reference surface normal vector v2 (normalized)
get angle between normals : angle = acos(v1•v2) (where • = 'dot' product )
get slope = Tan(angle)

if you need a surface normal here come the simple algoritm :
A surface normal for a triangle can be calculated by taking the vector cross product of two edges of that triangle. The order of the vertices used in the calculation will affect the direction of the normal (in or out of the face w.r.t. winding).
So for a triangle p1, p2, p3, if the vector U = p2 - p1 and the vector V = p3 - p1 then the normal N = U X V and can be calculated by:
Nx = UyVz - UzVy
Ny = UzVx - UxVz
Nz = UxVy - UyVx
EDIT: to get the angle between reference plane and triangle plane , you can calculate the angle between reference plane normal vector (call it Nref) and triangle normal (N already calculated). Here the angle between 3d vectors math:
"If v1 and v2 are normalised so that |v1|=|v2|=1, then,
angle = acos(v1•v2)"
Finaly from angle to slope : Tan(angle)
Comment: I need the slope, though. A single scalar value not a vector.
Comment: @posfan12 Angle between the ground plane and a triangle?
Comment: I think you can't define a single slope. You can get x-slope and y-slope , and can calculate them from normal vector x and y components
Comment: Why no slope? Two planes intersect at only one angle.
Comment: oops , you're absolutely right
Comment: answer edited and integrated
Comment: @dnk drone.vs.drones I edited my post with some code but it is not working. Can you see what I did wrong?
Comment: Never mind. I forgot to normalize the cross product. It works now.
Answer: Based on dnk drone.vs.drones' instructions I created the following JavaScript:
function Get_Angle(vertex_1, vertex_2, vertex_3)
{
    // get two vectors in the triangle
    var vector_u =
    [
        vertex_2[0] - vertex_1[0],
        vertex_2[1] - vertex_1[1],
        vertex_2[2] - vertex_1[2]
    ]
    var vector_v =
    [
        vertex_3[0] - vertex_1[0],
        vertex_3[1] - vertex_1[1],
        vertex_3[2] - vertex_1[2]
    ]
    // calculate the cross product to get the normal
    var vector_n =
    [
        vector_u[1] * vector_v[2] - vector_u[2] * vector_v[1],
        vector_u[2] * vector_v[0] - vector_u[0] * vector_v[2],
        vector_u[0] * vector_v[1] - vector_u[1] * vector_v[0]
    ]
    // calculate the magnitude or length of the normal vector
    var magnitude_n = Math.sqrt(vector_n[0] * vector_n[0] + vector_n[1] * vector_n[1] + vector_n[2] * vector_n[2])
    // normalize the normal vector
    vector_n =
    [
        vector_n[0]/magnitude_n,
        vector_n[1]/magnitude_n,
        vector_n[2]/magnitude_n
    ]
    // the normal of the ground plane
    var vector_r = [0,1,0]
    // calculate the dot product of vector_n and vector_r
    var dot_product = vector_n[0] * vector_r[0] + vector_n[1] * vector_r[1] + vector_n[2] * vector_r[2]
    // calculate the angle between vector_n and vector_r
    var angle_between = Math.acos(dot_product)
    // returned value is less than or equal to pi
    return angle_between
}

Comment: Oh wow! Three years later! That's great, thanks for coming back and posting your solution :)
Comment: Can someone confirm this produces accurate results? I'm trying to review slope for rain drainage but I'm getting interesting results using the function above. https://i.imgur.com/RTIK3Fc.png white labels are for confirmed edge grade (deg/90*100 basically) and green labels is for the face grade. Shouldn't the face share the grade of the 2.85% edge since the top edge is at 0%?

Calculate the slope of a 3D triangle?


How does centrifugal force count on the ball-rope problem?

Question: I'm whirling a ball tying it by a rope. Then at any instant the centrifugal force (outward force)  equalizes the centripetal force (inward force) . Then both should cancel each other and there should be only tension of the rope to balance the weight of the ball. Then why do we count the centripetal force as resultant force. As an example in the mean position $T=mg + m\frac{v^2}{R}$ why do we also consider the second term?
Answer: Suppose, you are analyzing the situation from the your frame of reference. Then, the net radial inward force on the ball is, $T - mg \sin \theta$, while the inward radial acceleration is $\frac{v^2}{r}$. Applying Newton's second law, $T - mg \sin \theta$ $=$$\frac{mv^2}{r}$.

Now if you analyze the motion from the frame of the ball, there is no radial acceleration. So, the net radial force must be zero. The inward radial force is, again,    $T - mg \sin \theta$, while there is the centrifugal force (pseudo force) along the outward radial direction having magnitude $\frac{mv^2}{r}$. So, we get, $\frac{mv^2}{r}-(T-mg \sin \theta) =0$.
Thus, the equations are same in both of the frames.
Answer: From the reference frame of you whirling the ball, there is no centrifugal force. The centrifugal force is a fictitious force, only showing up in the reference frame of the ball. This is because the ball's reference frame is not inertial (it is traveling in a circle, and therefore is constantly accelerating). Noninertial frames gives rise to fictitious forces like the centrifugal and Coriolis forces.
The tension is the centripetal force (it is what keeps the ball moving in a circle). So the only forces acting on the ball, from your reference frame, are the centripetal force (tension) and gravity (neglecting air resistance). There is no centrifugal force, in your frame, to cancel the centripetal. If there was a force cancelling the centripetal force, there wouldn't be circular motion.
Comment: If that is true then we should write $T=mg$ always.
Comment: What is $T$? Tension?
Comment: tension is a force which takes accelerates the ball towards the center.
Comment: $T$ does not always equal $mg$. Think about the direction of each force. Gravity is always downward, but tension is always pointed toward the center of the circle that the ball is moving in. So gravity and tension will not always be in the same direction. So you can't say $\vec{T}=m\vec{g}$ always.
Comment: Are you spinning this ball horizontally or vertically?
Comment: no its just circular motion. You think the ball is a point mass only whirled in the vertical direction.
Comment: Then we should only write $\vec{T}=m\vec{g}\sin\theta$
Answer: The equation
$$T=mg + {mv^2\over R}$$
holds only for vertical circular motion at the instant the ball passes through the lowest point of the circle. Gravity(Weight of the ball) is always pointed down and so will be diluted as the ball passes around the circle except for the bottom like I said earlier. The tension in the rope constantly pulls the ball in while it moves in a circle and that is the source of the centripetal force. That is to say that centripetal force should not be regarded as a different kind of force than the rope tension. It is this tension in the rope that we call the centripetal force. What we normally call centrifugal force does not apply to the ball but instead the rope itself. By Newton's third law, the ball exerts equal force(called centrifugal) on the rope that the rope pulls on it ( centripetal force). So the "centrifugal force" doesn't affect the ball but the rope. Hence, the term $mv^2/R$ is the force due to the acceleration that the ball experiences ($F=ma$ remember). But it is the tension $T$ (centripetal not centrifugal) that is causing this while carrying the weight ($mg$) too. Effectively, at the very bottom of the vertical circle, $T=mg +mv^2/R$. It is good to note that the term $mv^2/R$ is neither the centripetal nor centrifugal force. It is the force due to the acceleration that the ball experiences. The centripetal force is the sum of this term and the weight. This centripetal force is same value as centrifugal force(by Newton's third law).But I repeat, the centrifugal force is on the rope not the ball so they can't cancel each other like people assume. Hope that one helps
Comment: Kk tank u sir I have went through it


Inertia and Rocket Propulsion

Question: We were taught in school that the law of inertia indicates that an object tend to stay the way it is, so if you throw something in space it will tend to go on forever and ever. The reason an object falls down when you throw it on Earth is because of gravity and air resistance. If that's the case, why don't rockets and spaceships need just enough fuel to escape the atmosphere plus the single thrust to push the craft in the right direction and let inertia drift it away?
Comment: Because gravity is stil acting on the rocket (its magnitude is proportional to $\frac{1}{r^2}$).
Answer: That's exactly the case. If you look at the trajectory of any given spacecraft, you will see that it has a few burns of the rocket engines punctuating very long periods just coasting along in orbit around some other body.
For example, the flight path of Apollo 8 has something like eight different rocket burns: launch, translunar and transearth injection (to get out of orbit and go towards the other body), three course correction burns, lunar orbit insertion to catch up with the moon, and one orbit correction burn on the moon.

 Image source: Wikipedia
The rocket engines spend most of their time turned off, and carry just enough fuel for all of this plus a little extra for safety. This still means that the initial rocket needs to be huge, because the translunar injection requires quite a bit of fuel and that fuel needs a huge other load of fuel to get into orbit.
Comment: (I might also mention that [ion thruster](http://en.wikipedia.org/wiki/Ion_thruster)-driven spacecraft constitute the one (very rare!) exception to this rule.)
Comment: Aha, I always thought that they were burning fuel all the way. Thanks.
Comment: You should watch "Apollo 13" the movie, or "The Right Stuff" which dramatizes the above scenario.
Comment: +1 for the simple pleasure of finding a 26 year old deftly work in a much older image of an Apollo moon mission.  I can earnestly say that I do wish you were of my age (9) then and could have shared the wonder of this 9 year old when all of this was going on.
Comment: @AlfredCentauri For sure. I did very much enjoy Tom Hank's *From the Earth to the Moon*, and particularly Apollos 9 and 15, though. (nudge nudge.)
Answer: I suspect that you may be under the mistaken impression that there is no gravity in space.  This is a common belief since we all can see the astronauts floating in "zero g" when on the ISS are some other spacecraft.
However, we can easily dispense with this misconception by asking "what keeps the ISS in orbit around the Earth if there is no gravity?".  Of course there is gravity; Earth's gravity keeps the ISS circling 'round the Earth.
The reason the astronauts float and experience "zero g" is because they are in free-fall.
In fact, when the Apollo astronauts left Earth orbit at about 25,000 mph, their spacecraft was slowing down and, by the time the spacecraft begin falling towards the Moon rather than the Earth, their speed had fallen to, if I recall, around 2000 mph (I'll verify and update later if necessary).
So, you see, it isn't the case that, once outside the atmosphere, a spacecraft will maintain its speed, relative to the Earth, without firing the rocket engine.  That would only be the case if it were in space far away from any other gravitating body.
Comment: Fun exercise for the reader:  Imagine a tower that is as tall as the average altitude of the ISS.  What would you weigh if you stood on top of the tower and waved at the astronauts as the ISS whizzed past?  (Hint: Use Newton's Universal Law of Gravitation) The answer might surprise you (or not, if you are a physicist or a space flight engineer.)  And please be careful!  The ISS will be moving about 12x as fast as the bullet from a high-powered hunting rifle when it goes by.  You don't want to stand in the way of that.
Answer: The escape velocity from earth (the speed required for an object to leave earth completely, i.e. travel infinitely far away) is 11.2 km/s. If the object has a smaller velocity it will return eventually.
Unless an object is launched straight up, it also has a sideways velocity. This means that it will not fall back directly on top of the launcher. If it moves horizontally at a speed of 7 km/s or more, it will keep "falling" beyond the edge of the earth and stay in orbit. Of course, you need to do this high enough so that you are out of the atmosphere.
Spacecraft initially travel vertically to escape the atmosphere. When they are high enough they start changing direction so they eventually travel about 7 km/s "horizontally". At this point they can stay in orbit indefinitely. To travel to other planets, a further boost changes their orbit so that it becomes large enough to eventually reach the other planet. En route it may get more boosts, either from on-board rockets, or from other planets.
Answer: This is a wonderful question and filled with interesting albeit incomplete or inaccurate answers.
Launching an "orbital body" concerns two issues and two issues ONLY namely mass and intertia.
So before we "launch" anything we must first understand THE EARTH IS MASSIVE...which works AGAINST the "inertial reality" of a conical shaped item which albeit is very MASSIVE (weight, size, volume, etc) is still "just sifting there."
Does one need to compute the Earth's Mass? No, not at all. Simply the knowledge that the Earth is truly massive AND IS AN ORBITAL ITSELF is sufficient to become an expert in orbital mechanics.
In other words you need no understanding of physics AT ALL to launch a rocket.
What you do need to know is the Earth wants to "throw" this object so to paraphrase a famous term "the more massive the better."
What "the physicists" get wrong is that getting a rocket off the ground has nothing to do with physics at all but merely "dumping the mass of fuel on the ground." Since the mass of the fuel is far larger than the mass of the object...the object is physically "lifted off the ground."
Everything that comes after said "lift" is just a function of performance and working against the natural forces having lifted the object simply wanting to fall.
The United States struggled MIGHTILY with this problem in the 1950's I might add...something the German Scientists solved quite easily.
This involved "controlling the dump" (to dramatic effect with the Saturn V) as it were...but literally nothing more.
Performance enhancements have been an interesting sidebar however.
Comment: You can launch a rocket in space with nothing to push on.  The mass of the Earth isn't what makes the rocket take off.
Comment: Bah, gibberish!
Comment: You do understand the Earth revolves around the Sun not the other way around, yes?
Comment: What do you mean? If I launch from the equator I get far better efficiency. There is not a subject for "debating" but merely grasping the reality that the Earth is not only launching your rocket but in fact is about the ONLY thing. Yes, true...we must ignite the fuel...but we don't do that at the top like a candle now do we.

Inertia and Rocket Propulsion


ESTA for Italian spouse

Question: I am Brazilian and my husband is Italian. We are going to the US and he is applying for an ESTA but I can't apply because my country is not specified on the list. Is there such thing as accessory ESTA for spouse?
Comment: No, you can only apply as an individual, or as a family or a group providing all applicants in the group are eligible for ESTA
Answer: ESTA, or more correctly, the US Visa Waiver Program (which is what the approved ESTA allows you to use to enter the country) is based on your country of citizenship. The citizenship of your husband (or parents/children/etc) is not relevant, and thus you are not eligible to use ESTA/VWP and must obtain a standard US visa.
As a longer-term answer, if you were to obtain Italian citizenship (based on your husbands citizenship) and an Italian passport, then you WOULD be eligible to use the ESTA/VWP programs - not because of your husbands citizenship, but because you could then apply as an Italian citizen yourself.

ESTA for Italian spouse


Using Name of Father or Mother in Prayer

Question: I've noticed that when we daven for someone, sometimes we use their name as ploni ben/bat their mother's name and sometimes we refer to them as ploni ben/bat their father's name. Does anyone know when and why we sometimes do one or the other?
Comment: More specific: http://judaism.stackexchange.com/a/2091 http://judaism.stackexchange.com/q/16658
Comment: http://judaism.stackexchange.com/questions/6097/phrasing-of-refuah-prayer-when-praying-for-a-non-jew
Answer: I heard from Rabbi Menachem Nissel, a noted authority on Tefillah, the following distinction:
When we are asking for rachamim (mercy - healing, shidduchim, livelihood) we use the mother's name.
When we are talking about chashivus (importance - aliyah to the Torah, dedication, general use) we use the father's name.
Additionally, the father's name is used with a deceased individual.
Answer: The gemara says in Nidah 31a that the father contributes the white part of the person such as bones and the mother contributes the red part such as flesh.
Therefore if we are praying for an ill person we mention the mother's name as the flesh is ill, if we pray for the deceased we mention the father's name as only the skeleton is left.
Comment: Sounds nice, but do you have a source that that is what the Gemara is coming to say?
Comment: What if his bone is sick (eg. broken) while he is alive?


Having only one die +Gremlins

Question: If a pc has the disadvantage "gremlins" (which results in him needing less 1s for a glitch when dealing with tech), and needs to roll on something which results in him having only one die (e.g. Computers + Logic, the pc has no points in Computers and 2 in Logic, resulting in 1 die), does he automatically roll a (critical) glitch because normally he would need to roll a single 1, but "gremlins" reduces this number by it's level, making it 0 or even less? Is there anything about this mentioned in the rule book(s)? I am not strictly asking for RAW here, because I don't know if that is even covered by the rules.
Comment: It probably sounds completely unimportant, but this is a serious attempt at clarification because I may or may not have an answer depending on your answer:  Does this character use guns and/or cyberware?  Or are we talking about a tech-eschewing character, like a sword adept or a nature mage?
Comment: A mage using a sword and bow, but she is a hermetic mage and not strongly against using guns at least, that was the situation where the question came up initially.
Comment: This mage is going to have a bad time using his commlink to call his mother...
Answer: Yes is the short and quick answer.
The Gremlins "upgrades" the innabilty of the character to use technology, so for a normal guy with gremlins it's an annoyance, but for such a tech negated guy, Gremlins is going to give him some pain in the ass.
If you use it as in RAW, the story ends here, but keep in mind that it can be exploited by the characters, since someone can have a dice pool of 2 and take the 4 level Gremlins and have the same effects that having level 1, totally dumping his tech skills forever, the level 4 only becoming an issue as he grows up tech skills.
You can house-rule something like when the character rolls 1 he must roll again 1D6, and rolling under his Gremlins level (1-4 in max Gremlin level) the glitch becomes critical, this way a level 1 Gremlin is verty glitchy, but not very critical, but the "exploited" Gremlins 4 - dicepool 2 character would end in critical glitching most of the time.
@Gatherer818 asked about if he using cyberware, but this is not a problem since last part of Gremlins say:

Page 81 Core rulebook (Gremlins):
The effect only applies to external equipment
and does not affect cyberware, bioware, or other implants.

Edit: But the use of guns can matter as it's external equipment...

Having only one die +Gremlins


Are old raspberry canes required to be chopped off?

Question: I just bought a Fall Gold Raspberry plant. It came with instructions to prune away canes that have already fruited because only new canes can fruit. What If I were to leave the old canes there? Do the canes serve any other purpose to the plant holistically other than fruiting? Will leaving the old canes there harm the plant, or even benefit the plant, or not affect the plant at all?
Answer: First year canes grow.
Second year canes develop side shoots with flower buds.
Third year canes may develop side shoots in a lot less quantity (diminished crop), but in domesticated Raspberries usually die. Removal is the best policy.
Unless you're dealing with wild black cap Rasberries, this is the standard growth cycle.
You can propagate by letting the canes bend over in a U till the tip touches the ground in the second year. They react by creating a "dragon head" which roots and clones the plant. The new growth from this follows the same routine, but may allow for new growth off the attached cane to produce berries.
Domesticated Raspberries are prone to various fungal diseases and depending on the cultivar also do not tolerate Anthracnose virus. Dispose of the trimmings, you don't want either to be serving as mulch for your new canes.
Answer: Trim the old canes close to the ground. First, you don't want the plant to invest any of its energy into maintaining these old canes. You want the energy to go into the new canes. Second, if you leave them, they will dry out and may rot in wet weather. With decreased air circulation, the rot may spread to the healthy young canes.
Answer: Another thing to keep in mind is older canes may harbor insect pests (borers, for example) and allow them to overwinter in your raspberry patch, making the next year's fight against infestation a lot harder. So, not only prune the old canes, but REMOVE them far away from the growing site.
Answer: Where you specifically noted your everbearing variety of berry, I think some of the previous answers are missing something important. While you won't get fruit a second time on the end of previous year's canes, you don't have to cut the canes to the ground after their fruiting season. There are some situations where it's pretty much a must, but that depends on your local climate and when you want next year's crop harvest.
If you want a July fruiting (note that it will not be as full of fruit as your Fall fruiting) you can cut back the canes to just below where they fruited in the previous Fall. The same cane will produce fruit its second year from below where fruit was produced in the first year. After that fruiting, cut the cane to within 2" of the ground. This will delay your Fall fruiting by 1-2 weeks, so you have to be careful if you live in an area with early/cool/wet Fall seasons that it doesn't mean that you miss your Fall harvest due to things like fruit rot.
For more info, you can read this page by UConn Extension or this article by Fine Gardening. The pruning-specific part of the Fine Gardening article is on page 4.
Answer: You've got Primocane raspberries there.  Those produce on this year's canes - as opposed to Floricanes which produce on the canes from last year.  Technically, there is no requirement to prune them back.  You could most definitely allow them to fruit next summer but I believe the general consensus is that Primocane-fruiting raspberries are chopped back to the ground.  Here in Virginia, I'd cut the Primocanes back in January and I'd cut them back to the ground.
If you choose not to prune those canes, you'll get some fruit on those canes next year but I don't think that's a common practice and it, frankly, complicates an otherwise simple raspberry growing experience.  I think Primocanes are a great choice for the home raspberry grower from the simplicity standpoint.   The raspberry canes grow and fruit in the same year then you wait until it's dormant and cut it back.  Next spring it'll send up new canes the process repeats.
Comment: Can you verify if [this article](http://www.degroot-inc.com/product_info.php?products_id=281) is accurate? It says everbearing raspberries produce fruit on the top 1/3rd in Fall then produce fruit on the bottom 2/3rd in the following Spring. In other articles, I've read that everbearing rasperries produce twice in one year without being separated by a winter time.
Comment: What's going to happen is that last year's canes (the ones that will fruit a second time) will fruit but there will also be *this year's* canes which will fruit later in the season (like last year's canes did).  The yields of those two harvests, in total, is typically *a bit higher* than if you chopped back the Primocanes in the winter and just had the single late-season harvest of berries.  But the new canes can get in the way of the old ones that fruit first and so that's a bit of a hassle.  I'd personally opt for more berry plants and prune then every winter.  Propagation is easy enough.


Find all the items and fields that have dropdown value not in selection list

Question: I have duplicated the site to create new site.
I am seeing on new site some values in drop down are coming from existing site.
I want to find list of items and fields for which value are coming from old site.
How we can achieve this.
Comment: Hi Aman, welcome to SSE. Is this SXA site ?
Comment: No. Its not SXA Site
Answer: You can use this approach and update the script accordingly. To compare two Sitecore instances and find duplicate items based on a specific field, you can create a PowerShell script that retrieves items from both sites and compares the values of the chosen field. Here's an example script to get you started:
# Site A
$siteAPath = "/sitecore/content/SiteA"
$siteAField = "Title"

# Site B
$siteBPath = "/sitecore/content/SiteB"
$siteBField = "Title"

# Get items from Site A
$siteAItems = Get-ChildItem -Path $siteAPath -Recurse

# Get items from Site B
$siteBItems = Get-ChildItem -Path $siteBPath -Recurse

# Hashtable to store encountered field values in Site A
$siteAFieldValues = @{}

# List to store duplicate items
$duplicateItems = @()

# Populate hashtable for Site A
foreach ($siteAItem in $siteAItems) {
    $fieldValue = $siteAItem[$siteAField]
    $siteAFieldValues[$fieldValue] = $true
}

# Compare with items from Site B
foreach ($siteBItem in $siteBItems) {
    $fieldValue = $siteBItem[$siteBField]

    # Check if the field value already exists in Site A hashtable
    if ($siteAFieldValues.ContainsKey($fieldValue)) {
        # Duplicate found, add to the list
        $duplicateItems += @{
            "SiteAItem" = $siteAFieldValues[$fieldValue]
            "SiteBItem" = $siteBItem
        }
    }
}

# Output the list of duplicate items
$duplicateItems

Modify the paths ($siteAPath and $siteBPath) and fields ($siteAField and $siteBField) according to your specific Sitecore instances and the field you want to check for duplicates. The script will output a list of items that have duplicate values in the specified field across the two sites.
Hope this helps.


K4iOS Media Query

Question: Does anyone know of a way to target K4iOS with a media query?
Like this: https://gist.github.com/dvschultz/8324974 but with Kindle for iOS.
Answer: I'm not 100% sure what you are trying to do (though I did read your recent MobileRead postings on the subject).  What use case are you trying to solve for? Reading on iPhones at night?
Here's my thoughts on the subject. Media queries to distinguish between Kindle e-inks vs non-e-inks
I decided not to bother with iOS-specific media queries because I thought the CSS media breakpoints worked well enough to make them unnecessary.
By the way, if you haven't done so already, I recommend that you download the new Kindle Previewer Beta version (which makes it a little easier to produce files for iPad/iOS devices. http://www.amazon.com/gp/feature.html?docId=1003018611)
I have had flaky results on embedded fonts and font effects across platforms (even on Google Play Books -- which doesn't make sense at all). I have added a few embedded fonts and done a little testing, but I don't require that my ebooks render it correctly.
I have slightly lower standards for how ebooks render in Kindle for iOS. (My thought is that if people want to buy something for an Apple device, they could always buy from the Apple store or buy the no-DRM epub files my company sells and import them into iBooks).
My Kindle formatting issues hinged mainly on image rendering and positioning, not so much on font effects, so my solution of not targeting iOS devices but keeping the breakpoints generic  may not work for you...
Comment: Well, there are two separate questions: targeting Kindle Fire Night Mode, and targeting K4iOS. Their use cases overlap, but they're separate things. I seem to have the K4iOS thing figured out though, as noted in my MobileRead posts: "target K4iOS" is actually wrong, I want to target non-e-ink. Funny that @HonzaHejzl couldn't get his queries to work...maybe I'll post mine on his question. Overall, thank you :)

K4iOS Media Query


If $Y_1, \ldots, Y_n$ are iid from $Pois(\lambda)$, how to show that the sample mean is a complete sufficient statistic?

Question: If $Y_1, \ldots, Y_n$ are iid from $Pois(\lambda)$, then I know that the sum of iid poisson random variables has the $Pois(n\lambda)$ distribution. However, I am trying to show that $\bar{Y}$ is a complete sufficient statistic. This can be done by showing that $E[h(\bar{Y})]=0$ for all $\lambda$. But, without knowing the distribution of $\bar{Y}$, how is it possible to show this? Thanks!
Comment: You first state you *do* know the distribution of $Y_1+\cdots+Y_n = n\bar Y$, so how could you *not* know the distribution of $\bar Y$?  BTW, something seems to be missing after "this can be done by," because the criterion you give is incomplete.
Comment: "scaling a poisson results in a binomial" that's for large n
Comment: Hi, thanks for your response. I know that the distribution of the mean is $\frac{1}{n}Pois(n\lambda)$, but scaling a poisson results in a binomial, is this what you meant? Thanks!
Comment: Your definition of completeness is a bit off.  Completeness of a statistic $T$ means that $\text{E}[g(T)] = 0$ implies that $g(T) = 0$ with probability one.
Comment: "This can be done by showing that $\operatorname E[h(\overline Y)]=0$ for all $\lambda$." That makes no sense without saying what $h$ is. I presume you meant "This can be done by showing that $\operatorname E[h(\overline Y)]=0$ for all $\lambda$ ONLY IF $h$ is the identically zero function."
Answer: To show that a statistic $T = \sum_i y_i$ is sufficient you can appeal to the factorization theorem, which says that $T$ is sufficient if and only if the likelihood can be written in the form $L_\lambda(y) = h(y) g_\lambda(T)$ for nonnegative functions $h$ and $g$.  In the Poisson case the likelihood takes the form
$$
L_\lambda(y) = \frac{1}{\prod_{i} y_i!} e^{-n \lambda} \lambda^{\sum_i y_i}
$$
and so the condition is satisfied with $h(y) = \left ( \prod_i y_i! \right )^{-1}$ and $g_\lambda(T) = e^{-n \lambda} \lambda^{\sum_i y_i}$.  Now if we're sampling from an exponential family then $T$ will be complete if the natural parameter space contains an open set (this is a convenient property of exponential families that allows us to avoid direct reference to the somewhat unusual definition of completeness).  The Poisson mass function can be written
$$
f_\lambda(y) = \frac{e^{-\lambda}}{y!} \exp \left [ y \log(\lambda) \right ]
$$
and so it is in fact an exponential family with natural parameter space $\{ \log(\lambda) : \lambda > 0 \} = \mathbb{R}$.  Since this space contains an open set (it is an open set) $T$ is also complete.


Better than VirtualBox

Question: I installed Ubuntu with a VirtualBox on my mac. But the more I use Ubuntu, the more I install package, the more it becomes very slow to launch on my VirtualBox. By the way, it makes slow all the apps running on my mac. Is there any other virtual environment more efficient than VirtualBox ?
Comment: Any performance issues with virtualization are generally caused by either having insufficient host hardware, or having a very hardware-intensive host. The virtual environment is rarely an issue.
Comment: No. I mean that the physical machine you are running Ubuntu on(your mac) does not have enough resources for a fast boot. You may want to upgrade that machine.
Comment: could you precise what you mean by insufficient host hardware ? Do you mean I must increase the disk space allowed to Ubuntu ?
Comment: Adding as answer...
Comment: I hate to be a nitpicker, but this is more of a **mac-related question**, since the host machine is mac. Anyway, you could try to install ubuntu as dual boot? I'm not aware of the process, but see here: http://lifehacker.com/5531037/how-to-triple+boot-your-mac-with-windows-and-linux-no-boot-camp-required -- http://www.omgubuntu.co.uk/2011/10/dual-boot-os-ubuntu
Answer: Before going into detail about Virtualbox, VMware or any other virtualization technology there are a couple of things that need to be checked. When starting to use virtualization one must have the correct hardware or better yet, a more capable and optimized hardware to help with virtualization:

CPU and Motherboard technologies like AMD's AMD-V and Intel's VT-X provide a huge leap in performance over hardware that does not have it, specially in the Input/Output.
Assuming that we have the CPU/Mobo cover, we then look into the amount of memory available. Virtualization requires in most cases that we assign real amounts of memory to a virtualized guest. The more memory assign to the guest, the less memory we have available for the host. So this memory sharing game can improve performance for the guest while lowering for the host or it can be enough to have both running perfectly.
After this, we then have hard disk performance. Is not the same to use a 5400RPM HDD than a 7200RPM HDD than a SSD. The amount of reads and writes the virtualization will do, plus the amount the host will be doing can make the HDD the bottleneck of the problem if the HDD is very slow.
Lastly in the hardware part we have the video and sound card. If the host has an Intel card that can only deliver OpenGL 1.x, we can't expect that the guest will offer OpenGL 4.x. The guest will work with whatever is available from the real graphics card (assuming the virtualization technology and OS allow direct access to the video card). Same goes for the sound.

So taking into consideration the CPU, Motherboard, RAM, HDD and Video/Audio we can play with it and have a virtualized hardware ready host.
If all requirements are met, then we can proceed to see what host OS to use. Some OSes are better at working with virtualization technology than others. Some are even better on specific hardware. The mileage depends on the hardware and OS involved.
With that in mind, in the software department, the guest OS also changes the game. Depending on the OS used in the guest, and the type of OS used in the host, it can have a positive or negative effect on overall performance.
So as you can see there are a lot of variables. Along with everything mentioned above, we also end with the question of:

How will you use the virtualized environment? For what purpose or need?
What virtualization technology is better for me? Virtualbox, VMWare, Parallels (since you mention a MAC), KVM, QEMU, etc...
What version to use and what does each version offer?
Does it repair a bug that affected me?, does it increase or decrease performance?
Will I be using it with a network interface, creating a virtual LAN, accessing a remote PC or offering a remote connection?
What Host is better with a specific virtualization software and what Guest is better for it?

So here are many questions that one must ask before going into the virtualization world.
My suggestions and also to add to your question would be to add the type of hardware you have and what type of use you will be doing with Virtualbox.
Answer: Any performance issues with virtualization are generally caused by either having insufficient host hardware, or having a very hardware-intensive host. The virtual environment is rarely an issue. This means that that the physical machine you are running Ubuntu on(your mac) does not have enough resources for a fast boot. You may want to upgrade that machine.
However, certain settings can improve performance. Make sure that under the VM's options, AMD-V/VT-x is enabled, as well as nested paging. If they cause issues, disable nested paging first, then the AMD-V if the problem is not resolved. Also, make sure you have at least 768MB dedicated to Ubuntu. At least 1.5GB is recommended i you have enough RAM in your system. of course, a faster CPU will make booting and running faster.
Another note: Running memory tests in VirtualBox is useless. If there is indeed an issue with your memory, the host would probably crash, not the guest.

Better than VirtualBox


How to integrate Stripe Connect with Node.js?

Question: So im at the part where you sign in your Stripe account and it redirects you to my website once done.
I dont know what to do next and the documentation is difficult to comprehend because i dont have any expierence in node.js
I just need some guidance in what to do.
Comment: The next part is to use the `authorization_code`: https://stripe.com/docs/connect/oauth#token-request
Answer:

After Clicking on 'Authorize' button, at your redirected URI it will give you Authorization code.
After getting Authorization code you should make post request to get details of connected user account.

It will give you json like this
{
   "token_type": "bearer",
   "stripe_publishable_key": PUBLISHABLE_KEY,
   "scope": "read_write",
   "livemode": false,
   "stripe_user_id": USER_ID,
   "refresh_token": REFRESH_TOKEN,
   "access_token": ACCESS_TOKEN
}

Now by using USER_ID and ACCESS_TOKEN and REFRESH_TOKEN, you can make charges on connected user account.
Answer: 1 Use https://github.com/gtramontina/stripe-angular on Client
2.Use https://github.com/stripe/stripe-node on server


Condition format in Excel base on cell value

Question: How to format a range base on previous column value. Ex: A2=33% (is Best Before Date); B2 is 33%, C2 is 31% (to be format in red due to less than A2=33%)
Comment: so you want both B2 and C2 to be formatted red?
Answer: Select the range that you want the conditional formatting applied to and ensure the top left most cell is the active cell of the selection.  It will appear to have a white/bright background compared to the rest of the selection.

With the range still selected, go to the ribbon, home tab, Styles sections and left click on Conditional formatting.  From the menu that appears, select new rule:

From the window that appears, select the entry at the bottom of the list "Use a formula to determine which cells to format".

In the formula box below, enter the following formula:
<code>=$A1>B2
</code>

Note the $ before the A.  This will keep the A from changing to B and C and so on in the background as the conditional formatting rule is applied.  B2 will update across the selected range and corresponds to the active cell picked when selecting the conditional formatting rage at the start.
Click the format button in the lower right side, and pick all the formatting you want applied when the result of the formula you entered is TRUE.

In this example I am colouring the font RED

And the end result is as follows:


Whats problem with my model faces

Question: Whats problem with my model faces. I have tried all Normal faces, recalculated inside and some time outside yet to not get success. My file is attached and a screen shot i hope there is addon that can make everything clear
Answer: In places, where you see darker shading, inner faces are to close to outer faces. Try to get better geometry (similar to the other side of your object, with smooth curve in upper corners) and then use solidify modifier, but if you don't want to repeat this process, you can just set Transformation Orientation to Normal and pull inner faces in problematic areas a little more inside or outer a little more outside.
Answer: You have some faces double each other in the same position, which causes the ugly Z-fighting effect. Delete one half of your mesh (I noticed that the model isn't symmetrcal). Remove doubles with W-->Remove Doubles and increase the Merge Distance to the value above 0.01.

Align the edge scaling it by 0 (S, Y, 0).

Add a Mirror Modifier and apply it.

Apply transformations (Ctrl+A-->Apply Location, Rotation, and Scale). Add Solidify Modifier, increase the Thickness value, check the Even Thickness checkbox and play with the Offset value to get rid of the ugly results.

Here's the final, clean result.
Answer: I found the good solution maybe ever body like it. After doing flip normal, recalculation inside and outside. Try this
select the model in edit model
press N to open the panel
go down in shading section ---
just check mark ------------- "Backface Culling"
.!!!!!!!!!!!!!!! thats it...............
Comment: But do you understand why this worked?  Your faces are too close together, as Mzidare says in his answer, and your graphics card's depth buffer does not have precision to tell them apart.  Flipping this checkbox may not have an effect on a final render, it's essentially sweeping the problem under the rug by not rendering faces that point away from the camera.

Whats problem with my model faces


Containing a nuclear explosion in space

Question: Suppose we have a nuke as strong as tsar bomb in space. can we somehow contain the explosion? the same way we contain plasma in fusion reactors.
Comment: Neither the gammas nor the neutrons, the primary energy output, are 'containable' like a plasma.
Comment: Note, that the explosion of a nuclear weapon in the vacuum of space would look _much_ smaller than if the same weapon were exploded in Earth's atmosphere. The amount of energy released would be the same, but in vacuum, almost all of that energy would be carried away by radiation (i.e., by Jon Custer's "gammas and neutrons.") In atmosphere, the surrounding air absorbs, and is heated by that radiation. The "blast" and the "fireball," which do most of the damage on the ground, are due to the sudden expansion of something approaching a billion cubic meters of super-heated air.
Answer: The fusion reactors currently under development ignite only a microscopically small sample of fuel at a time. The energy release of the tsar bomba was unimaginably bigger (50 megatons TNT equivalent) and despite being detonated 4 km off the ground, its shock wave and thermal blast scoured the ground right down to bedrock and glazed it.
Wikipedia has a good entry about this bomb and after reading it you can safely conclude that there is nothing within human capacity that could be invented to contain a blast of that size in space- or on the ground.

Containing a nuclear explosion in space


M4 screw and nut for 3D printing?

Question: Does anyone know where I can get a free 3D design (STEP or STL) of an M4 Screw and nut? I have found only an M3 on Thingiverse: M3 Bolt by Kaleta.
Answer: You can get a model for nearly everything McMaster-Carr sells from their website.
M4 Hex Head Screw - https://www.mcmaster.com/#91280a140/=15dmpx8
M4 Nut - https://www.mcmaster.com/#90592a090/=15dmqjy
The options to download models are to the right of the drawings.

NOTE: the site does prohibit use of these models for direct printing.

You shall not use a CAD model to engage in 3D printing or other
  fabrication of the object depicted in the CAD model for any other
  purpose. You shall not otherwise redistribute or make available the
  CAD models (or any design drawings or prototypes that incorporate
  them) to any third parties, including third parties in the business of
  selling products similar to the products sold by us.
Answer: The thing you linked to describes itself as being generated from a parametric model:
http://www.thingiverse.com/apps/customizer/run?thing_id=193647
To generate any different bolt or nut, you will need to identify the correct dimensions for not only the thread (where hints exist in the customiser), but also for the hex head. These are obviously less critical to define than the thread.
Once you have generated a custom model, you can share it and answer your own question.
Comment: Actually, I *think* that the  owner of the linked item created the matching customizer page.  You need to start w/ a SCAD dwg before you can create a Customizer, so far as I know.  PLease add info correcting me if I got this wrong.
Answer: A 3D printer does not have the necessary resolution to create a functioning screw thread. I suggest you print the hole (for the nut) and the shaft (for the screw) in oversize and use a tap and die set to make the threads.
You must print them out of PA12 nylon obviously. Due to the size, warping will not be an issue.
Comment: Maybe you should add that this is true for smaller thread sizes, I've printed larger threads that worked fine. SLS can even have a higher resolution.
Comment: I've printed an M36 once, so yes. But as long as you can cut the thread, you should cut it, not print it.
Answer: You could also apply a scaling factor in your
slicer to make a downloaded object larger or smaller. An M3 model scaled at +1.333 would produce a working thread with a nominal 4 mm OD.  As noted in the comments below, a different scale factor might be needed in the axial direction if exactly matching the pitch of an M4 thread is required.
Comment: That's not true. You'll want to scale it with a factor of 1.33333 along the thickness of the screw, but a factor of 1.4 along the length of the screw. Please study this chart and fix your answer: https://www.carrlane.com/engineering-resources/technical-information/design-standards-and-engineering-information/inch-and-metric-thread-standards

The threads of an M4 screw are 0.7mm apart. The threads of an M3 screw are 0.5mm apart. The threads of an M8 screw are 1.25mm apart. So an M3 to M4 scales 4/3th along it's width and 7/5th along it's length.
Comment: It's true that the thread resulting from scaling all three axes at 1.333 would not exactly match the pitch of a standard M4 thread. It would, however, produce a working set of threads as long as both male and female components were scaled at the same factor.  If attempting to make a true M4 part to mate up with a standard M4 component it would be necessary to apply a different scaling factor in the axial direction to duplicate the standard M4 pitch.

M4 screw and nut for 3D printing?


Attempting to restore iPhone 4 gives error -1

Question: I just bought a iPhone 4 off Craigslist, and it's stuck on the iTunes screen. Whenever I try to restore it, towards the end of the process, an icon pops up and says error -1. What does this mean?
Answer: Unfortunately, according to Apple, error -1 indicates a hardware issue. Specifically:

This may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.


Accepted into university for MS in CS but rejected by professor for research

Question: I got accepted into a top 10 school for CS (Computer Science) but I was rejected by a professor with whom I wanted to work with. No feedback after resume submission, just "I found another student." If I can't find a professor that wants to work with me in something I'm interested in at a MS level, should I even attend? Or should I just try to write my own paper (sole author) and see what happens? I want the research experience for PhD applications in the future.
Answer: If you can get a TA or otherwise afford to go, you might still consider it. You are likely to take around six classes your first year. You might meet several professors that you want to work with and who want to work with you. Plenty of students come to grad school without an advisor lined up and manage to find one during their first year.
It's unlikely but not impossible that you will work by yourself to complete a publishable paper in CS. Even if your work is purely theoretical, you are likely to need guidance at the very least and other resources in general.
Comment: Also, for your future PhD application, a letter from someone who observed your MS research is going to be required. It's going to be hard to explain if that doesn't come from your thesis advisor.


Simple Cucumber Test is not running on Sample Android Project

Question: I am trying to run the simple cucumber test cases on Android Project, but it shows 0 test passed ,means it does not run test cases.
I have follow the project from this Github link :
https://github.com/emmasuzuki/CucumberEspressoDemo which works successfully on my machine.
But when I implement the same steps and files in my new Android Studio project then it says 0 Test Passed. I have attached my Android project github link. Could you please tell me the reason? Thank you for your consideration.
My GitHub Project URL which I am facing issue 0 Test Passed issue : https://github.com/Devsank/AndroidUiTesting
Answer: You should have your instrumentation class under your test application package: com.demouitesting.test.Instrumentation. But your test instrumentation class was in com.demouitesting.Instrumentation.


How do I change http cache control options when a page contains personalized components?

Question: I am using Sitecore 9.3, SXA. I want to change the HTTP Header cache-control to no-store when a page or item on that page has been personalized. How do I go about doing this? Any articles/blogs or advice would be helpful.
Answer: I do not believe that caching based on personalized data is built in by default but we did something like this on an earlier version of sitecore, not using sxa. Based on the caching documentation, I am assuming you can do the same thing in 9.3. Here is a nice blog post that should give you an idea of how to achieve what you are looking for.


Authentication using Facebook iOS SDK with Safari throws API Error code: 100

Question: Testing my app on the Simulator requires Facebook authentication.
Since Facebook app is not installed on the simulator, Facebook uses Safari for authentication.
Apparently something changed in Facebook Authentication flow, which causes to users who already authenticated my app in the past to be redirected to an error page saying:

API Error Code: 100
  API Error Description: Invalid parameter
  Error Message: Requires valid redirect URI.

Everything worked fine before.
Temporary Solution:
Apparently it happens in Android as well, it has to do with the new Facebook authentication dialog.
As explained here: Facebook Android sdk throwing missing redirect uri on Authetication
Go to your Facebook app settings page --> Advanced page --> Migrations --> Disable "Enhanced Auth Dialog"
Comment: The issue was reported on Facebook bugs: https://developers.facebook.com/bugs/202310766508770
Answer: Use the Facebook API. Ray Wenderlich has a good tutorial


School Search Laws

Question: Consider a situation in a US public school where a bystander/observer of a fight records that fight with their cell phone. If the fight was interrupted by a person of authority, is that person of authority allowed to search everybody's phones and delete the video? Also, are the bystanders subject to punishment?
Comment: Call your local ACLU office and tell them the story of the searches and the deleted videos: https://www.aclu.org/about/affiliates
Comment: A good way to prevent that is to keep a password on the phone. And don't give anyone the password including the school.
Answer: Assuming US public schools, schools may be able to confiscate cell phones, if they prohibit cell phone use during instruction hours (a common rule). The 4th Amendment may prohibit them from searching the phone: nothing authorizes a school to delete files from a phone. Whether they may search would primarily have to do with urgent safety concerns. Schools have broader authority over students because they are acting in loco parentis, but that is distinct from carte blanche (especially since the courts now recognise that school attendance is mandated by law, thus intrusions on constitutional rights receive narrower scrutiny). Warrantless searches are allowed, based on a "balancing" of the item searched, the infraction, and the quality of the suspicion (New Jersey v. T.L.O).
One of the problems is that there is a certain baseline of expectation of privacy against which searches are to be judged, but, frankly, teen-agers have highly variable privacy expectations (Safford v. Redding). Courts recognize a reasonable expectation of privacy in terms of content on cell phones (Ohio v. Smith). This article is about the question of student cell phone privacy rights.
The general pattern, I have to say, is to start with the assumption that the school has a particular right, so they do something, and the student sues until the state or US Supreme Court articulates principle recognizing the student's constitutional right, at which point districts change their behavior. Based on existing case law, I would guess that this would be found to be an unconstitutional search, and is unlikely to actually happen (unless the district doesn't effectively communicate the law to staff). Deleting content would be beyond the pale.
Comment: What about the people that got in serious trouble? Is there anything against that.
Comment: What specifically was the punishment for?
Comment: Honestly I'm not exactly sure what it was for. My guess is something along the lines of not breaking up the fight. But this school really likes to make up reasons why something is bad. The punishment was basically a more intense ISS.
Comment: It's unlikely that there's any legal recourse for such punishment, unless it's actually against district policy (esp. if they have a "due process" requirement). You may have the right to a grievance hearing.
Comment: "Bystanders" are in some situations indistinguishable from "instigators" and "participants". Especially if you knew about a fight in advance or encouraged it once you did know, that's enough in its own to be disciplined for.

School Search Laws


MySql Update Trigger with Subquery (#1093 Error)

Question: Good evening!
I have a trigger to update a record from my table 'comment' named vote. The trigger will be fired when I update a value named 'vote' in my 'vote' table. For the trigger query, I need to sum up all 'vote' records in table 'vote' and then update in 'comment' the row with the 'comment.id = vote.pid' while 'vote.uid = user.id'.
Trigger Function:
<code>DROP TRIGGER IF EXISTS `CommentVoteOnUpdate`;CREATE DEFINER=`root`@`localhost` TRIGGER `CommentVoteOnUpdate` AFTER UPDATE ON `vote` FOR EACH ROW UPDATE comment
SET comment.vote = (
    SELECT SUM(vote.vote)
    FROM vote, comment, user
    WHERE comment.id = pid AND uid = user.id
)
WHERE comment.id = new.pid
</code>
When I want to update a value in the 'vote' table , then I got the following error message:
"Table 'comment' is specified twice, both as a target for 'UPDATE' and as a separate source for data"
Did anyone of you got a solution for my problem?
Answer: You need to give your comment table (In the subquery) an alias. See this question for more info.


Review claims reference was omitted, but it was not

Question: In a review to a manuscript I wrote one of the reviewers claimed in strong words that two important references were omitted. In fact, both references were cited in the text. I suspect the reviewer is among the authors of these references, since I recommended one of them as a reviewer during submission. The manuscript was rejected and I do not plan to resubmit, still I am contemplating if I should respond to this presumptive mistake by the reviewer. The reason is that the perceived omission likely affects the reviewers opinion of me as an author in a negative way. I think that there is a non-negligible chance that the same reviewer may also review future work. Should I accept this and move on or should I ask the editor to forward to the reviewer a statement that the references were not omitted?
Comment: then before second guessing the reviewer intentions, triple guess your understanding of the work.
And no, formulating a citation as "[33] previously investigated the topic" although common, it is not useful and it may be the reason why the reviewer didn't found the reference.

Disclaimer: I am playing Devil's advocate role, we know only one side (factual and emotional) of the story, so I am playing my role being biased toward the other side of the story we don't know.
Comment: Are you sure you properly cited the 2 items you mention? maybe you have read them wrong until today and your citation were not proper, such as you state "fact A [33]" while the reference [33] in  reality states "fact Ab000" and not "fact Ab005" as your text is presenting.
Read carefully what the reviewer wrote, if you cannot understand it without resorting to guessing who the reviewer is, in your reply to the editor (if you feel like).

What were the reasons given for rejection?
Comment: @EarlGrey The reviewer claimed that the reference were omitted as relevant prior work in the literature survey. In fact, they are cited exactly there. One reference is also cited for comparison in the results section.
Answer:
The manuscript was rejected and I do not plan to resubmit

Then do not respond.

Should I accept this and move on

Yes.  Reviewers make mistakes.  That's normal.
Most people who think they know who the reviewer was are wrong.
Answer: The editor rejected your paper, not the reviewer. You can quickly write to the editor that the reviewer may have overlooked your work, as seen in the not capturing/fully reading the citations you gave.
However, it is unlikely that the absence of them was so relevant to the decision.
"the perceived omission likely affects the reviewers opinion of me as an author in a negative way": it is not the opinion about you, it is about your work. If you take things so personally you are bound to a lot of insatisfaction in your life (academic and not). This apply to how you perceive yourself, as well as you perceive the others: stop assuming or guessing a reviewer identity and the "hidden" motives behind the request to cite certain works.


Any 3D CAD programs for Ubuntu?

Question: I need a good CAD program for mechanical engineering.
Are there any good 3D CAD programs available for Ubuntu like Autocad?
Answer: FreeCAD
If you haven't tried FreeCAD, you're missing out.  It's a fully parametric 3-D modelling package that can be extended with Python. The interface is reasonably user-friendly, and feels like a "younger" version of Solidworks.
Installation: Just install freecad package , or newer version using PPA. Also you have an AppImage.
Answer: OpenSCAD

OpenSCAD is a software for creating solid 3D CAD models. It is free
  software and available for Linux/UNIX, Windows and Mac OS X. Unlike
  most free software for creating 3D models (such as Blender) it does
  not focus on the artistic aspects of 3D modelling but instead on the
  CAD aspects. Thus it might be the application you are looking for when
  you are planning to create 3D models of machine parts but pretty sure
  is not what you are looking for when you are more interested in
  creating computer-animated movies.

To install OpenSCAD, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:
sudo add-apt-repository ppa:openscad/releases
sudo apt update
sudo apt install openscad

For more CAD apps see 8 Best CAD Apps for Linux
Comment: Ubuntu 14.04 just `sudo apt-get install openscad`
Comment: It looks really promising, since I am a programmer and it is for programmers. But wow it has some strange bugs! All the text is unreadable due to what looks like unicode bugs
Answer: For 3D use Blender. I think it is the only real alternative. BUT you will have to do a lot of work, because it is focused on animation. Blender is extremely wide, you will have to find what you need, what is not always easy for beginners. For example, there are plugin tools to improve exact 3D modelling, you might customize views etc.
For 2D use DraftSight (not free software). It is a clon of AutoCAD, which means that you don't have to get familiar with new commands, workflow etc. For individuals it is free, Information about your behavior will be send regularly to DraftSight. Go to their Homepage and get the actual .deb file. DraftSight's disadvantage is, that there is no 3D.
Comment: A free and open source alternative to DraftSight is [**LibreCAD**](https://librecad.org/).
Comment: DraftSight no longer available for Linux.
Answer: BRL-CAD
Maybe BRL-CAD would suit:

BRL-CAD is a powerful cross-platform Open Source combinatorial Constructive Solid Geometry (CSG) solid modeling system that includes interactive 3D solid geometry editing, high-performance ray-tracing support for rendering and geometric analysis, network-distributed framebuffer support, image and signal-processing tools, path-tracing and photon mapping support for realistic image synthesis, a system performance analysis benchmark suite, an embedded scripting interface, and libraries for robust high-performance geometric representation and analysis.
Answer: There is no free 3D solid modelling CAD software worth using.
FreeCAD is the only one coming close, but "close" in a relative sense... It does not do fillets well, boolean operators do not work, you can't even create sketch planes!
So unless you want trivially simple, blocky models for free then you are out of luck.
Comment: While FreeCAD suffers from having very few developers, bugs (many due to the third-party geometric modeling kernel) and lack of features, it can create sketches in an plane you need, and it can do a lot more than "trivially simple, blocky models". One just has to visit the official forum's "Users showcase" to confirm this.
Answer: Sometimes you have to pay for real software. Varicad is a very good linux compatible system and the price is very decent indeed. I have tested it against Solidworks and it performs just fine. It does not have built in FEA but there are many such programs for Linux. Try the free trial and see.
Answer: EQUINOX-3D has advanced freeform and numeric CAD, photorealistic / physically based rendering, animation, and tons of other features.
We use it heavily and exclusively for advanced CAD modeling / 3D printing very complex, organic shapes, like robot parts.
Here's the list of the latest features, movies, etc.
All images and movies on the Web site were a 100% created with EQUINOX-3D
Answer: Try Nanocad with the Wine emulator. Nanocad is the most similar software to Autocad I have found; I haven't tried it with Ubuntu but you can take a look at Wine's page for more information on how to run the Windows version on Linux.
Answer: You must be looking for something like M4 suite (proprietary software). I don't know how good it is, never used it, but it's the only specialized CAD I found in Linux.
Answer: use SIEMENS PLM NX. Although its not free and there is no ubuntu inbuilt support but u can use it via adding some libraries and applying some modifications to your os as it is supported in redhat and suse linux
Comment: Could you please expand on "*adding some libraries and applying some modifications*"? Otherwise this answer looks like a low-quality post.

Any 3D CAD programs for Ubuntu?


Can players in a Minecraft Realm play at different difficulty levels?

Question: I purchased a Minecraft Realm and play regularly with my two sons. One of them is really freaked out by hostile mobs and the other really wants to fight them and collect what they drop. Can I set the frightened child to Peaceful and the other child to Easy? If so, what is the command? I have only had luck changing the difficulty level for everybody. Thank you!
Answer: Difficulty is set for the entire world, not individual players.
You might want to set your youngest's "game mode" to "creative", meaning he will be invulnerable to hostile mobs (also, they will completely ignore him). You'd use the command /gamemode creative <player-name>.
I have the same issue, and I just had to make a rule that when they are playing together, the difficulty must be set to "peaceful".
Answer: While the overall difficulty of the game is set on a per-world basis, you could just go and automatically remove all hostile mobs from the vicinity of your younger son's character using command blocks.
To do so, set yourself to creative mode and give yourself a command block (/give @p minecraft:command_block). You'll also need a scoreboard objective (you could do it without one, but it's cleaner with one):
scoreboard objectives add hostileMob dummy

Set up a 20Hz./fill clock close to the world's spawnpoint (so that they are always loaded), preferably in a bedrock cage as to be inaccessible in survival mode.
Place the following commands:
/scoreboard players set @e[type=Creeper] hostileMob 1
/scoreboard players set @e[type=Zombie] hostileMob 1
/scoreboard players set @e[type=Skeleton] hostileMob 1
...
/execute @p[name=<NAME>] ~ ~ ~ @e[score_hostileMob_min=1,r=<R>] ~ -10 ~

The ... represents additional scoreboard commands. You'll need one for every type of hostile mob from this list. Replace <NAME> by your younger son's Minecraft name. This will teleport the mobs into the void if they are within <R> blocks (I suggest something like 20) of that character.
Note that your son will still have to deal with the hunger bar depleting (unlike true peaceful mode).
Comment: Is there some reason why you have to say `@p[name=NAME]` instead of just NAME?
Answer: I'm not aware of a command that can change the difficulty for individual players, but going on creative for your youngest son is a good idea. If they are very frightened, try playing mini-games as well as survival, it can be fun for children! :)


Tag synonym: polar-coordinates | spherical-coordinates

Question: I feel the tags polar-coordinates and spherical-coordinates should be merged to general $n$-dimensional polar coordinates, since polar-coordinates is used for the general anyways.
Comment: Huh? I apparently never got the memo that "polar coordinates" is "used for general anyways". I always reserve that term for two dimensions.
Answer: I am not convinced. Those are separate topics in calculus. For a typical calculus student asking questions on either of these topics, "$n$-dimensional polar coordinates" could as well be in Greek. Besides, "$n$-dimensional polar coordinates" does not fit the 25 character limit.
If the tags are indeed merged, I'd rather merge all them into coordinate-systems, which is short and understandable.
Comment: As to the character limit: how about n-dim-polar-coordinates; or simply leave polar-coordinates and adjust the description to include any dimension (especially spherical)
Comment: Could be a language thing. Where I come from, Polarkoordinaten is the common term. Very rarely, in dimension $3$, some people speak (write) of sphärische Polarkoordinaten, I don't remember having seen that used in dimensions $> 3$, though. From that perspective, I don't understand the singling out of the two-dimensional case in the English nomenclature. But meh.


Can I automate crafting in Minecraft Java edition?

Question: I made a few farms in my survival world to get the ingredients for cake. I made an automatic chicken farm for the eggs, a cow farm for the milk, and an automatic sugar can farm for the sugar can and sugar. They all go to a centralized hopper. Now I want to know how to automate the crafting process. I tried putting a crafting table underneath the hopper, so the ingredients will craft and then get sent to the hopper underneath, which will get delivered to a chest. However, that didn't work, because the ingredients got sent in and random times, meaning sometimes the sugar cane went in first, sometimes the sugar went first, etc. Is there a way I can control the flow of ingredients to automate the crafting process?
Answer: Autocrafting is a much requested feature, but not one that currently exists in Vanilla Minecraft. Many mods add it, but all of them in their own way, so there is no general answer for those either.
Some people, like members of the Scicraft server, have automated crafting as far as possible, by building a redstone machine that puts a shulker box full of resources in one spot, letting their computer use a click macro to quickly take items out of it, craft them and put the result back in, which the machine detects, crushes the shulker box and places a new one, repeating the cycle.
One tutorial for such a machine is here (disclaimer: I have not watched that video myself, I just know that type of machine and that Ilmango has used them in the past).
A lot of items that are usually crafted can also be automated in unusual ways. For example bowls drop from turtles (which can be bred by holding one button) that get struck by lightning, endermen can hold melons and drop them as full blocks when killed, fishing and mob drops can give you lots of different items that would usually be crafted, including leads from wandering traders and so on.
In theory you could even farm raids or patrols, then convert the pillager banners to banners with one less layer on them using cauldrons by dropping the banners onto you while holding the "use" button and looking at a cauldron, which gets occasionally refilled by rain, then repeat the process more times to remove more layers. That would be a way to farm a theoretically infinite amount of white banners (very slowly) without needing a click macro.
But there is no such method for cake.
Comment: Perhaps look into updating this answer as a recent snapshot appears to have added a new feature https://feedback.minecraft.net/hc/en-us/community/posts/20459106029709-Let-s-talk-about-the-Crafter-#:~:text=Minecraft%20Update%201.21%20was%20announced,paves%20the%20way%20for%20autocrafting!
Answer: Automated crafting is currently not possible in Minecraft Java Edition. There are mods and data packs which add this functionality though.
Answer: You can now autocraft in the vanilla Minecraft 1.21 snapshot version. It is experimental right now, though.

Introducing the Crafter, a new block that, combined with a redstone signal paves the way for autocrafting!
Answer: RFTools Control allows for completely automated, redundant crafting using not only crafting table recipes but also crafting recipes for machines added by other mods.
By redundant I mean it will fetch and/or craft ingredients for all subcomponents of the current requested crafting result.  It's frankly OP, if you know how to program the processor to do it.


Schroedinger equation. Why Potential energy instead of Force?

Question: What is the reason Schroedinger equation is quoted in terms of potential energy instead of  force?
Comment: Related question: http://physics.stackexchange.com/q/45869/29216
Answer: Schrödinger's Wave Equation is an application of Hamiltonian Mechanics. Unlike Newtonian Mechanics, Hamiltonian Mechanics relies on knowing about the things that contribute to the energy of the system. If you know the things which contribute to the energy of a system, then you can determine things like forces, accelerations, and positions. (All through the miracle that is calculus!) These forces and accelerations can also change over time, and we can better understand how they evolve over time using Lagrangian and Hamiltonian Mechanics. Even better, with Lagrangian and Hamilitonian Mechanics, we don't have to know how these forces change over time, because we can figure it out with math!
This approach makes life easier, because we often want to know what the energy of a particle is. This is especially true of small particles because a lot of their behaviors depend on the particle's energy. The ability to simply set a term to 0 allows us to solve for simple situations, (such as a "particle in a box" and "free particle" situations, where the potential energy is very often 0) which then let us solve more complicated situations later using various techniques, like Perturbation Theory.
This approach is super awesome because humans are get pretty good at identifying the various things that contribute energy to a system. Forces in a system, however, can be tricky, and it can be hard to guess which forces happen when.
To concisely answer your question, the Schrödinger Wave Equation has values for energies because of Hamiliton (and Legrange), and it's super useful.
Answer: A less theoretical reason to consider is that the schrodinger equation usually describes charged particles. It's in general easier to create and measure potential energies (e.g voltages) than forces. Additionally, solving the schrodinger equation gives you energy information, which is observable as an emission spectrum.


Buzzing sounds from dimmable floor lamp

Question: I have a floor lamp which is dimmable and has a box (ballast?) connected and controlling the brightness. It's making a loud buzzing sound when turned on. What can I do to fix it?
Comment: Did it ever work without buzzing? What kind of bulb are you using? If an LED, some dimmers are not designed to work properly with those. If a different bulb doesn't help, try contacting the manufacturer.
Comment: i've de-buzzed a floor-standing torchiere lamp that was using a cheap LED halogen-replacement bulb by adding a 2nd cheap bulb in parallel in reverse polarity. I think some such little bulbs don't have room for a full bridge rectifier, so they only conduct on a positive half-cycle, which annoys the triac's snubber network or doesn't meet it's clamping current.
Answer: Has it always buzzed?  First off, make sure you're using the correct bulbs as stated on the sticker that should be somewhere around the sockets. If using acceptable LED bulbs, make sure they are dimmable. Try plugging it into a different outlet; you might be getting some interference from other devices. Last but not least, your dimmer switch it starting to fail.

Buzzing sounds from dimmable floor lamp


Adding labels in Google Earth Pro?

Question: I am preparing the map of Nepal with 75 districts using the KMZ file downloaded from global admin. I opened the KMZ file (NPL_admin3.kmz) in google earth pro. I produced the map, and also worked successfully with coloring the districts. But I could not put the name of the 75 districts in the map. In other GIS tools such as DIVA or Quantum, when we 'add label' under the 'layer' menu bar, we get the name associated to the boundary. But in google earth pro, I have been facing difficulty. Can anyone please help me?
Comment: If possible have someone create centroids for the polygons you wish to label (or manually add a pin to each poly.) Place all the points in one folder. Then format the points folder and on the icon dialog pick No Icon. The text will not scale as a true label would.
Comment: A bypass route of displaying 'Label' in Google Earth using Quantum GIS(QGIS) is possible.
Comment: Neither of these worked for me.
Comment: Key difference in Sandipan's answer is that he is working with points, whereas the person who is asking is referring to districts (alluding to polygons). FYI
Answer: A bypass route of displaying 'Label' in Google Earth using Quantum GIS(QGIS) is possible.
At first import the .kml file into QGIS & save it as .kml data during saving procedure mention 'Name' of the field you want to display as label from 'NameField' under 'Datasource Options'....

Answer: Try this. Rename your kmz to zip. Open the zip and rename the kml to txt (or just use open with).
With your kml open in notepad or some other text editor look for the part of the html that says "LabelStyle" and change the "scale" number (Mine said 0 and I changed it to 0.666667) delete the entry for anything else (mine had color set to a string of 0's). Save the edited text file and rename back to kml. Save the modified zip file and rename to kmz. This worked for me... some variation will likely work for you, but dynamic labels are what they are. I just let it label with the field it had already defaulted to... which in my case was a useful field... but you might need to modify something else in the html in your case.
Here is the unlabeled points

Made a copy of the kmz and renamed to zip

Renamed the kml in the zip to txt

Opened the text file and did a find for "LabelStyle"

Deleted the "color" text and changed the "scale" value to 0.666667

Saving and naming things back the way they were

rename your zip to kmz and open in GE
Comment: oh...copy your kmz first... do this on a copy... I don't want to be contributing to your grief
Comment: This sounds like a good answer, but I'd be interested in a few screenshots to show the process and the result.  Any chance you could edit your answer to include some?
Answer: I experienced this issue with a kml file produced from ArcGIS tool Layer to KML. In my case, the label "scale" and "opacity" properties were set to zero for all features. I figured out a way to solve the issue through the Google Earth interface. By right-clicking on the layer (or individual features) and going to "Properties", then clicking on the "Style, Color" tab, I was able to get my labels to show by increasing the scale to e.g. 1 and the opacity to e.g. 100%. This is basically what @Mike is doing programmatically by opening the KML as a zip/text file.

Adding labels in Google Earth Pro?


What type of security sensors should be used in a three bedroom house?

Question: I have just purchased a house and am hoping to install SimpliSafe throughout. I have 3 bedrooms: mine, my children's,  and my office. Would window sensors be best in all these rooms, and then motion detectors in the kitchen and living room? Are motion sensors a good idea if you expect not to be moving about at night? I was think door and window sensors instead on my 9 openings. Is this overkill? I was also thinking one window break sensor.
Comment: There is a very big difference between alarm system that are designed for protecting you while at home (and asleep) and one designed to protect your home while away.  Stay modes try to address this, but for home protection while at home, perimeter sensors are essential.   It is of very little use (at least where I live) to activate the alarm if someone is already inside your house.
Answer: Alarms like the SimpliSafe support "away" mode and "home" mode. In home mode the motion sensors are inactive.  The need for window sensors has a lot to do with how hard it is to reach the window from outside.
Answer: At the end of the day, motion sensors will be the most effective. However -

Try not to have the sensor point into possible "Billowing" curtains or directly outside.
Try not to get sensors to point at each other.
Consider pet friendly sensors inside the house.

The number of sensors installed would be a factor of the access possibilities from the three rooms; generally, you could detect movement over the two doors of adjoining rooms - if you are comfortable with that, you do not need to monitor inside those rooms.
I am a fan of window magnets (sensors), since they are relatively inexpensive; however, you will either need to bypass them or have the windows closed when activating the alarm. A work-around here is to put certain windows which you know you like to keep open on the same circuit and install a manual bypass toggle switch which will de-link those specific windows from the circuit (the location of the switch must be secret/hidden). That way you can still activate your bypassed alarm and include the closed windows onto the alarm.
One Glass Break Detector is only really effective in about a 5m radius, and they can be sensitive - but yes, they are definitely effective when setup correctly.
One thing to consider is to install an outside PIR which can alert you before someone gets into the house. This at least can be activated when you are in the house.
Also, if you have a trap-door, don't forget to put a window magnet there (if your house has tiles which can be easily lifted).
Comment: I feel like monitoring inside my daughters room and my office would be important, hence me thinking about going with window sensors there.

I feel like we would only need motion detectors when we are out of the house, because we'll more than likely set it off at night.

I think a 5m range is good for a glass break detector. We only have a 1200 ft2 house, so that's probably more than enough.


Video Stream Issue in Safari and Mobile Chrome

Question: I am having an issue with streaming a video in Safari for the iPad and Google Chrome browsers on Android devices. The application is working fine on my laptop that is using a Microsoft Edge Chromium browser. I have looked for examples to solve my problem, but I can't find anything specific to this. The issue is that the client will send a get request to retrieve a video file. I use gridfs-stream to retrieve that file from a MongoDb database, and then a pipe the file to the response object. This allows the user to view the video stream in a video-js player. This works with no issues on laptop and desktop devices with Microsoft Edge Chromium browsers, but it is failing in Safari and Mobile Chrome browsers. Here is my code:
I respond to the request and retrieve the file from the database, then pipe it to the response object in node:
app.get('/get-video', (req, res, next) => {
    let video = req.query.video;
    gfs.files.findOne({ filename: video }, (err, file) => {
        // Check if file ex
        if (!file || file.length === 0) {
          return res.status(404).json({
            err: 'No file exists'
          });
        }
        else {
            let readstream = gfs.createReadStream(file.filename);
            readstream.pipe(res);
        }
   });
});

As you can say, I find the file based on the video name in the get request, create a ReadStream, and stream the file to the response object. Here is the html code in which the get request is made from the client. The player is utilizing the video-js library, but I couldn't find any compatibility issues with creating streams, AND this does work in the Edge/Chromium browser:
<video class="video-js vjs-big-play-centered vjs-16-9 card-img-top" autopreload="false" data-setup='{"autoplay": false, "controls": true}'>
    <source src="/get-video?video=<%= post.source %>">
</video>

I am making the source for the video the response sent from the get request, which is the video stream. In the Safari browser I get the error: The media playback was aborted due to a corruption problem or because the media used features your browser did not support
I do not have this issue in any browsers when sending images via the get request. I also don't have any issues when I simply request static files. The issue seems to be contained to specific browsers when I attempt to send a video stream.
The reason why I am using the stream and not a static file is because I am hosting the application in the cloud. I have to send the raw file from the MongoDb database (or at least that's my understanding). When I was testing the application before sending it to the cloud this issue did not occur because I could simply utilize the file system and store the file path as the source for the video. However, the file system is not persistent with Heroku application, so I am using a cloud database in this situation. Now that I need to stream it from a database the issues are occurring.
Comment: I have very similar setup (video.js + node.js + gridfs) and basically the same problem - after playing numerous videos mobile chrome and safari returns same error for remaining videos. Did you find what the issue was?
Answer: use custom iframe concept

<!DOCTYPE html>

The iframe element

Your browser does not support iframes.

Answer: To play your video on a web page, do the following:
Upload the video to YouTube
Take a note of the video id
Define an  element in your web page
Let the src attribute point to the video URL
Use the width and height attributes to specify the dimension of the player
Add any other parameters to the URL (see below)

<!DOCTYPE html>

Comment: This would be a good idea for certain applications, and i'd add that this solution will not be viable in this application. The video has to come from the server in this situation that is coming from the database. Using the iFrame concept, this will simply prompt the user to download the file instead of playing it in this situation.


How to add Hard Drive to Dell Optiplex 330 Desktop?

Question: I read in the manual for the Dell Optiplex 330 that I can use second HDD. Actually I want to place 2.5" SSD. But I don't even understand where can I place 3.5". Tried to remove the 1st HDD and find where I can place somewhere else but didn't find. Also, didn't find tutorials for that PC.
Answer: SSDs, since they have no moving parts, can be attached anyplace in a system where they will get adequate airflow. You can use hook-and-loop (i.e., Velcro(TM)) to fasten them whereever you can get the SATA drive and power cables to reach.
Answer: It will fit into the 5 1/4" bay where the CD-ROM would normally go, but you'll need a drive adapter to go from 3.5" to 5 1/4"
Answer: it goes on top of hard disk 1,  i think that the screws for it are behind the front cover, you have to remove it, and there will be 4 special screws that make the second hard disk fit on the first on top, there are marks on the chassis indicating that where the disk 1 goes and where the disk 2 goes... actually i am running one optiplex 330 right now, trying to get the sata drivers for windows xp setup...


Formal Definition of APR

Question: I have seen several conflicting sources on the internet about APR.  Some say the effective rate is (1+APR/n)^n -1 while others say this formula is the APR since APR represents the rate over all compounding periods within a year.  What is the textbook definition of APR typically used in contracts and other formal documents?
Comment: is http://en.wikipedia.org/wiki/Annual_percentage_rate not sufficient?
Comment: In what jurisdiction?
Answer: If the compounding periods are shorter than a year, Annual Percentage Rate (APR) is calculated by ignoring the compounding.  Annual Percentage Yield (APY) includes the effect of compounding.
In the original post's math:

Assume there are n compounding periods per year.  For example, 12 equal-length months.
Assume the annual percentage rate is APR.  For example, 6 percent per year.
The periodic rate is APR / n.  For example, (6%/year) / (12 months/year) = 0.5%/month.
The annual percentage yield is APY = (1 + APR/n)^n - 1.  For example, (1.005)^12 - 1 ~ 1.0617 - 1 ~ 6.17 percent per year.

Some (very one-sided) contracts calculate the daily interest by dividing a (notional) APR by 360 days per year -- and then compound that daily rate every day of the 365 or 366 day long year.  The only place I have seen such a contract was for a "loan" by the new stockholders (in a leveraged buyout) to a holding company they set up.  The purpose of the loan was to let the holding company pay de facto dividends to the (mostly tax-exempt) shareholders, but let the company take a tax deduction for the interest.  If the holding company could not afford to pay the interest in cash, it could "pay in kind", by increasing the amount it owed.  The holding company then invested the "loan" as equity in a company that had actual revenues, expenses, and profits.  In this situation the "lenders" and "borrowers" were basically the same people, and the only restraint on the interest rate was "what will the I.R.S. let us get away with?"

Formal Definition of APR