does the battery determines the amount of current flowing in the circuit?

Question: suppose a 9v battery is connected to a load which draws 2 amps of current. so how does the battery determines that load requires this much current ?
I mean if the battery throws about 3 amps, then it would just blow the load, so how the battery just supplies 2 amps and not just any other value?
Comment: The battery does not determine anything in this instance. The load takes what the load wants. Look up Ohm's Law.
Comment: @Trevor_G - although of course, with a *real* battery, there is an internal resistance that will limit the maximum current that can flow...
Comment: It is a negotiation process. The battery offers 9V. The load says, if you give me 9V, I will take 2A. Then the battery says, well, if you are going to take 2A, then I can only give you 8V. Then the load says, well, if you are only giving me 8V, then I guess I will take 1.8A. Then the load says, well, at 1.8A I can give you 8.1V. And then the load says, well, at 8.1V, I would actually like 1.81A, and so on. Eventually, they find an operating point where they are both happy.
Comment: When you deal with power sources that are not simple voltage or current sources, sometimes the best thing to do is draw a load line. You draw one for the source, and another for the load, and where they cross, that is what the voltage and current will be.
Comment: https://en.wikipedia.org/wiki/Load_line_(electronics)
Answer:
Does the battery determine the amount of current flowing in the circuit?

Well... yes and no. The battery will try and give the load whatever it asks for not the other way round. This is true for any voltage source not just batteries (current sources will try and push a set current through a circuit but voltage sources will just sit there and do as they're told).
If the load wants 16.73 micro amps, that's what it will get, if it wants 500mA, that's what it will get. All normal batteries along with almost all power supplies you will normally encounter (except for LED drivers) try only to keep their output at a constant voltage (even if you're drawing 0A, although some ancient PC power supplies go a bit funny with no load).
The problems start when heavy loads are connected to light-duty sources, just like how I'll struggle to lift an 80kg railway sleeper, small power supplies will struggle to maintain their designed output voltage under heavy load.
Everything that isn't superconducting has resistance, everything. Small things generally have more, big currents and high resistances turn into big voltage drops (and lots of internal heating). So if you try and pull lots of current from a small battery, you might find that its output voltage drops right down and keeps dropping until either the load turns off or it stops trying to draw full current. Electronics are not that tough, keep pushing them and eventually they just give up trying (it'll probably get pretty warm too).
Answer:
suppose a 9v battery is connected to a load which draws 2 amps. so how does the battery determines that load requires this much current?

It works in the same way as the national electricity grid does. My house is powered at 230 V by the Irish national grid which has a peak supply of about 5,000 MW (5 GW). When I switch on a 25 W light bulb it just draws that much power from the grid and not the whole 5 GW (which would burn out my house in a spectacular flash).
The current drawn from the grid or from your battery depends on the resistance of the device connected.
$$ Current = \frac {voltage}{resistance} = \frac {V}{R} $$
$$ Power = \frac {voltage^2}{resistance} = \frac {V^2}{R} $$
or
$$ Power = volts \ \times \ amps = VI $$
Answer: A battery has no such ability as push certain current through a load regardless what a load wants and loads generally have no such ability as suck a certain current regardless what a battery offers. The current is a result, the found balance between the voltage and resistances in the circuit.
We can construct control circuits which try to regulate the current, but they fail as soon as some basic laws of the electricity must be violated. For example many led light drivers try to keep a constant current current through a led chain. The led driver succeeds if it has enough voltage for the number of the leds. It fails if there are too much leds or other resistance.
The most basic laws which cannot be violated are Ohms law, Kirchoff's laws and the energy principle. You should learn these if you try to calculate something about the electricity.
The situation is same in water supplying systems. There are no such systems in use which try to push say 2 liters/second. The system has certain pressure.  You have not a faucet which unavoidably takes say 3 liters/second. You turn the faucet to have some resistance and the flow is the resulted balance between the pressure and flow resistance.
You can construct a controller which opens the faucet until the flow is 3 liters/second. It has a flow measurement sensor. Your controller fails if the water supplying system haven't enough pressure to push that much water/second through all the pipes between you and the pump station.
Voltage in a battery or pressure in the water supplying system can be so high that a breakdown occurs. But that's due a tendency to push a certain current or water flow only if there's some current or flow control system which can rise the voltage or pressure over the breakdown limit.
Answer:
Does the battery determine the amount of current flow in the circuit?

yes and no
For the most part no, and this would be because most times a given circuit is deigned or wired properly as well as the battery being sized properly for the given power requirements.
Remember a battery is a chemical device, and it is the chemical reaction within the battery that is important to know about regarding whatever circuit the battery is going to power.
YES a  battery could determine the amount of current flowing in the circuit.  In this kind of scenario the battery would basically be undersized or already discharged to where the elctro-chemical reaction within the battery cannot keep up where the limiting factor would normally be load resistance; in this case it would be the chemical reaction within the battery or possibly the batteries internal resistance becoming greater as it gets hotter trying discharge more current than it was designed to.  A good example would be using a 12 volt lantern battery (or two 6v lantern batteries) to start your car; a typical lead-acid car battery rated at 500 cold cranking amps versus the lantern batteries (which do not have a CCA rating but let's say it has 1 amp rating).  Try and use the lantern batteries to power a car starter (DC motor) which are rated at around 1.2 Kw or 1.5 hp and generally draw around 500 amps  and it would be the lantern batteries internal resistance and chemical reaction which determines how much current flows in that circuit not the resistance of the DC starter motor.... just replace the DC motor with a 0.00? ohm simple resistor (for argument's sake) and hopefully you get the idea.

I mean if the battery throws about 3 amps, then it would just blow the load, so how the battery just supplies 2 amps and not just any other value?

ANY battery does not just throw amperage or current; it will first discharge as much current as physically possible based on its chemistry and chemical reaction,
and then what limits this discharged current is the resistance of the circuit it is connected to. And then if the battery in undersized where the circuit resistance is so low that will allow whatever battery to discharge at an extreme rate causing it to first overheat which is sometimes described as that battery's internal resistance increasing which then would be the limiting factor in the amount of current, if the battery doesn't catch fire and explode.
Really need to consider the make/model and chemistry of the battery, you mention a 9v battery and a 3 amp discharge which is not realistic, those batteries do milliamps at best.  And then you have alkaline, Ni-Cd, Ni-MH, various lithium chemistries, lead-acid and so on.  Some are quite safe, some can be quite powerful and dangerous.  But for example if a circuit designed for 12 volts having a resistance or 360 ohms and an expected current draw of 0.033 amps then it makes no difference if you use a little duracel 12v type 21/23 battery, your car battery; the limiting factor for battery discharge would be the circuit resistance and not the battery's physical capability, chemistry, and electrical capacity.
Answer:
suppose a 9v battery is connected ... if the battery throws about 3 amps

A battery supplies electric power within some limits, and there's an equation for its output, characterized by the terminal voltage and
the output current.   The battery is characterized by an equation
with voltage and current variables, plus constants (which are
the datasheet entries for the battery you choose).
A '9V battery' is not completely defined; there's more to it
than that 'terminal voltage under zero load' value.   The
'throws 3 amps' scenario might be another part of the puzzle,
like a short-circuit current.   If so,(9V, 0 A) is one point on a curve,
and (0V, 3A) is a second point.   Draw a line between those
points, and THAT might be the battery characteristic function.
Similarly, a load draws electric power within some limits, and
there's an equation for its input current and terminal voltage.
See where this is headed?  Two equations, and two unknowns, is
often a soluble mathematical problem.   So, if you know both
the battery and the load, you have enough data to predict, mathematically, what electric power transfer happens when they
are connected.   You just solve for voltage and current.
It's a little more complex, because a battery charge state, or
load temperature, or even barometric pressure, can be involved.
Answer: The amount of current the battery will provide is going to rely on the circuit equivalent resistance. Batteries can usually hold up to a certain value, which after such its output voltage will drop due to its internal resistance as more current will be flowing, more voltage is dropped on this internal resistance. To control the current you´d need a separate circuit to do so. A battery is a constant voltage source, and that´s what it´s going to do: provide a constant voltage to the circuit, regardless of current.
Answer: your battery never determine the amount of current  throw to the load, rather the load resistance and operating voltage of the load determine the amount of current.
For two or more load resistance (Vs= Vr1+Vr2+Vr3...+Vrn) and each voltage drop (Vr1=IR1, Vr2=IR2, ..., Vrn=IRn). Therefore; for a closed loop of single load resistance, the voltage drop(Vr) is the same as source voltage/battery voltage(Vs) and current can be determined  by the equation (Vr or Vs=IR). this implies if the operating load resistance is 4.5ohm it is possible to draw 2 amp unless it will below or above the required amount.
To draw the desired amount of current; the load resistance (designed resistance or designed load of an equipment) multiplied by desired current should equal with the battery voltage.
Le's assume the load resistance is 4.5ohm and battery voltage is 9v, so current flow through the loop is 2amp; for the same load resistance(not be changed in any variation of voltage and current), if the battery voltage is 18v the current flow through the loop becomes 18v/4.5ohm=4amp.
if I am wrong please give me feed back.


「 〜のです。」is confusing when I have to use it with the casual form of the verb

Question: I'm having trouble understanding the difference between 何かあるのですか。and 何かあったのですか。Are they both the same? Initially I thought that the former was present tense and the latter was past tense but I really don't know. It's confusing to me. Please explain...
Comment: Why do you think they are the same?
Comment: Do you understand the difference between ある and あった?  Would you have understood the difference between 何かありますか and 何かありましたか?  Tell us something about what you're able to make of this otherwise this question will most likely get flagged as a translation request.
Answer: あった is the past form of ある, so the difference is simple:

何かあるのですか。
Is there something?
Is something going on?
Will something happen?
(Very literally: Is it that something exists?)
何かあったのですか。
Was there something?
Did something happen?
(Very literally: Is it that something existed?)

のですか/んですか/のか/の at the end of a question is for seeking clarification (known as explanatory-no). See this article and this question. のだ/のです/etc itself won't be in the past form even when you're talking about something in the past.


How to work out p-value if variances of two groups are different?

Question: How do I work out the p value if the variance of my control and experimental group are different? I can't do the t-test anymore. How do I work the p -value out, what method?
Also, my two groups are different amount of trials. The control has 25 values and the experimental only has 5 values. Hence I can't do the chi-squared test.
Comment: Welcome to CV. You are referring to two tests with very different hypotheses. What are you trying to demonstrate?
Answer: As you are talking about the t-test, I assume that you want to compare the mean of the experimental and the control group. An 'extension' of Student's t-test to unequal sample sizes and unequal variances is Welch's t-test. Welch's t-test uses the test statistic
$$  \frac{\overline{X}_1 - \overline{X}_2}{\sqrt{ \; {s_1^2 \over N_1} \; + \; {s_2^2 \over N_2}}}. $$
This test statistic is approximately t-distributed with $\nu$ degrees of freedom, with $\nu$ given by:
$$ {{\left( \; {s_1^2 \over N_1} \; + \; {s_2^2 \over N_2} \; \right)^2 } \over
 { \quad {s_1^4 \over N_1^2 (N_1-1)} \; + \; {s_2^4 \over N_2^2 (N_2-1) } \quad }} .$$
The p-value is then calculated using Student's t-distribution with $\nu$ degrees of freedom.
Comment: Yes well, there's Wikipedia, then there's the *actual authors'* respective work cited. :)
Comment: The degrees of freedom you present is Satterthwaite's formula. Welch's formula is $$df = -2 + \frac{\left(\frac{s_{x}^{2}}{n_{x}} + \frac{s_{y}^{2}}{n_{y}}\right)^{2}}{\frac{\left(s_{x}^{2}\right)^{2}}{n_{x}+1} + \frac{\left(s_{y}^{2}\right)^{2}}{n_{y}+1}}$$ Satterthwaite, F.  E.  1946.  An approximate distribution of estimates of variance components.  *Biometrics Bulletin* 2: 110-114. Welch, B.  L.  1947.  The generalization of "Student's" problem when several different population variances are involved.  *Biometrika* 34: 28-35.
Comment: @Alexis Thank you. Wikipedia calls it the Satterthwaite-Welch formula.
Comment: Formulas from original papers sometimes get adjusted or refined in usage: Snedecor and Cochran (1980) and the [NIST handbook](https://www.itl.nist.gov/div898/handbook/eda/section3/eda353.htm) (current) both have
 what looks to me like the same formula as Wikipedia. Would be the last to claim Wikipedia is always right, but maybe this time....
Answer: When sample sizes are very different, as in your case, a problematic
situation occurs for the pooled two-sample t test if the population variance is larger in the
population from which we have the smaller sample size.
Let's look at an example in which we have 25 observations x from
$\mathsf{Norm}(50, 2)$ and 5 observations y from $\mathsf{Norm}(60, 5),$
where the second argument in my notation for a normal distribution is the
population standard deviation.
Here are fake data, generated in R, and their stripcharts:
set.seed(915);  x = rnorm(25, 50, 2);  y = rnorm(5, 60, 5)
all = c(x,y);  gp = c(rep(1,25), rep(2,5))
stripchart(all ~ gp, ylim=c(.5, 2.6), pch="|")

In R, the default version of a two-sample t test is the Welch test:
t.test(all ~ gp)

    Welch Two Sample t-test

data:  all by gp
t = -2.7021, df = 4.1464, p-value = 0.05195
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -14.43014179   0.09579794
sample estimates:
mean in group 1 mean in group 2
       50.11499        57.28217

So at the 5% level, the difference in sample means (50.11 and 57.28) is not quite significantly different from $0.$ [The P-value for one-sided test against alternative $H_a: \mu_t < \mu_c$ would have been half as large, significant at the 5% level.]
The P-value for this two-sided test is found in R (where pt is the CDF of a t distribution) as follows:
2*pt(-2.7021, 4.1464)
[1] 0.05194632

Ordinarily, you need software to find an exact P-value. Taking df = 4, you can
bracket the P-value corresponding to $|T| = 2.7$ by using a printed table of t distributions: Noting that the probability in the right-hand tail of $\mathsf{T}(\nu=4)$ beyond 2.776 is 0.025, and that the probability beyond 2.131 is 0.05,
you can deduce that the P-value for the two-sided test is between 0.05 and 0.10.
With $n_1 = 25,\, n_2 = 5,$ the degrees of freedom $\nu$ from the formula given in
@Nussig's Answer (+1) must lie between $\min(n_1-1, n_2 - 1) = 4$ and $n_1 + n_2 - 2 = 28.$
In our example, we happen to be near the lowest possible value of $\nu.$ [Some software programs round to integer degrees of freedom.]
Notes: (1) An inadvisable pooled two-sample t test (with t.test(all ~ gp, var.eq=T))
uses $\nu = n_1 + n_2 - 2$ along with a somewhat different formula for
the t statistic $(T = -5.298),$ giving the (bogus) 'highly significant' P-value 1.228e-05.
(2) When
$n_1 = 25, n_2 = 5, \sigma_1 = 2, \sigma_2 = 5,$ a pooled two-sample t test
at 'advertised' significance level 5% has actual significance level above 25%.
The following simulation verifies this:
set.seed(918)
pv = replicate(10^5, t.test(rnorm(25,0,2),rnorm(5,0,5),var.eq=T)$p.value)
mean(pv < .05)
[1] 0.26253

By contrast, the Welch two-sample t test has nearly the nominal 5% level:
set.seed(2018)
pv = replicate(10^5, t.test(rnorm(25,0,2),rnorm(5,0,5))$p.value)
mean(pv < .05)
[1] 0.05404


Specifying assumptions at the start of a piece of code

Question: I am aware of the use of 'Assumptions' or 'Assuming' to attach to certain operations (e.g. integrals) to aid Mathematica. Is there a way of listing asssumptions at the beginning of a piece of code such that every evaluation thereafter makes use of them, rather than writing the assumptions in every evaluation? Thanks in advance for any help.
Answer: You can check if using
Block[{$Assumptions =...}, ...]

will do the trick for you.
$Assumptions is a global variable, so the Block construct just plays the the role of localising the effect of changing it -- thanks @Natas in comments.
Sorry, I'm a newbie here so don't know how to refer to the comment
Comment: Perhaps you should also point out that `$Assumptions` can be set outside of block? I think OP is referring to the options `Assumptions` (see parenthetical remark in OP).
Comment: @Chris - Note that "such that every evaluation thereafter makes use of them" will in general not be achieved since assumptions only affect functions that make use of the `Assumptions` option. Consequently almost "every evaluation" would need to include `Simplify` or `FullSimplify` to ensure that the assumptions were used. This could significantly impact performance. Further, you would still need to explicitly include the assumptions in the system of equalities and inequalities given to `Solve`, `Reduce`, `FindInstance`, or other functions that take constraints.


Is 风光不再 correct in 广州恒大风光不再?

Question: I think it is a misspelling, which should have been 风光不在.
不再 is no more, or not any more
不在 is absent, unavailable
Comparing the two, I think only the latter makes sense, for the former there has to be another complementary words, such as 广州恒大不再(经营足球业务)
Answer: It is correct. 风光不再 is an idiom, meaning the previous upwards trends (of something) is no more, and it is on the decline.
In this sentence, it means that the soccer club is not doing well in recent years, comparing to its peak (winning 2 Asian championships). It is on the decline.
Answer: 1]
在 is a complementation which negative form is 不在.
提问:

小王在吗? (is Wang here?)

回答:

小王在. (Yes, Wang is here.)
小王不在. (No, Wang is not here.)

2]
再 is a adverb which negative form is 不再.

