I have a list of elements like:  x = ['A, B', '2', '3', 'Jan, Feb'] #      ^                   ^ #    comma separated single string   I want to transform this list into a list of lists with all the combinations of each element that is comma separated so that it looks like:  [['A', '2', '3', 'Jan'], ['A', '2', '3', 'Feb']  ['B', '2', '3', 'Jan'], ['B', '2', '3', 'Feb']]   What is the elegant way to achieve this using Python's in-built functions/libraries?
How do you generate all the permutations of a list in Python, independently of the type of elements in that list?  For example:  permutations([]) []  permutations([1]) [1]  permutations([1, 2]) [1, 2] [2, 1]  permutations([1, 2, 3]) [1, 2, 3] [1, 3, 2] [2, 1, 3] [2, 3, 1] [3, 1, 2] [3, 2, 1]
The default in lyx is to have   I. First part (roman number)   Section 1   1.1 Subsection 1  and I'd like to have   First part (arabic number)   1.1 Section 1  1.1.1 Subsection 1  etc.   Any suggestion? Thanks a lot in advance! The supremum norm is submultiplicative Is the following proof correct:  Let $X$ be a compact Hausdorff space and $C(X)$ the space of continuous functions $f: X \to \mathbb{C}$. We can equip $C(X)$ with the (edit: sorry, semi-)norm $\lVert f \rVert_\infty = \sup_{x\in X} |f(x)|.$ I want to prove that for $f,g \in C(X)$, $\lVert fg \rVert_\infty \leq \lVert f \rVert_\infty \lVert g \rVert_\infty $. Let $z \in X$ be arbitrary then $$ \lvert f(z)g(z) \rvert \leq \lvert   \; \sup_{x} \lvert f(x) \rvert  g(z)  \;\rvert=\sup_{x} \lvert f(x) \rvert  \lvert    g(z)\rvert \leq \sup_{x} \lvert f(x) \rvert  \sup_{y} \lvert g(y) \rvert.  $$  Since $z$ was arbitrary $$ \sup_{z} f(z)g(z)\leq \sup_{x} f(x) \sup_{y} g(y) $$  that is the sought. Regex to strip lat/long from a string Anyone have a regex to strip lat/long from a string? such as:  ID: 39.825 -86.88333 Using Blender Game Engine for VR 360 tour on Mobile, is it doable? I'm sorry if my question sounds clumsy, I'm not a seasoned BGE user.  I'd like to make a virtual tour for Gear VR and/or Google Cardboard in the BGE that works on Mobile.  Is this doable in a user friendly way using the BGE? Can I export to Mobile (android, IOS, Windows Phone)? I know this is possible using Unity, but I find Unity difficult to use. I've tried UE4, but the process is a big mess, it requires a buggy multi-level hack that only results in wasting my time. Suppose $a_0,a_1,a_2$ satisfy the recurrence $a_n = 3a_{n-1}-3a_{n-2}+a_{n-3}$ for $n\ge3$   Let $c_n=a_{n+1}-a_n$ for $n\ge1$ and $c_0=0$   Find a linear recurrence of degree at most 2 for the sequence $c_0,c_1,c_2,...$  I'm not entirely sure what they are asking for but I think it is asking for a recurrence relation for $c_n$ where the characteristic polynomial has degree at most 2.  I tried finding a closed form for $a_n$ to try and get rid of the $a_n$ in the $c_n$ equation, but I can't figure it out when the initial conditions aren't specified ($a_0,a_1,a_2$)  Any help would be appreciated! I'm trying to prove the following statements.  Let $G$ be a finite abelian group $G = \{a_{1}, a_{2}, ..., a_{n}\}$.   If there is no element $x \neq e$ in $G$ such that $x = x^{-1}$, then $a_{1}a_{2} \cdot \cdot \cdot a_{n} = e$.   Since the only element in $G$ that is an inverse of itself is the identity element $e$, for every other element $k$, it must have an inverse $a_{k}^{-1} = a_{j}$ where $k \neq j$. Thus $a_{1}a_{1}^{-1}a_{2}a_{2}^{-1} \cdot \cdot \cdot a_{n}a_{n}^{-1} = e$.   If there is exactly one $x \neq e$ in $G$ such that $x = x^{-1}$, then $a_{1}a_{2} \cdot \cdot \cdot a_{n} = x$.   This is stating that $x$ is not the identity element but is its own inverse. Then every other element $p$ must also have an inverse $a_{p}^{-1} = a_{w}$ where $p \neq w$. Similarly to the first question, a rearrangement can be done: $a_{1}a_{1}^{-1}a_{2}a_{2}^{-1} \cdot \cdot \cdot xx^{-1} \cdot \cdot \cdot  a_{n}a_{n}^{-1} = xx^{-1} = e$. And this is where I am stuck since I proved another statement.    Any comments would be appreciated for both problems. In Inno Setup is it possible to add conditional statements to what in the [Run] section gets executed? Alternatively is it possible to manually update the built in progress bar? Basically I have 2 MSIs included and using Inno Setup as a bootstrapper, and depending on user input one or both of the MSIs are to be installed.  I have something working using Exec statements in CurStepChanged but it doesn't update the progress bar as the files are extracted and it looks like the installer is stalled.  I guess the end result is I want some progress bar updates while the files are extracted to the temp folder.  The following is my current code:  procedure CurStepChanged(CurStep: TSetupStep); var     ResultCode: Integer; begin     if(CurStep = ssInstall) then begin         if(InstallServer) then begin             ExtractTemporaryFile('ServerSetup.msi');             Exec('msiexec',ExpandConstant('/i "{tmp}\ServerSetup.msi" /qb INSTALLDIR="{code:GetInstallPath}\Server\" ALLUSERS=2'),'', SW_SHOW, ewWaitUntilTerminated, ResultCode);         end;         if(InstallClient) then begin             ExtractTemporaryFile('ClientSetup.msi');             Exec('msiexec',ExpandConstant('/i "{tmp}\ClientSetup.msi" /qb INSTALLDIR="{code:GetInstallPath}\Client\" ALLUSERS=2'),'', SW_SHOW, ewWaitUntilTerminated, ResultCode);         end;     end; end; How to pass parameters to an alias? Can you nest html forms? Let us consider The following example   \documentclass{article} \usepackage{enumerate} \begin{document} \begin{enumerate}  \item Which of the following numbers is the largest ?\\ $2^{3^4},2^{4^3},3^{2^4},3^{4^2},4^{2^3},4^{3^2}.$  \begin{enumerate}[(a)] \item  $2^{3^4}$ \item  $3^{4^2}$ \item  $4^{3^2}$  \item $4^{2^3}$ \end{enumerate}  \end{enumerate} \end{document}   This produces :    But I'd like to produce the following using the same package  :   OR     OR   How can I do that? Suppose $u$ is an element of a ring with a right inverse. I'm trying to understand why the following are equivalent.   $u$ has at least two right inverses $u$ is a left zero divisor $u$ is not a unit   If $v$ and $w$ are distinct right inverse of $u$, then $u(v-w)=0$, but $v-w\neq 0$, so $u$ is a left zero divisor. It's also clear that if $u$ is a left zero divisor, it cannot be a unit (else I could cancel $u$ from $ub=0$ to see $b=0$).  I'm having a heck of a time seeing why $u$ is not a unit implies $u$ has at least two right inverses. I tried the contrapositive, but saw no good approach. What am I missing? I’m reading Shakespeare’s Henry IV (Part 1) right now and I’m noticing that Sir John Falstaff has a propensity of saying “If this, then I’m a this” sort of statements. A few examples to clarify:     … An I   have not ballads made on you all and sung to filthy   tunes, let a cup of sack be my poison      An I have not   forgotten what the inside of a church is made of, I   am a peppercorn, a brewer’s horse      if manhood, good manhood, be   not forgot upon the face of the earth, then am I a shotten herring      If I do not beat thee out of thy   kingdom with a dagger of lath, and drive all thy   subjects afore thee like a flock of wild-geese,   I’ll never wear hair on my face more   Is there a particular literary term for these sort of sentences? Definite article before name of languages Should I use the definite article before name of languages?   (the?) Persian language (the?) German language (the?) Arabic language (the?) Russian language (the?) English language   Some language name may also refer to other things, so you need language word after their name. How much should a "button of Cure Light Wounds" cost (should it be available at all?) Accessing the web page's HTTP Headers in JavaScript How do I access a page's HTTP response headers via JavaScript?  Related to , which was modified to ask about accessing two specific HTTP headers.     Related: How to use Class in Java? There's a good discussion of Generics and what they really do behind the scenes over at , so we all know that Vector&lt;int[]&gt; is a vector of integer arrays, and HashTable&lt;String, Person&gt; is a table of whose keys are strings and values Persons.  However, what stumps me is the usage of Class&lt;&gt;.  The java class Class is supposed to also take a template name, (or so I'm being told by the yellow underline in eclipse).  I don't understand what I should put in there.  The whole point of the Class object is when you don't fully have the information about an object, for reflection and such.  Why does it make me specify which class the Class object will hold?  I clearly don't know, or I wouldn't be using the Class object, I would use the specific one. How to read and understand the java stack trace? Deleting Objects in JavaScript In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or parse the string "31" to an integer, 31?  I just want to know how to parse a float str to a float, and (separately) an int str to an int. How to read and write excel file