I've always seen that the preferred alternative to   function MyObject ( ... ) {     this.MyFunction = function ( ... ) { ... }      // ...  }   is  function MyObject ( ... ) {     // ...  }  MyObject.prototype.MyFunction = function ( ... ) { ... }    My understanding is that in the way that the JavaScript hierarchy known as the prototype chain works, MyObject.prototype is the object from which MyObject derives. In English, what this is saying is      "Give me a property by giving it to my ancestor who I will then   inherit it from."   which seems like a very obscure and inefficient way of going about things. Coming from a C# background, how I see this is like the equivalent of having a class   class SpecialString : String  {  }   and saying      Ok, I want SpecialString to have a function SpecialFunction, so   I'll go into String and give it public void SpecialString (...). Now SpecialString has it! Mission accomplished.
What's the difference between  var A = function () {     this.x = function () {         //do something     }; };   and  var A = function () { }; A.prototype.x = function () {     //do something };
window-switching keyboard shortcuts interfere with emacs and cannot be changed in the main keyboard system preferences I've a file named addresses.txt :  address1@domain.com address2@domain.com address3@domain.com   I'd like to echo "address1@domain.com.html" using for loop. Here's what I did :  cat addresses.txt | while read address do echo "${address}.html" done   Here's the result :  .htmlss1@domain.com .htmlss2@domain.com .htmlss3@domain.com   Same result if I add a space between the variable and ".html"  What am I miss ?  Thanks I recall a short lived TV show that I think was broadcast on the British TV channel ITV in the late 90s or early 2000s and it was about time travel. It was set in Britain in relatively modern times. The scene that really sticks in my head is when the protagonist goes to use their time travelling machine they go in to a room where the machine is and they close all the windows. The windows have latches on them and by closing the window it creates a circuit. By closing all the latches the circuit is complete and the machine is able to be activated. I don't know if it's much to go on, but it's been really bugging me for ages. T-SQL: Selecting Column Based on MAX(Other Column) Why does Ubuntu fail to run .exe files? / How do I run .exe? Visual Flow: How to set Date field to Null / Blank? In the context of topological spaces, I see the following major countability properties:  A space is:   "separable" iff it has a countable dense subset "second countable" iff if has a countable basis "first countable" iff the neighbourhood system of every point has a countable local basis.   (Definitions taken from Counterexamples in Topology by Steen and Seebach, 2nd ed. 1978 -- there may be differences in wording from other sources.)  The question I have is: "separable" into what, exactly? By which I mean to say: what is the thinking behind calling such a condition "separable"?  It appears not to be related to the concept of "separation axioms", which do immediately and obviously invoke an intuitive notation of separation, neither does it seem to have anything to do with "separated sets".  (Anyone using the spelling "seperable" or "seperated" will be immediately downvoted. :-) ) Any gotchas I should be aware of?  Can I store it in a text field, or do I need to use a blob? (I'm not overly familiar with either pickle or sqlite, so I wanted to make sure I'm barking up the right tree with some of my high-level design ideas.) What are some important applications of the Erdős-Szekeres Theorem? Similar to '', is it also ok to add an example?   I was going to  but I noticed that one answer had most of the things I needed to say, except perhaps that the questioner didn't perhaps understand the answer and  I feel that an example may help. Are humans the only animal that requires "clean water"? Regex for parsing directory and filename I'm trying to write a regex that will parse out the directory and filename of a fully qualified path using matching groups.  so...  /var/log/xyz/10032008.log   would recognize group 1 to be "/var/log/xyz" and group 2 to be "10032008.log"  Seems simple but I can't get the matching groups to work for the life of me.  NOTE:  As pointed out by some of the respondents this is probably not a good use of regular expressions.  Generally I'd prefer to use the file API of the language I was using.  What I'm actually trying to do is a little more complicated than this but would have been much more difficult to explain, so I chose a domain that everyone would be familiar with in order to most succinctly describe the root problem. I've done some research, and found this on Wikipedia. \begin{matrix}a\uparrow b=a^{b}=&amp;\underbrace {a\times a\times \dots \times a} \\&amp;b{\mbox{ copies of }}a\end{matrix} \begin{matrix}a\uparrow \uparrow b&amp;={\ ^{b}a}=&amp;\underbrace {a^{a^{{}^{.\,^{.\,^{.\,^{a}}}}}}} &amp;=&amp;\underbrace {a\uparrow (a\uparrow (\dots \uparrow a))} \\&amp;&amp;b{\mbox{ copies of }}a&amp;&amp;b{\mbox{ copies of }}a\end{matrix} I'm still a bit confused on this topic. I've done a lot of research, but I can't seem to understand this. Could somebody explain this in an understandable way? From what I can gather, for example 2↑↑3 would be 2^2^2 = 16? Then 2↑↑↑3 would be 2^2^2^2 = 256? Am I correct, or have I mis-interpreted this? Were there any improvements to the second Death Star (other than the change in exhaust port) that we know of? We know that the second Death Star was meant to have a different/non-existent exhaust port and when under construction it had a shield projected around it.  Other than these elements, one of which was planned to be totally temporary, do we know of any other improvements over its predecessor?  Did it have improved defences against one-man fighters? Did its laser charge more quickly? Did it have an upmarket cafeteria? Updated WiFi fix for Yoga 13 and Ubuntu 16.04? I have a Lenovo Yoga 13 and I was running 14.04 on it and I've since upgraded to 16.04. I applied the fix descibed here () with 14.04 and it worked but no longer seems to with 16.04. I know that the way Realtek drivers work was reorganized in Linux kernel 4.4 () however I don't know enough about what was changed to know if that was the problem. Has anyone else experienced this issue or know how to fix it? Label callouts in QGIS Has anyone been using callout labelling with QGIS, either trunk or stable?   Used for clustered points. That means the point stays where it is, the label maybe moved if required and a leader (plain or pointed) shows the linkage between the label and the point.   How could I do it (you know what I mean, no coding....)? Ethernet indicator in OSX menu bar I am using OSX 10.7  When I move between different ethernet networks (e.g., at work using ethernet on an external display, at home using thunderbolt ethernet), the ethernet does not always connect. However, I don't get immediate feedback. Instead, I connect to wi-fi. However, wi-fi is both slower and less reliable than ethernet. Thus, I'd like to know whether I am connected to ethernet or not. Of course I can go into preferences and network settings to see whether I'm connected to ethernet, but it would be better if there was some form of indicator in the status bar, just as there is for wi-fi. Thus, my question:  Is there a way of getting an indicator of ethernet connectivity in the OSX menu-bar?  Perhaps there is a free application that can do this. Does the Dueling Fighting Style prevent using a shield? The Dueling fighting style doesn't seem to state anything about shields, stating that the character can only wield one weapon while fighting to gain the benefit. Does a shield count as a weapon or otherwise stop the damage bonus from occurring? How to Edit PDFs? Why are there holes in the icing? I tried to follow the new Blender 2.8 tutorial from Blender Guru.   When entering "Sculpting" with the icing there were suddenly alot of holes in it. Why is this?