他再次进球. (He do the goal again.)
他不再进球. (He were to do not goal again.)

We use 再次 instead of 再 to indicate something have happened just like above, or use 再 to indicate states of unreality, for example:

你再进球, 我就揍你. (I'll kick you if you goal again.)

I hope this will help you.
Answer: 不在 - 指不位于或处于某处 (be not in; be out) - 他不在 (He's out/He's not in)
不再 - 结束;停止;终止 (no more; no longer) - 风光不再 (flourishing scene no more - indicating "the past honor and glory has ended")
Answer: That's fine. "不再" means "not any more" here.
And "风光" literally translate to great view. Imply for been in great position or in great power, and therefore been worshiped or been admired.
So, "风光不再" means: been worshiped no more.
But to be honestly, I think "不在" may also work, only it doesn't emphasize the emotionally taking pity on the fact. If using "风光不在", simply specify the fact of losing the position. For "风光不再", it feels like: One been worshiped no more, what a pity...
Anyway, like I always say: Chinese seems to become a stream of consciousness or even subconsciousness now days.

Is 风光不再 correct in 广州恒大风光不再?


Class methods and instance methods - when/when not to use them?

Question: I was wondering when and when not to use class methods and instance methods. I need some practical examples. I am really confused. Another question: can't we do exactly the same things with instance methods that we can with class methods?
Answer: Class methods:  The method isn't tied to any specific object.  In a way it acts like a free function in the class's namespace.  No 'self' pointer.  For instance [UIScreen mainScreen] is a class method because there's only one screen and there's no need to care about multiple 'screen instances'.
Instance method:  Tied to a specific object.
This applies to most OO languages, not just obj-C.
Comment: A class method is in fact tied to the _[class object](http://www.sealiesoftware.com/blog/archive/2009/04/14/objc_explain_Classes_and_metaclasses.html)_, and, just like an instance method, has a hidden `self` parameter, which points to that class object.
Answer: At the implementation level, an instance method call contains a hidden pointer to a data structure (the object), a class method does not.
The practical question to ask is whether your call requires sending the call some specific data which is or could best be encapsulated as instance data inside an object, or not.
You (usually) can do the same thing with class methods as instance methods, but then you have to explicitly pass the object as a visible parameter in the call, which is uglier looking and also potentially disables some method override features of the Objective C language.
Comment: Class methods have a hidden `self` parameter, too; it is a reference to the class object.
Answer: Use class methods for utility functions and Instance methods for object oriented stuff.
Eg. For Mathematical calculation (eg sin x ) use class method. But for invoking a behavior specific to an object.. use instance method ..
Answer: A class method as the name implies is bounded to the class. You can invoke them just with the name of the particular class. These can be normally exposed methods of a class.
For example
 NSArray
+ (id)arrayWithArray:(NSArray *)array;.
You call it with the class name NSArray. What you expect is just a creation of a object of the type of that particular class. This doesn't need an object to invoke. Also these are very basic method required so its better to make it as a class method.
On the other hand instance method as the name implies is very much bound to the instance. Object is an entity that encapsulates state (ivars) and behaviors (methods) of a class. This can be very specific to the object.
For example
- (NSUInteger)count;
Lets take NSArray *a  and NSArray *b. If a contains 5 items whereas b contains 4, instance methods called upon these instances will produce different results. And thats why we need instances to be initialized while invoking instance method. They work on the context(or state) of the object they are been called upon. Also they are not exposed as the class methods are.
Hope this helps.
Answer: If you want to use instance objet or instance variable you have to go with instance Methods.
Bcz Inside the class you cant access the Instance instance objet or instance variable.
Class methods are static methods.


Android: How to Order ArrayList>?

Question: I'm saving details of product in a map and adding in  ArrayList< HashMap< String,String >> and setting in to a custom list adapter. I need to sort the values by price in it. How to achieve it? Thanks in advance.
Comment: try googling for map sorting.
Comment: possible duplicate of [How sort an ArrayList of HashMaps holding several key-value pairs each?](http://stackoverflow.com/questions/5369573/how-sort-an-arraylist-of-hashmaps-holding-several-key-value-pairs-each)
Answer: Pleas use the code below :
ArrayList< HashMap< String,String >> arrayList=populateArrayList();
    Collections.sort(arrayList, new Comparator<HashMap< String,String >>() {

        @Override
        public int compare(HashMap<String, String> lhs,
                HashMap<String, String> rhs) {
            // Do your comparison logic here and retrn accordingly.
            return 0;
        }
    });

Answer: You can implement a Comparator<Map<String, String>> or Comparator<HashMap<String, String>>
How sort an ArrayList of HashMaps holding several key-value pairs each?
answers it well :
class MapComparator implements Comparator<Map<String, String>>{
    private final String key;

    public MapComparator(String key){
        this.key = key;
    }

    public int compare(Map<String, String> first,
                       Map<String, String> second){
        // TODO: Null checking, both for maps and values
        String firstValue = first.get(key);
        String secondValue = second.get(key);
        return firstValue.compareTo(secondValue);
    }
}

...
Collections.sort(arrayListHashMap, new MapComparator("value"));

Also look at How to sort a Map on the values in Java?
Answer: you can simply use this for your custom Sorting of objects in an Array List,
public class MyComparator implements Comparator<MyObject> {
    @Override
    public int compare(MyObject o1, MyObject o2) {
        return o1.getYOUROBJ1STR.compareTo(o2.getYOUROBJ2STR);
    }
}

Let me know  if you still face issues for sorting of Map
Answer: Can be done using comparator and Collections class together if its a case of ArrayList
Check this link
Thanks to Lars vogel
Answer: I think you are searching for this:-
Sort ArrayList of custom Objects by property
sorting a List of Map<String, String>
Hope it will helps you...

Android: How to Order ArrayList>?


Can earth grazers skip on the atmosphere more than once?

Question: Earth grazing fireballs are asteroids that enter the atmosphere at a low angle, and skip off it, leaving to space again. Would it be possible that they skip more than once and still leave the atmosphere?
Comment: "enter the atmosphere at a low angle, and skip off it" – I don't think that's how it works, generally speaking. (Skipping off, whether on water or on air, requires a shape that provides stable lift in up-direction; meteoroids don't have such a shape.) Rather, the fireball simply is on an orbit that would have left the atmosphere again anyway (because of the Earth curvature).
Answer: I believe the answer is yes, when the asteroid after the initial pass through the earth's atmosphere no longer has escape velocity relative to the earth, but enters an elliptical orbit around the earth.  The perigee of the orbit will be within the atmosphere, so on the next pass the newly-captured earth satellite will lose more energy, lowering the perigee until it eventually burns up in the atmosphere (or hits the ground).
Comment: @Ruslan No, it can capture into Earth orbit but still have apogee well above the atmosphere, so it leaves the atmosphere before re-entering it.
Comment: This answer is contrary to the OP's _"and still leave the atmosphere"_.
Comment: @MikeScott I think the intent is in the first sentence of OP "leaving to space again", so it shouldn't eventually reach the earth, because "skipping more than once" already means touching/entering the atmosphere and the coming out, before coming back again. And so adding "and still leave the atmosphere" would very reasonably intend to mean that the asteroid eventually move away from earth.
Comment: @justhalf Indded, if we consider "skipping" to be "bouncing off the atmosphere", the literal question becomes *"Would it be possible that they bounce off the atmosphere more than once and still leave the atmosphere?"* which doesn't seem very sensible question to me, unless "leaving" means not remaining in orbit.
Comment: I did voted for both current answer although one says yes and the other not :) I do have a little question. Since the phenomenon occurs at least for object disintegrating or landing, can it explains certain waving falling stars that I have seen in photos with an otherwise unblurred firm background?
Answer: If by "more than once" you mean "more than once in a single visit", then that would seem impossible.
After the first skip, the object is moving away from the earth.  Either it has sufficient energy to depart or it doesn't.  If it returns, then it doesn't have enough. Further interactions with the atmosphere won't give it any additional energy (in the earth's rest frame).
Comment: an object can have an orbit that goes through the atmosphere, just not long enough to fall completely. It's easy to observe in KSP
Comment: Sure, but that seems uninteresting to me.  That was why I limited my answer to those entering twice in a single visit.  I would regard taking a full orbit a different visit.
Comment: could a moon boost lead to escape after a couple of skips
Comment: Another body could interact and boost the object, but only over the course of an orbit.  During atmospheric interactions, it will be too small of a force.
Answer: I will not commit to a "yes" or "no" answer, but instead refer to examples of artificial objects that do go at least down-up-down.
From Space Exploration SE:

Did the Apollo Command module really "skip" within, or off of the atmosphere as a part of its reentry program?
How does skipping off the atmosphere work?
Mathematically, what is the argument in favor of skipping reentries?
Why didn't the Space Shuttle bounce back into space as many times as possible so as to lose a lot of kinetic energy up there?
Why can't deep-space missions escape orbit by skipping off the atmosphere?
What is the word for using atmosphere to dissipate kinetic energy during reentry?

Several answers 1, 2, 3, most often by @MarkAdler of JPL fame mention that aerobraking at Mars and Venus has been used lower the energy of spacecraft. However I am not sure how many times something coming in at a positive $C_3$ relative to the planet can skip without also using some energy-lowering propulsion as well. Also the shapes of these spacecraft are not necessarily asteroid-like; they may have been engineered to provide some amount of lift.
@MarkAdler also points out that both Apollo and the Space Shuttle were qualitifed to implement skip-reentries but only Apollo actually used it.
@OrganicMarble's answer includes the following data for an Apollo capsule


Heavy-tailed data

Question: Hi lately I was focused on theoretical modeling of heavy-tailed data. However, I find it hard to collect some classic heavy-tailed data for experiments. I wonder if there is any public and well-known (better if any) dataset confirmed to be heavy-tailed from Kaggle or some labs ?
Answer: The types of heavy-tailed distributions (wikipedia) gives an overview, and I'd start with Pareto or Log-normal. The hard part will be finding just one dataset!
I'd start with Log-normal, and then going to this page, you see sources for this distribution:

Let's pick one of the easier ones to find: Length of Spoken Words. (Note that written words is not lognormal - source.)
And to keep it relevant, there is good structured data for US Presidential (Campaign) speeches. You mentioned Kaggle, so here is one example:
https://www.kaggle.com/alandu20/2016-us-presidential-campaign-texts-and-polls

Collection of data from the 2016 U.S. Presidential Election Campaign containing:
1 Transcripts of the three presidential debates, divided into separate Trump and Clinton text files
2 Transcripts of Trump's 64 speeches delivered after the RNC and Clinton's 35 speeches delivered after the DNC
3  Transcripts of select speeches delivered by candidates during the primary campaigns
4  USC Dornsife/LA Times Presidential Election Poll, with daily breakdown by voter groups
5  Five Thirty Eight Election Poll, containing daily data from numerous pollsters

1, 2 or 3 would work.

For the record, there are MANY ways of collecting heavy-tailed data, and this is just an example of one way to get started...

for fun, quick analysis from 2016 election:

Heavy-tailed data


Why would governments want to cover up the existance of aliens?

Question: We have asked how a government could cover up an alien crash before, but the real question is why they would want to. Given that in most science fiction series, that the aliens either outright attack or humans join the aliens,
there is never really a good explanation for why the government would want to cover up alien existence. Given that in our own world the government claims they are searching for alien life, why would the American government want to cover up the existence of aliens?
Comment: @Aify I'm no veteran of this site, but I agree with TrEs-2b. It's *theory* based, and since most of this site is armchair reasoning it's subject to one's personal viewpoints, but this seems to be reasonably answerable.
Comment: @Aify What!? no, this question is in no way more opinion based than any reality check question on the site! Every question calls for peoples opinions
Comment: @Aify There's definitely an objective way to judge answers to this. Does anyone have the number for the White House switchboard? It'd be awesome for the site to get input from the POTUS.
Comment: Not all governments would, and that is evidence against such a conspiracy.
Comment: The line between opinion based and not on Worldbuilding has always been a complicated one.  Rarely are questions completely opinion based.  Rarely are questions obviously not opinion based. I know my first thought was "opinion based" because I can't think of any reasonable way to rank the answers.  If anything, this may be a "list question."  As an exemplar, consider my answer.  How should it compare to the others presented here?
Comment: Why? The depends on the type of government entirely. Also, this question is completely opinion based because nobody can actually answer for what a government would **actually** do.
Comment: @NexTerren The issue with this one is that there's no objective way to define which of the resulting answers would be correct - thus, 100% opinion based. Each persons theory on what or why the government would do it is completely based on their own opinion and not based on any facts whatsoever, so this question isn't "theory based" at all.
Comment: @Frostfyre Fair enough - if someone would be able to grab that input and post it on this question after receiving the results, then I will most definitely retract my close vote.
Comment: WHY is part of the story.  We cannot define that for you.  That is clearly story based.  If you were to give us a particular scenario we could let you know in the *reality-check* sense if it were plausible but for me to answer this question I feel like I'd be writing a section of story plot for oyu.
Answer: This question is pretty close to opinion-based idea generation, two bad things at once. I'll try to give a non-opinion-based answer.
Governments have several reasons for keeping secrets.

Revealing the secret would disclose means of intelligence gathering. For example, I'm pretty sure that in the real world the NSA could shut down many of the ransomware encryption trojan criminals, but making that stick in court would force the NSA to reveal how they work. So they don't do it.
Revealing the secret would disclose targets of intelligence gathering. The initial indication of the secret might come from an operation against a neutral or friendly government. Follow-up investigations would be classified at least as high as the initial clues.
Revealing the secret would undermine official or semi-official ideology. Perhaps the aliens are Communist (or not Communist). Or the aliens are Christian (or not Christian). There is a nice quote from a character in the Laundry novels by Charles Stross how the US is at a fundamental disadvantage against eldritch horrors because of the widespread religious beliefs of their population.
The government did something evil in their inital reactions to the aliens and now they want to sweep that under the carpet. Perhaps a SAM downed an unarmed flying saucer full of tourists. Or they kidnapped and vivisected a member of the first contact delegation.
The aliens demand that the secret is kept, for reasons of their own, and their hosts comply.

Either way, once the existence of aliens is kept secret and the first official denials are given, changing this policy would damage political leaders.
Comment: Vivisection means never having to say you're sorry
Answer: One possibility that didn't come up yet: The government is aliens. The aliens don't want to reveal that they are already ruling us, as that will likely lead to much opposition by the humans, if not revolution. And the best way to make sure nobody suspect that the government is composed of aliens is to make sure that nobody believes that aliens even exist, or at least not on this planet.
Comment: Nicely done. You'll be hearing from our agents soon enough.
Answer: They could want to cover it up because:

Concerns over mass panic of their citizens
To gain a tactical advantage against foreign powers

Knowledge is power; if I know something you don't I'm at an advantage
Technology can be researched/reverse engineered that places one nation at the advantage over another.

To gain a tactical advantage against its own citizens (see above)
To keep the status quo: Maybe the powers-that-be just don't like what such a discovery would imply to the social change.

Also if the aliens were hostile, it could be used to keep information from the rest of the aliens. The scout ship just 'disappears' and the other aliens may be uncertain what happened to it (destroyed on entry? Missed Earth entirely?).
Answer: Kay from Men In Black put it best:

A person is smart.  People are dumb, dangerous, panicky animals and you know it.

The best reason to want to cover something up is that people might do something stupid and damaging with that information if it got out.  A wise individual knows there is a time and place for everything, and it may not yet be the time for such information.
Answer: There are probably as many reasons as there are pairs of earthly governments and alien cultures.  A few prominent candidates:
1) Aliens are a source of advanced technology.
All states and state/corporation complexes are dependent to various degrees on control of the most advanced technology available in their geographic area of control, not just weapons but also surveillance/communications, computing, agriculture...  Even entertainment.  America will be in a bad way the day the world doesn't want to see its movies anymore.  Because states depend on controlling advanced technology, and aliens visiting Earth are an obvious source of advanced technology, keeping those who would seek advanced technology to resist or assimilate the state ignorant of the existence of aliens is the first sensible and maybe only possible effective step in keeping alien technology from falling into the hands of another Earthly faction.
2) Aliens, if they are visiting here now, probably have the know-how to dominate us completely, and if they did, the population may not take it well.
Even if they couldn't actually dominate a planet light years from their home, they'd have a trivially easy time making our leaders think they could.  It's possible that they would agree to pay great tribute to stave off a full-scale invasion (or even extermination.)  But how do you think people would take it if we learned that there is no "1%", at least not in the human demographic: they really are Reptilians or whatever, and they're growing fat on the wealth of our world while they cook us to a crisp!  Probably not incredibly well.  Maybe badly enough to disrupt planetary production and trigger an invasion, certainly badly enough to threaten the job security of the leaders who agreed to the deal and their political descendants, and that's motive enough for anyone to cover it up.
3) The aliens said so.
If the aliens said "don't reveal our existence to the general population", it is unlikely that they would be ignored, especially when they've cowed us with a demonstration of their EverZapp Brand Intergalactic Space Laser.
Answer: The usual rationale is that the government has made an unholy deal with the aliens. More or less like if the US government behaved towards the aliens like third-world governments behave towards the US. Granting unlawful advantages to the aliens, perhaps even sinister ones (where do you think embryos' organs harvested at Planned Parenthood go?), for instance, in exchange for some kind of bribery, or to circumvent blackmail.
It is evidently hogwash, of course, and it isn't even a reasonable plot for fiction. But I fear it is the most common "argument" regarding this issue.


How can I prepare bread dough to be cooked the next day?

Question: I'd like to make some fresh bread for breakfast tomorrow, but don't particularly want to wake up at 5am to mix and prove the dough. How could I make the dough tonight so that I could just throw it in the oven tomorrow?
Comment: Just to clarify - it's a stuffed loaf (a layer of cheese and cooked vegetables in the middle) rather than a straight bread loaf.
Comment: related : http://cooking.stackexchange.com/q/14184/67
Answer: Make the bread all the way through.  You can even let the first rise happen.  Drop your yeast to about half.  Oil a bowl, drop in the dough, spin once to get the ball of dough covered with the oil and then put plastic wrap over the bowl, or a damp cloth...and plastic wrap.  Put the bowl in the refrigerator.
The refrigerator slows down the yeast without killing it, which also increases the flavor of the bread (over night cool low yeast methods for bread are considered the "right" way to make bread).
In the morning, pull out the bread, press out any large bubbles, roll it around and let it come to life again.  I usually punch it down one more time and then let it rise in the pan or on a sheet depending on what kind of bread I am making, then bake as normal.
In your case, because you're doing a stuffed loaf, assuming there is a rise before the stuffing, THAT is the point where you will start the morning.  Everything before the pre-stuff rise, the refrigerator IS the pre-stuff rise, pull it out, let it warm, punch it down, stuff, put in the pan, let rise, bake.
Comment: In breads where the final step is kneading in baking powder, should I do that final step, or wait to knead in the baking powder until I'm ready to bake the dough?
Answer: You will likely find you actually get far better results if you start the dough the night before, because the long, slow rise will build great flavors. Go ahead and make it as normal, let it rise a little bit (1/2 hour maybe) and put the covered bowl in the refrigerator.
In the morning, pull it out and let it warm up enough to work it. It may take a while depending on how much dough you have. It'll go faster if you move it to a warm bowl instead of the one that's cold from the fridge.
Once it's warm enough to work, handle it as usual.
Comment: Well, it really depends on how cold your fridge was and how warm your kitchen is--and how firm your dough is in the first place. Maybe 45 minutes to and hour? You basically want to let it get to room temperature if you can. You can work it when it's colder, but if you need it to rise after stuffing, that step will take longer if you start with colder dough. It will also have a tendency to snap back, making it hard to spread out if you need that to do the stuffing and rolling.
Comment: How much time does it take for a 0.5kg bread to warm up enough?
Comment: I have made bread with dough out of the fridge and for a small un-stuffed loaf, I formed it immediately then let it sit to re-awaken for 30 minutes before putting it in the oven.   I think this is the method that "Artisan Bread in 5 Minutes a Day" suggests.
Comment: This first rise in refrigerator method. What sort of yeast should I use,Instant or Dry active yeast?
Comment: @kin Just follow your normal recipe. As long as it's a working recipe and you wake the yeast up before it goes into the fridge, it'll work.


Has anybody used SIKULI for testing their GUI-based apps?

Question: SIKULI seems to have an enormous amount of potential. Has anybody tried to use this as a tool for testing? Or would it be better suited for automating actions for users?
Answer: Quoting Unit Testing for GUI (in the project Documentation):

Sikuli is designed to support unit testing for GUI by integrating with junit. The unit testing panel can be opened by clicking on View/Unit Test or by shortcut Cmd-U on Mac (or Ctrl-U on Windows/Linux).

So, while my understanding is that SIKULI is initially aimed at GUI automation, it can definitely be used for GUI testing (which is closely related if you consider that GUI testing = GUI automation + verification framework). Have a look at Unit testing for GUI (JEdit) for a full example (and see the assertXXX on images).
And indeed, I see a big potential in SIKULI for testing as it seems to make writing tests very easy, even without a single line of the real application written (just using some initial mockups for example). SIKULI could become a great companion for various flavor of testing (BDD, acceptance testing, etc).
It' really an amazing piece of software, very impressive.
Answer: I am using Sikuli extensively for UI test automation. I am "late" to the Sikuli party, having discovered it in January 2011. I am actually glad I discovered it late, because while it was promising earlier, I don't think until Sikuli x1.0-rc1 (which happened in December) was released that it was ready for primetime.
Previously, I have used TestQuest and EggPlant for UI test automation. In my opinion, Sikuli beats both of them hands down. I truly believe it has the potential to dramatically change how folks perform UI test automation for the better and will be evangelizing it to folks around me.
Using Sikuli correctly is means that you are not following a "record and playback" model. Rather, you have to approach developing test automation with Sikuli - as you need to with all tools - as a software development task.
We are currently in the process of porting a UI automation DSL (Domain Specific Language) we built for EggPlant to Sikuli. One of the key features we will be leveraging in our DSL is Sikuli's text recognition capabilities. This will allow us to run the same script across various localized versions of our product.
Because Sikuli builds on OpenCV (for image recognition) and tesseract-ocr (for text recognition), it has an incredibly amount of power and flexibility.
Answer: Also, see the paper: http://groups.csail.mit.edu/uid/projects/sikuli/sikuli-chi2010.pdf
Answer: @jordan,
Absolutley spot on 'Using Sikuli correctly is means that you are not following a "record and playback" model. Rather, you have to approach developing test automation with Sikuli - as you need to with all tools - as a software development task.
I created an end to end test automation solution for testing a videoconferencing application made by the worlds largest PC manufacturer.  They did not understand that it was a full dev project, not a point and click operation that any monkey could execute.  Trying to explain the challenges of coding with a dynamically typed language was impossible.
From my experience the biggest challenge is image managment.  I used the file system and configparser for the first iteration of the test automation.  Using configparser worked however it was difficult to implement.  In the future I plan on using blobs.  Sikuli does not support direct extraction of images from a DB (yet) although I do have a work around.
Use of an IDE is critical since the Sikuli IDE fails to have and development tools.  The 2 IDE's I've configured, NetBeans and Eclipse/PyDev have their own set of issues.  The are great for coding however false errors, injection of whitespace and code loss make both less than ideal solutions.  I code and test in NetBeans, Execute in SikuliIDE and save all in notepad as a backup.
Inspite of any difficulties encounteres i'm a big supporter of Sikuli.  Sikuli has the potential to change test automation, making it accesable to the entire QA community without having to be an OO coder.
Answer: Recorded a workflow with a Flex web app. Took a while to figure out a reliable strategy to create the screenshots, but once I did it, the script continued working even after I changed my desktop color scheme! The syntax gets a bit awkward though when you need to click a specific control in a collection of similar controls, i.e. checkboxes, input fields. Looks like the only way to do it is by using find() in combination with  right(); left(); inside(). Seems like the smaller the screenshots are, the more reliably are they detected. Imo a good practice would be to include only significant objects on screenshots, and make them as atomic as possible but without compromising their uniqueness.
Answer: For less developer centric test automation for Sikuli, also check out RobotFramework.org. There's a tutorial on how to make a (custom) Sikuli test library for Robot Framework
http://blog.mykhailo.com/2011/02/how-to-sikuli-and-robot-framework.html
and I created a simple generic version as well
http://code.google.com/p/simplesikuli
And if there was ever limitations for Sikuli in terms of window handling, GUI controls, mouse and keyboard interaction, you can always complement it with another great free test tool: AutoIt. AutoIt by itself also has limitations, when you combine it with Sikuli, they make up for each tools shortcomings, to replace commercial grade GUI test tools.
Answer: Here's my take on the awesomeness of Sikuli for test automation: http://pculture.org/devblogs/mirotesting/2011/06/24/using-sikuli-to-automate-miro-testing/
I have a reliable cross-platform test suite for Miro.
Answer: I am actually writing a framework for GUI testing/error handling with sikuli.  It's great.
Answer: I have used sikuli for GUI testing, also i was able to integrate it with HUDSON.
Answer: I have just published my own framework for GUI application testing using Skikuli + RobotFramework.
SikuliFramework provides an object-oriented abstraction on top of Sikuli to assist with interacting GUI elements, such as sets of buttons, checkboxes, radio buttons, windows and dialogue hierarchies for GUI automation and testing. It also has tight integration with RobotFramework.
https://github.com/smysnk/sikuli-framework
Answer: Sikuli is based on static image matching. So it is only suitable for situations where the GUI is sufficiently stable. For dynamic GUI such as animation or GUI which includes some kind of randomness, it is not so applicable.
And Sikuli only covers the visual part of the tested. It has no idea if the internal state is indeed as expected.
Answer: I am a fan of Sikuli and I believe that it is complementary to other tests and can save much of the manual testing efforts.
However, it takes time to get it right.
I gave it a second shot in the span of two years and the second time I was able to achieve good results as I was more familiar with the environment.
It comes with an intuitive IDE and python makes it easy to extend a few things.
It's very easy to change click positions, set tolerance and record things. Once you get hold of how to record and check documentation, it becomes easy to use minimum images and improve accuracy. It catches changes in the GUI and results quite easily. It is also easy to wait for a certain event. Error checking is easy.
The biggest issue with it is that the recorded tests often fail if you just run it on another machine than the one it was recorded on. It might have to do with the image comparison based pattern matching. One can improve the match pattern probability by giving tolerance values. But it gets annoying at times to keep on changing the tolerance. My recommendation is to use a different set of images on different platforms and preferably run it on a single machine or VM.
Once you have a common set of workflows, you can make a library of those common functions such as (open-close-save project, change settings)and use across different scripts. It becomes very easy as the library gets comprehensive. It also means that you will have to change the script only at a single location and it will reflect in all the scripts.
I also created a simple framework (image attached) to run the tests and record results using C# .Net. One can make use of anything to create a simple test run application. It just needs to run the test on command line and check the results.

I was working in a small team in which we had limited testing resources. With Sikuli I actually saved efforts of existing QA team and also helped myself catch the bugs before pushing it to main.
I recommended Sikuli to members of other teams in my company and they use it to generate the dataset for the ML models. They did it by automating their Engg application with parameters.
Sikuli takes time to sink in initially. But when done right, it could save lots of efforts.


How to run a script if external IP is changed?

Question: How can I execute a bash script when the external IP is changed. I wonder if there is a hook in macOS to run such a script.
Answer: Your computer has no way to detect by itself that the external IP has changed, as this is handled by the router that translates your private IP to the public one.
So you must poll either the router itself, or an external site.
The router can be interrogated through SNMP le if it supports this protocol.
If it doens't but has a command line (CLI) access then you can use it with a language like expect.
If the router is only accesible through a web interface, this is doable but more complex.
You can actually avoid polling if the router support sending SNMP traps or has an event handler, then it is the router that can notify you computer about the change, and then you run your script on reception of such notification.
Comment: You may be able to use uPnP for this as well, but probably SNMP and uPnP are overkill and you can poll some external site giving you the request ip.
Comment: @allo Polling an external site periodically is what I'm thinking to do, since I'm more comfortable to implement it.
Comment: There are services like dyndns that provide a dns name and polls to see when the up address changes


Downgrade SharePoint WFE with respect to apps server

Question: I am trying to add new WFE to existing SharePoint 2013 farm,For that i installed Prerequisite,SP2013,SP1,CU and language Pack etc...During the installation unfortunately i have installed higher version setup(Language Pack) in my WFE,when
i run product config wizard,its throwing up message like "Missing 15.0.4571.1502 version in APPs Server".To resolve this issue,i have uninstalled higher version in my WFE. Then i ran Product Config wizard,but still its throwing message "Missing 15.0.4571.1502 version in APPs Server".(Even I restarted the Server after uninstalled 15.0.4571.1502 version in my WFE).
Answer: As per my experience, you cant uninstall the patches once it installed.
You have to un install the SharePoint then re install it with correct patches.


What is the difference between Collections and "Stored Collections" in Java? and why "Stored"?

Question: What is the difference between Collections and "Stored Collections" in Java? and why they are called "Stored"?
Comment: Where do you have seen both terms ? I don't understand the question.
Comment: Stored Collections are not a standard JDK feature. This is some addition from Oracle based off of Berkeley DB.
Comment: http://docs.oracle.com/cd/E17277_02/html/collections/tutorial/createbindingscollections.html          --> second paragraph
Comment: First link on google for "Java stored collections": http://docs.oracle.com/cd/E17277_02/html/collections/tutorial/UsingStoredCollections.html
Comment: Section Stored Collections Versus Standard Java Collections
Comment: yes, already seen this. I am a newbie. need a less technical explanation
Answer: I've never heard about "stored collections" in the default Java API. There are stored collections in certain database-related libraries, however. For example, the Java libraries for Oracle have so called "stored collections", which are basically nothing else than collections that can be persisted using an Oracle database.
Answer: Stored Collections are not a standard java concept. I assume you are referring to the Oracle concept. That link describes some of the differences, but the upshot is that the database is using (abusing - because it violates the contract) the Collection interface in order to provide storage in a database. Standard java Collections are in-memory only objects, and storage and retrieval are done with separate APIs.
Answer: Collection in general describe an object which can handle a number of other objects. Stored collections is a term used to describe collections stored in a database (hence the term).


Where can I find "Use Nodes" checkbox for Light objects in Shader Editor?

Question: I'm using Blender 3.3 and I can't find the Use Nodes checkbox for Light objects in Cycles. Where do I find this checkbox in Cycles?
Answer: It should be under the light properties (with the light selected):

It can also be accessed from the shading tab (also with the light selected):

If your settings do not look like this, something may be wrong with your blender setup. Start with factory settings if necessary


Is it allowed to spend a night in the first entry country before moving to the main destination?

Question: I have booked to spend a night in the first entry point which is Germany. Then in the second day I'm going to move to the main destination (Switzerland), where my visa has been issued, by car.Is that illegal and I have to have a flight to the main destination at same time?
Comment: Is the airport you landing at normal for people going to Switzerland?
Answer: No problem at all if you explained it in your visa application.
If you want to make changes to your original itinerary, that is also possible, but then you must avoid the appearance that you misrepresented your itinerary. Having hotel reservations, etc., for Switzerland should resolve this.
Answer: You did your job great. Schengen rules require that you apply for the visa by the main destination of your itinerary, not the port of entry. You applied in Switzerland, you are going to visit Switzerland for the main of your journey. Check ✔
Now, Schengen rules allow you to visit every Schengen country in any order. No one forbids you to stay in Germany even for one night, even for the first night. You can request visa to Switzerland as soon as you can justify it's the main destination.
At the border in Germany, if immigration ask for documentation, you can easily show both of your hotel reservations and they will have nothing to say against letting you in.
When you will be driving to Swiss, you will cross customs but since you are still in Schengen area there are odds that no one will bother you. It is very unlikely that in the event of a police check they will ask for documentation about your visit, since you already cleared immigration to the Schengen space by the German immigration.
A final word about misrepresenting the itinerary. In theory, you could request visa in country A, book a very cheap lodging (e.g. hostel, Couchsurfing...) in country A and at the same time book a proper lodging in country B; then you can get your bogus reservation ready for show-off and hide reservation for country B, by simply not printing/showing it when asked. At the current time, no one is capable of discovering this unlawful behaviour.
Comment: I would like to upvote this, except the last paragraph looks rather like a nudge-nudge-wink-wink advice to lie to immigration.
Comment: @usr-local-ΕΨΗΕΛΩΝ, it is best to edit the last paragraph, telling that it is illegal and if found out it can have serious follow up, like being banned from the Schengen area for a long time (or forever.)
Comment: @HenningMakholm my statement was a factual consideration and not an advice/solicitation. Maybe Europe should be worse than the Big-Brother's country where every private interaction of a traveler is pre-monitored and pre-screened in order to find such *cheating*. Or maybe it's just tooooooooooooo expensive to enforce *something* to catch this kind of cheating than the real loss caused by the few cheaters. After all, IMO/AFAIK the reason of the main-destination visa rule is on economic grounds to balance the administrative costs that diplomatics have to sustain. That goes beyond our scope anyway
Comment: Maybe I should just put emphasis on `unlawful`


display base currency symbol in checkout

Question: My store base currency is AUD and the local store displays the currency values with A$, I have an international store which has currency displayed in USD. The catalog items all display on US$. When I go to checkout-payment page in International store the symbol next to this text "Your credit card will be charged for" displays as just $ instead of A$. The amount however gets converted correctly to AUD. How to display the symbol as A$. I have attached screenshot of the same.
Answer: For Magento 1:
Goto system -> Manage Currencies -> Symbols
And then change the currency symbol for AUD which is currently you have set $ to A$.
Comment: I am looking for magento2
Comment: Yes the same feature is also available on magento 2.


Calculating $\displaystyle{\int_0^\infty e^{-i\omega t}dt}$

Question: I was studying Fourier Transform; I could answer to this $$\int_{-\infty}^\infty e^{-i\omega t}dt$$ by Fourier Transform, but I have problem in $$\int_0^\infty e^{-i\omega t}dt.$$ I would be grateful if you help me to get the point of this integral.
Comment: So you want to integrate $$\int_0^\infty e^{-jwt}dt.$$
Answer: It's the Fourier transform of the Heaviside step function (which is zero for $x<0$). It only exists in the sense of distributions. Does it help if I point you to entry number 313 in Wikipedia's table of transforms?
Comment: I was not aware of the difference. For me Laplace and Fourier transform is all the same just a bit rotated ;-)
Comment: the Fourier transform actually exists for $\text{Im}\, \omega < 0$.
Comment: @Fabian: Sure, but when one says "Fourier transform" rather than "two-sided Laplace transform" it is usually understood that $\omega$ is a real number.
Answer: Assuming $\text{Im}\,\omega<0$ (for convergence), you can calculate the integral easily
$$\int_0^\infty e^{-i\omega t}dt = \frac{e^{-i\omega t}}{-i \omega} \biggl|_{t= 0}^{\infty} = \frac{i}{\omega}.$$
As some people want to use the fourier transform for $\omega$ on the real line, they write
$$\frac{i}{\omega - i 0^+}$$ where the $0^+$ reminds them that the original integral was only defined for $\omega$ in the lower half plane.
At some point, you might learn about distributions (which Hans Lundmark was referring to) and then you can use the Sokhatsky-theorem and rewrite it as
$$\int_0^\infty e^{-i\omega t}dt = \mathcal{P}\frac{i}{\omega} - \pi \delta(\omega).$$
Comment: Thank you so much for your kind help.I'm thinking and studying to learn what you mentioned about Sokhatsky Theorem and distributions.


