I am trying to figure out how to not to exports the private functions when using functions in the objects.  For example, in modules.js I have the following:  const modelType1 = require('./Message/type1');  module.exports = {     Type1: modelType1 }   type1.js look like this:  const Message = {     publicFunction: function() {         return 'hello!';     },      privateFunction: function() {         return 'hello!';     } }  module.exports = Message;   How to not to export privateFunction?  When I tried to different approach without using an object which I have got it to work, for example:  const modelType2 = require('./Message/type2');  module.exports = {     Type2: modelType2 }   type2.js look like this:  function publicFunction() {     return "Hello" }  function privateFunction() {     return "Hello" }  module.exports = {     publicFunction }   Which is best practice to use type1.js or type2.js and what the difference between them two?
To make a JavaScript class with a public method I'd do something like:  function Restaurant() {}  Restaurant.prototype.buy_food = function(){    // something here }  Restaurant.prototype.use_restroom = function(){    // something here }   That way users of my class can:  var restaurant = new Restaurant(); restaurant.buy_food(); restaurant.use_restroom();   How do I create a private method that can be called by the buy_food and use_restroom methods but not externally by users of the class?  In other words, I want my method implementation to be able to do:  Restaurant.prototype.use_restroom = function() {    this.private_stuff(); }   But this shouldn't work:  var r = new Restaurant(); r.private_stuff();   How do I define private_stuff as a private method so both of these hold true?  I've read  a few times but it doesn't seem like "private" methods can be called by public methods and "privileged" methods can be called externally.
Proof of inequality using AM-GM inequality prove that $x^2 + y^2 + z^2 \ge xy + xz + yz$  I tried proving it the way I prove $x^2 + y^2 \ge 2xy$. But it just doesn't seem to work. I tried using AM-GM. Should I be using GM-HM or AM-HM? I really don't know what the problem is and I'd appreciate any help and a full proof explanation. Thanks. I am new to blender. Pressing &#9096; Ctrl&#9095; AltQ opens the quad view. How to maximize any one of the four views of the quad view? I use wubi to install Ubuntu 10.10 on my ntfs partition. So I want to change the home folder to a folder on the ntfs partition. I could keep the personal configuration, software and so on after reinstalling the Ubuntu.  So I use ntfs-config to manage the disk partition, it's mounted when system is startup. And the permission of all files and directories are 777.  Then I modified the /etc/passwd to set the home folder to the folder on the ntfs partition. I can successfully login the account, however it looks like the .bashrc and .profile are not loaded correctly. I can't use the input method(even can't configure ibus), no sound device. However everything works well after changing the home folder back to /home/.  Could anybody give me a hint to make it work? Thanks. Why should the first person pronoun 'I' always be capitalized? Comma before "and" in compound sentences? I read this sentence on an educational website:     Now times have changed and you are ready for situations involving forces in two dimensions.   Shouldn't there be a comma before and, since the subject of the sentence has changed (things vs. you)?      Now times have changed, and you are ready for situations involving forces in two dimensions.   What is the exact comma rule for joining two clauses with and? Where can I find historical data on flights, specifically Delta international flights?  I need to find out about cancellations, diversions and any other flight data pertaining on particular route at a given time.  This source has to be official and stand up to legal scrutiny. I'm a Sri Lankan passport holder. I'm planning to travel to China in January and have to transit in Malaysia. I wonder whether I can obtain a Malaysian transit visa in KLIA 2 when I'm flying back to Sri Lanka. Can I install Ubuntu inside Windows? Ubuntu 12.04 won't come with the Windows Installer (Wubi) pre-added. But is there any way to install 12.04 using Wubi? I use bash on both my Mac and as my cygwin shell. Overall, I'm quite pleased with it.  My one complaint however is that its TAB completion isn't as good as Windows Command Line TAB completion.   For example, if there are two files with the same prefix, then bash just beeps at me when I try to TAB complete. If I keep nailing TAB, then it will eventually show me a list of potential files.  I definately prefer how Windows will cycle through potential files right on the command line.   Is there a way to get bash to operate similar to Windows Command Line in this regard?  If there isn't (I do not want to switch shells), am I missing something about TAB completion in bash? Is there a more efficient way to use it? Let $f(x) = x^2 \sin{\frac{1}{x}}$ for $x\neq 0$ and $f(0) =0$. (a) Use the basic properties of the derivative, and the Chain Rule to show that $f$ is differentiable at each $a\neq 0$ and calculate $f'(a)$. You may use without proof that $\sin$ is differentiable and that $\sin' =\cos$.  Not even sure what this is asking.  (b) Show that $f$ is differentiable at $0$ and that $f'(0) =0$.  $\frac {f(x)-f(0)}{x-0} \to \lim_{x \to 0} x \sin(1/x)$. $x \sin(1/x) \leq |x|$ and $\lim_{x \to 0} |x|=0$. Thus $f(x)$ is differentiable at $0$; moreover $f^{'}(0)=0$.  (c) Show that $f'$ is not continuous at $0$.  $f{'}(x)=x^{2} \cos(1/x) (-x^{-2}) + 2x \sin (1/x)$. In pieces: $\lim_{x \to 0} \cos (1/x)$. $f^{'}(0-)$ nor $f{'}(0+)$ exists as $x \to 0$ $f^{'}(x)$ oscillates infinity between $-1$ and $1$ with ever increase frequency as $x \rightarrow 0$ for any $p&gt;0$ $[-p,0]$, $[-p,p]$ or $[0,p]$ $f$ is not continuous. Question: How to show more rigorously? Conditional expectation of $\mathbb{E}(X - Y | (X, Y)\in\mathcal{A})$ Given two independent random variables $X \sim \mathcal{U}[-1,5]$ and $Y \sim \mathcal{U}[-5,5]$, what is $$\mathbb{E}\{Y - X | X \le 1, Y &gt; X, Y \in [-1,1] \}\,?$$  I managed to compute the respective probability   $$ \mathbb{P}\{ X \le 1, Y &gt; X, Y \in [-1,1] \} = \mathbb{P}(X \le 1) \mathbb{P}(Y &gt; X) \mathbb{P}(Y \in [-1,1]) = 1/3 * 1/2 * 1/5 = 1/30$$  How do I continue from there? What is included in Wolfram Extras? My son is 5 years old.   Over the last few months I have been observing some disturbing sexual behavior from my child.  He is rubbing his penis on  the bed or pillow. Sometimes he would get naked and rub very tightly and make some sounds of pleasure! Previously, I thought he was playing... but later I understood.   His father doesn't want me to scold him, but one day I was really surprised and shocked by one incident... when I was in deep sleep in the afternoon, I suddenly woke up and saw he had pulled up my skirt and trying to mount me! I was really shocked!  I'm really upset.  What should I do? Correct ssh config file settings to tunnel to a 3rd machine I'm trying to tunnel to a server via a bridge server. So far, I've been able to get it working from the command shell properly using the following command:  ssh -A -t bridge_userid@bridgemachine.com ssh -A remote_userid@remoteserver.com   But I've been trying to wrap this into my ~/.ssh/config file and I have troubles. I've tried:  Host axp   User          remote_userid   HostName      remoteserver.com   IdentityFile  ~/.ssh/id_rsa.eric   ProxyCommand ssh -A -t bridge_userid@bridge_userid.com ssh -A remote_userid@%h   But when I do, I get the following error message from remoteserver.com and I'm not sure what is causing it:     ksh: SSH-2.0-OpenSSH_6.8^M:  not found   I know that when I log into remoteserver.com , my shell is /usr/bin/ksh.  I've tried to add path arguments to the ssh commands in the config file, but it made no difference.  Any ideas what it can be? I want to prove with mathematical induction that:  $$\sum_{i=1}^n i \cdot i! = (n+1)! - 1$$  So in the first step we define $n = 1$:  $$\sum_{i=1}^1 i \cdot i! = 1 \cdot 1! = 1 = 2! - 1$$  In the second step we define $n = n + 1$:  $$\sum_{i=1}^{n+1} i \cdot i! = \sum_{i=1}^n i \cdot i! + (n+1)(n+1)!$$ $$\implies (n+1)! - 1 + (n+1)(n+1)!$$  This can now be simplified to $(n+2)(n+1)! - 1$ but I do not see how...  We could do $(n+1)!(-1 + (n+1)) = (n+1)! \cdot n$ but still this will not be the same as above.  What did I miss?  Bodo I'm playing around with height maps (bitmaps), trying to create some of my own in my game, and for that I need to implement some basic drawing methods. I've quickly realized that drawing straight lines isn't as basic as I thought.  It simple's if your points share an X or Y coordinate, or if they are aligned so you can draw a perfectly diagonal line. But in all other cases its trickier.  What algorithm do you use to determine what pixels need to be coloured for it to become a "straight" line ? Finding the conjugate hyperbola Assume we are given a general proper hyperbola $  a_{11}x^2 + 2 a_{12} x y + a_{22} y^2 + 2 a_{13}x +2 a_{23}y + a_{33} = 0$ with  $D =\det \begin{pmatrix}   a_{11} &amp; a_{12} \\   a_{12} &amp; a_{22} \end{pmatrix} &lt; 0$ and $ A = \det \begin{pmatrix}   a_{11} &amp; a_{12} &amp; a_{13} \\   a_{12} &amp; a_{22} &amp; a_{23} \\   a_{13} &amp; a_{23} &amp; a_{33} \end{pmatrix} \neq 0$.  Is there an easy way to find the implicit description of the conjugate hyperbola?  I could translate and rotate the hyperbola and obtain a canonical representation of the form $\frac{x^2}{a^2} - \frac{y^2}{b^2} = \pm 1$, find the conjugate of the canonical one and the transform back. However, I'm looking for a more straightforward way to achieve this. When I input [asdf][lisp] into the search field on , without being logged in, only one tag remains. Is it broken? I encountered an 'errorUnknown graphics extension: .eps.' I tried to load an .eps picture, but an error occured,      errorUnknown graphics extension: .eps. In what order should the Star Wars movies be watched? Please don't lynch me, but I've never sat through an entire Star Wars film. I'm aware that the 3 (new) films are technically prequels, but I feel strange watching 3 new films then 3 old films?  Do I need to watch the new ones then the old ones?