The bridge of guitar getting detached from the body

Question: I recently got my yamaha F310 acoustic guitar replaced because the part of the body to which the bridge was attached started swelling and it seemed that the bridge was about to detach from the body as there were many cracks developed around it.
Now that I've got the guitar replaced, I want to know what caused that problem because I want to take precautions for the new one. I handled the guitar very carefully. I think it has something to do with how I kept it because I always kept it lying on the bed. Maybe that was the problem but I'm just geussing. So, what might have caused that problem ?
Answer: Some possible reasons:

The guitar is ill-built. The manufacturer may have used a board which is too weak, or the bracings are incorrectly designed or installed. This is fairly common on less-expensive guitars;
The string tension is too high. You may have a set of high-gauge strings installed, which your guitar cannot bare. It's normally safe to use 0.11 gauge strings on most guitars with standard tuning, but not all guitars are designed to withstand 0.13 gauge string set;
The temperature is too high, or the humidity is too low. The glue which bind parts of your guitar might fail in such condition. It's always a good idea to put your guitar back to the case if not playing, especially in extreme weather conditions. A moisture-proof box will also help, although it could be more expensive than your guitar itself.
Comment: Are there really any decent 6 string acoustics which can't support a set of 0.13 (medium gauge) strings?
Comment: It would be exceptionally rare to find a guitar built for steel strings that would be limited to lower tension strings. Unheard of actually, unless it was a very poor manufacture.
Comment: The humidity could be too high, also. The top will expand as it absorbs moisture and it could buckle and start to pop off the bridge. You might mention that keeping the guitar in a case is better than keeping on a bed.
Comment: High humidity in itself shouldn't be enough to cause buckling of the face. It is rapid changes in humidity that causes the most problems, or very high humidity and heat. A guitar maybe shouldn't be left out of the case in places like Florida in the summer if you don't have air conditioning, but in most dwellings it is perfectly fine to leave an instrument out if its case. I have many of my instruments hung on my walls for easy access.
Comment: @DavidBowling It depends on the definition of *decent*. If the Yamaha F310 of OP's is decent enough, the answer is, yes there are, and surprisingly not rare. There is a tension limit for every guitar structure. For (an extreme) example, a fan-braced classical guitar cannot bare steel strings, not even the lightest ones. Steel string guitars have much stronger bracing, but It's not unheard of on many of those cheap guitars, *especially* on those $200 entry-level solid-top guitars, the bracings are not strong enough to withstand high gauge string tension. (...
Comment: ...) When there is something wrong with the bracing, like being weaken due to extreme weather conditions, the top board is even more likely to swell with high gauge strings.
Comment: @AlphonsoBalvenie I'm not sure what should or shouldn't be true, but when a solid wood guitar absorbs moisture, the wooden parts swell and deform. The top rises and can become more curved. Don't take my word for it, Taylor Guitars has a great article about it: https://www.taylorguitars.com/support/maintenance/symptoms-wet-guitar Rapid changes in humidity are actually **not** that dangerous. Prolonged high or low humidity is what's bad. That's because it takes days to weeks for a solid wood guitar to reach equilibrium with the relative humidity of the surrounding air.
Comment: @Todd Wilcox rapid changes in humidity from wet to dry can cause top cracking. For example, I did a top crack repair on a guitar that was kept in a case with a humidifier,  and then taken to the mountains where it was very dry, and the crack opened up within a weekend. My point was that unless the bedroom has a consistently high (over 80%) humidity, it is perfectly safe to leave a guitar out, especially a composite top like the F310.  Even when an instrument is subjected to high humidity, the top shouldn't buckle unless there is something wrong with the struts.
Answer: The raising of the face of a guitar is most usually caused by a problem with the soundboard struts.
In some cases the strut doesn't get glued properly during manufacturing and the issue won't show up until after some time under tension.
Occasionally a guitar model is built with a thin top or struts in unconventional locations that causes raising later in the instrument's life.
A sharp knock to the guitar can cause the glue on a strut to break away or the strut to crack, especially a hit on the side of the guitar where the strut end joins the body. The guitar can take a hit and not show any visible body damage. In some cases this can happen during shipping and isn't the fault of the owner.
The glue under the struts can weaken under high temperature, although you won't usually see a problem unless the temperature reaches around 120F / 48C. Higher humidity will make the glue soften at a lower temp. An instrument left in a car or garage, or in its case sitting in the sun in hot parts of the world can reach these temperatures.
Unless your room has extreme conditions of high humidity or heat, it is perfectly safe to leave the instrument out of the case. You might want to get a wall hanger or non-tripod guitar stand though, so there is less risk of the instrument getting knocked off of the bed and taking a hit.
String tension itself should not cause any problems on a standard built guitar made for that type of strings.  If there are mechanical problems with the guitar then higher tensions will cause a problem faster than lower tension strings. Putting steel strings on a guitar built for nylon strings will damage the guitar however.
Answer: When you play any string instrument the strings get warmed up and relax (or stretch) which is why all string instruments that haven't been used lately can need frequent additional tuning when someone picks them up again.
I was once asked about repairing a ukulele that had had the whole face ripped off because it had been left in tune for a very long time.
If you know that you won't use the guitar for some time, it is always a good idea to loosen the strings. A few weeks isn't usually a problem, a few months is.


Why is everything based on likelihoods even though likelihoods are so small?

Question: Suppose I generate some random numbers from a specific normal distribution in R:
set.seed(123)
random_numbers <- rnorm(50, mean = 5, sd = 5)

These numbers look like this:
 [1]  2.1976218  3.8491126 12.7935416  5.3525420  5.6464387 13.5753249  7.3045810 -1.3253062
     [9]  1.5657357  2.7716901 11.1204090  6.7990691  7.0038573  5.5534136  2.2207943 13.9345657
    [17]  7.4892524 -4.8330858  8.5067795  2.6360430 -0.3391185  3.9101254 -0.1300222  1.3555439
    [25]  1.8748037 -3.4334666  9.1889352  5.7668656 -0.6906847 11.2690746  7.1323211  3.5246426
    [33]  9.4756283  9.3906674  9.1079054  8.4432013  7.7695883  4.6904414  3.4701867  3.0976450
    [41]  1.5264651  3.9604136 -1.3269818 15.8447798 11.0398100 -0.6155429  2.9855758  2.6667232
    [49]  8.8998256  4.5831547

Now, suppose I calculate the likelihood of these numbers under the correct normal distribution::
likelihood <- prod(dnorm(random_numbers, mean = 5, sd = 5))
[1] 9.183016e-65

As we can see, even from the correct distribution, the likelihood is very, very small. Thus, it appears to be very unlikely in a certain sense that these numbers came from the very distribution they were generated from.
The only consolation is that the likelihood is even smaller when coming from some other distribution, e.g.
> likelihood <- prod(dnorm(random_numbers, mean = 6, sd = 6))
> likelihood
[1] 3.954015e-66

