Javascript objects. I am trying to understand the difference between the following ways of class declaration.  At a fundamental level is the difference between both of them? Is one advantageous over the other? if so, how?      1)         var Animal = function(){           this.run = function(speed){              console.log(speed)            };             this.eat = function(food){              console.log(food);            };           }          var dog = new Animal();  2)       var Animal = function(){};       Animal.prototype.run =  function(speed){              console.log(speed)            };        Animal.prototype.eat =   function(food){              console.log(food)            };
What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };
Integral $\int_{\frac{1}{2}}^1 \frac{\ln x}{\sqrt{x^2+1}}dx$ Relative performance of std::vector vs. std::list vs. std::slist? If it is given that component of acceleration perpendicular to the velocity of a body has a constant, non-zero magnitude, how can we mathematically prove that the trajectory of the body will be circular?   I have basic knowledge of calculus, vectors and co-ordinate geometry. I can prove that the trajectory of a body in projectile motion is parabolic. I tried to follow a similar method to get an equation of circle but couldn't succeed. I tried forming parametric equations of x and y in terms of time t (the way we proceed when proving the parabolic path of a projectile) but could not reach the conclusion.  Edit: I have edited the question in order to improve it. However I still can not share my work on this question as I had asked the question almost 6 months ago and now I can not find where I tried solving it. Sincerely sorry for that. Rules for Profiles Are there any rules concerning what I can put in my profile? Although work and heat do the same thing (increase or decrease the internal energy of the system), There is still a fundamental difference between them. For example, The way in which entropy is defined is a very good way to differentiate between work and heat. But, why is there such a distinction between the two things? Is it the limitation of Newtonian mechanics that it never accounted for something like heat which could also change the energy of the system? Is the word "Thermodynamical work" or "Hidden work" suitable for heat? What is the command that lets me see what and where devices are mounted?  I'm having trouble changing songs on my old iPod, and I have a feeling it's because of the mount point. long long implementation in 32 bit machine As per c99 standard, size of long long should be minimum 64 bits. How is this implemented in a 32 bit machine (eg. addition or multiplication of 2 long longs). Also, What is the equivalent of long long in C++. Find files in directory with paired names I'm running tests of a variable-size-and-contents test set. Data files are added and removed frequently. I'm looking for an automated way of gathering a file list.  All files are in subdirectories of D; I need the full directory and name added to a text file. However, I only need those files that have a "paired" file, which has the same filename but a different extension (so... different filename, but in a structured way). So, if there is a MyFileName.A and MyFileName.B, then I want D/.../MyFileName added to the file list.  There are .A files without .B files, but no .B files without .A files. If a .A has a .B file, then both files are in the same directory.   Any advice? Does $\lim_{h\rightarrow 0}\ [f(x+h)-f(x-h)]=0$ imply that $f$ is continuous? Imagine you're teaching a first course on quantum mechanics in which your students are well-versed in classical mechanics, but have never seen any quantum before.  How would you motivate the subject and convince your students that in fact classical mechanics cannot explain the real world and that quantum mechanics, given your knowledge of classical mechanics, is the most obvious alternative to try?  If you sit down and think about it, the idea that the state of a system, instead of being specified by the finitely many particles' position and momentum, is now described by an element of some abstract (rigged) Hilbert space and that the observables correspond to self-adjoint operators on the space of states is not at all obvious.  Why should this be the case, or at least, why might we expect this to be the case?   Then there is the issue of measurement which is even more difficult to motivate.  In the usual formulation of quantum mechanics, we assume that, given a state $|\psi \rangle$ and an observable $A$, the probability of measuring a value between $a$ and $a+da$ is given by $|\langle a|\psi \rangle |^2da$ (and furthermore, if $a$ is not an eigenvalue of $A$, then the probability of measuring a value in this interval is $0$).  How would you convince your students that this had to be the case?  I have thought about this question of motivation for a couple of years now, and so far, the only answers I've come up with are incomplete, not entirely satisfactory, and seem to be much more non-trivial than I feel they should be.  So, what do you guys think?  Can you motivate the usual formulation of quantum mechanics using only classical mechanics and minimal appeal to experimental results?  Note that, at some point, you will have to make reference to experiment.  After all, this is the reason why we needed to develop quantum mechanics.  In principle, we could just say "The Born Rule is true because its experimentally verified.", but I find this particularly unsatisfying.  I think we can do better.  Thus, I would ask that when you do invoke the results of an experiment, you do so to only justify fundamental truths, by which I mean something that can not itself just be explained in terms of more theory.  You might say that my conjecture is that the Born Rule is not a fundamental truth in this sense, but can instead be explained by more fundamental theory, which itself is justified via experiment.  Edit:  To clarify, I will try to make use of a much simpler example.  In an ideal gas, if you fix the volume, then the temperature is proportional to pressure.  So we may ask "Why?".  You could say "Well, because experiment.", or alternatively you could say "It is a trivial corollary of the ideal gas law.".  If you choose the latter, you can then ask why that is true.  Once again, you can just say "Because experiment." or you could try to prove it using more fundamental physical truths (using the kinetic theory of gases, for example).  The objective, then, is to come up with the most fundamental physical truths, prove everything else we know in terms of those, and then verify the fundamental physical truths via experiment.  And in this particular case, the objective is to do this with quantum mechanics. What is the difference between a deep copy and a shallow copy? How can a singularity in a black hole rotate if it's just a point? I guess nobody really knows the true nature of black holes, however, based on everything I know about black holes, there is a "singularity" at their center, which has finite mass but is infinitely small and thus infinitely dense.  So a black hole is really just a point mass that dramatically warps the space-time around it so that an event horizon is achieved.  What doesn't make sense to me is how a true mathematical "point" can rotate, or at least how it is even possible to determine if a point is rotating (or if it should even make a difference about whether or not it is rotating, for the same reason it would be impossible to tell if a perfect, featureless sphere were rotating (I know it would have higher rotational energy but lets assume you can't measure that because a true "point" can't attain rotational energy since it has no radius)).  The only conceptual solution I have to describe a rotating black hole would be to compare it to a rotating whirlpool, where the surface of the water is the fabric of space-time... but this is different because there is no "singularity" in a whirlpool that causes the water around it to rotate, whirlpools form from flow of water around a point (put into motion perhaps by some kid swirling water in a 2-liter bottle... it's due to an external cause), but the only thing that could cause rotation around a black hole would be the singularity itself, which doesn't make sense because, once again, how can we know if a true point is actually rotating?  Aside from everything I've said, here is what I am actually asking:  Why/how do some black holes rotate... what is the mechanism of their rotation (is analogous to a spinning point or a 3-d whirlpool, or something different)? Can I bring a pack of razor blades on a plane? I have to take a flight soon and I want to know if I can take a pack of razors with me. They are in a pack that is designed to not let any out unlesss a person really wants to open it. I'm going to the USA so, can I?  I mean plain old razor blades: "24 hours' notice" or "24 hours notice"? Which one is correct?  1: Well, you canceled on Tuesday and our policy is 24 hours' notice for all cancellations. 2: Well, you canceled on Tuesday and our policy is 24 hours notice for all cancellations.  To me personally, the first one makes more sense grammatically. But I've also heard that the second version is how they typically write it on paper forms at hospitals (that's what native speakers say). Could you please clarify my confusion? How to evaluate $\int_{0}^{+\infty}\exp(-ax^2-\frac b{x^2})\,dx$ for $a,b>0$ Greatest common divisor of two positive integers I know that Greatest common divisor of two positive integers $a$ and $b$ is the largest positive integer that divides both $a$ and $b$, but how can I use that to prove that $\gcd(a, b) = \gcd(a, b-a)$. Force as gradient of scalar potential energy My text book reads      If a particle is acted upon by the forces which are conservative; that is, if the forces are derivable from a scalar potential energy function in manner $ F=-\nabla V $.   I was just wondering what may be the criteria for force to be expressed as negative gradient of scalar potential energy and HOW DO WE PROVE IT? Using apt-get how to check have installed latest version ? Hello im just new for Linux   I know that  sudo apt-get   is for installing application   but how I would know that I have installed the latest version of the application   for example apt-get install sun-java6-jdk   is there an option to upgrade or see the latest version   or its ok to install an old version the application and Linux will upgrade it for me ? Get Emacs to ignore contents of \Sexpr{} command in Sweave document to prevent incorrect $-based syntax highlighting $\forall x,y>0, x^x+y^y \geq x^y + y^x$ Prove that $\forall x,y&gt;0, x^x+y^y \geq x^y + y^x$   A friend of mine told me none of the teachers in my school have succeeded in proving this seemingly simple inequality (it was asked at an oral exam last year). I tried it myself, but I made no significant progress.