Application relies on Python 3, system uses Python 2. How to fix this?
How to install Python 3.4 on Ubuntu?
Isomorphism between complex numbers minus zero and unit circle How do we show that $\mathbb{C}^{\times}$ and $S^{1}$ are isomorphic as groups? Flattening a shallow list in Python Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?  I tried to flatten such a list with a nested list comprehension, like this:  [image for image in menuitem for menuitem in list_of_menuitems]   But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined.  After googling and looking around on Stack Overflow, I got the desired results with a reduce statement:  reduce(list.__add__, map(lambda x: list(x), list_of_menuitems))   But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object.  Conclusion:   Thanks to everyone who contributed to this question.  Here is a summary of what I learned.  I'm also making this a community wiki in case others want to add to or correct these observations.  My original reduce statement is redundant and is better written this way:  &gt;&gt;&gt; reduce(list.__add__, (list(mi) for mi in list_of_menuitems))   This is the correct syntax for a nested list comprehension (Brilliant summary !):  &gt;&gt;&gt; [image for mi in list_of_menuitems for image in mi]   But neither of these methods are as efficient as using itertools.chain:  &gt;&gt;&gt; from itertools import chain &gt;&gt;&gt; list(chain(*list_of_menuitems))   And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so:  &gt;&gt;&gt; chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) &gt;&gt;&gt; print(list(chain)) &gt;&gt;&gt; [1, 2, 3, 5, 89, 6] Can I use Mage Hand to fly by Polymorphing myself and picking myself up with the hand? Could I first cast Mage Hand, then Polymorph into a Tiny creature less than 10 pounds then use the Mage Hand to pick myself up and fly at 30 Ft per turn?  Polymorph says:     The new form can be any beast ... The target's game statistics,   including mental ability scores, are replaced by the statistics of the   chosen beast. It retains its alignment and personality ... The   creature is limited in the actions it can perform by the nature of its   new form and it can't speak, cast spells, or take any other action   that requires hands or speech.   This keeps me from casting spells, which keeps me from just casting Mage Hand to fly as long as I want to over and over. But for that initial duration of the Mage Hand cantrip, could I use the Mage Hand to fly as a Tiny polymorphed creature until the spell runs out? We always change subject and verb positions in whenever we want to ask a question such as "What is your name?". But when it comes to statements like the following, which form is correct?        I don't understand what are you talking about.   I don't understand what you are talking about.      Another example        Do you know what time is it?   Do you know what time it is?      Another example        Do you care how do I feel about this?   Do you care how I feel about this? I've noticed a MATCH SIMPLE and MATCH FULL, but I don't understand what they do. I see default is MATCH SIMPLE; but, how do the other MATCH clauses to the FOREIGN KEY constraint function? Tools for automating document compilation A lot of people write makefiles that say something like  paper.pdf: paper.tex         pdflatex paper         bibtex paper         pdflatex paper         pdflatex paper   To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this? Movie Identification: People record their experiences on reel-to-reel I know that this sounds like Strange Days, which I haven't seen, but from the Wikipedia description I don't think that's it.  I saw this back in the early-to-mid-90's on TV, pretty sure it was a premium channel. It follows a research group who develops a way to record experiences. Not thoughts, but at least the sights, sounds, smells, touch, etc. They record it onto this reel-to-reel tape, it looked striated and golden in color. The protagonist is the head of the research team.  I don't remember a great deal of the plot, but there were conspiracies surrounding the invention. The lab clown decides to give it a whirl by putting the bike-helmet-sized apparatus on his head and going out to have a little fun, in the classic wine, women, and song fashion. Once he returns, an older member of the team finds the tape and finds a section where the clown is having sex. Later on, the protagonist, who is the lead researcher, finds the older member shut up in his house seemingly for days and nearly comatose. The older researcher had the playback device over his head and is non-responsive. Worried, the protagonist removes the helmet and puts it on himself, only to find that the older researcher had snipped a few seconds of tape and had them running on a non-stop loop; the moment of orgasm for the clownish researcher. The older researcher eventually comes to and awkwardly apologizes.  I think there were also experiments in recording the sensorum of a lab monkey, and that played into the plot. I remember the plot seemed fairly thin and dull for what seemed to be a pretty neat idea. I don't desperately feel the need to watch the movie, but I'm mildly curious if my impressions would differ 20 years later now. Max dimension of a subspace of singular $n\times n$ matrices I am sure the answer to this is (kind of) well known. I've searched the web and the site for a proof and found nothing, and if this is a duplicate, I'm sorry.  The following question was given in a contest I took part. I had an approach but it didn't solve the problem.     Consider $V$ a linear subspace of the real vector space $\mathcal{M}_n(\Bbb{R})$ ($n\times n$ real entries matrices) such that $V$ contains only singular matrices (i.e matrices with determinant equal to $0$). What is the maximal dimension of $V$?   A quick guess would be $n^2-n$ since if we consider $W$ the set of $n\times n$ real matrices with last line equal to $0$ then this space has dimension $n^2-n$ and it is a linear space of singular matrices.  Now the only thing there is to prove is that if $V$ is a subspace of $\mathcal{M}_n(\Bbb{R})$ of dimension $k &gt; n^2-n$ then $V$ contains a non-singular matrix. The official proof was unsatisfactory for me, because it was a combinatorial one, and seemed to have few things in common with linear algebra. I was hoping for a pure linear algebra proof.  My approach was to search for a permutation matrix in $V$, but I used some 'false theorem' in between, which I am ashamed to post here. "Deleted by {owner}" vs "Deleted by owner" in self deleted answers $X^n-Y^m$ is irreducible in $\Bbb{C}[X,Y]$ iff $\gcd(n,m)=1$ I am trying to show that $X^n-Y^m$ is irreducible in $\Bbb{C}[X,Y]$ iff $\gcd(n,m)=1$ where $n,m$ are positive integers.    I showed that if $\gcd(n,m)$ is not $1$, then $X^n-Y^m$ is reducible. How to show the other direction. Please help. Going into a directory linked by a link When I cd a link, my current path is prefixed with the link's path, rather than the path of the directory the link links to.  E.g.  ~/dirlinks/maths$ ls -l logic lrwxrwxrwx 1 tim tim 71 Jul 27 10:24 logic -&gt; /windows-d/academic discipline/study objects/areas/formal systems/logic  ~/dirlinks/maths$ cd logic ~/dirlinks/maths/logic$ pwd /home/tim/dirlinks/maths/logic  ~/dirlinks/maths/logic$ cd .. ~/dirlinks/maths$   I would like to have my current path changed to the path of the linked dir, so that I can work with the parent dirs of the linked dir as well. Besides ls the link to find out the linked dir, and then cd into it, what are some simpler ways to accomplish that? For example, after cd into a link, how do you change your current path to the path of the linked dir? RAII and smart pointers in C++ In practice with C++, what is , what are , how are these implemented in a program and what are the benefits of using RAII with smart pointers? I need to purchase my first ever lens. So far I've only used lenses that were built into a camera. This specific lens is for the BlackMagic Deign Pocket Cinema Camera (a video only camera, but one that uses photography lenses). I would prefer this to be a prime lens.  I have tried to find the exact way to calculate the focal length of the lens I need but I have not been able to find a good resource to make this simple enough for my limited optics knowledge. Can you please explain a simple way to calculate the focal length of a lens given the following inputs as an example:    I would prefer a simplified mathematical explanation so that I may use it to make similar determinations in the future using a "" method.  I have . Using that method, I came up with:  Required lens focal length = 7.02mm sensor height x (77in / 36in) = 15mm   Is that correct? Fortunately, I have very few strongly negative interactions with cars (most people generally seem to respect the way I ride), but those that do stick with me for a while.  The scenario is almost always the same. Rude driver approaches, does their rude thing (obscenities, "get off the road," unsafe passing, etc...), then speeds off to annoy the next bicyclist (or more than likely arrives at the next red light).  While this is generally a short interaction, I find that I just don't have a good rest of the ride. I find myself angry at the driver, thinking about what I could have done differently, and just generally being pissed off. Clearly I realize that it is possible I'm a jerk, but given the relative infrequency of these events I'm hoping that's not the case and I'm just riding defensively and this driver is having a bad day.  What can I do to get over (or mitigate) my anger at inconsiderate drivers? SEO for importing the page header with JavaScript rather than PHP My website has the same header/sidebar/footer on every page, so I have been importing them using PHP. To do this I forced all html files to be processed through the apache servers PHP handler via htaccess. I have come to understand that is not necessarily the best thing to do and so found out how to do everything I need using simple JavaScript. I also store a variable in the initial page that then gets used in the imported html.  Questions: By switching from:  &lt;?php include "_header.html";?&gt;   to  &lt;script type="text/javascript" src="_header.js"&gt;&lt;/script&gt;   I am noticing that the "view source" shows the header.js link, whereas the PHP method will show the source as if the html had been there all along. Will search engines recognize the html in the JavaScript just as they would when loaded with PHP?  I understand it is bad practice to alter the page contents -after- it is downloaded, but this doesn't fall into that category does it? That would detail things like after a wait function, or after user interaction, correct?  Are there any other foreseeable downfalls to switching to JavaScript and turning off the forced PHP processing? Configure long table caption I'm using Linux (centos) machine, I already connected to the other system using ssh. Now my question is how can I copy files from one system to another system?  Suppose, in my environment, I have two system like System A and System B. I'm using System A machine and some other using System B machine.  How can I copy a file from System B to System A? And, copy a file from System A to System B? Prove that if $A$ is an infinite set then $A \times 2$ is equipotent to $A$ I want to prove that if $A$ in an infinite set, then the cartesian product of $A$ with 2 (the set whose only elements are 0 and 1) is equipotent to $A$.  I'm allowed to use Zorn's Lemma, but I can't use anything about cardinal numbers or cardinal arithmetic (since we haven't sotten to that topic in the course).  I read a proof of the fact that if $a$ is an infinite cardinal number, then $a+a=a$, which is something similar to what I want to prove.   Any suggestions will be appreciated :) Excel destroying special character when saved as CSV Why does Stephen Hawking say black holes don't exist?