Relationship between RAM and CPU to assign to servers

Question: I would like to know if there is any method, formula, recommendation or good practice to establish the relationship between CPU and RAM on a server, be it physical or virtual, I have recently seen virtual machines (VMWare vSphere 6.5) that had assigned a quantity of CPU to my seem disproportionate, example a vm with 32 GB of RAM and 26 CPU, another with 16 GB RAM and 8 CPU, I am not clear how these resources should be allocated, could you please clarify if there is any way to calculate it or some method to assign them?
Thank you
Answer: Software will require an amount of RAM to run and will need a certain amount of CPU to perform efficiently.
A virtual machine would need to be assigned the correct amount of RAM and CPU based on what software you plan on running with it.  Some software wants lots of CPU but can get away with little RAM, others want lots of RAM but do not need much CPU.
You should be able to change either RAM or CPU without affecting the other.  There is no direct, proportional relationship between RAM and CPU on a machine.


Microformats in ASP.Net WebForms

Question: I am writing a basic search feature that searches for a string in a SQL DB, and then returns the rows where the string is present. I am using a DataGridView as the table to present this information. This is my "get" function:
public void DisplaySearchResults(string searchStr)
    {
        SqlCommand cmd = new SqlCommand("Vendor_SearchVendor",
        new SqlConnection("connection string here"));
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.AddWithValue("@SearchString", searchStr);
        cmd.Connection.Open();

        SearchTable.DataSource = cmd.ExecuteReader();
        SearchTable.DataBind();

        cmd.Connection.Close();
        cmd.Connection.Dispose();
    }