But this to me seems like a moot point: a turtle is faster than a snail, but both animals are slow. Even though the correct likelihood (i.e. 5,5) is bigger than the incorrect likelihood (i.e. 6,6), both are still so small!
So how come in statistics, everything is based on likelihoods (e.g. regression estimates, maximum likelihood estimation, etc) when the evaluated likelihood is always so small for even the correct distribution?
Comment: The probability of observing an _exact_ value from a truly continuous distribution might be zero, but your values are nowhere near exact, as they are expressed to 8 significant figures. The probability of observing a value that rounds to, or is observed to 8 significant figures is much higher than zero.
Comment: Welcome to Cross Validated! Would it help if we normalized the area under a PDF to a googol to inflate these numbers?
Comment: @AlexSmart - that is the probability.  But likelihood can be still be positive, as it is proportional to the density for an absolutely continuous distribution:  from a normal distribution, the likelihood of $X=\mu$ is $e^2 \approx 7.4$ times the likelihood of $X=\mu + 2\sigma$
Comment: Try with a smaller standard deviation in your example (the mean does not matter), perhaps less than $\frac1{\sqrt{2 \pi e}} \approx 0.24197$.  For  some seeds, including your `set.seed(123)` it will give a product greater than $1$ and for others such as `set.seed(122)` a product less than $1$ but still far higher than your example.   This illustrates that your likelihood calculation is related to the scale of your distribution, which is not particularly important. In fact likelihoods are only proportional to your calculations, and relative likelihood and likelihood ratios are what matter.
Comment: Yes, but think about how high the PDF y-values (the likelihood values) would be for the area under the PDF to be a googol.
Comment: You're mixing up likelihoods and posterior probabilities. The likelihood of d values from a Normal Distribution is defined to be the probability of sampling those d values given the parameters of the Normal. It is not the probability that those numbers came from that Normal Distribution. To answer that question, you need to say what other possibilities you're considering (perhaps some other parameter values) and use Bayes Rule. This will end up comparing the ratio of the likelihood to other likelihoods.
Comment: You could benefit from having a look at [Maximum Likelihood Estimation (MLE) in layman terms](https://stats.stackexchange.com/questions/112451/maximum-likelihood-estimation-mle-in-layman-terms/112480#112480)
Comment: isnt that for integration?
Comment: I am a bit confused. integrating a distribution tells the probability of observing a range of values. likelihood is for individual points .... because the probability of observing an individual point is 0 as I understand?
Comment: https://stats.stackexchange.com/questions/2641/what-is-the-difference-between-likelihood-and-probability, https://stats.stackexchange.com/questions/609166/what-is-likelihood-actually, https://stats.stackexchange.com/questions/97515/what-does-likelihood-is-only-defined-up-to-a-multiplicative-constant-of-proport
Comment: The likelihood of getting any particular outcome from a continuous probability distribution like the normal distribution is not just small, it is exactly zero. For every single particular outcome!
Comment: It's the curse of dimensionality, really. A 50-dimensional cube of radius 5 has rather high volume. The likelihood coming from the density thus has to be rather small
Comment: Computers use discreet computations, so you get discreet results which you can use to approximate to a continuous distribution. If you try to see those results as representing a continuous distribution, the precision of those numbers indicate the range you are working with. When you compute the likelihood of 5, from a continuous perspective you are approximately getting the probability in a range like this `[5.0000...000 , 5.0000...001)`, so it is expected the probability to be as small as the precision it has. It must be using a float data type, which gets more precise the lower the number is
Comment: BTW, thinking about how computers use `Float point numbers` internally to represent some numbers, and the fact that they increase their decimal precision the lower the number gets (and decrease on larger numbers). I realize that can affect the underlying range of each number, so I wonder how the language, and essentially all libraries in other languages handle this skewing effect that might make larger numbers have higher probabilities than they should have because Floats makes them represent a larger amount of real numbers
Comment: I'm not sure why you think that a value as enormous as ten to the negative 65 is a small number. That number is over a trillion times larger than an *infinite* number of positive real numbers. Does that give you any insight into your conundrum?
Answer: The key lies not in the absolute size of the likelihood values but in their relative comparison and the mathematical principles underlying likelihood-based methods. The smallness of the likelihood is expected when dealing with continuous distributions and a product of many probabilities because you're essentially multiplying a lot of numbers that are less than 1.
The utility of likelihoods comes from their comparative nature, not their absolute values. When we compare likelihoods across different sets of parameters, we're looking for which parameters make the observed data "most likely" relative to other parameter sets, rather than looking for a likelihood that suggests the data is likely in an absolute sense.
The scale of likelihood values is often less important than how these values change relative to changes in parameters. This is why in many statistical methods, such as MLE, we're interested in finding the parameters that maximize the likelihood function, as these are considered the best estimates given the data.
Because likelihood values can be extremely small, in practice, statisticians often work with the log of the likelihood. This transformation turns products into sums, making the values more manageable and the optimization problems easier to solve, while preserving the location of the maximum.
set.seed(123)
random_numbers <- rnorm(50, mean = 5, sd = 5)

# Function to calculate log likelihood of a normal distribution
log_likelihood <- function(data, mean, sd) {
  sum(dnorm(data, mean, sd, log = TRUE))
}

# Calculating log likelihood for the correct parameters
log_likelihood_correct <- log_likelihood(random_numbers, 5, 5)
print(log_likelihood_correct)
[1] -147.4507

# Calculating log likelihood for incorrect parameters
log_likelihood_incorrect <- log_likelihood(random_numbers, 6, 6)
print(log_likelihood_incorrect)
[1] -150.5959

# Comparison
print(log_likelihood_correct > log_likelihood_incorrect)
[1] TRUE

Comment: Unfortunately I could only accept one answer :( Thank you so much ... I wrote this question about simulations just like you...can you please see it? https://stats.stackexchange.com/questions/641165/how-does-simulation-help-check-if-model-assumptions-are-met
Answer: First, as others have mentioned, we usually work with the logarithm of the likelihood function, for various mathematical and computational reasons.
Second, since the likelihood function depends on the data, it is convenient to transform it to a function with standardized maxima (see Pickles 1986).
$$
R(\theta) = \frac{L(\theta)}{L(\theta^\ast)} \quad \text{where } \theta^\ast = \arg \max_{\theta} L(\theta)
$$
set.seed(123)
random_numbers <- rnorm(50, mean = 5, sd = 5)

max_likelihood <- prod(dnorm(random_numbers, mean = 5, sd = 5))

nonmax_likelihood <- rep(0,1000)
j <- 1

for (k in seq(0,10,length.out=1000)) {
  nonmax_likelihood[j] <- prod(dnorm(random_numbers, mean=k, sd=5))
  j <- j+1
}

par(mfrow = c(1, 2))

plot(seq(0,10,length.out=1000),nonmax_likelihood/max_likelihood,
     xlab="Mean", ylab="Relative likelihood")

plot(seq(0,10,length.out=1000),log(nonmax_likelihood) - log(max_likelihood),
     xlab="Mean", ylab="Relative log-likelihood")

Comment: I would say that the mathematical convenience of using log likelihood functions are more than counterbalanced by the un-intuitiveness introduced by the log scale. In the figures you supplied the support by the data of means near 5 is much more easily seen in the linear likelihood graph.
Comment: I would also add that the convenience of scaling the likelihood function to have unit maximum is possible because the likelihoods are only used as ratios. It is also worth noting that you have only dealt with the mean parameter, whereas the question included variation of both the mean and spread parameters. (I only mention this because the OP seems to be new to likelihoods.)
Comment: You do not typically work with the logarithm of the likelihood function when multplying the prior by the likelihood function and then normailizing, to get the posterior distribution.
Comment: Unfortunately I could only accept one answer :( Thank you so much ... I wrote this question about simulations just like you...can you please see it? https://stats.stackexchange.com/questions/641165/how-does-simulation-help-check-if-model-assumptions-are-met
Answer: I can think of two things that might help you.
First, likelihoods are defined only to a proportionality factor and their utility comes from their use in a ratio and while they are proportional to the relevant probability, they are not probabilities. That means that if you are uncomfortable with the values in the range of $10^{-65}$ then you could simply multiply them all by $10^{65}$ without changing the ratios. Of course, there is no need to do as the ratio effectively does it for you. The likelihood ratio for the two distributions is about 25 times in favour of the 5,5 distribution over the 6,6 distribution. That would typically be thought of as being fairly strong (but not overwhelmingly strong) support by the data (and the statistical model) for the 5,5 distribution over the 6,6 distribution.
Second, I usually find a plot of the likelihood as a function of a parameter to be helpful. You have set up the system with two parameters that are effectively 'of interest' and so the relevant likelihood function would be three dimensional and thus awkward. (Those dimensions being the population mean, the standard deviation, and the likelihood values.) It would be easier for you to fix one of those parameters and explore the likelihoods as a function of the other. My justification for looking at the full likelihood function rather than a singular ratio of two selected points in parameter space is that it contains more information and it allows the data to speak with less distortion.
Comment: @MaxMeijer The second sentence on that page is totally confused: "Intuitively, the likelihood function [formula] is the probability of observing data $x$ assuming $ \theta$ is the actual parameter." Fisher was quite explicit in his original definition of likelihood (1922): "The likelihood that any parameter (or set of parameters) should have any assigned value (or set of values) is proportional to the probability that if this were so, the totality of the observations should be observed." There are sources far more reliable than a Wikipedia page.
Comment: @MaxMeijer It's no _my_ definition! It's Fisher's. RA Fisher, the guy who introduced the concept. AWF Edwards gives this as the definition in his monograph called Likelihood: "The likelihood, $L(H|R)$, of the hypothesis $H$ given data $R$, and a specific model, is proportional to $P(R|H)$, the constant of proportionality being arbitrary." That accords with Fisher, with Royall, with Pawitan, and with Birnbaum. It's not _my_ definition.
Comment: Usually likelihood refers to the probability of the data given the parameter and so the proportionality factor is really part of the definition. If you multiply the whole thing by a constant it won't be the likelihood anymore even though you can still use it to compute the likelihood ratios.
Comment: @MaxMeijer Sorry, but you are mistaken. Likelihoods are not probabilities and they remain likelihoods when multiplied by any constant.
Comment: The likelihood function is not a probability distribution but each likelihood (i.e. for a specific theta) is the probability of the data being observed if the parameter is theta. Just read the second sentence of the Wiki page: https://en.m.wikipedia.org/wiki/Likelihood_function . The likelihood function multiplied by a constant may happen to be a likelihood function of a different model but not of the same model and sometimes not at all.
Comment: I've never seen that used as definition in the many books on statistics I've studied. And it is not mentioned on the Wikipedia page nor on the Wolfram page. If you're using a non-standard definition of a term you should indicate that so that people do not become confused. Or you can say that it is the case under your own definition.
Comment: @MaxMeijer it might not be so great to take on a fight about definitions using Wikipedia and Wolfram as your resources (especially the former can be incomplete and narrow depending on the editor). The definition of the likelihood as being *proportional* to the probability (density) is widely recognised. It is possibly only in Bayesian analysis that people use a more narrow definition such as the user toenails does in [their talk](https://en.wikipedia.org/w/index.php?title=Talk:Likelihood_function&diff=prev&oldid=927514180) on Wikipedia. The older wiki contained proportionality but got removed.
Comment: The old Wikipedia page contained a phrase *"and also any other function proportional to such a function"* that got rephrased [here](https://en.wikipedia.org/w/index.php?title=Likelihood_function&diff=next&oldid=372418269) and eventually deleted [here](https://en.wikipedia.org/w/index.php?title=Likelihood_function&diff=prev&oldid=643009417).
Comment: While the broad definition isn't completely unheard of apparently, my claim is that it is not the standard definition. Implicitly taking Fisher's definition as your definition may be confusing to readers that were presuming the standard definition was being used, as essentially all of the other answers and comments seem to have done. (Not to mention the wiki and the Wolfram page and most other StackExchange posts on the topic.)
Comment: Also, I think that one source that is definitely less reliable than Wikipedia is Wikipedia edits that have been reverted due to false claims, so it may be better to cite a textbook or other authority that uses the broad definition (I can cite many textbooks that contain the Wiki/Wolfram definition)
Comment: @MaxMeijer I am happy to hear that those many (uncited) textbooks have made you so well informed. Perhaps you could extend your reading here: https://stats.stackexchange.com/questions/97515/what-does-likelihood-is-only-defined-up-to-a-multiplicative-constant-of-proport/97522#97522 (Please note that I will not  respond to any more of your comments.)
Comment: @MaxMeijer Yes, the edits are neither good sources, That was exactly my point that Wikipedia is a bad source. With the links to the edits I justed wanted to sketch how that Wikipedia article about the likelihood function has become the molested article that is is now because people with only clappers are writing about the entire bell.
Comment: @MaxMeijer how is it decided what the standard definition is? Is there some governing body of statistics that decides on this? Or do you speak about the "standard" layman's definition? If the broad definition is confusing to readers then this may be actually good. It is an opportunity to be triggered to educate themselves about the *meaning* of likelihood. It is *not* the same as probability. It is about *relative* probabilities and the value of the constant of proportionality is irrelevant. If 'something has a likelihood of 1', then it is not like saying  'something has a probability of 1'.
Answer: If you flip a coin which is known to be weighted $100$ times and it comes up heads $80$ times, then you probably have a guess as to what the weight might be.
One way to formalize this intuition is to ask "Of all the possible weights $\theta \in [0,1]$ I could have used, which value is most likely to have produced $80$ heads?"
Now, it is true that for any particular value of $\theta$ the chance of getting exactly $80$ heads is quite small!  $L(\theta) = \theta^{80} \cdot (1-\theta)^{20}$ is pretty tiny no matter what value of $\theta$ you choose.  However (and you should do the Calc 1 problem here!) it is maximized when $\theta = 0.8$.
How large $L(\theta)$ is in an absolute sense doesn't really matter.  We really only care that $L(0.8)$ is larger than $L(0.5)$ or $L(0.6)$ in a relative sense.
Answer: likelihood $\neq$ probability
The likelihood function is not the same as a probability distribution and it can be defined up to a constant.
Seperating likelihood from probability has always been tricky,  already since it's introduction. In 1922 Fisher wrote in "On the Mathematical Foudations of Theoretical Statistics" about how he chose the term likelihood to make it seperate from probability

I must indeed plead guilty in my original statement of the Method of the Maximum Likelihood (9) to having based my argument upon the principle of inverse probability ; in the same paper, it is true, I emphasised the fact that such inverse probabilities were relative only. That is to say, that while we might speak of one value of as having an inverse probability three times that of another value of $p$, we might on no account introduce the differential element dp, so as to be able to say that it was three times as probable
that p should lie in one rather than the other of two equal elements. Upon consideration, therefore, I perceive that the word probability is wrongly used in such a connection : probability is a ratio of frequencies, and about the frequencies of such values we can
know nothing whatever. We must return to the actual fact that one value of $p$, of the frequency of which we know nothing, would yield the observed result three times
as frequently as would another value of $p$. If we need a word to characterise this relative property of different values of $p$, I suggest that we may speak without confusion of the likelihood of one value of pbeing thrice the likelihood of another, bearing always in mind that likelihood is not here used loosely as a synonym of probability, but simply to express the relative frequencies with which such values of the hypothetical quantity $p$ would in fact yield the observed sample
(9) R. A. Fisher (1912). "On an Absolute Criterion for Fitting Frequency Curves,", 'Messenger of Mathematics,' xli., p. 155.

The absolute value of a likelihood is meaningless as discussed here: Is the exact value of any likelihood meaningless? An expression like "a probability of 1" has a meaning without comparing it to another probability. But an expression like "a likelihood of 1" or "a plausibility of 1", do not have the same meaning when uses without a comparison in a ratio.
In the definition of likelihood, Fisher (in On the Mathematical Foudations of Theoretical Statistics) explicitly stated that there is an arbitrary constant involved in the scale of 'likelihood'.

Likelihood — The likelihood that any parameter (or set of parameters) should have any assigned value (or set of values) is proportional to the probability that if this were so, the totality of observations should be that observed.

Distribution of likelihood
I can repeat your procedure several times and also add in the computation of the likelihood for another value of the population mean:
set.seed(123)
n = 10000
likelihood_5 = rep(NA,n)
likelihood_7 = rep(NA,n)
m_random_numbers = rep(NA,n)

for (i in 1:n) {
  random_numbers <- rnorm(50, mean = 5, sd = 5)
  m_random_numbers[i] = mean(random_numbers)
  likelihood_5[i] <- prod(dnorm(random_numbers, mean = 5, sd = 5))
  likelihood_7[i] <- prod(dnorm(random_numbers, mean = 7, sd = 5))
}

And a plot of it will look like

The single events that we may observe can have a very small probability. But it is always a small probability. This is because the space of possible events is so large and fractionated; there are so many different events that each event has it's  own small little probability.
For a likelihood it doesn't matter how probable exactly a specific event is, what matters is the distribution of likelihood and how the distribution of the likelihood for the correct model is higher than the distribution of likelihood for incorrect models.
There is an asymmetry between the probability that is used to compute a likelihood and the probability that a model has the highest likelihood. The former probabilities can be small even when the second is large.
It is not about

'the probability of the event'

Instead it is but about

'the probability that the likelihood of the correct model is higher'

or that

'the model with the highest likelihood is with high probability close to the correct model'

Constant of proportionality
The likelihood is defined to be proportional to the the probability of the event as function of the parameters.
This difference in a constant of proportionality is especially clear when you consider the observation of $n$ identical and independent distributed Bernoulli variables that can be either treated as a binomial distribution or a multivariate Bernoulli variable (see also In using the cbind() function in R for a logistic regression on a $2 \times 2$ table, what is the explicit functional form of the regression equation? and the same example occurs here)

$n$ Bernoulli experiments PMF $$f(x_1,x_2,\dots,x_n) =  \prod p^{x_i} (1-p)^{1-x_i} = p^{k} (1-p)^{n-k}$$
Binomial distribution PMF $$f(x_1,x_2,\dots,x_n) = f(k,n) =  {n \choose k} p^{k} (1-p)^{n-k}$$

Here the probability for the Bernoulli experiments will be different with a factor ${n \choose k}$ from the Binomial distribution. Intuitively we can see this as the space of potential outcomes is very large (every specific order of $x_1,x_2,\dots,x_n$ is considered seperately).
For continuous variables we even get infinitely small probabilities (see for example: Why can you not find the probability of a specific value for the normal distribution?), and you may wonder whether the absolute probability value of a single small observation is actually important. This is why often p-values are used, for a range of observations, instead of the probability of the single observed observation. An example where this can go wrong is in: Should we really search for the model for which the probability of the data is maximal? where an image like the following occurs

The higher peak may not be the best estimate because the total area around it is not so large. Luckily the above is a contrived example and when we find a maximum likelihood, then this is often high for a wider entire region. Using the Fisher information (relating to the rate of change of the likelihood function) we can estimate the variance of the estimator. For likelihood functions that change slowly (are spread out a lot), we will end up with less precise estimators.

About your 10 normal distributed variables
An alternative view on the probability of your observation shows that the probability may actually not be as small as you think and is also due to additional variables that are independent from the parameter that is being investigated:
Your sample can be generated by

first sampling the mean in a distribution that is dependent on parameter
$$\bar{X}|\mu \sim N\left(\mu, \frac{\sigma^2}{n}\right)$$

and following that sample the $X_i$ based on the value of $\bar{X}$ which follows a multivariate normal distribution that is independent from the parameter $\mu$.
$$X_1,X_2,\dots,X_n \sim N\left(\mathbf{\bar{X}},\boldsymbol{\Sigma}\right)$$
where $\mathbf{\bar{X}}$ is a vector with all entries equal to $\bar{X}$ and covariance matrix $\boldsymbol{\Sigma} = \sigma^2(\mathbf{I}-1/n \mathbf{J})$ (where $\mathbf{I}$ is the identity matrix and $\mathbf{J}$ is a matrix with all entries equal to $1$)

For the parameter $\mu$ it is only relevant what value $\bar{X}$ you observe. The exact distribution of the $X_1,X_2,\dots,X_n$ is independent from the parameter $\mu$ and irrelevant. You can add all sorts of additional variables like giving the values random colors and that would have changed the likelihood value (making it's value smaller) but it doesn't change anything about the inference of $\mu$ if these random variables have nothing to do with the value of $\mu$.
This alternative view may help to see how the actual value of the likelihood can be of less importantance, but it doesn't work in every case (e.g. when there is no sufficient statistic, like when estimating the location parameter of a Cauchy distribution)
Comment: I accepted your answer! Thank you for the simulation ... I am trying to learn about the usefulness of simulations. Do you know how I can solve this? https://stats.stackexchange.com/questions/641165/how-does-simulation-help-check-if-model-assumptions-are-met


How to login when you have a default page setup with panels?

Question: I have been messing with panels.  I set a default layout page that basically has no content and is set for all the pages at the moment.  I logged out like a dummy and now when I go to website/user/login it gives me a blank page.  Is there another way I can login?
Thanks!
Comment: If you have access to drush, you can generate a one time login link use `drush uli`. Other than that, I'm not sure other than manually restoring to a back-up.
Comment: Bummer! You can also try to manually edit/remove the panel from your database, should be in the table page_manager_panels
Comment: try www.example.com/user
Answer:
If you have access to drush, you can generate a one time login link use drush >    uli. Other than that, I'm not sure other than manually restoring to a back-up - lukedekker

Awesome!  That worked.  I was trying something else the other day with drush that wasn't producing results.


Run two commands in discord.py at same time

Question: I have a small bot that downloads audio from a youtube video and uploads it to Anonfiles. Here is the code at that point:
<code>@commands.command(name='audio')
async def audio_download(self, ctx, name, *, link: str):
    cwd = os.getcwd()
    path = f'{cwd}/media/audio'

    ydl_opts = {
        'format': 'bestaudio/best',
        'postprocessors': [{
            'key': 'FFmpegExtractAudio',
            'preferredcodec': 'mp3',
            'preferredquality': '192',
        }],
        'outtmpl': f'{path}/{name}.mp3',
        'quiet': True
    }

    abspath = f'{path}/{name}.mp3'

    with ytb.YoutubeDL(ydl_opts) as ydl:
        ydl.download([link])

    r = requests.post('https://api.anonymousfiles.io',
                    files={'file': open(f'{abspath}', 'rb')})

    json_all = json.loads(r.text)
    url_file = json_all["url"]

    await ctx.send(f'File: {url_file}')

    os.remove(abspath)
</code>
The problem is when two different people wanna download at the same time. When this code runs, the bot stop responding to any command until the task has ended, I mean, until the file is uploaded to the Anonfiles. Is there a way to make this code assyncronous and make two people can use it at the same time? The people A wanna download audio from video X, and the people B wanna download audio from video Y.
Answer: I think you can do it using the thread libary like this:
<code>import threading
from threading import Thread

bot1_thread = Thread(target = bot1)
bot2_thread = Thread(target = bot1)
</code>


React JSON schema double quotes encoding

Question: I am working on a React app which needs json-ld schema to be defined. I get the schema string through an API and need to add the appropriate script tag to my page.
My schema string looks something like this:
[{"@context": "http://schema.org"}]

I expect this to be translated to:

However, I am having trouble dealing with the double quotes, as these get converted to html equivalent - "
This is how my code looks like:
schemaString = "[{\"@context\": \"http://schema.org\"}]";

render() {
    return (
{schemaString &&
                }

)
}

The html generated is:

Any pointers on what I am missing here? Thanks!
Comment: Try `{JSON.stringify(schemaString)}`. It also may have to do with your script type.
Comment: Is it not possible to encode/decode using `encodeUriComponent` and `decodeUriComponent`?
Comment: I'm pretty sure that there's no reason to react-`render` script tags.
Answer: Am I late? :) Make sure you place the script tag content by dangerouslySetInnerHTML property. Also, don't forget to convert default object into proper JSON by JSON.stringify() method.
Like this:
return (

            }

)
}


Alternative proof to non-emptiness of spectrum/spectral radius formula

Question: The following two results are probably the most basic results in the spectral theory:

Let $a$ be an element in a unital Banach algebra $\mathcal{A}$ (over $\mathbb{C}$). The spectrum of $a$, $\sigma(a) = \{\lambda \in \mathbb{C} \mid (\lambda \mathbb{1} - a) \text{ isn't invertible} \}$, is non-empty.

This allows us to define the spectral radius $r(a) = \sup \{ \lvert \lambda \rvert \mid \lambda \in \sigma(a)\}$ for which

$r(a) = \lim_{n \to \infty} \lVert a^n \rVert^{1/n}$

holds. All proofs I've seen of these two theorems are essentially the same. The sketch of the proof of the first proposition goes as follows:
We prove this via contradiction, so suppose $\sigma(a)$ is empty. Define the resolvent of $a$ as the map
$$
R:\mathbb{C} \to \mathcal{A}: \lambda \mapsto (\lambda \mathbb{1} - a)^{-1}.
$$
It's analytic in the sense that $\phi \circ R$ is analytic for all $\phi$ continuous linear functionals on $\mathcal{A}$. Then it's not so hard to prove $R$ is bounded, so by Liouville's theorem $\phi \circ R$ must be constant for every $\phi$. This then implies $R$ must be constant and zero and thus we arrive at a contradiction.
The proof of the second theorem is very similar:
First it's proven that $r(a) \leq \inf_n \lVert a^n \rVert^{1/n}$, which is not so hard. Then all that is left to prove is that $r(a) \geq \limsup_n \lVert a^n \rVert^{1/n}$. Let $\Omega$ be the open disk in $\mathbb{C}$ around $0$ with radius $\frac{1}{r(a)}$ and define
$$
f:\Omega \to \mathbb{C}: \lambda \mapsto (\mathbb{1} - \lambda a )^{-1}.
$$
We prove that $\phi \circ f$ is analytic for every $\phi$ as before. Then we can argue that $\phi(a^n) \lambda^n$ is a bounded sequence for every $\phi$ and $\lambda \in \Omega$ by using the power series of $\phi \circ f$. By Banach-Steinhaus we then have that $a^n \lambda^n$ is bounded for every $\lvert \lambda \rvert < \frac{1}{r(a)}$. It then follows that $r(a) \geq \limsup_n \lVert a^n \rVert^{1/n}$.
Every text I've encountered so far describe the same proof, maybe in a slightly different fashion but essentially the same. Are there any alternatives to these proofs? Preferably ones that use less complex analysis. I imagine this could be very hard, particularly for the second one. This because that formula is already very reminiscent of the root test for series, so it "screams" power series to me. But I would be very interested if there were any at all.
Edit: I would also like to add my interest in proving only the convergence of $\lVert a^n \rVert^{1/n}$ without relying on the proof described here. So no proof that it's equal to the spectral radius, but simply a proof that it converges.
Comment: Since nonemptiness of the spectrum isn't a theorem for _real_ Banach algebras, I wouldn't bet money on the existence of a proof avoiding complex analysis.
Comment: Keep in mind that any proof of the general case will imply the Fundamental Theory of Algebra, for which there are no methods nearly as nice as the Complex Analysis proof. It's surprising that the Complex Analysis proof of the Fundamental Theorem of Algebra extends so nicely to this general case.
Comment: @DanielFischer Of course there's that too, of course any other proof would also be welcome even if it uses more complex analysis then these ones.
Comment: How would it imply the Fundamental Theorem of Algebra? Is it true that any polynomial is the characteristic polynomial of some matrix?
Comment: About the Edit: the fact that $\|a^n\|^(1/n)$ converges is a particular case of something referred to as Fekete's lemma, because $\|a^n\|$ is submultiplicative : $\| a^{n+m} \| \leq \|a^n\| \, \|a^m\|$.
Answer: You can replace Liouville's theorem by what is used to prove Liouville's theorem, namely Cauchy estimates.  For $|\lambda| < 1/\|a^{-1}\|$,
$$R(\lambda) = (\lambda 1 - a)^{-1} = \sum_{n=0}^\infty - \lambda^n a^{-n-1}$$
and in particular
$$ -a^{-2} = \frac{1}{2\pi i} \oint_{\Gamma(r)} \frac{R(\lambda)}{\lambda^{2}}\; d\lambda $$
where $\Gamma(r)$ is a positively oriented circle centred at $0$ with radius
$r < 1/\|a^{-1}\|$.  But if the spectrum were empty, this would be true for all $r > 0$.  As you take $r \to \infty$, since $\|R(\lambda)\| \le 1/(|\lambda|-\|a\|)$ the norm of the right side goes to $0$, contradiction.
Comment: That's quite nice, thank you!
Comment: Interesting idea! It's more complex analysis, though...it would be interesting to know if there exist proofs circumventing it completely, but I strongly suspect that there are none...can you offer any insights? EDIT: the argument by DisintegratingByParts in the comment under the OP makes it at least extremely implausible
Answer: See theorem 1.2.8 pages 10-13 in A course in commutative Banach Algebras, Eberhard Kaniuth. The first proof is classic, the second one, probably, is what you are looking for.


Why compare AUC's in binary classification?

Question: I understand that a common metric for comparing binary classifiers is the AUC of the ROC curve.
But, after this is computed, only one threshold is actually chosen for classifying negative and positive examples.
So, I wonder why I've often seen AUC's compared, when comparing two ML algorithms?
Wouldn't it be better to compare, for example, the F-scores of the BEST threshold from each ROC curve from the two curves?
And, as a follow up, does the classifier associated with the better threshold always mean that it has a higher AUC score?  I think I know of some counter examples....but wondering if someone can shed light on this.
Answer: There is no given best threshold. It depends on your cost of false-negative and false-positive and your plan of operation.
Example: Some model classifying either GOOD or BAD investments could be applied with different thresholds when used by a banker or venture capitalists. The careful banker would prioritize to have a very low FALSE-GOOD to never loose money. The daring venture capitalist would accept a higher FALSE-GOOD to avoid ever missing out on big investment opportunities(FALSE-BAD).
ROC-plot shows the "sensitivity" vs "1-specificity" for any possible threshold. The AUC could be understood as summarizing the 'average' classification performance over any threshold. AUC is of course not an optimal metric if you already have chosen one specific threshold.
In practice you would probably:

build a model first
investigate your cross validated ROC-plot
wonder how to utilize such predictions
decide for a hard threshold (or stay in probability land)
Comment: well yes... AUC is most useful for comparison when no obvious single threshold is given.. Instead of one metric such as F measure, you could try to estimate your practical costs and gains of acting on predictions by a certain threshold by a certain model. That could possibly answer which model is best for your purpose.  You could also proceed by combining both models into an ensemble
Comment: I would also add that thresholds are not always chosen. Sometimes what matters is the scores ability to rank the target variable. In such a case, AUC is very informative as the whole distribution can be observed in one plot.
Comment: Right, so at some point you have to decide on a "hard threshold" , as you said.  So, if I'm comparing two models, wouldn't it be best to:  _1)_ determine a measurement (say, F measure, with beta = 2).  _2)_ Find a threshold for each model that maximizes that measurement. _3)_ Finally, pick the model that has a better F measure.  I don't understand the need for an AUC to compare these unless I'm missing something....?
Comment: Hm.  I'm not sure I follow that @Zelazny7, do you mind elaborating?  Perhaps you're suggesting something like computing risk using a binary classifier?  And, one could use AUC for determining how well we rank the risk of the examples in our classifier.  Is that true?


What is the point of dividing data into training and test parts to assess prediction properties when we have AIC?

Question: Asymptotically, minimizing the AIC is equivalent to minimizing the leave-one-out cross-validation MSE for cross-sectional data [1]. So when we have AIC, why does one at all use the method of dividing the data into training, validation and test sets to measure the predictive properties of models? What specifically are the benefits of this practice?
I can think of one reason: if one wants to assess the models' predictive performances, out-of-sample analysis is useful. But although AIC is not a measure of forecast accuracy, one usually has a good idea if some model is reaching its maximum potential (for the data one is given) in terms of how well you are gonna be able to predict.
Comment: An excerpt from [sklearn's docs](http://scikit-learn.org/stable/auto_examples/linear_model/plot_lasso_model_selection.html): *Information-criterion based model selection is very fast, but it relies on a proper estimation of degrees of freedom, are derived for large samples (asymptotic results) and assume the model is correct, i.e. that the data are actually generated by this model. They also tend to break when the problem is badly conditioned (more features than samples).*
Comment: $\operatorname{tr}(J(\theta_0)(I(\theta_0))^{-1}) \approx k$ in slide 10 that @sascha linked to. (I was just looking on our site - we seem to have a lot of assertions about AIC, & references containing yet more assertions; but little beyond. From memory, Pawitan, *In All Likelihood*, & Burnham & Anderson, *Model Selection*, give derivations.)
Comment: @sascha has a point there: for AIC to approximate expected KL info. loss *well* one of the models has to be fairly good. I don't think anyone advocates using AIC to compare bad models to see which is less bad.
Comment: Ok, I skipped the TIC-part and missed that bit. You are absolutely right. Apologies to you @sascha , and thank you for enlightening me :) Yes, I just had a look in Burnham & Anderson myself. Great resource!
Comment: I do not actually think that AIC assumes a correct model (http://stats.stackexchange.com/questions/205222/does-bic-try-to-find-a-true-model). Regarding sample size and AIC being an asymptotic result: you would *never* divide your data into three parts when you have little data. So small sample size is problematic for *both* out-of-sample analysis and AIC
Comment: I'm not an expert, but these [slides](http://www4.ncsu.edu/~shu3/Presentation/AIC.pdf) indicate, that AICs theoretical properties are dependent on "how good" the model is. There is also an alternative information-criterion which seems to be more robust regarding this aspect (at some costs).
Comment: Yes, I know what AIC *is* and *means*. I'm not getting how these links you provide are helping with the question posed.
Comment: Well, both links say, that AIC-based model-selection lose some theoretical properties (performs worse) when the model is "not good" which is not the case for leave-one-out CV / k-fold CV. How does this not target your question (irrespective of your trust on this statement)?
Comment: As I said, I believe there is an erroneous statement in your first link regarding assuming the model is "correct". The best model is the model with the least KL information loss, and a "not good" model is a model with more KL information loss. In terms of the properties of AIC I cant remember such a thing that AIC "breaks down" when handling a "not good" model. "Badly conditioned" does not mean a "not good" model. As far as I can see your second link does not shed any new light on this either. If you could specify what exactly you mean by "lose some theoretical properties .. ctd
Comment: ...ctd ... when the model is "not good"...)? To me, this does not make any sense. It does not target my question because AIC does not work any *less good* when handling bad models (defined in terms of KL information loss).
Comment: @Scortchi: In the derivation of the AIC, or any treatment I've read on AIC, I've yet to see this been mentioned. Could you please show me where this is stated? (I see no such thing in the two links provided)
Answer: In practice, I always use cross-validation or a simple train–test split rather than AIC (or BIC). I'm not too familiar with the theory behind AIC, but two chief concerns lead me to prefer more direct estimates of predictive accuracy:

The number itself doesn't tell you much about how accurate a model is. AIC can provide evidence as to which of several models is the most accurate, but it doesn't tell you how accurate the model is in units of the DV. I'm almost always interested in concrete accuracy estimates of this kind, because it tells me how useful a model is in absolute terms, and also how much more accurate it is than a comparison model.
AIC, like BIC, needs for each model a parameter count or some other value that measures the model's complexity. It isn't clear what you should do for this in the case of less traditional predictive methods like nearest-neighbor classification, random forests, or the wacky new ensemble method you scribbled onto a cocktail napkin midway through last month's bender. By contrast, accuracy estimates can be produced for any predictive model, and in the same way.
Comment: +1 Great! #2 is a great argument! #1 adresses what I write about AIC not being a measure of forecast accuracy, great point! Can I ask how you compare "how much more accurate it is than a comparison model"? I recently thought about this when comparing two models' MSE. MSE of Model 1 and Model 2 was 10 and 20, respectively. How do I interprect *how much* more accurate Model 1 is? I'm thinking it cannot be as simple as 20/10, because comparing this must/should take the scale of the DV into account?
Comment: I just look at both of the respective accuracy figures (MSE or whatever), rather than trying to make a comparison score. Also, it always helps to have an accuracy score for a trivial model (i.e., a model which uses no predictors) if that wasn't already one of the models you were comparing.
Comment: (+1) There's a cottage industry in inventing effective AICs, quasi-AICs, & the like for situations that aren't maximum-likelihood estimation with a fixed no. parameters.
Comment: @Kodiologist: I think it would be very interesting with a comparison score. This way we can compare models made on different data sets, e.g. evaluate performance of old models vs new models when new data is available.
Comment: In respect of 2. there's a relatively easy way to get the degrees of freedom of the model (though in some cases it may be moderately time consuming to compute, in many common situations there's a shortcut); which is $k=\sum_i \frac{\partial \hat{y}_i}{\partial y_i}$; in a quite literal direct sense this measures the model's degrees of freedom to approximate the data. See for example Ye's 1998 JASA article. StasK links to a full reference in [this](http://stats.stackexchange.com/questions/57027/what-does-degree-of-freedom-mean-in-neural-networks) answer for example. ... ctd
Comment: ctd... It corresponds to the usual notion of degrees of freedom in common cases. e.g. if you can write $\hat{y}=Hy$, such as with a linear smoother, then that d.f. is just the usual trace of $H$. The nice thing about this approach is that all you really need is the ability to produce a fitted value for each observation.


How to limit Entity Reference to only allow referencing of nodes with the same (or undefined) language?

Question: I know I can simply add language to displayed title of a node in Entity Reference field based on views. What I failed to discover is how to limit possible values to only show and allow matching ones.

When current node is language independent, all nodes should be listed as possible in reference field.
When node has language defined, only nodes of the same language, or undefined language, should be available.

I don't really mind wrong selection to be saved in database if language of node will be changed, as it shouldn't happen often enough to be a problem. I simply don't want "wrong" nodes on the list of available reference choices. On-save validation would be nice, but isn't a must-have.
I tried to use view to populate entityreference field's dropdown on node edit form:

My big block is how to access a language of a current node in view that provides list of available entities. I can't find a way other than to guess using current UI language, but that may be wrong for edits and usually is wrong on new node creation. Ideally, the entity reference field should repopulate via AJAX according to the language selected in the node edit from.
For the sake of future visitors I would appreciate complete answer. Of course answer not based on views will be appreciated, too.
Comment: Since I have few knowledge on Entity Ref, It is difficult to understand the question, So are you looking something similar to this module https://drupal.org/project/cer
Comment: I don't know may be this could be the answer https://drupal.org/project/reference_option_limit  . You can also integrate with the entity reference fields
Comment: @Bala Reference field option limit might be an answer. Certainly what it claims to do would be enough. If you can check if it and post as an answer, would be nice. I'll test it when I'll find a bit of time, of course, but I cannot reward bounty on comments :P
Comment: Still searching for you have look https://drupal.org/project/entityreference_dynamicselect_widget
Comment: @Bala - no use unless I want to repeat language next to reference dropdown. Maybe could be used as a codebase for custom solution, but that's all. Now experimenting with computed fields (@language) and reference option limit, but field can be computed on read and on save it seems... not live on edit form.
Comment: I think i found one solution for you, see the another answer
Comment: could you tell what do you use for multilanguage system? did you succeed to define the language of your node?
Answer: Reference field option limit module allows reference fields of several types to have their widgets' available options limited by the values of other fields in the current entity.

It currently supports taxonomy term and entity reference fields.
Comment: Docs looks good. To bad I cannot make it work. [Issue 2082217](https://drupal.org/node/2082217) might or might not be the reason. We'll see. Will test more. Anyway, it seems to be a nice code to start with.
Comment: Sadly, language is not exposed as a field... Testing continues ;)
Answer: I can suggest some "concepts" of solution with Views.
I didn't understood if you succeed to define target node language. (if no, write a comment, I'll update the answer).
Step1. You are able to pass arguments to the view that filters entityreference field. Then it's possible to add your language to the field views args programmatically in $field['settings']['handler_settings']['view']['args'];.
Step2. You can create custom contextual filter programmatically. Filter will pass the language id. This contextual will change View language using agrument value. you can change language in query alter - query() method of your child class of views_handler_argument.
Then just dpm($this) in the query() method and change language value to your argument.
Comment: Not bad concepts, but it seems basically you are telling me to rebuild [Reference field option limit](http://drupal.org/project/reference_option_limit) Bala [suggested](http://drupal.stackexchange.com/a/84680/16495), only with language instead of fields :)
Comment: Yes, you have now solution for both fields and language :)  Unfortunately I'm not common with "Reference field option limit". I suggested custom coding
Answer: Check out Translated Entity Reference module.
Another option is to create your custom view to render your Entity Reference field selectable options. Just:

Create a new view
Add a new Entity Reference View Widget
Add a filter for your content type
Add a new contextual filter for field "Language"
Select "Provide default value" + "PHP code" (maybe you will need
"Views PHP" module for this)
Enter this code on "PHP contextual filter code" textarea:
global $language;
$lang = $language->language;
$node = menu_get_object();
if (!empty($node)) {
  $lang = $node->language;
}
return $lang;
Edit your Entity Reference field and select your new custom view as
entity selection mode
Answer: I'm looking for the same thing.
The closest I got was by using the current user's language.
The current user's language will be determined by what you select in /admin/config/regional/language/configure.

add relationship "Entity translation: translations"
add filter "Entity translation: Language (=Current user's language)"

Also, this link cleared the field_title issue for me: https://drupal.org/node/1327012.
So, for example, going to /en/node/add will populate the entity view with the referenced entities in English.
But, if the user changes the language on the edit form the view will remain the same.
This solution would suffice if the referenced entities were the same in all languages and simply translated (like the "localize terms" functionality that that core taxonomy translation provides).
The only other 'quick and dirty' way I can think of is editing the output of the title field in views and adding a css class according to the language. Then writing some jquery that shows/hides the entities by mapping the class of the entity in the view to the language selection field.
*Ideally, the entity view should repopulate via ajax according to the language selected in the node edit from.*
If anybody has any ideas please let us know.
Thanks
Comment: It does not actually provide an answer, only something colse + comments. If you don't mind maybe we should integrate these comments into my question? On the other hand, you would not get reputation from that question... I will not flag it or anything
Comment: That's why I said that "I'm looking for the same thing". I just thought that my comments might be helpful to you and others who might try to answer.

Feel free to integrate my comments into your question. I'm not expecting any points or anything.
Answer: Field reference

Depending on configuration, authors can pick fields from the same
  node/entity, from other nodes/entities, from specific revisions, from
  specific languages, or even a specific delta value within the field.
  Fields can be displayed using either the 'full' or 'teaser' mode from
  their original node/entity.
Comment: Quick test seems to indicate that you need to hard-configure language and it will not change live. I'll be glad if you can prove me wrong. Last but not least, I need to reference entities, not their fields. But that's a minor problem I guess.


Colocating mystery server

Question: My employer has tasked me with bringing a server over to a local web hosting facility. The server has vsphere pre-installed with numerous virtual servers installed(5 servers, 3 linux, 2 windows). After bringing this server to the web host they have emailed me back with the following.
<code>Gateway: 67.x.y.z
Netmask: 255.255.x.y
IP range: 67.x.y.156 - 67.x.y.158
</code>
So I would like to ask how do I administer the virtual servers installed on that machine. I tried to ssh the IPs in the range given but it timed out. Is there anything I can do with the information they have given me? Why would they give me the gateway or netmask?
Comment: This question is being voted for closure because the author does not show a level of technical understanding or appropriate due diligence in researching the topic that the community judges as being a minimum barrier to participate.
Answer: You cannot just unplug a server and plug it into a colo providers network, turn it on and expect it to work.
You need to update all the IP Addresses, gateways and so on on those machines and expose them in the correct way.  And there might be a bit more to it than just changing each machines IP details.  These servers might be inter-related. i.e. they may talk to each other.  Do they all need public IP's?  Since you have no idea, neither do I.
Unfortunately, you don't seem to know what they are and what they do or how they are configured and how to go about figuring it out.  I don't want to sound rude, but I think you're out of your depth here.  Most sysadmin's would have a pretty good idea on how to proceed.  I suggest you call in an expert who knows what they are doing.  You should not have been given this task in the first place.

Colocating mystery server


Why the dot product of two vectors in sklearn is not a scalar?

Question: In a 2d Euclidean space,
Let point $a=(a_x, a_y)=(1,1)$;
Let point $b=(b_x, b_y)=(5,1)$;
Let point $c=(c_x, c_y)=(4,4)$;
the squared Euclidean distance between point a and point b is equal to
$(a_x-b_x)^2 + (a_y - b_y)^2$.
>>> a = np.array([1,1])
>>> b = np.array([5,1])
>>> np.linalg.norm(a-b)**2
16.0

the squared Euclidean distance between point a and point c is equal to
$(a_x-c_x)^2 + (a_y - c_y)^2$
>>> a = np.array([1,1])
>>> c = np.array([4,4])
>>> np.linalg.norm(a-c)**2
18.0

sklearn.metrics.pairwise.euclidean_distances uses this approach to compute the distances
>>> X = np.array([[1,1]])
>>> Y = np.array([[5,1],[4,4]])
>>> np.sum(X*X,axis=1)[:, np.newaxis] - 2*np.dot(X,Y.T) + np.sum(Y*Y,axis=1)[np.newaxis, :]
array([[16, 18]])

which corresponds to this formula

dist(x, y) = sqrt(dot(x, x) - 2 * dot(x, y) + dot(y, y))

per this post
dot(x, x) in the formula above means the dot product of two vectors.
per wiki
the dot product of two vectors

is a scalar, rather than a vector

but the result of this Python code
>>> X = np.array([[1,1]])
>>> np.sum(X*X,axis=1)
array([2])

is an array (represents a vector) rather than a scalar, why is that?
Answer: This one could represents an array
a = np.array([1,1])

and X is a matrix rather than an array.
X = np.array([[1,1]])

Both this line of code
np.sum(a*a)

and this one
np.dot(a,a)

could get the dot product of two vectors (actually a vector and itself in this case)
2

which is

a scalar, rather than a vector


Inicio e fim de um mês/ano passado em parâmetro (Oracle)

Question: Preciso que retorne os dados totais mensal de acordo com o parâmetro de MÊS e ANO informado.
Fiz da seguinte forma:
WHERE a.dt_mesano_referencia between
to_date('01/'|| :NR_MES ||'/'|| :NR_ANO ||' 00:00:00', 'dd/mm/yyyy hh24:mi:ss') and
last_day(to_date( :NR_MES ||'/'|| :NR_ANO ||' 23:59:59', 'mm/yyyy hh24:mi:ss'))

Mas ao executar, obtenho o seguinte retorno de erro:

Existe uma outra forma de fazer?
Comment: Peguei apenas sua condição de where e coloquei em uma consulta  "from Dual" e rodou sem erros. Os parâmetros estão sendo enviados corretamente? Existe mais condições na consulta?
Comment: Qual o tipo do campo  `dt_mesano_referencia`, executei aqui também deu certo...
Answer: Ao invés de ver data e hora de inicio e fim, vamos considerar na pesquisa somente o mês e ano.
Para isso precisamos truncar a data para não trazer a hora, depois alteramos o formado da hora com o to_char, para trazer somente o mês e o ano, e depois comparamos com os parâmetros passados:
 WHERE TO_CHAR(TRUNC(a.dt_mesano_referencia)
              ,'mm/yyyy') = '&NR_MES' || '/' || '&NR_ANO'


css issue taking extra space

Question: I am using html and css. i am stuk with some issue.
here is my link
it is taking some extra white spaces. i used casurel plugin for  testinmonial. This page is showing extra empty space at footer. i don't want extra white space. this problem is due to testimonial section.
i tried to remove height under ul but still it causing problem. it doesnot showing content properly if i change the height .
Can you tell me where is my problem?
Thanks
Answer: You need to use overflow: hidden; for #newsticker-demo because your text is flowing out of the carousel.
Also you've height: 100px; for #footer

css issue taking extra space


Combine three Big Query tables

Question: I have pulled data from Google Analytics into several Big Query tables. Google Analytics limits the numbers of dimensions to 7 and the number of metrics to 10.
I have three tables, each with the same 7 dimensions. I have a total of 30 metrics (10 in each table).
How do I combine these tables into one table? JOIN or UNION doesn't seem to be the correct way of doing this, as all of the 'dimensions' have the same names, and I don't want to append additional row; basically just add 20 additional columns to the first table based on the dimension 'keys'?
Comment: Some (simplified) sample data and desired results would help.  Do the tables overlap?  How do you combine the metrics when they do?
Comment: @J.Ayo Thanks for your question. If you're satisfied with the answer - it would be great if you'll mark any answer as correct. If you still need some answer improvements - feel free to ask.
Answer: If I understood you correct you have the following:
Table 1 (only 3 samples here, instead of 10):
SELECT 'metric_name_1' as metric_name,
       'val_1' as dim_1,
       'val_2' as dim_2,
       'val_3' as dim_3,
       'val_4' as dim_4,
       'val_5' as dim_5,
       'val_6' as dim_6,
       'val_7' as dim_7
 UNION ALL
 SELECT 'metric_name_2',
        'val_8',
        'val_9',
        'val_10',
        'val_11',
        'val_12',
        'val_13',
        'val_14'
 UNION ALL
 SELECT 'metric_name_3',
        'val_15',
        'val_16',
        'val_17',
        'val_18',
        'val_19',
        'val_20',
        'val_21'

And the second table:
SELECT 'metric_name_4' as metric_name,
       'val_22' as dim_1,
       'val_23' as dim_2,
       'val_24' as dim_3,
       'val_25' as dim_4,
       'val_26' as dim_5,
       'val_27' as dim_6,
       'val_28' as dim_7
UNION ALL
SELECT 'metric_name_5',
       'val_29',
       'val_30',
       'val_31',
       'val_32',
       'val_33',
       'val_34',
       'val_35'
UNION ALL
SELECT 'metric_name_6',
       'val_36',
       'val_37',
       'val_38',
       'val_39',
       'val_40',
       'val_41',
       'val_42'

And from this, you want to receive a table like this:

It's not too trivial and may be achieved in two steps:
resulting_join as (select first_table,second_table  from first_table join second_table on True)
SELECT * EXCEPT (pos, pos_1)
FROM (
  SELECT *, ROW_NUMBER() OVER (PARTITION BY first_table.metric_name) AS pos,
            ROW_NUMBER() OVER (PARTITION BY second_table.metric_name) AS pos_1,
  FROM resulting_join
)
WHERE pos = pos_1

I think that it's much better to just use UNION ALL in such cases and add new rows. Hope it helped - if you'll need some further explanation - I'll be glad to respond.
Answer: I think you want full join:
select dim1, dim2, dim3, dim4, dim5, dim6, dim7,
       t1.* except (dim1, dim2, dim3, dim4, dim5, dim6, dim7),
       t2.* except (dim1, dim2, dim3, dim4, dim5, dim6, dim7),
       t3.* except (dim1, dim2, dim3, dim4, dim5, dim6, dim7)
from t1 full join
     t2
     using (dim1, dim2, dim3, dim4, dim5, dim6, dim7) full join
     t3
     using (dim1, dim2, dim3, dim4, dim5, dim6, dim7);

This assumes that the metrics have different names and the tables have only dimensions and metrics.
If all tables have the same dimensions, you can use inner join instead.

Combine three Big Query tables


Why some audio cables are so dramatically more expensive than others?

Question: Why there are so huge differences in price of audio cables, even when they have comparable length, similarly looking connectors and lack some complex mechanisms that could have different quality?
For instance,  Vovox 142417 has "white" connectors but still costs about 100 USD. The comparably looking RockCable RCST2PPS costs 20 USD only, even if the connectors look gold plated.
Why Vovox is five times more expensive? This 6.3mm jack connector even does not have any moving parts; how could it be made to be five times better?
Comment: Just Google "Hifi snake oil" to see just how much 'advertising speak' can go into cable manufacturing claims. I remember in the 80s we were all encouraged to tie knots in our cables to make them sound better - then someone discovered 'science sells' & they could make money from 'high tech knots' rather than give them away for free. See also https://en.wikipedia.org/wiki/Clever_Hans
Comment: It isn't five times better. It is only five times as expensive.
Answer: There are some aspects of a cable's design that do affect audio quality. When connected to the output of a passive electric guitar, a low capacitance cable will cause less high-frequency roll off per unit length of cable. That doesn't mean that the high-capacitance cable will necessarily sound worse - in some cases, it might be preferred - but it is a consideration.
Other important characteristics for an audio cable are proper soldering between the cable and jack connectors, effective shielding (for some applications), and connectors that won't corrode, although none of these characteristics add an enormous amount of expense.
Possibly the bulk of the justified cost of a cable is in ensuring its long-term physical integrity through the use of robust strain relief systems, the use of multiple insulating outer layers, possibly with the addition of armour and bedding layers to protect the cable even if stamped on or rolled over.
While this is not to be taken as a comment on the particular 'expensive' cable you linked to, it is fair to say that the advertised cost of some cables is more a factor of the price point that they can be sold at than of the manufacturing cost. Manufacturers know that when people are passionate about music / audio as a hobby or profession, they might be inclined to pay on the high side for a product, especially if it is still significantly less expensive than the guitar or amplifier that it's connected to. This is not helped by confirmation bias - many people will 'hear' an improvement with a more expensive cable, as that's what's expected, even when no such preferability is found in double-blind tests.
Answer: Cables differ in build, shielding quality, resistance, impedance and its constancy (admittedly, not particularly relevant for audio frequency cables at customary lengths), bendability and its effect on the cable parameters and some others.  The copper inside can have different qualities.
The most audible differences may be caused by instrument cables for high impedance sources (like electric guitar) since they are rather susceptible to noise, and loudspeaker cables.  For those, low resistance is rather desirable since loudspeakers usually have differing impedances for different frequencies and the output for solid state amplifiers is defined via its voltage, and the loudspeakers and crossovers show capacitive and inductive behavior where they release stored energy back into the cable and the amplifier has to suck it up without it affecting the voltage and thus other loudspeakers.  So considerably lower resistance than the loudspeaker impedance makes the almost-zero impedance of the amplifier work best.
As a corollary, speaker cables are less of an issue with tube power amplifiers since those have considerably higher output impedance anyway.
If you have a passive crossover network, its effects will mostly outweigh those of the cable.  A long thin cable will lose energy particularly with the low frequencies, and it will cause mushier response for the high tweeters.  For the rest, the crossover effects will far outweigh that of the cable.  And it's quite likely that for a reasonably chosen cable, the exemplar tolerances of the speaker pairs or a pile of clothes on the floor will quite outweigh the difference between a good and a "fabulous" cable.
So yes, there are measurable and perceivable differences with speaker cables, but the high-price race happens with specs and features that are outside of that range.  Their main qualities derive from pride, trust, and confidence.
Comment: I'd say just "pride," at least when it comes to "silicon filled gold Monster cables" and their ilk.


Ajax Callback Function in Submit Button Doesnt Work

Question: I have a submit button in my form and I want to implement it using ajax:
function myid_user_page_form(){

   drupal_add_library('system', 'drupal.ajax');

   $form = array();

   $form['id'] = array(
       '#type' => 'fieldset',
       '#title' => t('ID Information'),
       '#prefix' => '
',
       '#suffix' => '
'
   );

   $form['submit'] = array(
      '#type' => 'button',
      '#value' => 'Save',
      '#ajax' => array(
         'event' => 'click',
         'callback' => 'myid_user_page_form_ajax_submit',
         'wrapper' => 'myid_search_id_number_wrapper'
      ),
      '#attributes' => array(
        'id' => 'myid_save',
    ),
);

function myid_user_page_form_ajax_submit($form, &$form_state) {
    watchdog('Wow','Wow');
}

After executing the code above, the page still has it's refresh after it's clickfunctionality. The ajax doesnt work and no Wow message log in my watchdog table from my database, which means the ajax callback function isn't called. Where am I missing?
Comment: A few quick things I noticed, which might get you started in the right direction: 1) If that truly is the submit button in the `$form['submit']` array, then replace `#type => 'button'` with `#type => 'submit'`.
Also, you should be returning the `$form` variable in a `hook_form()` function.

Also, people better at Drupal than myself might know better, but I don't think there's any need to manually include a core Drupal library in your module.
Comment: Also, setting your own id attribute may be having an effect (not 100% sure though)
Comment: @2pha --> Thanks. Please put your comment in the answer section and I'll accept as an answer. I tried removing myid and it worked fine.
Answer: It is because you are changing the id attribute of the button.
The ajax in Drupal automatically attaches the javascript event listener to the submit, but it expects the button the have the automatically generated id.
Adding or changing the class attribute should not affect it though.
All the suggestions TerryCB made in the comments are also valid.


Error when trying to Promisify JWT in Typescript

Question: I am trying to promisify jwt verify in typescript, but I am getting this error.
"Expected 1 argument, but got 2.ts(2554)"
Sync version is working fine.
How to fix it?
import util from 'util';
const promisify = util.promisify;

const decoded = await promisify(jwt.verify)(token, process.env.JWT_SECRET as string);
console.log(decoded);

Comment: Did you look at the type of `promisify(jwt.verify)`?
Comment: Types of verify function

function verify(token: string, secretOrPublicKey: jwt.Secret, options: jwt.VerifyOptions & {
    complete: true;
Answer: Glancing at the types for jsonwebtoken and the documentation for verify that should have worked. But we don't live in a perfect world. You can always promisify the function yourself:
const jwtVerifyPromisified = (token, secret) => {
    return new Promise((resolve, reject) => {
        jwt.verify(token, secret, {}, (err, payload) => {
            if (err) {
                reject(err);
            } else {
                resolve(payload);
            }
        });
    });
}

You'll have to add some annotations but you get the idea.


integration services custom script reference issues

Question: I received an .ispac file which I successfully added to vs2019 with Integration Service Wizard project everything fine, but the problem is when I'm opening the custom script for the .dtsx file, some of the Microsoft references have a warning sign on them e.g: Microsoft.Xrm.Sdk and Microsoft.Crm.Sdk.Proxy, reinstalling the core assemblies nuget does fix the problem but when I save everything and close the script editor upon editing again the same problem persists and I think it prevents SSIS from functioning as intended.
I'm new, I don't know much about Integration Services, I'm getting on track.
Question:

How to deal with those warning signs ?
Is there any other problem ?

Thanks
Answer: adding nuget package dlls to gac solved this problem.


Speed up C++ code performance (map, find(), input and output)

Question: We input into console sequence of pairs(a,b) of int values. Then we input sequence of integers(z). And if we have some a[i] == z, should output b[i].
    int main()
    {
        std::ios::sync_with_stdio(false);

        std::map<int, int> mp;
        std::map<int, int>::iterator iter;

        int x, y;
        while (std::cin >> x && x != -1 && std::cin >> y && y != -1) {
            mp[x] = y;
        }
        while (std::cin >> x && x != -1) {
            iter = mp.find(x);
            if (iter != mp.end())
                std::cout << iter->second << ' ';
            else
                std::cout << 0 << ' ';
        }
        std::cout << -1;
    }

Code not fast enough, please help me to understand what I need to do to make it faster.

SOLUTION: Actually, trouble was in "mp.find(x)". Need just "mp[x]" ...
Comment: Use `std::unordered_map` instead of `std::map`.
Comment: I think as well, but I could be wrong. But "they" tell me that it is not fast enough for our tasks. Let's say it is 90 percent fast, and we need 100 all. I can't understand what else can be done with this without weird things (like inserting an assembler code).
Comment: I have to come up with a hash function faster than searching in the standard case, I suppose. I have no idea how to do this with such simplicity of the task.
Comment: Step 1: make sure you build your code with compiler optimizations *enabled* (the default in most cases is "optimizations disabled" to give a better debugging experience). Your IDE may call it "Debug build" vs "Release build". In some cases the difference can be orders of magnitude, performance wise. Step 2: Profile it.
Comment: Usually, *not fast enough* or Time Limit Exceeded (TLE) errors are a result from choosing a slow algorithm.  See if you can change your design to use a faster algorithm, or use more math, or simplify.  Rarely, do these online challenges require coding optimizations.
Comment: The problem with search times is that the search depends on the quantity of data and whether it is sorted or not.  For small sets of data, a linear search may be faster than a map.  If the data range is small, you could use a fixed array.
Answer: There is nothing in your code that indicates you need a sorted map.  So, use an std::unordered_map, which is usually much faster than std::map.

Also note that some of those who think std::ios_base::sync_with_stdio(false); matters add something like this to it :
std::cin.tie(nullptr);
std::cout.tie(nullptr);


Detect fingerprints on Androids not running API level 23?

Question: Is it possible to detect fingerprints on Androids not running API level 23?
Comment: There is zero point in a device having a fingerprint scanner, but an Android version lower than 6 (API level 23)
Answer: As per the Fingerprint Authentication requirements in the Xamarin Documentation, this is not possible:

Fingerprint Authentication requires Android 6.0 (API level 23) or
  higher and a device with a fingerprint scanner.


Compute a new list of integers by adding consecutive elements in a list with C++

Question: I am a beginner in C++. I am wondering how can I compute a new list by adding 8 consecutive elements and then divide them by the number of elements added in a list with C++. For example, the new list is re[], and the list we'll be using is a[], it has 200 elements. so re[i] = (a[i-1]+a[i-2]+a[i-3]+a[i-4]+a[i]+a[i+1]+a[i+2]+a[i+3]+a[i+4])/9
for(int i=4;i<196;i++){
    re[i] = (a[i-1]+a[i-2]+a[i-3]+a[i-4]+a[i]+a[i+1]+a[i+2]+a[i+3]+a[i+4])/9
}

However the above code is not applicable to  the first 4 elements and the last 4 elements in re[], because a[i] in these cases has no 4 consecutive elements either preceding or following a[i].
So I am wondering how can I do the same using for loop for these elements?
Thanks for any help.
Comment: start your loop from i = 0 and continue to i<192. In each iteration, calculate the average of a[i]+a[i+1]....+a[i+7].  You have to calculate re[192], re[193]....  and re[199] after finishing this loop.
Answer: I don't really know what you are doing but you might need to use Modulo Symbol so you wont get out of range
For example:
I want to stick with number 7 not get more and not getting less than 0
I will say for example 1 mod 7 and I will get 1
how? because it takes the reminder of the division
To understand more about it go here
To calculate and try go here
in your example
for(int i=0;i<200;i++){
    re[i] = (a[(i-1)%200]+a[(i-2)%200]+a[(i-3)%200]+a[(i-4)%200]+a[(i)%200]+a[(i+1)%200]+a[(i+2)%200]+a[(i+3)%200]+a[(i+4)%200])/9
}


Set max-width in Internet Explorer

Question: What I need is to set the limit of an image's width to 100% in Internet Explorer, like other browsers do with max-width.  That is, if the image's width is larger than the containing area's width, it scales down to fit the width of the containing area, but if it's smaller, its size doesn't change. Similarly, if the image is inside a table cell (td) and it's larger than the cell, I want it to scale to the size of the cell, instead of expanding it.
While there are other questions and answers that seem to be about this, I can't get any of them to work.  For example, this solution is usually suggested to emulate max-width in Internet Explorer:
http://www.svendtofte.com/code/max_width_in_ie/
In essence using this:
width:expression(
    document.body.clientWidth > (500/12) *
    parseInt(document.body.currentStyle.fontSize)?
        "30em":
        "auto" );
}

However, when I try it I don't get expected results at all. In some cases I get width values of -1 and no displayed image at all when I check in Firebug or something like it.
And I don't see how that solution could work either.
EDIT:
According to request, here is some sample code:

Bild 1. Uponor Push 12

Bild 2. Uponor ElPush 12

And the simple css (working for all browsers except IE):
img
{
    max-width : 100%;
    max-height : 100%;
}

But it doesn't work for this code in IE. Maybe it has something to do with the fact that it is placed in a table, I don't know, but when I try this div example on W3Schools, it works fine:
http://www.w3schools.com/cssref/playit.asp?filename=playcss_max-width&preval=50%25
EDIT 2:
Example full HTML page:
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <title>Image test</title>

Image test

This page shows the same problem. The images do not scale down to fit in the table cells. In other browsers I can resize the window as much as I want, and the images just keeps scaling down. IE8 and 9 don't. So it seems IE8 and 9 support max-width and max-height, but only for pixel values, not for percentage values - i.e. it only has partial support... If I'm correct, I'm really surprised it's so hard to find any info on this on the Internet. Everyone's just talking about these browsers as finally supporting it after IE6 didn't...
Anyway, I have written a jQuery workaround, but I would rather have not needed it. So if anyone can tell me I'm wrong and show me that IE8 and 9 actually do support max-width percentage values I'd be glad to be wrong :-)
Comment: Your question is more likely to get some answers if you provide the code you already have. As it stands, if the typical options don't work, there very well may be something interfering with the techniques, or some other conflict.
Comment: You may be right in some sense, see my edit about the W3Shools example that works. But it doesn't work in my own page...
Comment: Are you talking about IE6? Newer versions support max-width.
Comment: No, I'm talking about both IE8 and IE9, and yes, I know it's supposed to support it, but in my example above it doesn't. And the exact same code is used for all other browsers, where it works fine.
Comment: @AndersSvensson Are you sure your website is being displayed in standards mode? You should have `` at the top of your markup.
Comment: I'm using IE9 and I use the built-in developer tools to switch between versions of the standard, from latest IE9 to IE8. Not compatibility mode or anything. Just browser versions. I'm on Mac OS X Lion, using Parallels to open Windows and IE. And no I don't use the HTML5 doctype, because this is a transformation from XML (done in bulk) using the DITA Open Toolkit. HTML5 is not supported there yet.
Comment: What doctype is it producing, then? Even if it's not the HTML5 one, it still needs to be a valid one that IE understands.
Comment: @Shauna: Of course. It uses the XHTML transitional doctype. I'll post a full sample HTML page so you can see. I've tested this, and I tested all your suggestions as you can see except removing the table altogether (tables are important since this is technical documentation, it's full of actual tables, not tables for layout). This simple example shows the same problem. Try it with a couple of large images if you like. I believe the problem is that while IE8 and 9 support max-width and max-height, they only do it for pixel values, not for percentages, which other browsers do...
Answer: IE9, at least, does support max-width percentages for images, but the percentage is relative to the image's size, not the container's size. (You can see this by changing 100% to, say, 70%.)  It will work somewhat as expected, however, if you specify inherit instead of 100%.  Doing so will inherit the container's size for max-width in IE9.  (I've only tested your example page in IE9, Firefox, and Google Chrome, and it's not true that for that page, the images will keep scaling down as the window width gets smaller.)  This is not a perfect solution however; in IE8 browser mode, applying inherit this way will make the table cell's width equal to the image's unscaled width, even though the image is correctly scaled down.
Comment: Thanks. I haven't had time to test it, but this is an idea that seems worth checking out, so I'll go with this answer.
Comment: I tested this out now, and unfortunately it didn't work... I suppose inherit doesn't work because there is no max-width set on the parent?
Comment: `max-width` is already set on the parent `td` element, namely 500px.  It "works" insofar as the image is scaled down to 500px, which is the size given by `max-width` on `td`.  If you say it doesn't work because the image doesn't keep scaling down as the window width gets smaller, keep in mind again that neither IE9 nor other browsers show that behavior in your test page.
Answer: Is there any particular reason why you've put a div inside of a td?
There are two things offhand that I think may be interfering:

The div. If it's only there for class and ID, see if you can move that into the td element. If you can't, make sure you set its width and height properties to 100%. Letting it take on automatic dimensions may be interfering with the image sizing.
It may be breaking due to the nature of display: table-cell;, which is what td typically defaults to. Try changing its display to something like block or inline-block and see if that fixes the issue, then go from there (fyi - IE7 doesn't understand inline-block, but you can deal with that after you figure out what's causing the image problem).

Another alternative is to avoid tables altogether. The code you've provided suggests that you may be using a table for layout purposes, which isn't what they're meant for.
Additionally, your usage of attributes such as cellpadding and valign suggest that your references are quite a bit outdated. I highly recommend learning about more current methods and standards. Here's an article addressing cellpadding to get you started.
Comment: Sorry, I should have explained this: I don't actually create this html code myself (god forbid), no it's generated in an XSLT transform from the DITA Open Toolkit for technical documentation. And I have very little influence over the xml files that are the basis for the transformation. Also, I agree there is a lot that's outdated in the html code, but that is also largely out of my hands. What I do is customize a predefined XSLT transform. So I can do some changes to the output, but to change all of it would be monumental... But I'll see if any of your suggestions help in a test file. Thanks.
Answer:
Setting max-width: none resolved an issue in my case.

Note: tested on IE11

Set max-width in Internet Explorer


Connect from local machine to aws MSK

Question: I followed "public access" to set up the configuration. I have two goals, Firstly, I want to create topic from local terminal by using this command line "/bin/kafka-topics.sh --create --bootstrap-server ZookeeperConnectString --replication-factor 3 --partitions 1 --topic ExampleTopicName", but it always return "the broker is not available". Secondly, I want to connect MKS from local .Net Application. However, it seams cannot connect to the MKS successfully.
This is my some configuration that attach on my MKS

Create public subnet 172.31.0.0/20 and 172.31.16.0/20 and attach an Internet Gateway
Close unauthenticated access control off and turn on SASL/SCRAM access-control methods. Besides, I attached an secret for this authentication and add allow.everyone.if.no.acl.found to false to cluster's configuration.
Turn on public access
Cluster configuration
Cluster configuration
Producer Configuration
Producer Configuration
Security Group
Security Group

Does anyone can give me some advice or hints? I do some research that not sure I have to add listeners in my cluster configuration? Thanks for your time and consideration.
Comment: 1) `kafka-topics.sh` should use `--bootstrap-server`, not `--zookeeper` since it is deprecated. Also, you need `--command-config` to pass a properties file with SASL details 2) I suggest you contact AWS Support if their own documentation is not  working
Comment: @OneCricketeer Thank you for point out should use "bootstrap server". I changed it and still not work. Thanks for your answer!
Answer: I was struggling with MSK, too. I finally got it working and maybe give some hints here:

