var Person = function(name){     this.name = name;      this.sayName = function () {         console.log("My Name is "+ this.name);     } }  var nitin = new Person("Nitin");  nitin.sayName(); // My Name is Nitin   // Codebreak  var Person = function(name){     this.name = name; }  Person.prototype.sayName = function (){   console.log("My Name is "+ this.name); }  var nitin = new Person("Nitin");  nitin.sayName(); // My Name is Nitin   I was going though inheritance in JS, but for both the approaches above result is same. So I am confused here which approach to follow and why?
What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };
Punctuation in an indirect quotation Consider the brief passage:     "I love your work, but calling you 'the artist' {1} just doesn't seem to be   cutting it anymore. What shall I call you?"      "OK. Call me George." {2}   So my instincts tell me to put {1} in single quotes as opposed to no punctuation (or perhaps even italics) but to do the opposite for {2}. Is this right? Why?  Let me expand this one further iteration:     "Wow, that's a great name, especially with this crowd. Maybe for your next book    you should call yourself Ringo."{3} Salesforce query on profile not working on user language change I have a query on profile like  profilename = [Select name from profile where id=:userinfo.getUserprofileid ].name  Now I have a check in  VF page  like  profilename  == 'System Administrator' . this works fine if the logged in user language is english. If the user language is different then profile name will be  'System admin' in that language . So how to prevent this beahviour?   Also  is there any particular field in profile which I can use  to identify the profile is system admin? so that I can have check on that field instead of checking for name which is causing the problem, for example I think modifyall filed is only checked for system admin. What is ground and what does it do? In a script I'm trying to find the Terminal.app window containing a specific tty device and raise that window to the top. Here's what I have in Applescript so far:  tell application "System Events"   set foundWin to false   if (name of processes) contains "Terminal" then     tell application "Terminal"       set theTabs to first tab of every window where tty is "$(tty)"       repeat with theTab in theTabs         if class of theTab is tab then           set theWin to (first window whose tabs contains theTab)           set selected tab of theWin to theTab           set foundWin to true         end if       end repeat     end tell   end if   if foundWin then     --RAISE THE WINDOW?!   end if end tell   Where I'm getting stuck is the "raising the window" part.  Here are some things that are not quite what I want:  set frontmost of theWin to true -- this brings the window to the front of the group of Terminal.app windows but doesn't raise it above any other windows.  tell application "Terminal" to activate -- this brings every Terminal window to the front in a big stack. I just want the one window.  tell application "System Events"     set theSysWin to first window of process "Terminal" whose name is (name of theWin)     perform action "AXRaise" of theSysWin end tell   This almost does it, but what it does is to raise the terminal window to the #2 position, still underneath the active window (if the active app is something other than Terminal.app.)  click theSysWin at {10,50} -- doesn't seem to do anything.  click first static text of theSysWin -- doesn't seem to do anything.  Is there a way to do this? It doesn't have to be in Applescript.  EDIT I did find this web page (  ) quoting an Obj-C/Cocoa call:  SetFrontProcessWithOptions(&amp;psn, kSetFrontProcessFrontWindowOnly);  I'm not familiar with either ObjC or Cocoa, and this is (ultimately) getting invoked from a shell script, so not sure where to go from there. How does Cypher exit/enter the Matrix without an operator? In The Matrix, Cypher enters the Matrix to speak with the Agents, then leaves again. We never see if he has an operator, and as he kills Tank and Dozer you might assume he doesn't have one.  If he didn't have an operator how does he jack in/out of the Matrix? Sobolev space $H^s(\mathbb{R}^n)$ is an algebra with $2s>n$ (Google) Title of page not updated, everything else did My website changed significantly this month.  Amongst the changes was the website's title.  Two weeks ago, I finally used Webmaster Tools and submitted the page.  So far, Yahoo and Bing have updated the title in the search results, but not Google.  I've resubmitted via Webmaster Tools the website, and the bots have crawled the page, and have added "content keywords".  But the title still doesn't match.  The "content keywords" lists many of the words in the new title (but contains keywords of the existing title also).  Must say that 4 of the top 5 key words in the "significance" list are the new title's.  Still, no change.  Any remedies for this problem?  Is adding the "alt" tag for the logo significant enough to trigger the change?  There isn't an appropriate place to put the company name between  tags on the front page.  Any suggestions?  Thanks. Which is the easiest way to evaluate $\int \limits_{0}^{\pi/2} (\sqrt{\tan x} +\sqrt{\cot x})$? How to securely delete files stored on a SSD? $(K[x,y,z]/(x^2+y^3+z^7))_{(x,y,z)}$ is a UFD. Activity Monitor in Mavericks "Show Memory Usage" dock icon gone? I just purchased a new MacBook Pro with Mavericks installed and noticed that Activity Monitor doesn't have the "Show Memory Usage" dock icon option anymore.  I really liked this option since I used it to prevent disk swapping by closing applications when I had too many open.  What gives? What is the subject of this sentence I've seen this sentence in someone's facebook status but it sounds unnatural to me.     I'm the Rumplestiltskin who spins straw into gold   I thought it should be spin because the subject is I, but I'm not sure. Which one is the subject in this sentence, I or Rumplestiltskin and why? What is momentum really? I know there is a method for a Python list to return the first index of something:  &gt;&gt;&gt; l = [1, 2, 3] &gt;&gt;&gt; l.index(2) 1   Is there something like that for NumPy arrays? I have a script that updates my desktop background every day with the NASA APOD. Since upgrading to 11.10, that script stopped working, presumably because I'm using gconftool-2 to actually update the desktop background. Is there a new way to do this under Unity? How do I cherry pick packages from a PPA? How to capture Control+D signal? Line of Bones to Travel and Conform to Curve (Train or snake following path) I've searched google extensively on this. Can't seem to find an answer.   I know about spline IK, which is wonderful for conforming a row of bones to a path. But combining the armature object with a follow path modifier causes the point of origin to move, but the bones themselves stick to the beginning of curve.   Ultimately my goal is to make a creature like a snake or centipede follow a curve path, thus animating it fairly realistically ... I'm trying to solve this problem from Hatcher 3.3.24.  Let $M$ be a closed connected 3-manifold, and write $H_1(M, \mathbb{Z})$ as $\mathbb{Z^r} \oplus T$ where $T$ is torsion. Show that $H_2(M, \mathbb{Z})$ is $\mathbb{Z^r}$ if $M$ is orientable or $\mathbb{Z^{r-1}} \oplus \mathbb{Z_2}$ if $M$ is not orientable. In particular $r \geq 1$ if $M$ is not orientable. Using exercise 6 construct examples showing there are no other restrictions on the homology groups of closed 3-manifolds. (In the nonorientable case consider the manifold $N$ obtained from $S^2 \times I$ by identifying $S^2 \times \{0\}$ with $S^2 \times \{1\}$ via a reflection of $S^2$.)  I think I've solved the first part, here's my proof:   First note the following theorem: If $M$ is a closed connected and orientable n-manifold then $H_n(M, \mathbb{Z}) = \mathbb{Z}$ and $Tors(H_{n-1}(M, \mathbb{Z})) = 0$. If nonorientable, then $H_n(M, \mathbb{Z}) = 0$, $Tors(H_{n-1}(M, \mathbb{Z})) = \mathbb{Z_2}$.  Now note by Poincare duality and UCT we have that $H_2(M) \cong H^1(M) \cong \mathbb{Z^r} \oplus T_0 \cong \mathbb{Z^r}$.   In the nonorientable case consider the exact sequence:  $0 \longrightarrow H_2(M) \longrightarrow H_1(M) \longrightarrow H_0(M) \longrightarrow 0$  But we know $H_1(M) = \mathbb{Z^r} \oplus Z_2$ from the earlier theorem and $H_0(M) = \mathbb{Z}$.   Therefore $H_2(M) \cong ker(\mathbb{Z^r} \oplus Z_2 \rightarrow \mathbb{Z}) \cong \mathbb{Z^{r-1}} \oplus \mathbb{Z_2}$.   For the rest of the question I'm quite lost. If the quotient group $G/N$ be isomorphic to $G_2$, is $G$ isomorphic to $G_1\times G_2$ where $N$ is isomorphic to $G_1$?