where SearchTable is the DataGridView.
I need to implement microformats for the values returned i.e. instead of

you would have

I follow how to do this for standard HTML, but the data grid has an  tag and the different columns have  tags, and I can't add the microformat tags to them.
I thought about converting the DataGrid to HTML, but that solution would involve having a data grid table constantly present, which is not what we want. In fact, I don't think microformatting here makes sense because, as I understand, microformats are for static text and the data here may or may not be generated based on the display shown.
To conclude, should I even try to microformat given what I'm trying to do, and if so, how should I go about it?
Thanks.
Answer: Use an <asp:ListView> instead — it gives you much more control over the HTML output.

Microformats in ASP.Net WebForms


Can't connect to machine behind router VPN

Question: We have an AdLink industrial PC running Ubuntu sitting behind an Asus broadband router (RT N12) at a customer's home, and I'm having trouble accessing it from outside the network. Details:

When the PC was connected to an external static IP on our office, I
was able to ping it as well as VPN into it using OpenVPN over port
1194 via TCP, then, once VPN'd in, was able to access an application
on it via HTTP on port 8088
We enabled VPN on the router and port forwarded 1194 to the PC IP's 1194 as well as 1022 to the PC IP's 22 for SSH access and 8088 to the PC IP's 8088 The router uses PPTP for VPN. I was able to successfully connect via the built-in PPTP provider on my windows 10 box
Initially, the router created an internal private IP address in the 192.168 range, which was the same as my internal home network behind my internet router, so we adjusted the customer's router to use the 172.16 address range. The AdLink PC was able to obtain an IP address in that 172.16 range behind the customer's router
When I am VPN'd in to the router, I can ping the router's internal IP address but not the AdLink PC's internal IP address
After I ping the router, I can run arp -a in a command prompt and see the AdLink IP address under the Interface with the customer router's IP address
I cannot ping or ssh or browse to the HTTP service at 8088 on the PC
Someone on site, who was connected to the router directly via a network cable, was able to ping and ssh into the machine
The router has a network ping feature, and it can ping the attached PC