according to the docs at AWS, only SCRAM-SHA-512 is supported, not -256
in the SG, I did add a rule for inbound traffic to accept from anywhere (0.0.0.0)

Hope that helps,
<code>donbachi
</code>

Connect from local machine to aws MSK


How to assess the quality of a return period estimate?

Question: Background
I have a time series of structural loads, which are measured forces on a moored ocean buoy, and I need to obtain the return period value so that the structure can be designed to withstand the max load expected in a storm. The return period is estimated from the measured time series in the following way: First, I choose a threshold and identify the peaks above this threshold. Extreme events are expected to have a distribution known as the Generalized Pareto Distribution (GPD), so I fit the peaks to that distribution. Then the GPD fit is inverted to give the load associated with the probability of a chosen time period (3 hours). This load is called the return period value. I am using a program called WAFO, which takes extreme value analysis routines from S-Plus, to do this analysis.
Problem
The problem is how to assess the quality of the return period estimate. WAFO produces quantile-quantile plots that show how well the peaks match the GPD, a p-value to check the quality of the fit, or confidence bounds on the return period estimate. But these 3 diagnostics seem to conflict. Sometimes the q-q plot shows that many peaks don't fit the GPD (bad), but the p-value for the fit is high (good) and the confidence bounds are narrow (good). Sometimes the confidence bounds are very wide (bad) but the q-q plot shows the peaks lining up with the GPD (good). My gut sense is that the quality might be poor because we only measured data for a limited duration and there is likely measurement noise.
Question: How can I tell if the return period estimate is good vs bad?
Comment: Just bought 'An introduction to statistical modeling of extreme values' by Stuart Coles, which looks like it will help. He recommends calculating the CI by the profile likelihood method rather than the delta method as I have been doing, and also notes that the CI is not assessing the quality of the fit - that's what the plots are for. Will post any insights after reading further.
Answer: Based on the Coles book, which I highly recommend, the best check on the goodness of fit is the quantile-quantile plot. The confidence interval does not address whether the model was correct or not. The CI should be seen as a lower bounds that would be much greater if the model correctness were considered (p.57 of Coles). You still need to look at it, it's just not the whole story. And for extreme values, the CI should be estimated using the profile likelihood method rather than the less accurate delta method that I was using previously. That was a big improvement.


