I have 3 lists out of which 1 is empty. I want to take count of lists in a list which are not empty.  For example:    a = ['username', 'username', 'social']  b = []  c = ['username', 'instead', 'added']   Combining all the lists together:  combine = [a,b,c]   Counting the non-empty lists:  count = sum(x is not '' for x in combine)   When I am running the above code, I have getting 'count=3' but I want 'count=2'  Please help me how should this can be done.
For example, if passed the following:  a = []   How do I check to see if a is empty?
Can you check if a PSN code is valid without redeeming it? I have a code for additional content on a Playstation game, and I want to know whether it is still valid, but I don't want to redeem it for myself.  If I enter it in the Playstation Store (on PS3, PS4 or the website), does it get redeemed to my account automatically, or can I enter it without redeeming? If it gets redeemed automatically, is there another way to check if it is valid? Show that if $a$ and $b$ are positive integers with $(a,b)=1$ then $(a^n, b^n) = 1$ for all positive integers n Assume f is a bounded continuous function on $\mathbf{R}$ and $X$ is a random variable with distribution $F$.  Assume for all $x \in \mathbf{R}$ that  $$ f(x) = \int_\mathbf{R}f(x+y)F(dy) $$  Please help conclude that $f(x+s) = f(x)$ where $s$ is any value in the support of $F$.  The hints that I have come across are to use Martingale theory and consider $\{ X_n\}$ to be i.i.d. with distribution $F$ and make a martingale with some function of $S_n = \sum_{j=1}^nX_j$.    Thanks! Fermi in his lecture asserts:     The second law of thermodynamics rules out the possibility of constructing a perpetuum mobile of the second kind.   So, this means there can be no machine which just transforms all the heat energy gained by cooling surrounding bodies into mechanical work.  But how does actually the Second Law prohibit this?   The hot reservoir provides heat energy to the system. Does it cause a decrease in entropy of the universe(system + hot reservoir)? How? In order to receive heat wouldn't the system have to be cooler than the reservoir? If so, then entropy increases as the heat energy gets expelled from the reservoir at a higher temperature than the temperature the system receives the heat energy. Is it so?  I'm not getting how the Second Law nullifies the existence of this machine. Could anyone please explain how the Law prohibits the perpetual machine of the second kind? I have a quick question about updating my references from Bibtex.  I am using TexStudio as my Latex editor.  I have to make changes to some of the references.  I put the changes in the "references.bib" file.  I then compile the Bibtex and the main document I'm working on.  Sometimes the changes show up, and sometimes they don't, and I haven't figured out why. I have even gone as far as trying to delete the references by changing the filename, but the original references still appear.  Here's what I put in my main document:   \newpage %Puts in References  \bibliographystyle{unsrt}  \bibliography{references}   My references.bib file shows all the changes I have made.  Any suggestions are appreciated! "Within" and "in" when referring to time I know that both can mean "inside" but what I don't have clear is whether both mean the same when talking about time. For example:   The party is in two days = The party is within two days ??   According to this link  within means a limit that can be exceeded, so I'm wondering too if say "the party is within two days max" is correct or redundant. In an enumerate environment, I want a few (not all) of the items to have asterisks which appear before the number (I don't feel strongly about whether the number or the asterisk is horizontally aligned with the other numbers).  Is there a less crufty way to do this than, say, using multiple lists (or &mdash; horrors &mdash; numbering manually)?  I'm already using enumitem for an unrelated purpose, if that helps, although I didn't find a solution after a quick skim of its manual. How do I set up SIP voice calling in Empathy? I would like to use Empathy for Internet voice chat, but I do not see an option under the Empathy Accounts menu to create a SIP account.  How do I set up Internet voice calling in Empathy? I want to describe my business and want to refer to it in a sentence.  I am trying to say:      "In 2015 we established a business (that is) named X".   Intuitively, the "that is" part is redundant, and makes the sentence more cumbersome. But I cannot think of a reason why we should be able to drop the verb.  Is the version without the "that is" part grammatically correct? How can it be explained? Prove: If a sequence converges, then every subsequence converges to the same limit. Why is the field inside a conducting shell zero when only external charges are present? are two consecutive numbers relatively prime? I have a question.  I have been given this proof: "For any $n$ in the integers where $n&gt;2$, show there are at least $2$ elements in $U(n)$ that satisfy $x^2=1$."  I have gone through and actually proved this, (that the numbers are $1$ and $n-1$) but i didn't' know how to prove that $n-1$ is in fact in the set $U(n)$. Is it because two consecutive numbers are always relatively prime? Feedback Request: New Timeline Question View There is an experimental timeline view for questions now available on meta ONLY! (Now working on SO, SF, and SU as well)  This is partially motivated by comments about how difficult it is to follow very active questions which have a lot of activity, and also the feedback on the API which was heavily dominated by "we need to know what happened in this time range" type responses.  It can only be accessed through URL hackery at the moment. To get to it, enter question URLs like so:  https://meta.stackexchange.com/posts/{id}/timeline  This is a chronological timeline of everything that happened on a question, including   initial question ask answers  revisions comments closure, deletion, reopen, undelete, etc votes   all based on when they happened in chronological order.  We are thinking about making this a fourth tab on the question, like so:  Timeline | Oldest | Newest | Votes  Please try it out and provide feedback. It is still a little rough, so we are not looking for highly detailed bug reports, just more general feedback.  Timeline view for this question: Lost/Deleted dpkg (package manager for Debian). How do I get it back? Comparisons: "so [adjective/adverb] as" or "as [adjective/adverb] as" Now that tags have this erm...  which appears when you move your mouse over them (try it! ), one question remains: What in the billion blue blazes does the 'subscribe' button do?   It's not RSS, since a traditional RSS feed link appears beside it, and clicking on it seems to increment the number of subscriber by one, but other than that scouring over the Stack Overflow UI does not appear to reveal anything. Surely this feature would have more use than serving as a popularity contest for the tags? Assume I have the following list:  foo = ['a', 'b', 'c', 'd', 'e']   What is the simplest way to retrieve an item at random from this list? Can the coefficient of static friction be less than that of kinetic friction? Sending Text Cross Domain By Bookmarklet How are virtual functions and vtable implemented? We all know what virtual functions are in C++, but how are they implemented at a deep level?  Can the vtable be modified or even directly accessed at runtime?  Does the vtable exist for all classes, or only those that have at least one virtual function?   Do abstract classes simply have a NULL for the function pointer of at least one entry?  Does having a single virtual function slow down the whole class? Or only the call to the function that is virtual?  And does the speed get affected if the virtual function is actually overwritten or not, or does this have no effect so long as it is virtual.