Is it possible to add/reduce number of nested for loops in a function based on the length of input?  For example: Based on a certain input of length 3, I may need to use 1 nested for loop (for loop inside another for loop). Similar to this,  for i in range(0, len(input)+1):     for j in range(i+1, len(input)+1):   However, when the input length is 4, I could have achieved my result  if I could introduce additional for loop inside the already existing nested for loop, which means,  for i in range(0, len(input)+1):     for j in range(i+1, len(input)+1):         for k in range(j+1, len(input)+1):`   Similarly, if the input length is 5, then I would like to introduce another for loop,  for i in range(0, len(input)+1):     for j in range(i+1, len(input)+1):         for k in range(j+1, len(input)+1):             for l in range(k+1, len(input)+1):`   The pattern is, there will be n-1 number of for loops for an input of length n.  Is it possible create such a function in Python?
I have a list with 15 numbers in, and I need to write some code that produces all 32,768 combinations of those numbers.   I've found  (by Googling) that apparently does what I'm looking for, but I found the code fairly opaque and am wary of using it. Plus I have a feeling there must be a more elegant solution.  The only thing that occurs to me would be to just loop through the decimal integers 1–32768 and convert those to binary, and use the binary representation as a filter to pick out the appropriate numbers.   Does anyone know of a better way? Using map(), maybe?
Without solving the equation, show that all nine roots of $(𝑧 − 1)^{10} = 𝑧^{10}$ lie on the line $Re (𝑧) = \frac{1}{2}$ Problem: Without solving the equation, show that all nine roots of $(𝑧 − 1)^{10} = 𝑧^{10}$ lie on the line $Re(𝑧) = \frac{1}{2}$. I would like to say I tried something but I am actually clueless. I was thinking maybe I could use De Moivre's theorem but I am not sure how. Any hint would be appreciated. C# - how can I get owner's name for a Mutex I have a shared mutex between 2 applications. I want to create an administration console that shows the current owner's name of the mutex.  How can I get the application name that currently owns the Mutex? How to remove/apply all modifiers of one object in python Lets assume you have 1 object with 4 modifiers added to it. I am curious how one would approach the task to apply all or to delete all modifiers of a just selected object that has many modifiers already added.  The console reads out the modifier delete as  bpy.ops.object.modifier_remove(modifier="Box Right ")   So "Box Right " I might have to replace with something like active.object.modifier.name and then work each modifier off?  This would be very helpful when you want to generate a static mesh for animation or 3D printing. How can I stop applications and services from running? When my phone starts up there are several application/services running in the background that I would rather not.  And when I press the Home button while using an app, that app usually goes into the background without exiting.  How can I stop these apps from running? LSTM : shape of tensors? I'm trying to understand LSTM, using for instance   I get the overall idea, I guess. But I'm not quite sure I get the maths.  I'll set a very simple problem : I have a sequence of numbers and want to predict next number.   So x_t is of shape (1), and as I understand, h_t will be the prediction, so it should also be of shape (1). (I'm just here ignoring batch size)  Now, the equation producing h_t, using * operation should then have two operands of the same size as the result; that is, C_t and o_t should also be of shape (1).  Following on that idea, equation producing C_t forces also shape of (1) for f_t, i_t and ~C_t.  So... everything reduced to scalar real numbers in that case ?  what am I getting wrong ? because this would just not be able to learn much, would it ? EJB Transactions in local method-calls In the following setup, does method B run in a (new) transaction?  An EJB, having two methods, method A and method B  public class MyEJB implements SessionBean     public void methodA() {        doImportantStuff();        methodB();        doMoreImportantStuff();     }      public void methodB() {        doDatabaseThing();     } }   The EJB is container managed, with methodB in requires_new transaction, and method A in required transaction. thus:  &lt;container-transaction id="MethodTransaction_1178709616940"&gt;   &lt;method id="MethodElement_1178709616955"&gt;     &lt;ejb-name&gt;MyName&lt;/ejb-name&gt;     &lt;method-name&gt;*&lt;/method-name&gt;   &lt;trans-attribute&gt;Required&lt;/trans-attribute&gt;   &lt;/method&gt;   &lt;method id="MethodElement_1178709616971"&gt;     &lt;ejb-name&gt;MyName&lt;/ejb-name&gt;     &lt;method-name&gt;methodB&lt;/method-name&gt;   &lt;/method&gt;   &lt;trans-attribute&gt;RequiresNew&lt;/trans-attribute&gt; &lt;/container-transaction&gt;   Now let another EJB call methodA with an EJB method call. methodA now runs in an transaction. Will the subsequent call to methodB from methodA run in the same transaction, or does it run in a new transaction? (mind, it's the actual code here. There is no explicit ejb-call to method B) Block network access of a process? Is it possible to block the (outgoing) network access of a single process? What is object serialization? Why don't absorption and emission lines cancel out in our Sun? I was looking at  on why  and emission lines don't cancel out:      An experiment shining light on the material and looking at the   reflected spectrum will see absorption lines at those frequencies,   because the relaxation of the excited electrons will emit back   radiation all around randomly, whereas the reflected spectrum is at a   specific angle.   However it is not totally convincing to me. The photons that get emitted towards the center of the Sun (by the electrons in higher energy states that absorbed a photon earlier) would get absorbed again when they hit a different electron (and then re-emitted) and would eventually make it out. So why don't absorption and emission lines cancel out in our Sun? Let $\Gamma$ be a set of formulas and $\phi$ be a formula. Show that $\Gamma \cup \{\neg \phi\}$ is satisfiable if and only if $\Gamma\not \models \phi$.   This seemed pretty obvious but I wanted to see if my proof made sense:  Proof: $(\Rightarrow)$  To derive for a contradiction, suppose that: $\Gamma \models \phi$. That means for all truth assignments $v$, for $\gamma \in \Gamma$, if $v(\gamma) = T$, then $v(\phi) = T$.  But this contradicts our assumption that $\Gamma \cup \{\neg \phi \}$ is satisfiable by the fact that $v(\phi) = T$ cannot happen so: $\Gamma \not \models \phi$ .  $(\Leftarrow)$   So by the definition of $\Gamma \not \models \phi$, we have that there is some truth assignment $v$ which satisfies $\Gamma$ but does not satisfy $\phi$. So  that means $v(\phi) = F$ since $v(\phi) \not = T$ which implies that $v(\neg \phi) = T$ which means $v$ satisfies $\Gamma \cup \{\neg \phi\}$.    I feel like I'm missing something in the forward direction, but at the same time... It looks pretty trivial as well. Am I missing anything crucial?  Thank you! Is there a way to switch the mesh selection mode by a shortcut? If $11z^{10}+10iz^9+10iz-11 = 0$. Then possible value of $\mid z \mid,$ is Derivative of determinant of a matrix I would like to know how to calculate:  $$\frac{d}{dt}\det \big(A_1(t), A_2(t), \ldots, A_n (t) \big).$$ Connecting two relative clauses in one sentence I would like to write an essay which gives information about the charts but because I am not native English speaker, when I started to write down my essay I came across the similar problems that I do sometimes.  Here my sentence:  Figure 1 and figure 2 show the percentage of people, WHOSE age is between 25-44 and over 65, WHO purchased concert, cinema and theater tickets online over the first three months of 2006 in three countries, WHICH are Australia, the UK, Malaysia.  Here is my questions:  1.How can I give the information of age and of what do people buy in one sentence?  2.Such vital and important information on the figures can be used as indefinite relative clause? How can I tell if sheet a exists in a workbook? I have the following code that's not working as expected:  If Sheets("a") &lt;&gt; "" Then MsgBox ("sheet a exists")   How can I tell if sheet a exists in the workbook? Hovering over featured moves the questions down a bit When I hover over featured tab, both on the front page and in questions, the questions move down by one pixel. Here's a small screen capture demonstrating the issue:        I see it in Chrome 34 and Opera 20, but I don't see it on IE11 or Firefox 28. I know questions on the "hot" tab of a site homepage are based on some sort of views/velocity criteria, but does anyone know the actual algorithm used?  Background: I was considering a feature-request about the "hot" tab, but I don't have enough information to speak about it intelligently. How to integrate $\int\sqrt{x^2+1}dx$ $$\int\sqrt{x^2+1}dx$$ I've been attempting this problem for days and I've made very little progress. I understand that I should substitute $x=\tan(x)$ and $dx=\sec^2(x)dx$ but beyond that I am very much lost. I have Ubuntu 14.04 installed on my laptop. Can I clone the entire system with apps, settings, etc on a USB 3 pendrive, and then boot from that on other computers as a portable Ubuntu installation to take around with me?  I am trying a function that Timeshift has that's called "Clone the current system on another device". I've selected the pendrive as the target device. Timeshift was talking about this being bootable. But is it going to bootable on only this laptop, or on any system? For example, on an Intel Mac, or a Windows computer without the grub bootloader? Is that Timeshift function what I am looking for, or do I have to do something else?  Edit: The Timeshift clone failed to boot on the first system I tested it on. (A Dell Hackintosh that usually boots from USB just fine.) What does // mean in a path?