how do i select an interpreter on my IDE which is Python IDLE

Question: How do I select an interpreter on my IDE which is Python IDLE? I can't find the options to do that.
I managed to install Tensorflow but it only works when I import it in the terminal, not in my current IDE
What I want: Make my current IDE use the Python.exe that has been provided when I installed Tensorflow on my computer
What I tried: Using PYCHARM, it works (like a charm!) but I can't do that stuff like import module then have " >>> " then issue my commands etc...
Comment: Did you try `import subprocess` and then run `subprocess.Popen(['/path/to/your/tensorflow_executable'])` ?
Comment: Or if you'd like to run tensorflow commands from within a python script just execute `pip install tensorflow` in your regular command line interface, then start Python IDLE and just type `import tensorflow` and write the rest of your script.
Comment: I can't understand the question.  I hope @SB87 did.  If not, try re-wording.
Comment: I'll try the second solution @SB87, but if I write that amn't I ( sry broken english ) going to install tensorflow twice?
Answer: IDLE does NOT provide such functionality - it works through idlelib, a package from stdlib so it's executed using pythonw -m idlelib. To change interprenter in IDLE, call it using a different interprenter - "C:\path\to\your\python\interprenter\pythonw.exe" -m idlelib (make sure idlelib is installed for target interprenter).


