Closed formula for $\sum_{i=1}^n \det(v_1, \ldots, Av_i, \ldots, v_n)$
Showing that $f_0 (x_1, \ldots, x_m) \mathrm tr A =\displaystyle{ \sum_{i=1}^n} f_0(x_1, \ldots, Ax_i,\ldots, x_m)$
I need to use binary variables (values 0 &amp; 1) in k-means. But k-means only works with continuous variables. I know some people still use these binary variables in k-means ignoring the fact that k-means is only designed for continuous variables. This is unacceptable to me.  Questions:     So what is the statistically / mathematically correct way of using binary variables in k-means / hierarchical clustering? How to implement the solution in SAS / R? Temporary locks on answers not showing lock duration Tested on Stack Overflow, Stack Overflow Meta and Pets.  Questions  Temporary locks on questions are showing the duration (mod only).  Stack Overflow.   Meta Stack Overflow.   Pets.   Answers  On answers they are not and there's no way to find the lock duration when we use timeline tools to examine the post.  Pets.   Stack Overflow.   Meta Stack Overflow.   Is this something that hasn't been implemented or is it a bug?  If it hasn't been implemented can we please have it implemented? How do I update jQuery to the latest version I can download? I've just updated to the latest Google Chrome Dev build, and they've changed from the annoying-but-ok new tab page to an ugly and less usable page.  On the old one, nine thumbnails was not enough, and now they've restricted it to eight.  There's an empty "Tips and Suggestions" box which I wouldn't want even if it had stuff in; they've added Recent Downloads - on the rare occasions when I need that, I'll hit Ctrl-J to open the Downloads tab; and the site-specific search box on the right has now gone!  Is there a way to get the old new tab page back, or a plugin to provide a superior one?   Update: I launch Chrome by pressing Win+R and entering "chrome" - I have a shortcut on the Path with a Target of "C:\Documents and Settings\&lt;user&gt;\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --old-new-tab-page and whilst double-clicking this shortcut brings up the previous new tab page, using the keyboard method results in the old one.  How do I get it working via the Run box? (Without using a batch file, which slows things down too much.)  Update 2: GRRR! Now they've gone and stopped the --old-new-tab-page parameter from working at all! I hate this new version of the page that they're forcing upon us - can anyone provide a method to get rid of it and get the decent page back? Which livestock is the most efficient food source? Mechanics around a rail tank wagon Example of $\deg(fg)<\deg(f)+\deg(g)$ Let $R$ be an integral domain and $f,g\in R[X_1,...,X_n]$ where $n&gt;1$. What is an example of a pair $f,g$ such that $\deg(fg)&lt;\deg(f)+\deg(g)$?   Moreover, I have proven that the units of $R[X_1,...,X_n]$ are just the units in $R$. (Proof is done inductively) Is it true?  EDIT    Even though the each term in the underlined summation is nonzero, isn't it possible that the summation is 0? Why is this impossible ? "elements required by agent" is "required" here an adjective or verb? "elements required by agent" is "required" here an adjective or verb?  another example "elements expressed by person". The times they are a-changin' How can you use optional parameters in C#? Note: This question was asked at a time when C# did not yet support optional parameters (i.e. before C# 4).  We're building a web API that's programmatically generated from a C# class. The class has method GetFooBar(int a, int b) and the API has a method GetFooBar taking query params like &amp;a=foo &amp;b=bar.   The classes needs to support optional parameters, which isn't supported in C# the language. What's the best approach? injective linear transformation basis. Let $T : V → W $ be an injective linear transformation, where $V, W$ are vector spaces of dimension $n$ over the field $K$. If $\{e_1,\ldots , e_n\}$ is a basis for $V$ , show that $\{T(e_1),\ldots , T(e_n)\}$ is a basis for $W$. What's the right course of action for cross-site duplicates?  There are two flavors:   A question is posted which belongs on another site and ends up already having been asked there. I can't find an example right now, but it's bound to happen soon if it hasn't already. The same question is posted in two places at the same time. Take  for example, which is a duplicate of , posted within a half hour of each other by the same user.   Possible actions:   Move it to the proper site and close it once it gets there as a duplicate. Provide a way to close it right away as a cross-site duplicate, without moving it first. Flag it and let a moderator merge them. Close it as "no longer relevant" or something else.   Additionally, flavor 2 is a bit of a special case; perhaps the question really spans both sites in terms of content and intended audience. Should multiple-postings in this case be allowed? If so, should they somehow be linked to each other? If not, how do we avoid a migration war? What are the common phrases, words, abbreviations that are used on Stack Overflow, Server Fault, Super User, Meta Stack Overflow, and the other Stack Exchange sites? This is meant to be a very quick overview, not an in-depth tutorial. When considering whether a term ought to be included, please use this test:  New user comes in and posts on day 1. What terminology or jargon are they likely to run into (comments, support, system messages, etc.) that cannot be understood from the context without prior experience with the site (that is, clear only if known). For example: &quot;This is a dupe. Flag a diamond mod to close or migrate to SU.&quot; Huh? Can these instruction be made clear from the glossary? Is it clear for those for whom English is a second language?  Please:  Edit the existing answer Insert relevant links to more detailed information on the term/phrase/abbreviation Add only factual information Keep it very, very brief, terse, and to the point Delete your own comments once they become irrelevant (integrated into the glossary) Use the Edit Summary box to note reasons for your edit, not comments  Please avoid:  Opinion Using abbreviations, terms, and phrases inside a description Unverified information Uncommon terms, abbreviations, phrases Long descriptions Unnecessary detail - link to the relevant FAQ instead Citations or examples of usage Inside jokes that are not common on all of the trilogy () Common Internet jargon (that is, , , , etc.) unless usage here differs significantly  Recurring discussion: While the experiment to keep meta-discussion in the comments is going well (that is, deleting them once consensus is reached) it is clear that some discussions will be recurring, and we'll have to keep a record around so people new to the glossary can understand the consensus already reached. Add a new answer if you believe a new issue is likely to come up repeatedly. For instance, discussion about what terms to include, whether the glossary should be broken up to make linking easier, or formatting issues might be best discussed in new answer/comment posts. What is the best (idiomatic) way to check the type of a Python variable? I need to know if a variable in Python is a string or a dict.  Is there anything wrong with the following code?  if type(x) == type(str()):     do_something_with_a_string(x) elif type(x) == type(dict()):     do_somethting_with_a_dict(x) else:     raise ValueError   Update: I accepted avisser's answer (though I will change my mind if someone explains why isinstance is preferred over type(x) is).  But thanks to nakedfanatic for reminding me that it's often cleaner to use a dict (as a case statement) than an if/elif/else series.  Let me elaborate on my use case.  If a variable is a string, I need to put it in a list.  If it's a dict, I need a list of the unique values.  Here's what I came up with:  def value_list(x):     cases = {str: lambda t: [t],              dict: lambda t: list(set(t.values()))}     try:         return cases[type(x)](x)     except KeyError:         return None   If isinstance is preferred, how would you write this value_list() function? How did Google find my unlinked newly created pages? I am building a new site, but creating the content using a subdirectory on an existing site. I have never posted a link to this subdirectory anywhere, yet searching Google reveals that Google has found these pages on my site and indexed them.  Further, I updated the site with a robots.txt file that WMT reports as being read, and testing the blocked pages using the WMT test tool indicates that the pages will not be indexed. Apparently this does not remove the pages from existing results, though I submitted a request to do so.  How did Google find these pages to begin with? Is it because I used a common subdirectory name and Google guesses at common subdirectories? How to remove duplicate lines inside a text file? A huge (up to 2 GiB) text file of mine contains about 100 exact duplicates of every line in it (useless in my case, as the file is a CSV-like data table).  What I need is to remove all the repetitions while (preferably, but this can be sacrificed for a significant performance boost) maintaining the original sequence order. In the result each line is to be unique. If there were 100 equal lines (usually the duplicates are spread across the file and won't be neighbours) there is to be only one of the kind left.  I have written a program in Scala (consider it Java if you don't know about Scala) to implement this. But maybe there are faster C-written native tools able to do this faster?  UPDATE: the awk '!seen[$0]++' filename solution seemed working just fine for me as long as the files were near 2 GiB or smaller but now as I am to clean-up a 8 GiB file it doesn't work any more. It seems taking infinity on a Mac with 4 GiB RAM and a 64-bit Windows 7 PC with 4 GiB RAM and 6 GiB swap just runs out of memory. And I don't feel enthusiastic about trying it on Linux with 4 GiB RAM given this experience. I'm setting up a Cronjob that will backup a MySQL database I have in my server, but I don't want it to keep overwriting the same file over and over again. Instead, I want to have an array of backups to choose from, done automatically. For example:  ## Cronjob, run May 21st, 2011: mysqldump -u username -ppasword database &gt; /path/to/file/21-03-2011.sql  ## SAME Conjob, run May 28th, 2011: mysqldump -u username -ppasword database &gt; /path/to/file/28-03-2011.sql   And so on.  Is there any way that I can use the system date and/or time as some kind of variable in my Cronjob? If not, what are your suggestions to accomplish the same? I am working on the problems from the textbook "Topology without tears". I am stuck with problem number $4$ in Exercise $2.2$. Could anyone suggest some hints on how to proceed? The question goes as follows.  A topological space $(X,\tau)$ is said to satisfy the second axiom of countability or to be second countable if there exists a basis $\mathcal{B}$ for $\tau$, where $\mathcal{B}$ consists of only a countable number of sets.   Prove that the discrete topology on an uncountable set does not satisfy the second axiom of countability. Let $(X,\tau)$ be the set of all integers with the finite-closed topology. Does the space $(X,\tau)$ satisfy the second axiom of countability?   For the first problem, I tried to argue by contradiction assuming that the basis for the topology is countable. But I did-not know what I need to look at to prove the contradiction. For the second one, I do not know where to start. I have not thought deeply on the second one though.  Thanks, Adhvaitha How do I unlock all the other ships in the hangar? jQuery/JavaScript: accessing contents of an iframe I would like to manipulate the HTML inside an iframe using jQuery.  I thought I'd be able to do this by setting the context of the jQuery function to be the document of the iframe, something like:  $(function(){ //document ready     $('some selector', frames['nameOfMyIframe'].document).doStuff() });   However this doesn't seem to work. A bit of inspection shows me that the variables in frames['nameOfMyIframe'] are undefined unless I wait a while for the iframe to load. However, when the iframe loads the variables are not accessible (I get permission denied-type errors).  Does anyone know of a work-around to this?