Javascript && operator as if statement?
Is  && statement() the same as if() statement()?
I have run into a conundrum.   When I go to get some friends cans of beer I say:     You guys want a beer?   When I am referring to going to a bar and drinking some I say:     Let's go get some beers!   When I go to a store to buy beer I say:     I am going to get beer.   How can I work this out? My friend is a native Chinese speaker and this is the sort of plural thing that trips her up. How is this explained? How do you prove that $\sqrt{2} + \sqrt{5}$ is irrational?    I tried to prove it by contradiction and got this equation:  $a^2/b^2 = \sqrt{40}$. I am trying to read a custom (non-standard) CSS property, set in a stylesheet (not the inline style attribute) and get its value. Take this CSS for example:  #someElement {   foo: 'bar'; }   I have managed to get its value with the currentStyle property in IE7:  var element = document.getElementById('someElement'); var val = element.currentStyle.foo;   But currentStyle is MS-specific. So I tried getComputedStyle() in Firefox 3 and Safari 3:  var val = getComputedStyle(element,null).foo;   ...and it returns undefined. Does anyone know a cross-browser way of retreiving a custom CSS property value?  (As you might have noticed, this isn't valid CSS. But it should work as long as the value follows the correct syntax. A better property name would be "-myNameSpace-foo" or something.) Wrong hyperref with repeated counter I'm having an interesting problem with hyperref.  Apparently, when a counter is reset by \setcounter{mycounter}{0} then hyperref always links to the first possible instance of the counter and not the one where the respective label sits.   Check this MWE out:   % !TEX TS-program = xelatexmk \documentclass{article} \usepackage[paperwidth=6in,paperheight=3in]{geometry} \usepackage{hyperref} \hypersetup{colorlinks=true, allcolors=blue, } \newcounter{mycounter}\setcounter{mycounter}{0} \newcommand\countme{\refstepcounter{mycounter}\themycounter}  \begin{document}  First line \countme{} has some interesting text.  The second line \countme \label{onelabel} has \textbf{more} interesting text.  As we saw at line \ref{onelabel} ...  \newpage  A new page brings new numbers \setcounter{mycounter}{0}   A very different first line \countme{} has other interesting text.  The second line \countme \label{otherlabel} has \textbf{different} interesting text.  As we saw at line \ref{otherlabel} ... \end{document}   As you can see in the screenshot below, the pop up preview of the \ref on the second page doesn't refer to the second line with \label{otherlabel} but to the one on the first page (also has the tooltip "Go to page 1" -- in TeXShop).   Am I not understanding something fundamental about hyperref?      The context for all this is an environment that resets my counter to 0 at begin.  And all subsequent \refs to labels in a second or third iteration of the environment point to the very first instance of that environment, not the correct one where the label sits. Let $U,W$ be subspaces of a vector space $V$. Show that   $$\dim(U)+\dim(W)=\dim(U+W)+\dim(U\cap W)$$   Hint: Show that the map given by $L:U×W\to V$ given by $L(u,w)=u-w$ is linear.   I can show that $L:U×W\to V$ given by $L(u,w)=u-w$ is a linear map. I also know that the dimension of $U×W$ is $\dim(U)+\dim(W)$. What do I do next? Any hints? How do JavaScript closures work? How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help. How do I upgrade from 14.04 LTS to 16.04.1 LTS? So, today is July 21st and . gives me an option to download 16.04.1 LTS. However, attempting to upgrade gets me this message -  $ sudo do-release-upgrade Checking for a new Ubuntu release No new release found   What is wrong? Does it matter that I am running apt-get update behind apt-cacher-ng?  Note: Commenting out the files in apt.conf.d that used apt-cacher-ng did not make a difference.  Edit: Explanation for possible duplicates:  deals with upgrade from 12.04LTS to 14.04LTS. My question is specific to 14.04 LTS to 16.04.1 LTS upgrade. Old answers, while good for archival purposes are less relevant in a fast changing package like ubuntu. Moreover none of the answers answer what is wrong. The link  pointed out is mentioned in one of the comments. This Q &amp; A is more helpful for people upgrading today than the work around mentioned in "". How can I tell which cards or sets are currently legal in various formats? I haven't played Magic: the Gathering since the days of Onslaught and Mirrodin, and I would like to try to catch back up. Since all my cards are quite dated now, I may be more interested in formats other than the most up-to-date one.  Rather than ask what is currently legal in various formats (since that is likely too localized), I would rather pose the question of how can I tell which sets/cards are legal in each format. Why is paper more frangible when it is wet? My four-year-old daughter asked me why paper tends to fall apart when wet, and I wasn't sure.  I speculated that the water lubricates the paper fibers so that they can untangle and separate more easily, but I really wasn't sure. How to distribute objects in a circular pattern on a surface (Radial Array, Polar Array) This may be a very basic question.      Let $R$ be a commutative ring with unity (may be assumed to be an integral domain, if necessary) and $I$ be an ideal of $R$. Assume that $R/I$ is isomorphic to $R$. Does this mean $I=(0)$ ? I find that often after awakening from suspend on Ubuntu GNOME 16.04 with GNOME 3.20 (I have only found this issue on the latest version, though I have not tried with GNOME 3.18 on 16.04) that I get this strange font issue which can't be fixed by restarting gnome-shell and seemingly only by restarting my entire machine:            I do not believe that this is a theme issue as I have tried all the built-in themes (including the dark and light versions) and it is the same for them all. Though it does not seem to affect gnome-shell areas, that is the top-bar, the Activities Overview, etc, are not affected for some reason. So what could this issue be caused by and how can I fix or workaround it?  Information Update:  I have had a look at  but the only options in the gnome-tweak-tool for Antialiasing are Rgba, None, and Grayscale, but none of them seem to have any affect on the issue. Is there something I'm missing? I've upgraded from 12.04 to 14.04 via command-line when my system froze, had to do REISUB and dpkg --configure -a to recover from crash after rebooting.  Now everything seems to work except automatically mounting external thumb drives and external hard disk drives. After plugging in said drives, they fail to show up on the left pane and remains unmounted. I can see the device if I run lsusb and fdisk though, so it's possibly to manually mount it but I'd rather resolve why it's not automatically mounting. If A and B are correlated with C, why are A and B not necessarily correlated? Half doesn't or half don't? I want to simplify the following:  $\sum_{n=0}^x 1 - (1 - I[a \ne 0] * I[a \ge b]) * (1 - I[b \ne 0] * I[b \ge c]) * (1 - I[c \ne 0] * I[c \ge d]) * (1 - I[d = 0])$ Are all multiplicative functions additive? Embedding DLLs in a compiled executable Is it possible to embed a pre-existing DLL into a compiled C# executable (so that you only have one file to distribute)? If it is possible, how would one go about doing it?  Normally, I'm cool with just leaving the DLLs outside and having the setup program handle everything, but there have been a couple of people at work who have asked me this and I honestly don't know. Is there a "best" way to automatically restart SQL Server on a regular basis? I read that I could create a batch file to net start, net stop the agent and service in a batch file and schedule that, but I was curious if there was a better way of doing this.  Please nevermind how this is indicative of a larger problem of operation, I've been arguing this for a month and we've ended up here.  Thanks :). Why won't Blender run on Windows XP? I downloaded Blender 64 bit and the OS indicated that the program was not compatible with my computer chip. I then downloaded the 32 bit version which seemed to allow me to install. However the blender Icon in windows when pressed informs me that the program is not a window application. I have an Intel(R) Core (TM)2 Duo CPU E7300 @2.66Ghz if that is important and I am running XP. I am fairly sure I am doing something wrong here- can anyone help please?