I did something like this.  var person = function (){   this.print = function ()   {     console.log('person');   } }  console.log(person.prototype);   This logs Object{}, but if I do:  person.prototype.print = function () {     console.log('person'); }  console.log(person.prototype);   Now it prints the entire object and its proto
I'm not that into dynamic programming languages but I've written my fair share of JavaScript code. I never really got my head around this prototype-based programming, does any one know how this works? var obj = new Object(); obj.prototype.test = function() { alert('Hello?'); }; var obj2 = new obj(); obj2.test();  I remember a lot discussion I had with people a while back (I'm not exactly sure what I'm doing) but as I understand it, there's no concept of a class. It's just an object, and instances of those objects are clones of the original, right? But what is the exact purpose of this &quot;.prototype&quot; property in JavaScript? How does it relate to instantiating objects? Update: correct way var obj = new Object(); // not a functional object obj.prototype.test = function() { alert('Hello?'); }; // this is wrong!  function MyObject() {} // a first class functional object MyObject.prototype.test = function() { alert('OK'); } // OK  Also these  really helped a lot.
Search with Auto-Complete (like Gmail / Intellisense) If a sports team is down by 1-2 in a best of 7 series, what is their chance of winning (if both teams have a 1/2 chance of winning every game)? I know that the team has to win 3 of the 4 remaining games. So I thought that from the 4 remaining games, there are a total of $2^4 = 16$ total different outcomes.   Could someone point me towards the right direction to determine the probability of the team winning 3 of the 4 remaining games? Would it be 4C3/16 since the three wins can be chosen amongst the 4 games left? On equations $m^2+1=5^n$ I am looking for integer solutions of Diophantine equation $m^2+1=5^n$. I found that $m=0,n=0$ and $m=2,n=1$. I could not find any other solutions. I try to prove this but I could not. Could anyone help me to solve this equation? Are there surface-mount pin header footprints for KiCAD? Seeking options for Spatial ETL (Extract, Transform, Load)? I am interested in the pros and cons of various spatial ETL (extract, transform, load) tools.  If you have used the items listed here (or add your own), I seek your opinions and experiences.  In particular I would like to see usability comparisons of:    (proprietary)  (proprietary, subset of FME features)  (open source)  (open source)  (I don't know that it is truly ETL, but more of a file translation toolset) Any additional lot listed   There is no need to give a review of ALL software mentioned.  If you are experienced with even one then that will be very beneficial in making a decision about which direction to go.  Example: I am looking to create a schema conversion function that will allow me to select the input layer, create a translation, and output to a new, pre-defined schema.  Optimally, after creating the translation script, I would like to have an interactive form where I can "map" fields in my input layer to the output layer (ie- The output layer will have a field called "Address", what is it called in the input layer?)  Some were mentioned in the Q&amp;A at   And here are a couple of related articles that I found. Why does PHP consider 0 to be equal to a string? How to implement Bitcount using only Bitwise operators? I understand that the architecture of Convolutional Neural Networks (CNN) and Feed forward (FNN) are quite different. And that CNNs use pooling and filters of shared weights over a patch of the image. I am not so clear on the core convolution operator (1):   If anyone could link me to an explanation, I have looked at the Colah blog and Nielsen's online book, and I understand what it is doing but don't understand the convolution operator.  Also, it looks quite similar to the the core FNN function is there and difference? (2).  (1) convolution operator is $a^1 = \sigma(b + w*a^0)$ which is equivalent to:  $a^1 = \sigma(b + \sum^4_{l=0}\sum^4_{l=0}w_{l,m}a_{j+l,k+m})$  (2) feed forward operation:  $a^1_i = \sigma(\sum^n_{j=1}w_{ij}x_j +b_i)$  Many thanks  Sources: functions taken from: Prepend 0 to sublists \sqrt[x]{y} Breaks With unicode-math Hello I am taking a Discrete Mathematics course and having some trouble with this question about sets:  Under what conditions is $A- B = B- A$  Diagram:   Diagram:   Maybe I'm understanding incorrectly, but how can A-B and B-A be equal if they contain elements that are not in each other? I'm trying to prove the following statements in Folland's book.  Let $(X,\mathcal{M},\mu)$ be a measure space. If $f_n\to f$ in measure and $g_n\to g$ in measure, then $f_n+g_n\to f+g$ in measure and $f_ng_n\to fg$ in measure (in this last case, assume $\mu(X)&lt;\infty$).  The first one is already done, but the second one is giving me trouble.   My attempt: We can take subsequences $f_{n_k}$ and $g_{n_k}$ such that $f_{n_k}\to f$ a.e. and $g_{n_k}\to g$ a.e. In this case, we know that $f_{n_k}g_{n_k}\to fg$ a.e. Note that $\mu(X)&lt;\infty$, so we can use Egoroff's theorem to conclude that $f_{n_k}g_{n_k}\to fg$ almost uniformly. Finally, almost uniform convergence implies convergence in measure, therefore $f_{n_k}g_{n_k}\to fg$ in measure.   The problem is that I just have convergence in measure for some subsequence of $f_ng_n$ and I need convergence in measure for the whole sequence. Also I don't know if using Egoroff's theorem is unnecessary, if this is the case, I would appreciate to see some more elementary prove.  Detail: We say that $f_n\to f$ almost uniformly if for every $\varepsilon &gt; 0$ there is some $E\subset X$ measurable, such that $\mu(E) &lt;\varepsilon$ and $f_n\to f$ uniformly on $E^c$.  Thank you! How do I use a C# keyword as a property name? Using asp.net MVC I'd like to do this inside a view:  &lt;%= Html.TextBox("textbox1", null, new { class="class1" }) %&gt;   This statement does not compile because class is keyword in C#. I'd like to know how I can escape the property names such that this compiles.  It is possible to get this to compile if I change the "class" property to "Class" (uppercase C). But this is not suitable because strict xhtml says that all attributes (and element) names must be lowercase. Equation for a smooth staircase function I am looking for a smooth staircase equation $f(h,w,x)$ that is a function of the step height $h$, step width $w$ in the range $x$.   I cannot use the unit step or other similar functions since they are just one step. I have been experimenting with various sigmoid curves and while I can get a single smooth step I cannot get to realize the staircase shape. The closest staircase function I have found is given in  in equation (18) and depicted in Fig. 4 and it is a close example of what I want (i.e generate a staircase in the range $x$ for arbitrary step heights and widths) but it is not smooth at all.  Regarding smooth steps, a likely starting point I found is  but it gives a smooth function of just a single step. I have been unable to modify the equation to make it into a staircase. I would like to specify arbitrary step heights and widths and generate a smooth staircase in the range $x$ specified.    Edit (Extra info): The smooth function I mention above has the problem that the upper, horizontal line is not equal in length to the lower, horizontal line which is why I have been unable to adapt it into a staircase function   Edit 2 Including some pictures     Edit 2 Plot of $s$ with a steep slope showing a different width on the first horizontal line I have shapefile named `band-tailed_pigeon.shp which is fine and no problem on displaying or geoprocessing on Desktop but in ArcPy when I try to merge some layes to it I am getting this error   ExecuteError: ERROR 000354: The name contains invalid characters Failed to execute (Merge).  I tried to do the proccess with a simple name like sample.shp which it works but I HAVE TO keep the same name as we are using them in several projects. Here is the code which I have FinaloutLocation = &quot;E:\\GIS\\Data\\Final\\band-tailed_pigeon.shp&quot; inFeaturesToMerge = [dissolve_1, dissolve_2, dissolve_3, dissolve_4, dissolve_5] arcpy.Merge_management(inFeaturesToMerge, FinaloutLocation) Iterate over all pairs of consecutive items in a list There is  with this exact same prompt which got several down-votes for not showing  their work.  So I'll show what work I've got.  I know being a harmonic function implies satisfying the Mean Value Property, thus what I thought I'd do is consider two arbitrary points in $\mathbb{C}$ and prove that:  $$|u(z) - u(w)|=|\frac{1}{2\pi}\int_0^{2\pi}u(z - re^{i\theta})d\theta - \frac{1}{2\pi}\int_0^{2\pi}u(w - te^{i\theta})d\theta| $$ $$= |\frac{1}{2\pi}\int_0^{2\pi}u(z - re^{i\theta}) - u(w - te^{i\theta})d\theta|$$  Now what I wan't to do is take r and t to infinity and prove this integral goes to zero, but I can't figure out how to do that.  I've used the fact that my harmonic function u is defined on all of $\mathbb{C}$ in taking t and r to infinity but I still need to use the fact that it's bounded.  I also read through the proof of Liouville's Theorem, given as an answer in that other post, which seems intuitively correct but rather un-rigorous.  It actually says that the value in the center of a ball is equal to the average over the ball's volume.  I imagine this can be proven from the average over the boundary since the average over the boundary will not change as you continuously shrink the boundary down to its center. This however would require the difference of two surface integrals, or is there a simpler way?   I was also considering using the Maximum Modulus Principle somehow but I haven't found a way yet.  I've probably made this way more complicated than it has to be, hopefully someone can help me, thanks! =].  Edit: Ok after thinking some more about the accepted answer in that other post, I've decided what I need to do is look at the canonical holomorphic function whose real part is my harmonic function u, and prove that holomorphic function is bounded.  From there I can prove that since it's entire and bounded that it's constant, and from there prove that then its real part must be constant.  So could someone talk a bit about the construction of this canonical holomorphic function? Where can I find every gnome? No matter where I look, I just can't find gnome number [insert number here]. Where can I find every gnome in the game? are the uses of 'bare infinitive' & 'participle' same here? I saw him sing     I saw him singing    In the first example, the verb sing is used as a bare infinitive and in the following one it is exemplified as a present participle. My question is  if both of them are expressing the same meaning? Does any particle ever reach any singularity inside the black hole?