Outside the port forwarding, router VPN setup, and DHCP address range change, I'm not sure what else try to obtain a connection to the PC. Any other suggestions are welcome. I'm a software engineer by trade and do not know this kind of networking in any depth.
Comment: I don't understand your last bullet (''Someone on site was able to connect to the machine while on the local network'').  Can you rephrase that?   Please do not respond in comments; [edit] your question to make it clearer and more complete.
Answer: Several things were wrong:

Client IP list overlapped with the DHCP internal IP list
VPN access through the firewall needed to be enabled via specific port forwarding
DMZ had to be enabled


BiPolar Stepper Motor Polarity

Question: In my understanding, the polarity of the magnetic field of a bipolar stepper motor does not matter. You can hook it up to the biploar driver either way and it would still work correctly. However, is there a drawback to reversing the polarity of the magnetic field by hoooking it up incorrectly?
Answer: It technically doesn't matter.  Bipolar stepper motor drivers need to be able to drive current in either direction through the coils.  However, I assume that you'll be using some off the shelf stepper driver, and if it just takes DIR and STEP inputs, by wiring it up in an arbitrary matter your motor might not step properly, that's all.
Answer: If it's the four-wire kind, you can't really hook it up backwards. Both coils are designed and intended for current to pass in each direction. In fact, to get rotation at all requires periodically reversing the direction of the current first in one coil, then in the other.

