def height (t):   if not t:     return 0                                   # (1)   elif not t.nodes:     return 1                                   # (2)   else:     return 1 + max(height(n) for n in t.nodes) # (3)  hello guys some one can help me and change this function to pipline? using map , filter , lambda you don't need to write def height you need to use only with lambda map filter (PIPLINE)
A regular function can contain a call to itself in its definition, no problem.  I can't figure out how to do it with a lambda function though for the simple reason that the lambda function has no name to refer back to.  Is there a way to do it?  How?
What are the powers shown by the Rings of Power? How to determine which Python install is being used by the interpreter? Evaluate $\sum_{k=1}^\infty\frac{x^k}{k(k+1)}$ My partner is tutoring a Civil Engineering student in maths. Conveniently, I am a civil engineer so when any maths that's confusing comes up, I can usually help out. However, we are having a problem with the summing of power series, one area where I am sorely lacking.  After spending two hours on a question, we still cannot solve it and are always left with a $k$. Admittedly, I don't fully know what I am doing.     Evaluate $\displaystyle \sum_{k=1}^\infty\frac{x^k}{k(k+1)}$.   We do know that the answer is $1 + \dfrac{1-x}{x}\ln (1-x)$.  Any hints or help in the direction to go would be very much appreciated. Technical term for associating a group with the actions of a few Problem with option border of class standalone I tested a MWE given in question . Following the documentation (page 9) I used the class option border={left right bottom top} with left=right=top=0pt and bottom=20pt (20pt only to show the effect here).  With the version 2012/09/15 v1.1b of standalone and the following MWE I get no 20 pt margin at the bottom of my picture.  What is the problem?  MWE:  \documentclass[% % border=1pt   border={0pt 0pt 20pt 0pt} %left right bottom top ]{standalone}% http://ctan.org/pkg/standalone \begin{document} $2^5 = x_5 \times y^8$ \end{document} Organize desktop icons on Windows into categories or sections Probability of complete coupon set in $K$ boxes where a box has $N$ distinct coupons? Say there is a contest to collect a full set of $M$ coupons.  Each box of product has $N$ distinct coupons of the $M$ possible coupons in it, selected uniformly without replacement from the $M$ possible coupons, the same $N$ in number for all boxes.  I'm interested in the probability that after opening $K$ boxes of product I have at least one complete set of the $M$ coupons.  My attempt has been to take the probability of a coupon not being in a box, use that to determine the probability of that coupon not being in any of the $K$ boxes, and then... I get flummoxed, and don't think this is the correct approach.  I searched the site for coupon collector problems, there are a couple that deal with similar situations (multiple in a box), but with the box having coupons selected with replacement, so duplication in a box is possible.  Right now I'm using a CAS to get probability of sums of hypergeometric samples having all bins covered to check my ideas, but that's utterly impractical for other than tiny cases.   Is this not as trivial as I think it is, or is there a direct way to calculate this? I was reasonably certain I've seen this before, but I was wondering how to solve the Diophantine equation  $$a^2+b^2=c^2+d^2$$  I tried a web search and found nothing on this one.  I'm trying to avoid another library trip to a less than local library (maybe I should have taken better notes on that chapter...).  I'm not quite sure how to handle this one.  The only thing I can figure out with this equation, if I remember correctly, is that the sum on either side may only contain prime factors of 2 or odd primes congruent to 1 mod 4.  And if I don't want a and b equal to c and d, the sum can't be prime as I believe a prime congruent to 1 mod 4 can be represented as the sum of 2 squares in exactly one way.  But that doesn't give me any insight into actually solving this problem. Which are the most advanced frameworks and tools there are available for python for practicing Behavior Driven Development? Especially finding similar tools as rspec and mocha for ruby would be great. Short story or novel from the 1970s or before about two warring alien tribes dpkg: error: dpkg status database is locked by another process I just wondered if somebody could tell me what this means:  E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. reidsr@ubuntu:~$ sudo dpkg --configure -a dpkg: error: dpkg status database is locked by another process reidsr@ubuntu:~$    How do I run sudo dpkg --configure -a  manually? Cycles settings missing This particular blend file is messed up. I'm not sure what I did or pressed. If I open a new blend file everything works fine but in this one the materials tab is missing and the render properties is also missing some things. I don't want to start over my project. I have tried a day and a half to figure this out. How do I install the Firefox Developer Edition? I am attempting to solve this counting problem through combinatorial argument. The following is the equation I am given:   $$\sum_{i=1}^n (i-1)(n-i) = \binom{n}{3}$$  I understand that the right-hand side of this equation represents a set of $n$-elements out of which we choose 3. For example I believe we can say suppose we have a group of $n$ people and we want to choose 3 out of $n$ to be in a committee. However I'm not sure how to express the left-hand side in words. If forming a committee is an appropriate way to tackle this problem then I know the left-hand side must utilize the addition and multiplication principles, but I don't know how to put it into words. Also my intuition tells me that in solving this we should first flip $$(n-i)(i-1)$$  Thanks! dpkg -V , What does the output mean? I ran DPKG Verify on all packges and got this output and I don't know what it means :  ??5?????? c /etc/lightdm/lightdm-gtk-greeter.conf ??5?????? c /etc/default/chromium-browser ??5??????   /usr/local/etc/no-ip2.conf ??5??????   /var/lib/dokuwiki/data/cache/_dummy ??5?????? c /etc/xdg/menus/mate-settings.menu ??5?????? c /etc/apache2/apache2.conf ??5?????? c /etc/apt/apt.conf.d/10periodic ??5?????? c /etc/sysctl.conf ??5??????   /var/lib/xine/xine.desktop ??5??????   /boot/vmlinuz-4.4.0-21-generic ??5??????   /usr/lib/python3/dist-packages/cupshelpers/__pycache__/cupshelpers.cpython-35.pyc ??5??????   /usr/lib/python3/dist-packages/cupshelpers/__pycache__/xmldriverprefs.cpython-35.pyc ??5??????   /usr/lib/python3/dist-packages/cupshelpers/__pycache__/config.cpython-35.pyc ??5??????   /usr/lib/python3/dist-packages/cupshelpers/__pycache__/openprinting.cpython-35.pyc ??5??????   /usr/lib/python3/dist-packages/cupshelpers/__pycache__/__init__.cpython-35.pyc ??5??????   /usr/lib/python3/dist-packages/cupshelpers/__pycache__/ppds.cpython-35.pyc ??5??????   /usr/lib/python3/dist-packages/cupshelpers/__pycache__/installdriver.cpython-35.pyc ??5?????? c /etc/xdg/autostart/mate-volume-control-applet.desktop ??5?????? c /etc/libvirt/qemu/networks/default.xml I was wondering why binary crossentropy can be used as the loss function in autoencoders trained on (normalized) images, e.g.  or ? I know that binary crossentropy can be used in binray classification problems where the ground-truth labels (i.e. $y$) are either 0 or 1 and therefore when predictions (i.e. $p$) are correct, in both cases, the loss value would be zero:  $$ BCE(y,p) = -y.log(p) - (1-y).\log{(1-p)} $$  $$ BCE(0,0) = 0, BCE(1,1) = 0 $$  However, binary crossentropy does not have a value of zero when neither of its arguments are both zero or one, which is the case for an autoencoder with ground-truth labels in range $[0,1]$ (i.e. assuming the input data has been normalized in this range). I thought a regression loss function such as mean squared error or mean absolute error must be used instead, which have a value of zero when labels and predictions are the same. What am I missing here? I have some files with TikZ graphics that have suddenly changed appearance since I upgraded to PGF-2.10.  Here is a minimal example:  \documentclass{minimal} \usepackage{tikz} \begin{document} \pgfversion\par \begin{tikzpicture} \draw[blue] plot[domain=-1:1] (\x,{\x^2 + \x^3}); \draw[xshift=4cm,blue] plot[domain=-1:1] (\x,{(\x)^2 + (\x)^3}); \end{tikzpicture} \end{document}   In PGF 2.00 I had this:    while in 2.10 I have this:    The one on the left in PGF 2.10 looks like the graph of y=x^3 but could also be y=x^3 + x|x|.   This has been  on sourceforge and  on the pgf-users mailing list.  Although I haven't checked myself yet, the bug remains open and some of the commenters below report that problems still exist in the CVS version.   Geoffrey Jones notes the bug is in the 2.00 CVS version:     Hi Matthew, not an answer, just an FYI   that's too large for the comment box.   My compile of your code through pgf   v2.00 produces the result you see with   v2.10, above:       I.e., the difference you observe seems   to pre-date v2.10.   There is a workaround by inserting parentheses.  But since I have so many old lecture files I'd rather find a solution that doesn't involve rewriting my TikZ code.  And I'm squeamish about using the CVS bleeding edge code even if it were fixed, since I don't want to introduce other problems.  Ideally I'd like a simple patch that I can stick at the preamble, or just fix one file in the PGF distro. How to retain HTML5 Attributes on Markup I have a page with certain html markup and element attributes as shown in the snippit below:  &lt;ul class="accordion" data-accordion=""&gt;  When I edit the page as a user with the WP Administrator Role the &lt;ul&gt; remains intact upon page update. Perfect.  Yet when a user with WP Editor Role edits the page, the ul tag saves as follows:  &lt;ul class="accordion"&gt;  Notice the data-accordion attribute is removed.  How can I get WordPress to retain markup tag attributes for users with the Editor role? How can one run multiple programs in the background with single command? How can one run multiple programs in the background with single command?  I have tried the commands below, but they do not work.  nohup ./script1.sh &amp; &amp;&amp; nohup ./script2.sh &amp; -bash: syntax error near unexpected token '&amp;&amp;'  nohup ./script1.sh &amp; ; nohup ./script2.sh &amp; -bash: syntax error near unexpected token ';' Auto update specifick plugin I've created a plugin and I want to auto-update this plugin.  I've been looking in the WordPress Codex and found this following piece of code:  add_filter( 'auto_update_plugin', '__return_true' );   I added this code into a new Must-have Plugin but it doesn't work. It does not auto-update all my plug-ins..  Anyone that have experience with auto updating?