Android SDK deosn't think JDK is installed? - Windows 7

Question: On Windows 7 I have installed the Java SE JDK, then rebooted.

When I then run the Android SDK installer, there is a warning that the JDK is not installed.
Comment: Duplicate: http://stackoverflow.com/questions/4394584/android-sdk-install-problem
Answer: Did you install 32-bit version or 64-bit version?
Check out here for Windows 7 / Android Tools setup :
https://stackoverflow.com/questions/4588548/help-jdk-not-detected-problem-during-android-sdk-tools-setup
Also, check out your PATH environment variables to confirm JDK is setup and referenced!
And as commented below, also check out JAVA_HOME variable.
Comment: This is a good debugging tip Dominic. I did find that the Back, Next trick did it for me. Looks like a bug in the Android installer.
Comment: I had the same problem, turns out I did not have JAVA_HOME set for some reason (x64 JDK on Win7). I set the variable and restarted the Android SDK install, and it worked fine. So I'd mention JAVA_HOME in addition to PATH.
Answer: I found that if I press the Back button on the Android SDK installer, then press the Next button again, it works!
Comment: This question does (basically) duplicate another, but this is a different solution. Please accept this answer.
Answer: i had the same problem, tried all the solutions but nothing worked. The problem is with Windows 7 installed is 64 bit and all the softwares that you are installing should be 32 bit.
Android SDK itself is 32 bit and it identifies only 32 bit JDK. So install following softwares.

