In ES6 (ECMAScript 2015) you can define a class method either in the constructor or the body, what's the difference?  class Person {  constructor(name) {    this.name = name;     this.sayName = () =&gt; {      console.log('hello i am', this.name);    }  } }  class Person2 {  constructor(name) {    this.name = name;  }   sayName() {    console.log('hello i am', this.name);  } }   My guess is, in Person, the method sayName is being recreated each time we instantiate a Person object, and in Person2, we are applying the method to the prototype? (just a guess)
What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };
In Java, are enum types inside a class static? Number of $(0,1)$ $m\times n$ matrices with no empty rows or columns Is it possible to add a user and restrict him to run special programs? For example after this user logs in, he can only open Firefox to use Internet and no other programs can be run by this user. For example in a terminal, commands will not be accessible when you delete some environment variables like $HOME. But is it possible to avoid running programs in a graphical shell, like Gnome? If yes, how? Differences among "It feels...", "It looks...", and "It seems..." replace often used Tex-Literals ($ and $$) for math regions into \( or \) and \[ or \] Is there an editor or IDE (or a script) for substituting the TeX-Commands $ and $$ for opening and closing math regions into the corresponding LaTeX-Commands \(,\) and \[,\]? I'm sure there is a tool - and I'm searching for. I think, this will result in better readable code. A simple search and replace wont do that - but with regular expressions, that should not be problem. I simply do not want to invent the wheel a second time. Bibtex true unsort extended stars-and-bars problem(where the upper limit of the variable is bounded) The problem of counting the solutions $(a_1,a_2,\ldots,a_n)$ with integer $a_i\geq0$ for $i\in\{1,2,\ldots,n\}$ such that $$a_1+a_2+a_3+....a_n=N$$ can be solved with a stars-and-bars argument. What is the solution if one adds the constraint that $a_i\leq r_i$ for certain integers $r_1,\ldots,r_n$?  e.g. for $n=3$, $N=6$ and $(r_1,r_2,r_3)=(3,3,2)$, the tuple $(a_1,a_2,a_3)=(2,3,1)$ is a solution, but $(2,1,3)$ is not a solution because $a_3=3&gt;2=r_3$. How do Prestige Classes that advance spellcasting interact with racial spellcasting ability? Helpless after exhausting daily limit for reviewing Suggested Edits How can you print a variable name in python? Say I have a variable named choice it is equal to 2. How would I access the name of the variable? Something equivalent to  In [53]: namestr(choice) Out[53]: 'choice'   for use in making a dictionary. There's a good way to do this and I'm just missing it.  EDIT:  The reason to do this is thus. I am running some data analysis stuff where I call the program with multiple parameters that I would like to tweak, or not tweak, at runtime. I read in the parameters I used in the last run from a .config file formated as  filename no_sig_resonance.dat  mass_peak 700  choice 1,2,3   When prompted for values, the previously used is displayed and an empty string input will use the previously used value.  My question comes about because when it comes to writing the dictionary that these values have been scanned into. If a parameter is needed I run get_param which accesses the file and finds the parameter.   I think I will avoid the problem all together by reading the .config file once and producing a dictionary from that. I avoided that originally for... reasons I no longer remember. Perfect situation to update my code! Why can't the Polynomial Ring be a Field? I'm currently studying Polynomial Rings, but I can't figure out why they are Rings, not Fields. In the definition of a Field, a Set builds a Commutative Group with Addition and Multiplication. This implies an inverse multiple for every Element in the Set.   The book doesn't elaborate on this, however. I don't understand why a Polynomial Ring couldn't have an inverse multiplicative for every element (at least in the Whole numbers, and it's already given that it has a neutral element). Could somebody please explain why this can't be so? Complete userChrome.css specification in Firefox Tags are not showing up on the right side of the screen This is on Stack Overflow. On Meta I'm able to see what the tags are on the right side of the screen. In fact, I think yesterday or some point earlier today I saw tags on the right side of the screen (I can't screenshot or remember correctly).  It's right above the asked and active heading.  I know this is minor but what happened to it? It might be useful for browsing instead of having to look at the bottom of the question post.    Found an image on Google and it shows the tags on the right side of the screen: Did not receive site association bonus (+100 rep) Resuming and Finishing the flow Created a flow in the sandbox to capture a survey.  I have enabled the ability to Pause the flow and added the component to Home page.   All the screens for the flow is complete and when I test run below 2 issues are found.  1. In the last screen I do not find the Finish Button. There is a record update after last screen. When I add a screen after record update It shows the finish screen But if click the previous button present there it moves to the first and create a new record. Is there any possibility to finish without going on the previous screens   When I resume a Paused flow, after clicking on the last screen, instead of redirected to the Account page, the flow is restarting. Appreciate your help.   On pause going to first screen is normal functionality , Is there any modification that can be done. iPhone asks for Mac password (or Mac asks for iOS password) During iPhone update to iOS 10.3.1, I was asked for my password using the correct machine name for my Mac mini. To be clear, the request was not for my iCloud password, my actual local user account password for macOS. This can also happen in the other direction - setting up a Mac may ask for verification for you to enter your iPhone / iPad passcode (and not your iCloud password)  I could not find any information about this kind of access. I was thinking it was security for iCloud and possibly related to two step authorization or two factor authorization. This is the first time I can think of that I entered a desktop password outside of that actual desktop.  I don't have a screen shot but I recall an implication that some files in my Mac are encrypted and need my password. '... need to enter the password for .'   Are there settings I can I control this assuming it's a legitimate part of iCloud setup process or iOS setup process? What is "root" and how can I become it? When I ran a command, I got the following error:     You need to be root to perform this command.   What is root and how can I become it? Using article "the" with famous places? I'm editing a children's book about wonders of the World. In this book, the authors are not native speakers(they are XACT BOOK(India)), and they wrote these specific places without article "the":     -It is Taj Mahal.      -It is Tower of Pisa.   At first, I thought it's okay, but there are some pages has article "the":     -It is the Great Pyramid of Giza.      -It is the Temple of Artemis.   These sentences really make me confused. After researching, this website- - gives me some advice:     Do use the before:           names of rivers, oceans, and seas: the Nile, the Pacific          points on the globe: the Equator, the North Pole          geographical areas: the Middle East, the West     deserts, forests, gulfs, and peninsulas: the Sahara, the Persian Gulf, the Black Forest, the Iberian Peninsula      Unfortunately, I'm still not sure that adding "the" before each wonder's name is a right choice. Should I add article "the" or not? I already posted this problem in , but I'm still in vain. Why not always present logistic regression estimates in the response scale (probablity)? There's a lot of discussion in epidemiology around the relative merits of odds ratios vs risk ratios. Proponents of the former cite the mathematical qualities of odds (not constrained to be between 0 and 1) and their suitability for examining common outcomes. Proponents of the latter believe that RR's are often more interpretable, and match how clinicians and the public tend to think. Some have suggested methods to model risk ratios directly (in multivariable models). For instance, the log binomial model and poisson regression with robust standard errors. What I don't understand is - why don't we just fit the model using standard logistic regression and perform the inverse logit transformation on the fitted estimates? For instance, lets say we are trying to predict coronary heart disease using BMI (exposure) and age (confounder). We could fit the model and estimate the odds of CHD across the range of values of BMI (adjusted for age), according to the model. We then take the inverse-logit of those fitted odds to transform them onto the probability scale. Seemingly this way we now have an idea of the risk of the outcome across all values of the exposure, which we can plot or otherwise describe. But i've never seen this method recommended. Which makes me think there must be a conceptual issue with it?? p.s. lets assume we are performing a cross-sectional or cohort study (not a case-control study). Dynamic grid with Atlas generation