BiPolar Stepper Motor Polarity


Jesus speaks about actors/acting?

Question: What book in the bible does Jesus say something about the souls of entertainers being dark as a moonless night or something similar to that.
Comment: Welcome to CH.SE. This will be hard to answer without more context, and if you had more context you probably wouldn't have asked the question. Our word "hypocrite" comes from the Greek word for actor, so I suspect Jesus may have used "actor" figuratively to refer to someone who was "two-faced", insincere, "just pretending".
Comment: If you Google 'soul dark as moonless night' you will find it is not from the bible.
Answer: As a long time actor and a Christian I assure you that there is no such verse in the Bible.
What I suspect you are thinking of is one of the many verses in which Jesus condemns hypocrites and hypocrisy. Here is a search that will give you many of them. They are talking about those who pretend to be virtuous on the outside but inwardly are corrupt.
The claim is sometimes made by those that dislike entertainment of all kinds that the word 'hypocrite' derives from the word for 'actor', and this is in a sense true (it comes from French and Latin and ultimately from Greek), but the word did not mean that at the time when the Bible was translated to English, and the original Bible verses are not referring to actors, but to 'hypocrites' in the sense that we understand the word today.
Answer: As already communicated, outside of the calling people "hypocrites," Jesus did not talk about the theater.  But, here are a few related tidbits to add to what has already been said.

