for example   a = [1, 2, 3] b = [4, 5, 6, 7] c = [8, 9]  for i in a:     for l in b:         for h in c:             print [i,l,h]   but what if there is d, e ,f...  I want define a function can print them all but not use nested for.  how to do it?
How can I get the Cartesian product (every possible combination of values) from a group of lists?  Input:   somelists = [    [1, 2, 3],    ['a', 'b'],    [4, 5] ]   Desired output:  [(1, 'a', 4), (1, 'a', 5), (1, 'b', 4), (1, 'b', 5), (2, 'a', 4), (2, 'a', 5) ...]
This example illustrates some conflict between xelatex and natbib- and footnote-generated superscripts.  The semi-colon between distinct citations is not typeset as a superscript, nor is the dagger.  The asterisk, however, looks fine to me.  Any suggestion on how to make these auto-generated superscripts look more normal?   Update Mostly fixed, see second screenshot below.  Update 2 Fully fixed!  Alter the MWE below with this code:  \DefineFNsymbols*{safestar}{{$*$}{\textdagger}{\textdaggerdbl}{\textsection} {\textparagraph}{\textbardbl}{$**$}{\textdagger\textdagger} {\textdaggerdbl\textdaggerdbl}{\textsection\textsection} {\textparagraph\textparagraph}{\textbardbl\textbardbl}} \setfnsymbol{safestar}   This comes  Achim Blumensath on the MinionPro mailing list, together with  for the footmisc package.  \documentclass[article, a4paper, 12pt, oneside]{memoir}  \usepackage{fontspec} \usepackage{xunicode} \usepackage{xltxtra} % c/o @wasteofspace, this is the "offending" line \defaultfontfeatures{Mapping=tex-text} \setmainfont{Linux Libertine O}  \usepackage[super]{natbib} \usepackage[perpage,symbol]{footmisc}  \let\sc\scshape \let\bf\bfseries \let\it\itfamily  \setlrmarginsandblock{23mm}{23mm}{*} \setulmarginsandblock{23mm}{198mm}{*} \checkandfixthelayout  \begin{document}  \bibliographystyle{plainnat} \setcitestyle{nature} \thispagestyle{empty}  This is a nice\footnote{(That is to say, minimal.)} example.\cite{lenat1976artificial,lenat1984and} Unfortunately, it has some problems.\footnote{From an aesthetic point of view.}  \bibliography{corneli}{}  \end{document}     But if we don't load , then we get this other slightly problematic result:   I guess I can live with the small and over-elevated asterisk.  It looks less bad when it follows a period. I am reading Tom Apostol's Analysis and come across this theorem.   Should $a \leq b$ if $a\leq b+\epsilon$ for all $\epsilon &gt;0$?   I don't doubt the proof in the book but I don't understand the intuition or geometric explanation behind this. Could somebody shed some light on this equation? I just started studying analysis on my own.$\ \ $ Is GTA Online cross-platform? My wife is an Indian national with an Indian passport. She holds an indefinite leave to remain in the UK (permanent residence card). Does she need to apply for a Schengen visa before travelling to France or any other Schengen countries? How to create a Wi-Fi Hotspot (in Access Point mode)? Is there a practical way to change the phone number in Uber app when arriving at a country? I need something explained or corrected:  In my number theory class we proved that there are an infinite number of primes using Euler's Phi Totient. It went something like this:  Let $M = p_1 p_2 \dots p_n$ be the product of all primes. Consider $1 &lt; A \le M$:  Some prime must divide $A$, call it $q$. Since $q$ must be one of the primes, $q$ must divide $M.$  So the $gcd(A,M) &gt; 1.$ Thus $\phi(M) = 1$ ...?   Which is not even and contradicts the theorem that $\phi(N)$ is even for $N&gt;2.$ Therefore there exists an infinite number of primes.  I get confused by the statement "Thus $\phi(M) = 1$"....  Did i possibly copy this proof down wrong? or am I missing something? Thank you in advance.   Edit: by consider a such that...i meant consider an integer '$a$' I replaced it with $A$ to hopefully make it more clear.   Edit2: I'm sorry I am not familiar with using the equation editor. This is not a homework assignment, just studying for my exam. I just want to be able to understand this or clearify it. What is the proof that the universal constants ($G$, $\hbar$, $\ldots$) are really constant in time and space? Why use "need not" instead of "do not need to"? Is a switches voltage and current rating a hard limit? $$\int^2_{-2}\frac{x^2}{1+5^x}$$  How do I start to integrate this?  I know the basics and tried substituting $5^x$ by $u$ where by changing the base of logarithm I get $\frac{\ln(u)}{\ln 5}=x$, but I got stuck.  Any hints would suffice preferably in the original question and not after my substitution.  (And also using the basic definite integrals property.)  Now I know only basic integration, that is restricted to high school, so would prefer answer in terms of that level. How do I share internet with Windows from my Linux box? I have a Linux (Ubuntu 12.04) PC connected to the internet with a Greenpacket WiMax USB modem. I want to share the Internet connection with another computer running Windows 7 Home Premium, connected to the Linux PC over a LAN. Is this possible? How? Is the reverse possible instead (connecting the internet to the Windows computer and sharing it with Linux)? At work today, I came across the volatile keyword in Java. Not being very familiar with it, I found . Given the detail in which that article explains the keyword in question, do you ever use it or could you ever see a case in which you could use this keyword in the correct manner? Is there a term for a foreign word that looks like an English word but has a completely different meaning? examples:         Gift (German) = poison   poisson (French) = fish   embarazada (Spanish) = pregnant   sauce (Spanish) = willow   triviale (Italian) = vulgar   parentes (Portuguese) = relatives   slim (Dutch) = smart Suppose a gambler starts with one dollar and plays a game in which he or she wins one dollar with probability $p$ and loses one dollar with probability $1 - p$. Let $f_{n}$ be the probability that he or she first becomes broke at time $n$ for $n = 0, 1, 2\ldots$. Find a generating function for these probabilities.  Is it binomial distribution $?$ and then use the $\operatorname{mx}\left(s\right) = rx\left(\mathrm{e}^{s}\right)$ of the binomial distribution $?$. Help$\ldots!$. I am correcting my quiz. New question asking form sometimes leads to accidental double posts of questions I've noticed that with the new question asking form, sometimes, attempting to submit a question will post two identical copies of the same question.  I've  (), but at the time, I assumed it was just a temporary fluke. As far as I remember, I just reviewed the question, saw no errors, and submitted it. (That's all the info I have.)  However, I just saw this happen to someone else, so it can't just be a fluke on my end. , and . The author claims there that they did indeed double click the "Review" button, but their question didn't go through since it didn't have a required tag, but when they tried to submit the question with the required tag, they only clicked it once.  Also, now that I think about it, it could not have been just a temporary client-side issue on both our ends. The system is supposed to  if one tries to post more than one question in 30 seconds. Neither of us got a CAPTCHA. This means that the server accepted the double post, and so it's a server issue.  This has the effect of denying users badges that they would have otherwise qualified for, since a single negatively-received, closed, or deleted question . This means that even if the double post is deleted and the original is upvoted, the user won't qualify for that day since they've made a "bad" question on that day. (While they may be able to later reverse this 60 days later by undeleting and re-deleting their question - questions deleted more than 60 days later aren't considered "deleted" for the check - they often won't be able to, since most of the time, users will have downvoted the double post, which also disqualifies one from the badges.)  Can an employee go through server logs to see what happened in both these cases, and add some safeguards to prevent accidental double submissions of questions? This seems to have come up when the new asking form was deployed.  Update: There was another case just now:  was . As both have the exact same time of submission, this is an instance of this bug, since as I said above, this thing is ordinarily prevented by a CAPTCHA. Automatic left and right commands Is it possible to automatically "add" \left and \right commands in front of all brackets? The source code should be left intact, but LaTeX should interpret every pair of brackets as if they were preceded by such commands. This is because adding \left and \right commands is time consuming and makes source code longer and less readable. I considered defining new commands such as \lb and \rb for \left( and \right), but it doesn't seem very elegant to me: what if I also want to add square brackets for example?  Any ideas? Thanks. writing js objects to files (including methods) in nodejs? Is it really possible to break the speed of light by flicking your wrist with a laser pointer? Minutephysics has a popular  called "How to break the speed of light". In the video it states that if you flick your wrist while pointing a laser that reaches the moon, that the spot of light on the moon will travel 20 times the speed of light. Now don't get me wrong, I do like their videos, just this one seemed a bit fishy to me. At first I thought it all practically made sense, then I realised something...  In my mind, I would think that light particles (photons) travel from the laser to the moon and bounces off the moon and back to your eye (it doesn't just stay there, in place, so you can't move it around). Now, what he is stating is that if you flick your wrist these photons that have travelled to the moon will move along with your wrist. Wouldn't these photons be bouncing off of other objects or still travelling to the moon by the time you flick your wrist? i.e. dissipating, therefore new photons will be travelling to the moon (from the laser directly).  For example: let's say you point the laser at the moon, and once it reaches the moon, you wait a couple of seconds and then flick your wrist. The laser that you have flicked will emit photons in every direction that your wrist was in, correct? i.e. The photons would shoot out in a straight line (unless disrupted) continuously, with your wrist taking no affect on the speed of the photons.  So back to the question, is this video wrong? Ubuntu 16.04 VIM without python support! Although Ubuntu 16.04 release notes mention that:  The default VIM package has been built against python3 instead of python2.  Yet after I installed vim with the following command:  sudo apt-get install vim   And checked:  vim --version   It showed:  -python -python3   Is it a bug? How do I get vim with Python support?