JDK (32 bit)
Android SDK (while installing SDK, make sure install it in directory other than "C:\Program Files (x86)", more probably in other drive or in the directory where Eclipse is extracted)
Eclipse (32 bit) and finally ADT.

i tried it and all works fine.
Answer: You Should Create an Environment Variable to Point to Your java Directory.
Go to My Computer > right click on a free space > choose properties > in the left column choose "Advance System Setting" > Go to Advance tab > push Environment variable button > in System Variable click on New :
Variable name : JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.7.0_06
You should be careful about path if you add path like this "C:\Program Files\Java\jdk1.7.0_06\bin" or this one "C:\Program Files\Java" it will not work.
Answer: My is configuration Windows 7 64-bit.
I didn't want to uninstall 64-bit jdk and the other suggestions weren't working. So I just downloaded the 32-bit and re-ran the windows installer.
Voila, it works and doesn't take the 32-bit either. It takes the 64-bit higher version instead.
I feel it just feels safe with the presence of the 32-bit jdk :P
Answer: When you downloaded sdk, running via browser's downloaded files section right? application can't detect java in this state. if you run it via directly its own folder, it will find sdk. simple


Find angle of line tangent to a circle based on these parameters?

Question: Here is an image showing the problem I'm faced with.

All variables in the picture are known except for beta (ß). That is what I'm trying to find.
I have a circle of radius r that's a distance h from some (black) reference line.
From that reference line, there's an angled line (in green) that's tangent to the circle.
The starting location of that angled tangent line is a distance d from the vertical tangent of the circle (vertical in the sense that it is perpendicular to the black reference line).
If h, r, and d are known/given, how can I derive a formula to calculate ß?
Answer: hint
the tangent line has the equation
$$x\tan(\beta)-y=0$$
the center of the circle has cordinates
$$(h,d+r)$$
the distance between this center and the tangent line must be $ r$, so
$$\frac{|h\tan(\beta)-(d+r)|}{\sqrt{\tan^2(\beta)+1}}=r$$
Comment: Thank you for this. Is it possible to solve for ß in that final equation? That's the variable I'm most interested in calculating.
Comment: @tectactoe Yes, use the identity $1+\tan^2=\frac {1}{\cos^2}$
Comment: Square the last equation, multiply both sides by $\tan^2\beta+1$ and you get a quadratic in $\tan\beta$.