Paul likens the one who does not love to the bronze amplification 'gongs' of the theater (1 Corinthians 13:1). See "Sounding Brass" and Hellenistic Technology (https://members.bib-arch.org/biblical-archaeology-review/8/1/5)
It is likely that Jesus was very aware of the theater.  The major metropolis of Sepphoris was only a few miles north of Nazareth.  Jesus lived at the height of an economic boom that would have provided a carpenter from Nazareth with ample work.  The 4000 seat theater of Sepphoris was constructed at the time of roughly 20 AD.  It is here that Jesus may have picked up the word "Hypocrite."
In Augustine's Confessions - He speaks about the theater (book 3.2) " I was much attracted by the theatre, because the plays reflected my own unhappy plight and were tinder to my fire. Why is it that men enjoy feeling sad at the sight of tragedy and suffering on the stage, although they would be most unhappy if they had to endure the same fate themselves? Yet they watch the plays because they hope to be made to feel sad, and the feeling of sorrow is what they enjoy. What miserable delirium this is! The more a man is subject to such suffering himself, the more easily he is moved by it in the theatre. Yet where he suffers himself, we call it misery: when he suffers out of sympathy with others, we call it pity. But what sort of pity can we really feel for an imaginary scene on the stage? The audience is not called upon to offer help but only to feel sorrow, and the more they are pained the more they applaud the author. Whether this human agony is based on fact or is simply imaginary, if it is acted so badly that the audience is not moved to sorrow, they leave the theatre in a disgruntled and critical mood; whereas, if they are made to feel pain, they stay to the end watching happily."

Jesus speaks about actors/acting?


Quantum mechanical experiments with large objects

Question: What are some examples of quantum mechanical phenomena that have been observed not with electrons but rather with large real-life objects? In particular, what is the largest object for which the double slit experiment has been successfully performed with?
Comment: see https://vcq.quantum.at/fileadmin/Publications/2003-17.pdf for fullerenes
Comment: https://en.wikipedia.org/wiki/Macroscopic_quantum_phenomena
Comment: Or I could ask you to mention how this molecule is prepared, how it is done, as you can see below, it's is a bit more sophisticated that an electron gun or a photon source. This may allow us to learn how to eventually perform the DS experiment with a cell, but that is a long way off yet.
Comment: Maybe you should change the title to include just the double slit. Superconductivity and superfluidity are quantum phenomena over large distances. Also one could say that crystals fall in that category. All three are not explainable classically but need quantum mechanics.
Comment: We could then add magnetism as QM-effect, see the bohr van leeuwen theorem https://en.wikipedia.org/wiki/Bohr%E2%80%93van_Leeuwen_theorem
Answer: As I say in my comment, there is probably a duplicate of this, that will turn up as soon as I  write this,  but as technology advances, perhaps it's out of date.
This answer concentrates as much on how you prepare "large" molecules, as I think that aspect is of interest in itself,  but we cannot approach the size of a virus or any tiny bacteria as yet, or for the foreseeable futures, as far as I know.
From Largest Molecule Double Slit.
These molecules are around 100 atoms in size, compare to the 180, 000 atoms in the smallest virus.

The relatively large phthalocyanine $C_{32}H_{18}N_8$ and derivative molecules $C_{48}H_{26}F_{24}N_8O_8$ have more mass than anything in which quantum interference has previously been observed. To have wavelengths that are relatively large compared to their sizes, the molecules need to move very slowly. This was achieved this by directing a blue diode laser onto a very thin film of molecules in a vacuum chamber, effectively boiling off individual molecules directly under the beam while leaving the rest unaffected.
After separation from the film, the molecules were sent through a collimator to ensure they formed a beam before reaching the barrier, which had a number of parallel slits to produce the actual interference pattern. To prevent excessive interactions (primarily van der Waals forces) between the molecules and the edges of the slits, the researchers used a specially-prepared grating coated in silicon nitride membranes. Without such preparation, the molecules are likely to be deflected by ordinary interactions with the hardware.
After passing through the slits, the molecules' positions were recorded using fluorescence microscopy, which has both sufficient spatial resolution and fast response to detect when and where the molecules arrive. The positions of individual spots were measured to 10 nanometer accuracy. Additionally, the molecules lodged in the fluorescent screen, meaning their positions could be independently verified in the form of build-up at the experiment's end.
Comment: Great question! CountT10 and the referenced article have given you the answer. But the answer has raised another question with me. What's the smallest object that does not exhibit the wave particle duality? Like with a limit in calculus the wave particle duality "limit" could be found by approaching from both sides.
Comment: CountT10, the OP's question was what were some large object experiments with the double split?. The article you linked to clearly, in my opinion, gave a example of exactly what was requested by the OP. I should have said that the article answered the question rather than saying CountTo10 and the article answered the question. For that I stand corrected. Thanks for reading my comments.


A very loud, short- lived howl

Question: Within the last eighteen months, I'd say - commercial aircraft descending into Heathrow have started to emit a terrifying, short-lived but very loud whining howl when they pass over my house. They are about 1500-2000 feet on the final approach. it's a relatively recent phenomenon, so must be caused by a modification of some sort - I've only started to hear it lately. The worst examples are really scary, it sounds like a mechanical failure of some kind. The undercarriage are coming down around this time, so it may be that - but as I say, I've only started to hear it recently - and I've lived here for over forty years... what on earth might it be? It lasts for about 5 secs max, but frequently sets my pulse racing....
Comment: Is every single aircraft making this noise? I highly doubt so, as Heathrow sees just about every active aircraft design, and there are no global modifications across them all. It would be most helpful if you could identify which models are making the noise. There are several plane tracking apps, like FlightRadar24, which will tell you the aircraft type and it's altitude, which you can match to the sound. If you give us those we might be able to provide a proper answer.
Comment: This seems to be the most likely cause: https://aviation.stackexchange.com/a/96645/63967
Comment: I did as you said... first time I've heard it for a while.... it was indeed an A-220... theory holds up! Thanks!
Comment: Actually, it's not EVERY  aircraft, but it's pretty common, and, as I say it's a relatively new phenomenon - I'd say post-pandemic... I've had Flight Radar for years - I haven't bothered to track the  aircraft, because, as I say - it's too frequent. Maybe I'll try...It may be a change in procedure, rather than a change in hardware... or, perhaps a particular airliner - maybe it only happens when flights cut into the holding pattern and have to descend more rapidly? I'll see if I can pin it down
Comment: @TimStaffell You can verify it - when you hear that howl, open Flightradar24 and check if it is one of the first three aircrafts mentioned on my list. If it is, you've got your answer.
Comment: Glad I could help, good day!
Answer: Some airplanes make strange sounds when the landing gear is deployed/stowed, or flaps are lowered/raised. The BA-146 is famous for making a loud descending boooo noise when the flaps are lowered, for example. I live under one of the approach paths for London City, and the first time I heard it I thought I was about to witness an accident, but it is perfectly normal.
So there's nothing wrong or broken, it is caused by changes in configuration.
Comment: Yeah I was seated under the wing of a 146 when the flaps came out. Scared me silly.
Comment: This plus maybe a route change that cause aircraft to perform this at a different spot (op house)
Answer: The possible sources
Multiple components on a turbine engine can produce a howl, and the three most common sources are the air inlet, the compressor, and the combustor. Please identify which one of these you are talking about.
Inlet Howl
The howl like the one on Vulcan is due to the shape of the inlet - at certain power settings, the air inrush through that uniquely shaped inlet produces the howl. But Vulcans don't operate at Heathrow, and neither do any other aircraft with such oddly shaped inlets.
Compressor Howl
This is a much higher frequency howl produced due to the leakage of air through the compressor blade tips. This is produced on all engines, but is drowned out by the fan and exhaust noise on modern turbofan engines used by the aircrafts operating from Heathrow. This howl is the predominant sound on Su-57.
Combustor Howl (Suspected)
To allow for expansion due to heating, the combustor is not directly connected to the nozzle box¹, it is connected through sealing rings² - this connection allows for the axial movement of the combustor. This along with the fact that the combustor is only supported on two points - one on the compressor side and the other on the turbine side, means that it is free to vibrate.
At certain fuel flow rates, the combustor vibration can produce a sound that can be heard from even 10-15 kilometres away, like during a GE90 startup.
On some engines, this sound can be heard at higher fuel-flow rates as well, producing a brief loud howl like on the Pratt & Whitney GTF series engines. Engines from this particular series are used on the following aircraft:

Airbus A220
Airbus A320-neo family³
Embraer E-jets
Mitsubishi MRJ's
MC-21

The first three of these do operate from Heathrow, and are likely to produce that howl as power is adjusted during the approach, and it is probably this combustor howl that you are talking about.

¹ Gases exit the combustor into this nozzle box before entering the main turbine assembly.
² The sealing rings allow for the elongation of the combustor while ensuring an air-tight seal.
³ Not all A320-neo's have this engine - there are five engines in total that power the A320, two of which power the A320-neo. The models which are powered by the P&W GTF engines are: A320-171/-271/-272/-273.

A very loud, short- lived howl


Is the speed of Earth's spinning constant over a given 24 hours?

Question: Is the speed that the Earth spins on its axis constant over the course of 24 hours?
As opposed to does it turn faster and slower during different hours over any given day even by a very small variation. Who has made such measurements and how were they made?
Comment: https://xkcd.com/162/
Comment: Leaving the moon and other external sources aside, the moment o inertia is ruled by how the mass of earth shiftes to and fro its center. A major earthquake may shift enough mass to alter the length of day by a few microseconds. Summer lengthens the day by an infinitely amount, as there are more trees in the northern hemisphere, growing leaves some few meters above t ground and then shed them to ground level. Psibly (citationNeeded) there are also very, very,very minor effects on heating and cooling of air, unequal to the hemisph, that cause air mass t extend far o closer to center o gravity.
Comment: The Earth's rotation is monitored and documented by the International Earth Rotation and Reference Systems Service (IERS). See https://www.iers.org/IERS/EN/Science/EarthRotation/EarthRotation.html & https://en.wikipedia.org/wiki/International_Earth_Rotation_and_Reference_Systems_Service
Comment: https://www.cambridge.org/core/services/aop-cambridge-core/content/view/84497BCD02BEF00B835B7A4DE21C15BE/S1539299600010339a.pdf/earth-rotation-variations-from-hours-to-centuries.pdf
Comment: Related: The Shortt–Synchronome clock in 1926 was the first clock accurate enough to detect seasonal changes in Earth's rotation rate.
Answer: The rotation of the Earth (~73 µrad/s) does speed up and slow down by a few picoradians per second during the day because of solar/lunar tidal forces acting on the asymmetric distribution of the Earth's mass, and these variations can now be observed in real time by ring laser gyroscopes.
Because of angular momentum conservation, the Earth's rotation changes whenever its moment of inertia changes, which can happen because of earthquakes rearranging the tectonic plates, or more regularly because of earth, ocean, and atmospheric tides. The Earth's mass is not precisely spherically symmetric, e.g., the continents and oceans are asymmetrically distributed, so the size the Earth's tidal bulges (and hence its moment of inertia) changes depending on which parts of the Earth are closest to the Sun or Moon. This causes semidiurnal (~12 hour) and diurnal (~24 hour) changes in the Earth's rotation speed due to tidal cycles and a daily wobble in the direction of the Earth's axis.
As discussed in a recent article on "Variations in the Earth's rotation rate measured with a ring laser interferometer", the best modern instruments can resolve 12 prad/s in just a one second measurement and are sensitive down to a fraction of a prad/s for changes with periods of a few hours. The expected variations in the Earth's rotation speed with periods of ~12 and ~24 hours are seen.
Answer: The answer is that it depends on how technical you want to get.
At first approximation, no, the speed of the Earth's rotation is constant.
Getting more technical, the speed of rotation of the Earth depends on a lot of different factors: tides, distributions of atmospheric and oceanic masses, etc... A big factor in the Earth's rotation (and orbit) is the interaction with the Moon. This is known as tidal braking or tidal acceleration. Halley was the first to suggest this with considerations of the Earth's orbit and Laplace was the first to give a theoretical framework for changes in the Earth's orbit due to this interference. I know that this isn't exactly to Earth's rotation, but it is very much related.
The result from all of this is that the rotation of Earth is slowing, mainly due to this effect. Days are longer by around 2 milliseconds since the last century.
Another less important cause of Earth's rotational retardation is due to tidal acceleration from heat dissipation; however this is a very small effect.
Some of the measurements regarding the rotation speeds of Earth are made though very-long-baseline-interferometry (VLBI). Very briefly, telescopes in multiple different places (on the surface or in space) receive radio waves from natural source deep in space. The time differences in when these telescopes received these sources can be used to make quite a few measurements regarding Earth's natural parameters including LOD fluctuations as well measurements regarding Earth's surroundings.
Comment: The LOD fluctuations link is very informative. Thank you for addressing my question. It indicates there are fluctuations occurring even within several weeks.


What is this? Not: crabgrass, fescue clumps, quackgrass? Course and bright yellow?

Question: I'm stumped on this one ... as I've tried to compare growing patterns with the forum and it doesn't quite fit the crabgrass. quackgrass or fescue clump category as it's not really concentrated in one area or does fan out from one central root. But the thicker stalk seems to resemble. It shows up as bright yellow on my lawn and isn't spotty, but just blankets sections. On the other side of my lawn it seems to have uniform spread across 80% of my lawn. I've never seen these before in previous years and hoping with the warmer summer coming, it will naturally die off if I can nurture the regular grass to grow more. Help?
Answer: First and last picture looks like a clumping/coarse fescue.  Very common in northern blended turfs.  Even TTTF will begin clumping heavily under stress and may need thinning (scarifying) and reseeding to keep blade and clump sizes under control.  I've found that the texture of older TTTF cultivars can be a challenge if you don't have other grass types to keep regular spacing.
Second picture, with the lime green coloring, looks like a poa (annua) infestation.


Android: Alternative GIF loader?

Question: I want to load images in Android, but if the image is just too large I wanted to resize it prior to loading . I learned that one can use the BitmapFactory to get just the size of the image, then one can figure out an appropriate scaling factor and use BitmapFactory to load the image with the required dimensions (per the very competent suggestions I found in this related thread).
So I tried that and it refused to work. I spent the last hour picking through the code trying to figure out why such a simple operation wasn't having any effect whatsoever (the scaling factor was being utterly ignored!)
Then I stumbled upon Android issue 3072... turns out this has been identified as broken for GIF files for well over two years. I realize GIF isn't exactly modern but it's still out there and in wide use (my test set has a lot of them, which is why it seemed uniformly broken until I found that bug report).
My question is, what can I use as an alternative to BitmapFactory that will correctly read and resize a GIF file when a scaling factor is employed without silently ignoring it? Memory constraints preclude loading large images directly for further processing, so this would need to be a streaming solution.
My other question is, how many others run into old, unfixed bugs like this and either don't realize it or worse, rely on the API to accurately perform the requested function and end up with memory leaks and other strange surprises?
Comment: I was wondering if you ever found anything. 1.5 years after your post, and this issue still is not fixed...
Comment: I suspect people just write around it anymore. It's too bad really.... the bug isn't fixed and I moved on from that need.
Answer: I ended up using the solution posted here.
options.inSampleSize = 2;
bitmap = BitmapFactory.decodeStream(new URL(url).openStream(),null, options);
Bitmap scaledBitmap = scaleDown(bitmap, 1280, true);
bitmap = scaledBitmap;

Where scaleDown is:
public static Bitmap scaleDown(Bitmap realImage, float maxImageSize,
                               boolean filter) {
    float ratio = Math.min(
                (float) maxImageSize / realImage.getWidth(),
                (float) maxImageSize / realImage.getHeight());
    int width = Math.round((float) ratio * realImage.getWidth());
    int height = Math.round((float) ratio * realImage.getHeight());

    Bitmap newBitmap = Bitmap.createScaledBitmap(realImage, width,
                height, filter);
    return newBitmap;
}

as used here.
Comment: Thanks for that solution! It's nice to finally get some sort of closure on this question.

Android: Alternative GIF loader?


Bevel Edge after Boolean Difference

Question: I used a Boolean operator on a cylinder to punch a hole through my vase (see image). I want to bevel the edges of the hole. How can I do this? The vertices of the hole don't align with that of my vase.
Answer:
The reason the vertices don't line up is because the boolean makes its cuts wherever the two surfaces intersect. This leads to all kinds of artifacts and other issues and is often not ideal. For this reason, booleans are often a bad choice when we need very even topology after we are done modeling. That said, you may still be able to bevel, provided you don't need the bevel to be very deep. With the desired edges selected in edit mode, press Ctrl-B. This will allow you to create a bevel by moving the mouse to determine the extent of the beveled surface. However, be warned: As the included pic illustrates, you may have trouble because of your uneven topology. If you do, you will need to remodel the area of intersection so as to give the edge to be beveled better surface flow (or at least, to give yourself more room to create the bevel). Based on your pic, I would say almost any bevel you create is going to cause a problem like the one I'm showing in my image. What you don't want is edges crossing through other edges or vertices as you adjust your bevel (which is precisely what my image shows happening in the third frame). If you don't want to remodel anything, then consider redoing the boolean, and take care to ensure that no vertical spans on the cylinder that you are cutting into happen to intersect with the hole made by the cylinder that will be doing the cutting. If you can ensure that, then your bevel will probably work, though it will have ngons and possibly other odd edge artifacts even under the best of circumstances. Sadly, the only surefire way to avoid all this trouble is to avoid using booleans altogether.

In the first frame is a bevel performed after a boolean, while taking care to leave sufficient room between the intersecting objects to ensure that the bevel edge will not later encroach on any other edges. If you look closely, you can see that there is still a problem with extra edges forming in the bevel region, due to bad topology. The second frame shows what I get after deleting theses extra edges and then adding topology sufficient to get rid of all the n-gons. This isn't exactly pretty topology, but this should hopefully illustrate what can happen after using booleans and what kind of outcome you should be working to achieve so that you can create your bevel without inviting further complications. Note that because of this extra effort, if I was now to add another bevel to the rim of the object in the second frame, I would not have any more issues.
Comment: So if you were to start from scratch and not use boolean operators, how would you do it?
Comment: Good question. To be clear, there's nothing wrong with starting with a boolean, so long as you understand what can go wrong with them and are prepared to fix the resulting issues. So you could start exactly as you have, but take care to align the cutting object to avoid intersections with existing edges, then go in afterwards and do the edits needed to make the mesh clean. That's what I did in the final frame. In my case, there were doubles that needed to be removed, and this is a common issue to resolve after using booleans, since they often create cuts in ways that aren't helpful.
Comment: As to your question about alternative methods, the only thing I can think of is to use the knife project tool to cut the hole using the object you already have used for making the boolean, and then use Loop Tools to make it perfectly round afterwards, if necessary. Then delete the faces inside the hole region, extrude the edges making up the hole, and grid fill the interior edge to finish. Painstaking, yes, but it gives you complete control over the resulting topology at every stage. There are probably other ways, but I don't really know how else I would approach it.
Comment: "So you could start exactly as you have, but take care to align the cutting object to avoid intersections with existing edges, then go in afterwards and do the edits needed to make the mesh clean." I decided that this part of my answer isn't clear, so I'm creating a new one that will hopefully be more helpful.
Comment: Hello again. Here is an effort to explain the process that my previous answers were speaking to, but not adequately clarifying. Hope it helps. https://www.dropbox.com/s/kk1e0ey519v1mpj/Topology.pdf?dl=0
Comment: This is a great answer, thanks very much! I really appreciate the detail you provided as I am new to Blender. These tasks are very easy in SolidWorks and AutoCAD, I find it difficult to adjust. Thank you!

Bevel Edge after Boolean Difference


Does deleting a property from Google Search Console delete it for all users, or just me?

Question: Does deleting a property from Google Search Console delete it just from my own list or does it delete it for all users?
Answer: It depends on who gave access to the other users. If you delete the property and you are the verified owner that gave access, then everyone under you will lose the access. This means delegated owner as well as users.
However, other verified owners (new or existing) will be able to see every user and re-grant access.

If the verified owner of your site leaves, or you're not sure who the verified owner is, simply verify another owner for your site. The new owner will be able to see the list of all owners and users verified to that site, as well as the method used to verify each owner. You can then optionally unverify previous owners by removing their verification token (for example, removing the HTML tag from the site, for HTML-tag-verified owners).

Source: Google Search Console Help


woocommerce 3.2.1 not sending order notification emails

Question: Why woocommerce 3.2.1 not sending order notification emails to gmail, yahoo , ...
I have tested many ways to solving this problem like using smtp, disabling active plugins, testing other themes , ...
But nothing works and now I have installed older version (2.6.14) and is sending emails to inbox and works good.
I need latest version and need to fix it up.
Help me!
Answer: Have you checked the system status page in WooCommerce to see if there's anything not functioning properly?
Besides that you might want to see if it's actually a WooCommerce problem, or if for example sendmail() is not working. You can either check it in your PHP settings or by simply requesting a password change for your account and see if that email does arrive.
This has been a known issue in WooCommerce, and has apparently arisen when the woocommerce_defer_transactional_emails filter has been introduced. Try and see if that's the issue by disabling it using this code:
add_filter( 'woocommerce_defer_transactional_emails', '__return_false' );

If the problem persists, and you need your email back up and running asap I can recommend setting up a transactional email service like Postmark. Such services have always been the most reliable to me.
Comment: have done before what you said but not working....
Answer: Finaly got it!
if you have my problem you can do following steps to make it work:
install Easy WordPress SMTP. It the only one that works.
And do what is said in this link :
https://stackoverflow.com/a/25175234/2674546
Comment: Glad you got it working!