I have the following Meta-Code  var Parent = function(){} Parent.prototype.doSomething = function(){   console.log("As a parent I did like a parent"); }  var Child = function(){} Child.prototype = new Parent(); Child.prototype.doSomething = function(){   console.log("As a child I did like a child");   //This is where I am not sure what to put }   What I would like it 2 lines  As a child I did like a child As a parent I did like a parent   Of course the first one is simple but I am not sure how/if I can call a parent function once it has been overridden.
Is it possible to call the base method from a prototype method in JavaScript if it's been overridden?  MyClass = function(name){     this.name = name;     this.do = function() {         //do somthing      } };  MyClass.prototype.do = function() {       if (this.name === 'something') {         //do something new     } else {         //CALL BASE METHOD     } };
Replace \input{fileX} by the content of fileX automatically Suppose I have a document with multiple include or input statements  \input{fileA} \input{fileB}   etc.   Is there an easy way to generate a single .tex file where \input{fileA} is replaced by the actual content of fileA etc. without copying it manually? What is the actual mechanism behind the reflection of various colored light by material of different color? When light (composed of photons with different frequency and wavelength) falls on a material, some of it gets absorbed and some get reflected depending upon the color of the material on which it strikes. And the material reflects the light of its own color only, thereby absorbing all the other colored light. So, my questions are:  How would a photon with certain wavelength (say 400 nm) decide to get reflected after striking the material of red color?   What is the actual mechanism behind the reflection of various colored light by the material of different color? What are the proper uses of:   static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style cast type(value)   How does one decide which to use in which specific cases? Is there any objective benefit to escape sequences over tput? In people's '.*rc' files I see online or in various code, I tend to see a lot of people who manually use ANSI escape sequences instead of using tput.  I had the understanding that tput is more universal/safe, so this makes me wonder:  Is there any objective reason one should use escape sequences in place of tput?  (Portability, robustness on errors, unusual terminals...?) How do you use script variables in psql? In MS SQL Server, I create my scripts to use customizable variables:  DECLARE @somevariable int   SELECT @somevariable = -1  INSERT INTO foo VALUES ( @somevariable )   I'll then change the value of @somevariable at runtime, depending on the value that I want in the particular situation. Since it's at the top of the script it's easy to see and remember.  How do I do the same with the PostgreSQL client psql? There is a way to change top bar background opacity in ubuntu 20.04 lts.  I installed the hide top bar extension but is not a option to change it. When using vagrant Stderr: VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX) I am trying to install open edx with  ubunty 16.04 and I get this error  There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below.  Command: ["startvm", "c60f0594-d584-4e0b-b863-2801168e641e", "--type", "headless"]  Stderr: VBoxManage: error: VT-x is not available (VERR_VMX_NO_VMX) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole   this occurs when using vagrant up What is $(65!)^2$ congruent to mod $131$? Where can I find a list of all the Stack Exchange sites?  I need to ask a question about cars (where my total knowledge is about zero) but I can't find a cars Stack Exchange site - tried guessing all the obvious (and pun based) names.  I assume the list of a dozen or so at the bottom of this page is only a subset? There must be a site on a topic as geeky as cars!  A list of future/beta sites would also be useful - I found a few on topics I'm interested in only after they had been up for a while. How to resolve the C:\fakepath? General theorems for consistency and asymptotic normality of maximum likelihood I'm interested in a good reference for results concerning asymptotic properties of maximum likelihood estimators. Consider a model $\{f_n(\cdot \mid \theta): \theta \in \Theta, n \in \mathbb N\}$ where $f_n(\mathbf x \mid \theta)$ is an $n$-dimensional density, and $\hat \theta_n$ is the MLE based on a sample $X_1, \ldots, X_n$ from $f_n(\cdot \mid \theta_0)$ where $\theta_0$ is the "true" value of $\theta$. There are two irregularities I'm interested in.    The data $X_1, \ldots, X_n$ are not iid and, as a result, the Fisher information about $\theta$ accrues at a rate slower than $n$.  $\Theta$ is a bounded set, and with positive probability $\hat \theta_n$ lies on the boundary. The boundary corresponds to a "simpler" model, and so there is particular interest in whether or not $\theta_0$ lies on the boundary.    My particular questions are   Letting $J_n(\theta)$ denote the observed Fisher information corresponding to $\theta$, and suppose $\theta_0$ lies in the interior of $\Theta$. Under what conditions is $$\left[J_n(\hat \theta_n)\right]^{1/2}(\hat \theta_n - \theta_0)$$ asymptotically normal as $n \to \infty$? In particular, are the regularity conditions similar to the usual ones, with the relevant modification being $J_n(\hat \theta_n) \to \infty$ in some sense? Suppose instead that $\theta_0$ is on the boundary, and again recall that $\hat \theta_n = \theta_0$ happens with positive probability - for concreteness, in a mixed effects model $Y_{ij} = \mu + \beta_i + \epsilon_{ij}$ we can have $\hat \sigma_{\beta}^2 = 0$. Under what conditions does $\hat \theta_n \to \theta_0$ (almost surely or in probability) and under what conditions will $\hat \theta_n = \theta_0$ eventually (this probably fails for the mixed effects model, but corresponds to "oracle" properties for the LASSO and related estimators, so perhaps it is too much to ask for general results)?   Again, just a pointer to a text with results at this level of generality would be greatly appreciated. I have a list of dictionaries and want each item to be sorted by a specific value. Take into consideration the list: [{'name':'Homer', 'age':39}, {'name':'Bart', 'age':10}]  When sorted by name, it should become: [{'name':'Bart', 'age':10}, {'name':'Homer', 'age':39}] Can you use class features while Polymorphed? More specifically I'm trying to understand if a Barbarian who has been polymorphed, either willingly or not would be able to . However this also applies to things such as , or , anything a player might want to continue to use while no longer themselves.  Many questions specify you're able to rage while Wild Shaped, as  specifies      You retain the benefit of any features from your class, race, or other source and can use them if the new form is physically capable of doing so.   However,  specifies the following,     The target's game statistics, including mental ability scores, are replaced by the statistics of the chosen beast. It retains it's alignment and personality.   And     The creature is limited in the actions it can perform by the nature of its new form.   Unlike Wild Shape, nowhere does polymorph specify that you retain benefits from your class or race. Does this imply that class abilities do not carry over to polymorphed individuals? How to implement uniform grids Up until now, I implemented all-against-all collision detection in my games. It worked fine.  But I reached a point where implementing this kind of collision detection, makes the game run poorly, because there are two many objects to iterate through and check for collision.  I have searched this site and found something about 'uniform grids'. But I didn't completely understand what it is and how to implement it. Tried to Google it but nothing easy enough to understand came up.  I am a beginner to 2D-game programming. Do you mind trying to explain to uniform-grids, or link me to some good tutorial?  Thanks a lot If $a, b, c >0$ prove that $ [(1+a)(1+b)(1+c)]^7 > 7^7a^4b^4c^4 $. I solved it using AM, GM inequalities and reached to $[(1+a)(1+b)(1+c)]^7 &gt; 2^{21}(abc)^\frac72 $ please help how to get $7^7(abc)^4$ in the inequality. How to hide file extensions Show that any set in a metric space can be written as the intersection of open sets Find all integer solutions to Diophantine equation $x^3+y^3+z^3=w^3$ Compute all integer solutions to the equation  $$x^3+y^3+z^3=w^3$$ Is there a way to tell Nautilus not to generate previews of PDF files? I tend to download lots of articles as PDFs, and I find that when I browse a directory of these Nautilus takes 1 minute to load the directory. I assume that's because it's generating previews of their front pages. That feature is useless to me, alas.  I'd like to tell it not to do that. Is there an idiom available, that is exactly opposite to "Cake walk" or "Child's play"?