I'm using  to install Django with Postgresql in my Ubuntu 14.04.  In the 4th step, it asked me to go to my python directory, so I ran $ whereis python2.7 and I got multiple directories. One is the shortcut stored in /usr/bin, one is a library in usr/lib/python2.7, and there are many others.  And because of this very reason, I'm not sure where I am supposed to navigate to find my Python directory and continue the installation.
I have just migrated from Windows environment. I have installed Python 3.2 in a separate directory. How can I get the python installation path in Ubuntu shell?  Is there any way I can let the shell know/choose at runtime which python version is to be used for further code execution?  Are there any environment variables and search path kind of things in Ubuntu Linux as well?
Creating point features with exact coordinates in QGIS K-means is a widely used method in cluster analysis. In my understanding, this method does NOT require ANY assumptions, i.e., give me a dataset and a pre-specified number of clusters, k, and I just apply this algorithm which minimizes the sum of squared errors (SSE), the within cluster squared error.  So k-means is essentially an optimization problem.  I read some material about the drawbacks of k-means.  Most of them say that:   k-means assumes the variance of the distribution of each attribute (variable) is spherical;  all variables have the same variance; the prior probability for all k clusters is the same, i.e., each cluster has roughly equal number of observations;   If any one of these 3 assumptions are violated, then k-means will fail.  I could not understand the logic behind this statement. I think the k-means method makes essentially no assumptions, it just minimizes the SSE, so I cannot see the link between minimizing the SSE and those 3 "assumptions". I have looked through several questions and answers on EL&amp;U, and often there is an indication that American English prefers "have" while British English prefers "have got". In addition, there are several references to "have got" being more informal than "have" (e.g.: , ). But where is it considered more informal? In American English alone or both American and British English?   This point may seem obvious to those who made the above mentioned references, but the fact is that even the most fluent users of English in my country will say without a doubt that 'have got' is the preferred usage in the UK and, therefore, it must also be more formal. Why? Because in an academic environment, the more informal structures are generally frowned upon, outside some specific spoken exercises. And if the teachers insist on using "have got", it follows it isn't informal.  So, is the teaching of (British) English in our schools transmitting the wrong idea?  EDIT: I'm adding some information in answer to the comments.  I'm mainly concerned with the idea of possession:      I have got a cat vs. I have a cat and She has got a dog vs. She has a dog   As mentioned in the comments, every (Portuguese) student will be told that "have" and "have got", when it comes to the idea of possession, are absolute synonyms, the only two differences being:    "have got" is preferred by British English, "have" is preferred by American English   the negative and interrogative structures differ    I have never heard of any distinction in formality. In fact, I was rather surprised when I went through the EL&amp;U archives and read about it.  So, would "I have got a cat" be as formal/informal as "I have a cat"?   And how do British and American English look at its formality/informality? Is it the same? I'm trying to use Linq to return a list of ids given a list of objects where the id is a property. I'd like to be able to do this without looping through each object and pulling out the unique ids that I find.  I have a list of objects of type MyClass and one of the properties of this class is an ID.  public class MyClass {   public int ID { get; set; } }   What I want to do is write a Linq query to return me a list of those Ids  How do I do that given an IList&lt;MyClass&gt; such that it returns an IEnumerable&lt;int&gt; of the ids?  I'm sure it must be possible to do it in one or two lines using Linq rather than looping through each item in the MyClass list and adding the unique values into a list.  Any help in creating an elegant solution would be much appreciated! WHERE IN (array of IDs) I have webservice which is passed an array of ints. I'd like to do the select statement as follows but keep getting errors. Do I need to change the array to a string?  [WebMethod] public MiniEvent[] getAdminEvents(int buildingID, DateTime startDate) {         command.CommandText = @"SELECT id,                             startDateTime, endDateTime From                             tb_bookings WHERE buildingID IN                             (@buildingIDs) AND startDateTime &lt;=                             @fromDate";      SqlParameter buildID = new SqlParameter("@buildingIDs", buildingIDs); } How to include python script inside a bash script How to find vendor and model of unknown drivers I reinstalled windows on a new machine and the drivers are not present for the product network card.   When in device manager all I get is the question mark and I am unable to figure out the actual name of the vendor or model of the card. This is making my search to find the correct driver hard.   Anyone know how I to find out more about the hardware that does not have drivers? Mutual Independence Definition Clarification What's the @ in front of a string in C#? How can I speed up combat with a large number of enemies? I'm DMing for a campaign where the player characters will sometimes face small squads of creatures, most recently six ground troops and two archers helping out. In this setting, these creatures dominate the land the PCs are in and have an organised military, hence squads of enemies.  Combat tends to go quite slowly, however. Eight enemies and three players means the players spend a lot of time waiting between their turns!  Without reducing the number of enemies in the encounter, how can I speed up combat when the players are fighting many enemies? How do I perform an IF...THEN in an SQL SELECT statement?  For example:  SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product ASP.NET MVC How to pass JSON object from View to Controller as Parameter I have a complex JSON object which is sent to the View without any issues (as shown below) but I cannot work out how Serialize this data back to a .NET object when it is passed back to the controller through an AJAX call. Details of the various parts are below.     var ObjectA = {         "Name": 1,         "Starting": new Date(1221644506800),          "Timeline": [             {                 "StartTime": new Date(1221644506800),                 "GoesFor": 200              }             ,             {                 "StartTime": new Date(1221644506800),                 "GoesFor": 100              }          ]     };   I am not sure how this object can be passed to a Controller Method, I have this method below where the Timelines object mirrors the above JS object using Properties.  public JsonResult Save(Timelines person)   The jQuery I am using is:          var encoded = $.toJSON(SessionSchedule);          $.ajax({             url: "/Timeline/Save",             type: "POST",             dataType: 'json',             data: encoded,             contentType: "application/json; charset=utf-8",             beforeSend: function() { $("#saveStatus").html("Saving").show(); },             success: function(result) {                 alert(result.Result);                 $("#saveStatus").html(result.Result).show();             }         });   I have seen this question which is similar, but not quite the same as I am not using a forms to manipulate the data.   I have also seen references to using a 'JsonFilter' to manually deserialize the JSON, but was wondering if there is a way to do it nativly though ASP.NET MVC? Or what are the best practices for passing data in this way? I have recently been reading a lot on this site (@Aniko, @Dikran Marsupial, @Erik) and elsewhere about the problem of overfitting occuring with cross validation - (Smialowski et al 2010 Bioinformatics, Hastie, Elements of statistical learning).  The suggestion is that any supervised feature selection (using correlation with class labels) performed outside of the model performance estimation using cross validation (or other model estimating method such as bootstrapping) may result in overfitting.   This seems unintuitive to me - surely if you select a feature set and then evaluate your model using only the selected features using cross validation, then you are getting an unbiased estimate of generalized model performance on those features (this assumes the sample under study are representive of the populatation)?  With this procedure one cannot of course claim an optimal feature set but can one report the performance of the selected feature set on unseen data as valid?  I accept that selecting features based on the entire data set may resuts in some data leakage between test and train sets. But if the feature set is static after initial selection, and no other tuning is being done, surely it is valid to report the cross-validated performance metrics?   In my case I have 56 features and 259 cases and so #cases > #features. The features are derived from sensor data.  Apologies if my question seems derivative but this seems an important point to clarify.  Edit: On implementing feature selection within cross validation on the data set detailed above (thanks to the answers below), I can confirm that selecting features prior to cross-validation in this data set introduced a significant bias. This bias/overfitting was greatest when doing so for a 3-class formulation, compared to as 2-class formulation.  I think the fact that I used stepwise regression for feature selection increased this overfitting; for comparison purposes, on a different but related data set I compared a sequential forward feature selection routine performed prior to cross-validation against results I had previously obtained with feature selection within CV. The results between both methods did not differ dramatically. This may mean that stepwise regression is more prone to overfitting than sequential FS or may be a quirk of this data set. My program cannot run with "command not found" error I just switched from Windows to Ubuntu 11.10.  I wrote the following code in C with the text editor and saved it as HelloWorld.c in Documents.  #include &lt;stdio.h&gt; int main() {     printf("Hello World!\n");     return 0; }   And I started the Terminal and enter the following commands:  cd Documents  gcc HelloWorld.c   A file called a.out, which, after some search on Google, is the executable. I entered this command:  a.out   But I get   a.out: command not found   Which step did I do wrongly? How does ServerName and ServerAlias work? Purpose of asterisk before a CSS property Why does ice form on bridges even if the temperature is above freezing? So with this "arctic blast" continuing, I've noticed that for my area, the temperature drops below freezing just long enough to cause freezing rain, but then the sun comes out and the temperature rises immediately. However, on bridges, ice continues to form.   How can ice form even if the temperature is above freezing? I'm sorry if this question goes against the meta for posting questions - I attached all the "beware, this is a soft-question" tags I could.  This is a question I've been asking myself now for some time. In most areas, there's a "cut off age" to be good at something. For example, you're not going to make the NHL if you start playing hockey at 20. It just won't happen.  So my question then, how late is too late to start studying math and make a career out of it? By "start studying math" I mean, to really try to understand and comprehend the material (as opposed to just being able to do well in a formal, intuitional environment).   I don't mean this from a "do what you love, its not too late" motivational perspective. I mean this from a purely biological perspective; at approximately what age has your brain's capacity to learn effectively and be influenced by your learning stop? When does the biological clock for learning new math run out?  My reasoning for asking this question is (for those who care): I love math. Really I do. But , having spent the first 21 years of my life in sports/video games/obtaining a degree in a scientific field which I care nothing of/etc, despite all my best attempts at trying to learn math, am I just too late starting to ever actually be good enough at it to make it a career? I've almost completed my second degree (in Math), but find that in many cases, despite how I look at a problem, I lack the intuition to comprehend it. I'm going to single him out (sorry), only as an example, but Qiaochu Yuan is my age.   Note 1: If this question isn't a suitable post, I won't be offended at all if you vote to close - I know this question borders what's acceptable to ask.  Note 2: Thanks to everyone for reading and taking the time for the great responses. Really appreciate it! Integral vanishes on all intervals implies the function is a.e. zero I am having trouble with the following problem:      $f:\mathbb{R}\to \mathbb{R}$ is a measurable function such that for all $a$:   $$\int_{[0,a]}f\,dm=0.$$   Prove that $f=0$ for $m$ almost every $x$ (here $m$ is the Lebesgue measure).    I have no problem proving this for $f$ non-negative, or under the assumption that $f$ is integrable. But the question only assumes that $f$ is measurable and no more.  My idea was the usual thing; we look at the set of points where $f$ is positive and negative and assume one of these has measure greater than zero. Then I wanted to estimate one of these by an open set, look at the integral on the open set and show that it had to be greater than zero, a contradiction. But a key part of this attack is the assumption of the absolute continuity of the integral, which only holds in the case where $f$ is integrable.  Alternatively, if it were integrable one could simply estimate $f$ by a continuous function, where the result is quite obvious.  Ultimately we are going to show that $f$ is integrable, but it is not clear to me how to show this before showing it is zero a.e. So there must be a simpler way. Does anyone have suggestions? Why isn't my String comparison working in iOS 6?