How can I make constructor for callable object in JavaScript?  I've attempted various ways, like following. The example there is just shortened example of actual object.   function CallablePoint(x, y) {     function point() {         // Complex calculations at this point         return point     }     point.x = x     point.y = y     return point }   This works at first, but the object it creates isn't instance of CallablePoint, so it doesn't copy properties from CallablePoint.prototype and says false on instanceof CallablePoint. Is it possible to make working constructor for callable object?
function a () {     return "foo"; }  a.b = function () {     return "bar"; }  function c () { }; c.prototype = a;  var d = new c(); d.b(); // returns "bar" d(); // throws exception, d is not a function   Is there some way for d to be a function, and yet still inherit properties from a?
Do you want to come with? Can I come with?  I seem to hear this construction more often in recent years, but it still grates on my ear. I know it's often said that one shouldn't , but I class that rule along with  (i.e. — pedantic tosh). Is it always informal/casual speech to end a sentence with &quot;with&quot;? Was it ever thus? I would like to be able to copy and paste text in the command line in Bash using the same keyboard bindings that Emacs uses by default (i.e. using C-space for set-mark, M-w to copy text, C-y, M-y to paste it, etc.).  The  says that Bash comes with some of these key bindings set up by default.   For example, yanking (C-y) works by default on my terminal. However, I can't get the set-mark and copy commands to work, and they don't seem to be bound to any keys by default.  Usually, the way a user can define her own key bindings is to add them to .inputrc. So I looked and found the following bash functions in the documentation that I presume can help me define the Emacs-like behavior that I want (i.e. set-mark with C-space and copy with M-w).  copy-region-as-kill ()      Copy the text in the region to the   kill buffer, so it can be yanked right   away. By default, this command is   unbound.   and    set-mark (C-@)      Set the mark to the point. If a   numeric argument is supplied, the mark   is set to that position.   If I understand correctly, the above means that copy-region-as-kill is not bound to any keyboard sequence by default, while set-mark is bound to C-@ by default.   I tried C-@ on my terminal, but I don't think it runs set-mark because I don't see any text highlighted when I move my cursor. In any case, I tried adding  keyboard bindings (M-w and C-) to the functions  copy-region-as-kill and set-mark above in my .inputrc and then reloading it with C-x C-r, but this didn't work. I know that my other entries in .inputrc work because I have other user-defined keybindings defined in it.  Is there anything I am doing wrong? Am I missing anything? Effect of switching response and explanatory variable in simple linear regression Let's say that there exists some "true" relationship between $y$ and $x$ such that $y = ax + b + \epsilon$, where $a$ and $b$ are constants and $\epsilon$ is i.i.d normal noise. When I randomly generate data from that R code: x &lt;- 1:100; y &lt;- ax + b + rnorm(length(x)) and then fit a model like y ~ x, I obviously get reasonably good estimates for $a$ and $b$.  If I switch the role of the variables as in (x ~ y), however, and then rewrite the result for $y$ to be a function of $x$, the resulting slope is always steeper (either more negative or more positive) than that estimated by the y ~ x regression. I'm trying to understand exactly why that is and would appreciate it if anyone could give me an intuition as to what's going on there. Using "the" instead of "a" for something that isn't a specific object I've been curious about this for a while.  Generally, one uses "the" if they mean a specific object ("The copy of Lord of the Rings I bought yesterday") instead of any object that fits a description ("I have a copy of Lord of the Rings").  However I've seen "the" used in some cases where the phrase doesn't refer to a specific object. I've noticed it mostly being about technology, such as "This game requires the Classic Controller" (seen on some Wii Virtual Console games). While saying "This game requires a Classic Controller" seems to be correct as well, using "the" doesn't feel wrong either.  The controller's page on Wikipedia also uses "the":   What is the rule that allows the use of "the" in this context?  I presume it has something to do with "Classic Controller" being a proper noun. Let $V$ be a vector space over a field $F$ and $T$ a linear operator on $V$. If $T^2$$=$ $0$, what can you say about the relation of the range of $T$ to the null space of $T$? How do I install additional drivers? I've just installed Ubuntu and I need either video, wireless, or some sort of other manufacturer (non-opensource) driver. How can I run the tool that will fetch all of these for me? I'd like graphical instructions.  Related: iOS app 1.4.3, iOS 9.2.1  While viewing a post, the app somehow ended up in a state where it refuses to do much of anything.  What does work:   Swipe-scrolling vertically Jumping to the previous / next post using the up / down buttons    Everything else, though, has no effect:   Swipe-scrolling horizontally will not return to the previous view Tapping on a code block will not zoom to code-block view Tapping Delete button to delete a post will show a confirmation dialog, but saying yes will not cause deletion The Add Comment button brings up the text field, but I cannot type anything in it; I can only dismiss it None of the other buttons (Share, More, etc.) do anything Cannot view user profiles or revision history Tapping on links in a post or comment will not show a web page Tapping on a tag shows some visual feedback with a temporary color change, but doesn't do anything else   I still receive push notifications, but tapping on them doesn't take me anywhere. Show that the function $g(x) = x^2 \sin(\frac{1}{x}) ,(g(0) = 0)$ is everywhere differentiable and that $g′(0) = 0$ Show that the function $g(x) = x^2 \sin\left(\frac{1}{x}\right) ,(g(0) = 0)$ is everywhere differentiable and that $g′(0) = 0$. Recently the cranks on my bike started to creak. I checked with my usual "bike-bible" . They recommended dis-assemble, lubricate, re-assemble.  So I did that.  Remove cranks. Remove spindle. Clean. Lubricate. Reassemble.  No, the creak is still there.  (To find out the source-area of the sound I had a friend riding the bike slowly while I ran alongside listening. And the sound where coming from the area of the bottom bracket/cranks. I am happy no neighbor saw me...)   For each revelation of the cranks there are two creak-noises.  If I, when on the bike, push down with both feet I hear a noise. Turn 180 degrees without pressure, push down again and there is the noise again. If I am "too soft", low pressure there are no sound. Since I have clips I have tried to only work with one foot to keep a constant load during a revelation, there where no detectable sound then.  Anyone have any idea what is wrong on the bike? And how I should fix it?  /Leif density of $X^2$ when $X$ has uniform $[-1, 2]$ distribution Not an essential singularity The following is an old qualifying exam that I cannot solve:  Suppose $f$ is holomorphic on the punctured unit disk and $ \frac{f '}{f} $ has a simple pole at $0$.  Show that $f$ does not have an essential singularity at $0$. Stop Excel from automatically converting certain text values to dates Does anyone happen to know if there is a token I can add to my csv for a certain field so Excel doesn't try to convert it to a date?  I'm trying to write a .csv file from my application and one of the values happens to look enough like a date that Excel is automatically converting it from text to a date.  I've tried putting all of my text fields (including the one that looks like a date) within double quotes, but that has no effect. What rolls should players get to see? I'm a new DM and over the last few weeks I've been slowly learning the game and how it runs. My party consists of 5 PCs.   One thing I have been wondering after our last two sessions is: What rolls should all the players see and which rolls shouldn't they see?  Is there a comprehensive list of what rolls are public and which go behind the DM screen, or is it more down to house rules or personal preference? Does an increasing sequence of reals converge if the difference of consecutive terms approaches zero? If $a_n$ is a sequence such that   $$a_1 \leq a_2 \leq a_3 \leq \dotsb$$   and has the property that $a_{n+1}-a_n \to 0$, then can we conclude that $a_n$ is convergent?   I know that without the condition that the sequence is increasing, this is not true, as we could consider the sequence given in  to a similar question that does not require the sequence to be increasing.  $$0, 1, \frac12, 0, \frac13, \frac23, 1, \frac34, \frac12, \frac14, 0, \frac15, \frac25, \frac35, \frac45, 1, \dotsc$$  This oscillates between $0$ and $1$, while the difference of consecutive terms approaches $0$ since the difference is always of the form $\pm\frac1m$ and $m$ increases the further we go in this sequence.    So how can we use the condition that $a_n$ is increasing to show that $a_n$ must converge?  Or is this still not sufficient? How to obtain inverse behavior for `tail` and `head`? Is there a way to head/tail a document and get the reverse output; because you don't know how many lines there are in a document?  I.e. I just want to get everything but the first 2 lines of foo.txt to append to another document. How should one interpret the comparison of means from different sample sizes? Take the case of book ratings on a website. Book A is rated by 10,000 people with an average rating of 4.25 and the variance $\sigma = 0.5$. Similarly Book B is rated by 100 people and has a rating of 4.5 with $\sigma = 0.25$.   Now because of the large sample size of Book A the 'mean stabilized' to 4.25. Now for 100 people, it may be that if more people read Book B the mean rating may fall to 4 or 4.25.   how should one interpret the comparison of means from different samples and what are the best conclusions one can/should draw?    For example - can we really say Book B is better than Book A. I'm looking for a screen capture tool working on MacOSX that will export the capture to animated gif. When sending or forwarding emails using a personal or company domain using a  website or email client, how do I prevent the email from being incorrectly marked as spam? Is $n^{th}$ root of $2$ an irrational number? Possible Duplicate:          Will every $n^{th}$ root of $2$ be an irrational number? If yes, how can I prove that? How to install Microsoft fonts on Ubuntu 16.10?