Declare a generic type instance dynamically
How do I use reflection to call a generic method?
apt: how to be sure that a specific package gets installed/updated from specific repository and not from the default one? Is there a recursive version of the dict.get() built-in? Bottom to top explanation of the Mahalanobis distance? I'm studying pattern recognition and statistics and almost every book I open on the subject I bump into the concept of Mahalanobis distance. The books give sort of intuitive explanations, but still not good enough ones for me to actually really understand what is going on. If someone would ask me "What is the Mahalanobis distance?" I could only answer: "It's this nice thing, which measures distance of some kind" :)   The definitions usually also contain eigenvectors and eigenvalues, which I have a little trouble connecting to the Mahalanobis distance. I understand the definition of eigenvectors and eigenvalues, but how are they related to the Mahalanobis distance? Does it have something to do with changing the base in Linear Algebra etc.?  I have also read these former questions on the subject:       I have also read .  The answers are good and pictures nice, but still I don't really get it...I have an idea but it's still in the dark. Can someone give a "How would you explain it to your grandma"-explanation so that I could finally wrap this up and never again wonder what the heck is a Mahalanobis distance? :) Where does it come from, what, why?   UPDATE:   Here is something which helps understanding the Mahalanobis formula: What is gravity and what causes objects to act against it? So I understand the concept of gravity, in that it's not actually a force, but more of a displacement in the spacetime grid. An object with a big enough mass will bend the spacetime, causing smaller objects to "attract" to it (not really, but good enough for what I am trying to figure out)   Ok so that makes sense, but what I am not understanding is, how come planets don't just get engulfed by the Sun? There must be something acting against the gravity for the planet to be a certain distance away from the sun. Am I not understanding this concept correctly? How does a credit card company make any money off of me using their card if there are no fees associated with the card (I don't pay any extra) and I pay off my balance on time every month (so I don't pay any fees ever for this either).  Are they just banking on the fact that many people don't do this and end up owing them money? Today in a match the setter set the ball too low for me to spike it, so I just dinked it over.  The bottom of the ball was lower than the top of the net at the point where I made contact.  When the defender made contact, again, the bottom of the ball was lower than the top of the net (the top of the ball was over the top of the net though).  I felt that this wasn't technically a block and that he shouldn't have been allowed to hit it a second time, but I wasn't sure so I just let it go.  Was this a legal block or should it have been our point when he hit it a second time in a row?  Edit:  I don't think I was clear about the part where, after I hit the ball, the ball travelled over the net onto the other team's side of the court.  The other player did not reach over the net so there is no issue there.  It's just an issue of whether or not their first contact was a block or a hit.  I believe it was not a block but I can't find a specific ruling to address it. How to catch creation of DOM elements and manipulate them with jQuery Changing underline color of LanguageTool in TeXstudio I've recently installed LanguageTool to check grammar and spelling mistakes in TeXstudio. However, I often miss the errors because the gray-bluish underlining makes them hard to spot. Is there a way to change the underlining to a distinctive color, such as red for example?   I checked . It says I have to do some changes to the .languagetool.cfg file, but for some reason this file doesn't appear in File Explorer. Why do physicists believe that there exist magnetic monopoles? I am very interested in the evolution of the evolution process itself. There are of course a lot of things that influence how evolution will work, but for this question, I am interested in things that are only related to the evolution process. Examples could be increase chance of mutations in newborns, change in reproduction age, and similar. I am specifically interested in observation where the evolution process itself has adapted to a change in the environment. What really causes light/photons to appear slower in media? I know that if we solve the Maxwell equation, we will end up with the phase velocity of light being related to the permeability and the permittivity of the material. But this is not what I'm interested in - I want to go deeper than that. We know that the real speed of light is actually not changing, the decrease in speed is just apparent. Material is mostly empty, the light will still travel with $c$ in the spacing. The rare atoms will disturb the light in some way. So I am interested in how the atoms affect the light. Photon absorption-emission theory Some textbooks that I read explain it in a way kind of like this: In a material the photons are absorbed by atom and then re-emitted a short time later, then they travel a short distance to the next atom and get absorbed&amp;emitted again and so on. How quickly the atoms in a material can absorb and re-emit the photon and how dense the atoms decides the apparent speed of light in that material. So the light appears slower because it has a smaller “drift speed”. Interference theory But recently I realize an alternative explanation: Atoms respond to the light by radiating electromagnetic wave. This “new light” interferes with the “old light” in some way that results in delayed light (advanced in phase), this can easily be shown by using simple phasor diagram. Consequently effectively the light covers a smaller phase each second, which gives the impression of a lower phase velocity. However the group velocity is changing in a complicated way. I think that the first explanation does not explain the change in phase velocity of light. if we consider light travelling into a slab of negative refractive index non-dispersive material, let’s say the light is directed perpendicular to the slab. The phase velocity’s direction will be flipped, but group velocity’s direction in the material will not change. Only the second explanation can explain the flipped phase velocity direction. I guess that the velocity that we get in the first explanation is actually belongs to the group velocity. It makes sense to me that the front most of the photon stream determines the first information that the light delivers. So the question is What really cause the phase velocity of light to be decreased?  &quot;drift velocity&quot; of photons (they aren't the same photons, they are re-emitted all the time) phase difference between absorbed and emitted light something else  And also, I still don't really understand detailed explanation of the absorption-emission process for small light's wavelength (for large lambda compare to the atoms spacing, the photons will be absorbed by the phonons). The dispersion relation that we know is continuous and also some material is non-dispersive, therefore the absorption process must occur in all frequency for a certain range. So definitely it doesn't involve the atomic transition, otherwise it will be quantized. My guess is that the relevant absorption process gets smooth out by the dipole moment. What makes the spectrum continuous? EDIT: link for dispersion relation: Show that $2^n > n^2$ whenever n>4. Let $S(n)$ be the proposition "$2^n &gt; n^2$"  Basis step: $S(5)$ is true, since $2^5 = 32$, $ 32 &gt; 25 = 5^ 2$  Inductive step:  Induction hypothesis:   Assume $S(K)$ is true, $2^K &gt; K^2$.  Then  $2^{K+1} = 2.2^K &gt; K^2 + K^2$   I don't know how to proceed after this. How to complete this proof? How to use an optimization solver to get t-stats and p-values for the estimates? How to set a custom 4x4 projection matrix in Blender "Please do not repeat the mistake" and "Please do not repeat the mistake again" I ran into something a couple of weeks ago that I'd never seen before: A filesystem (ext3 I believe) installed to a storage device without a partition. In essence /dev/sdb was the entire filesystem. I know many filesystems can be extended into empty space, so doing this allows extending without dealing with LVM or some other kind of volume manager, but are there any other advantages for setting up storage this way?  The specific case I saw was as the ephemeral data volume for a number crunching server, the boot and root volumes were traditional partitions on a different storage device entirely. - Interpreting exp(B) in multinomial logistic regression This is somewhat of a beginner's question, but how does one interpret an exp(B) result of 6.012 in a multinomial logistic regression model?  1) is it 6.012-1.0 = 5.012 = 5012% increase in risk?  or  2) 6.012/(1+6.012) = 0.857 = 85.7% increase in risk?  In case both alternatives are incorrect, can someone please mention the correct way?  Ive searched many resources on the internet and I get to these two alternatives, and I am not entirely sure which one is correct. What are the differences between executing shell scripts using "source file.sh", "./file.sh", "sh file.sh", ". ./file.sh"? Android app chokes on per-site meta profiles Steps to reproduce:    Go to a per-site meta. Find any post. Touch the user that posted it. See something like this (click to enlarge):           As you can see, it says "Stack Overflow" as the site, and shows my SO rep and badges, but it shows my Meta.Code Golf posts. 3-4 old computers = general purpose cluster?