I don't understand why this.name isn't the same as obj.name, basically why in this case this refers to the window object and not the obj object. In the code below, this.name is instantiated after obj.name..  function createNewPerson(name) {     var obj = {};     obj.name = name;     alert(this.name);     return obj; }
How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.
Defer SP.RequestExecutor.executeAsync I'm working on a SharePoint app where I need to run SP.RequestExecutor.executeAsync() in order to grab some information from one of the Host Web's lists. Depending on what method is calling the oData call I want to do something different.   Unfortuntely, executor.executeAsync() isn't playing as nice as $.ajax() does in terms of using $.when().done() and executing code after an async call is made. Below is some code if you'd like to see:      load = function (){         $.when(getEntries()).done(function () {             ViewModels.Calendar.addEventSource(ko.utils.unwrapObservable(eventList));         });     }      getEntries = function () {         return executor.executeAsync({             url: appweburl                 + "/_api/SP.AppContextSite(@target)/web/lists/getbytitle('" + LIST + "')/items?@target='" + hostweburl                 + "'&amp;$select=Title,OData__x006e_ot5,qnlu,OData__x0066_x20"                 + "&amp;$filter=OData__x0066_x20 eq '" + ViewModels.Person.user.userName() + "' "                 + "and qnlu ge DateTime'" + startDate().toString("yyyy-MM-dd") + "T00:00:00' "                 + "and qnlu le DateTime'" + endDate().toString("yyyy-MM-dd") + "T00:00:00' ",             method: "GET",             headers: { "Accept": "application/json; odata=verbose" },             success: onGetEntriesSuccess,             error: onoDataCallFailure          });     },      onGetEntriesSuccess = function (data) {         var jsonObject = JSON.parse(data.body);         $.each(jsonObject.d.results, function (index, item) {             eventList.push(new Event(item.qnlu, item.OData__x006e_ot5));         });     },      onoDataCallFailure = function (data, errorCode, errorMessage) {         alert('Failed to get host site. Error:' + errorMessage);     };   Any ideas/suggestions would be appreciated. We have a SBS 2011 server with 16GB memory that runs Exchange, WSUS and File Sharing for approx 20 users. The server also gives 2GB memory to a virtual machine running in Hyper-V so 14GB left for the rest.  When the server first boots Store.exe consumes about 500MB memory, WSUS and IIS consume some as well, but we generally are only at 60% capacity. During the course of the working day Store.exe consumes 8GB memory and the server sits at approx 97% capacity.  This makes using the server very slow, logging on via RDP is slow, general server admin is slowed down.  Is this normal? I have read that Exchange will consume lots of memory that it does not neccessarily need and then releases it back to other applications that need it. I have also checked that all mailboxes are opened in cached mode. We do have some external uses who connect via Outlook Anywhere or OWA.  If it's deemed to be "normal" is there some way I can restrict it using ALL available memory and leave a little bit for SBS to use for server admin? I have seen some articles regarding setting a high and low memory flag but rumours that this does not work with update rollup 5 which we have installed.  Am I expecting a single server to do to much with only 14GB memory?  Thanks Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux How to achieve this 3D "Card" effect How do I prevent and/or handle a StackOverflowException? I would like to either prevent or handle a StackOverflowException that I am getting from a call to the XslCompiledTransform.Transform method within an Xsl Editor I am writing. The problem seems to be that the user can write an Xsl script that is infinitely recursive, and it just blows up on the call to the Transform method.  (That is, the problem is not just the typical programmatic error, which is usually the cause of such an exception.)  Is there a way to detect and/or limit how many recursions are allowed?  Or any other ideas to keep this code from just blowing up on me? I am curious about the practical implementation of a binary split in a decision tree - as it relates to levels of a categorical predictor $X{j}$.  Specifically, I often will utilize some sort of sampling scheme (e.g. bagging, oversampling etc) when building a predictive model using a decision tree - in order to improve its predictive accuracy and stability. During these sampling routines, it is possible for a categorical variable to be presented to a tree fitting algorithm with less than the complete level set.  Say a variable X takes on levels {A,B,C,D,E}. In a sample, maybe only levels {A,B,C,D} are present. Then, when the resulting tree is used for prediction, the full set may be present.  Continuing from this example, say a tree splits on X and sends {A,B} to the left and {C,D} to the right. I would expect the logic of the binary split to then say, when faced with new data: "If X has value A or B, send to the left, otherwise, send this case to the right". What seems to happen in some implementations is "if X has value A or B, send to the left, if X has value C or D send to the right". When this case takes on value E, the algorithm breaks down.   What is the "right" way for a binary split to be handled? It seems the much more robust way is implemented often, but not always (see Rpart below).  Here are a couple examples:  Rpart fails, the others are ok.  #test trees and missing values  summary(solder) table(solder$PadType)  # create train and validation set.seed(12345) t_rows&lt;-sample(1:nrow(solder),size=360, replace=FALSE) train_solder&lt;-solder[t_rows,] val_solder&lt;-solder[-t_rows,]  #look at PadType table(train_solder$PadType) table(val_solder$PadType) #set a bunch to missing levels(train_solder$PadType)[train_solder$PadType %in% c('L8','L9','W4','W9')] &lt;- 'MISSING'   #Fit several trees, may have to play with the parameters to get them to split on the variable  ####RPART mod_rpart&lt;-rpart(Solder~PadType,data=train_solder) predict(mod_rpart,val_solder) #Error in model.frame.default(Terms, newdata, na.action = na.action, xlev = attr(object,  :  #factor 'PadType' has new level(s) D6, L6, L7, L8, L9, W4  ####TREE mod_tree&lt;-tree(Solder~PadType,data=train_solder,split="gini") predict(mod_tree,val_solder) #works fine  ####ctree mod_ctree&lt;-ctree(Solder~PadType,data=train_solder,control = ctree_control(mincriterion = 0.05)) predict(mod_ctree,val_solder) #works fine My company has recently exceeded our data storage cap (at 102% right now.. :/ ).  A large portion of the data that pushed us over our limit was due to an import of records.  The weird thing about this is that the records only had a couple of fields populated each out of the 200 total fields on the object.  What this tells me is that SalesForce holds the space for each field (since it knows the max-length of each field) rather than populating space only when the field is not null.  Does anyone know if this is the case?  To reiterate, and perhaps present this question more clearly:  If a field has a max character count of 1,000 and only 250 of those characters are actually being used, does SalesForce count the total data storage consumed by that field as 250 or 1,000? Showing inequality for harmonic series. I want to show that $$\log N&lt;\sum_{n=1}^{N}\frac{1}{n}&lt;1+\log N.$$ But I don't know how to show this. I want to combine two ffmpeg commands to a single command. I am using ready made ffmpeg binary in my Android application. I want to concat .ts files and overlay an image.  I am using following commands:   To concat .ts files:  String[] ffmpegcommand = {"ffmpeg", "-i","concat:"+input_file_path+"|"+input_file_path1, "-c", "copy", "-bsf:a", "aac_adtstoasc", output_file_path};  Apply image overlay effect:  String[] ffmpegcommand = {"ffmpeg","-y" ,"-i", input_file_path,"-strict","experimental", "-vf","movie="+AppStaticData.BASE_FOLDER_PATH + File.separator + "watermarklogo.png"+" [watermark]; [in][watermark] overlay=main_w-overlay_w-10:10 [out]", AppStaticData.BASE_FOLDER_PATH+"/" + output_file_path}; What is $\sum_{r=0}^n \frac{(-1)^r}{\binom{n}{r}}$? Find a closed form expression for $$\sum_{r=0}^n \dfrac{(-1)^r}{\dbinom{n}{r}}$$ where $n$ is an even positive integer.  I tried using binomial identities, but since the binomial coefficient is in the denominator, I can't do much. Also, I'm seeking a non-calculus, elementary solution, if possible. Thanks. How do I defeat the Kayran in the first chapter of the Witcher 2? In the first chapter you are supposed to slay the Kayran, this enormous beast:    I'm having a hard time with it. I drank the Mongoose potion for poison resistance and I have the Kayran trap, but it just hits me too often with its tentacles. Especially when the Kayran swings a tentacle sideways, not from above, I have a very hard time evading it.  Is there any trick besides not getting hit by the tentacles?  With a lot of luck I'm getting as far as the point where it's throwing stones. Any idea what I'm supposed to do then? Addressing a former office-holder by that office's title When is it appropriate to use an "expired" honorific to address or refer to a person?   In the U.S., former state governors are occasionally referred to as "Governor So-and-so", although they have not held that office for several years. I see this happening most often when the former governor is actively campaigning for a new office (usually U.S. President), and my impression is that it's done only by someone with an interest in the campaign (for or against) rather than a (relatively) neutral party like a newspaper.  Certainly this could be used as a jab: in a political campaign for high office, addressing one's opponent by a former title — lower than one's own — could imply that the opponent is not qualified for the new job. It could also be used the other way around, to remind listeners that a candidate one supports used to hold an important title.  I'm curious whether there are formal rules for this in the U.S., or at least style or journalist guidelines, for various offices. Are ambassadors, for example, entitled to some sort of emeritus honorific? Story where the protagonist is turned off from an automated system of professional attribution and instant learning What is a word/idiom for 'unable to decide'? Let's say I have an important decision to make and I can't decide between two competing things (like break up with a girl or not break up with her). What would be a word/idiom to express that? More homework help.  Given the function $f:A \to B$.  Let $C$ be a subset of $A$ and let $D$ be a subset of $B$.  Prove that:  $C$ is a subset of $f^{-1}[f(C)]$  So I have to show that every element of $C$ is in the set $f^{-1}[f(C)]$  I know that $f(C)$ is the image of $C$ in $B$ and that $f^{-1}[f(C)]$ is the pre-image of $f(C)$ into $A$.  Where I'm stuck is how to use all of this information to show/prove that $C$ is indeed a subset.    Do I start with an arbitrary element (hey, let's call it $x$) of $C$? and then show that $f^{-1}[f(x)]$ is $x$?  I could use a little direction here...  Thanks. If you know what a number mod two different primes is (3 and 2) in this case, how can you tell what the mod is of the two products? I'm looking for specific, real cases in which a causal relationship was inappropriately inferred from evidence of a correlation.   Specifically, I'm interested in examples that meet the following criteria:   Existence of the causal relationship was accepted as fact widely enough to have notable effects (on public policy, discourse, individual decisions, etc.). The link was inferred solely on the basis of correlative evidence (perhaps along with the existence of a coherent but unproven causal mechanism).  Causality has been objectively falsified or at least called into serious doubt.   The two examples that came to mind for me aren't quite ideal:   Sodium intake and blood pressure: As I understand it, it has since been determined that salt intake only increases blood pressure in sodium-sensitive individuals. The existence of a valid causal relationship (although not quite the one that was originally accepted) make this example less compelling. Vaccines and autism: I may have the background wrong, but I believe this link was surmised on the basis of both correlations and (fraudulent) experimental evidence. This example is weakened by the fact that (fake) direct evidence existed.   Note: I've seen this similar question:    My question differs primarily in that it focuses on notable, real-world examples and not on examples in which a causal link is clearly absent (e.g., weight and musical skill). I need a poll inside my content types.  Sometimes the users create an article and like to create a poll directly into the node they created. They don't want to create an extra poll with no connection to the original article.  So how can I get the poll functionality inside a different content type? Attempting to compile kernel yields a certification error I'm currently attempting to follow  guide in order to install the 4.5.7 kernel with Grsecurity on my Kali Linux desktop.   I am following that list of instructions verbatim, except for the fact that I'm trying to use Grsecurity's test patch for the 4.5.7 kernel and I'm running Kali Linux instead of straight Debian.  Every time I attempt to compile the kernel, however, I get this error following the line "CC certs/system_keyring.o":    CC      certs/system_keyring.o make[2]: *** No rule to make target 'debian/certs/benh@debian.org.cert.pem', needed by 'certs/x509_certificate_list'.  Stop. Makefile:951: recipe for target 'certs' failed make[1]: *** [certs] Error 2 make[1]: Leaving directory '/home/jc/Downloads/linux-4.5.7' debian/ruleset/targets/common.mk:295: recipe for target 'debian/stamp/build/kernel' failed make: *** [debian/stamp/build/kernel] Error 2   I get this error, as I found out, for any kernel even if I apply no patches or modifications, so it has something to do with the tools I'm using to compile the kernel (apparently a system keychain of some sort). Can someone out there tell me how to fix my OS and compile my kernel?   P.S. Here is the output of cat /proc/version:  Linux version 4.6.0-kali1-amd64 (devel@kali.org) (gcc version 5.4.0 20160609 (Debian 5.4.0-4) ) #1 SMP Debian 4.6.2-2kali2 (2016-06-28) How soon should I "vote to close"?