I have the following code:   function myFunction(){   var bob = function() { alert("works");     }    }; //document.getElementById("btn").addEventListener('click', bob); //calls the function  }   How do I call the bob function outside the myFunction() ? It works with the btn element, but I want it to be called outside   Thanks !
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.
What does $\mathbb{R} \setminus S$ mean? What does $\mathbb{R}\setminus S$ mean? I am not getting it what it actually means. I have found it manywhere in real-analysis like in the definition of boundary points of a set. Can anyone tell me what it means really? Say if $A$ is an $n \times  n$ matrix, why is it that if $A^{T}A$ is positive definite, the matrix $A$ is then invertible? All I know is $A^{T}A$ gives a symmetric matrix but what does $A^{T}A$ is positive definite tell or imply or hint about the matrix $A$ itself that leads to the fact that it will be invertible? Parsing JSON with Unix tools What was the Historical Precursor for .NET Attributes? What languages or platforms influenced the .NET 1.0 Team to build-in the concept of Attributes from the very start? Was this an Aspect-Oriented thing? Serialization? or something else? I was still in VB6-land at this time, and never used any of the pre-1.0 .NET versions. What counts as an attack? I was looking over the class feature of the 'fiend' patron warlock in 5e. I'm a bit confused on what actions the player needs to take before they can use the 'Hurl Through Hell' ability on an enemy. The PHB states:     Starting at 14th level, when you hit a creature with an attack, you can use this feature to instantly transport the target through the lower planes.   I'm not clear on what an 'attack' means in this context. Does it have to be a physical attack like a sword or crossbow? Do magical attacks like Eldritch Blast that require an attack roll count? What about spells with no attack roll? I'm trying to get past a Snorlax and I need a Poké Flute to wake him up—how do I get one? How can I diagnose and repair missing drive space? I have a small ext3 / partition on a 2T drive which appears to have a discrepancy in its free space. How can I determine what is causing it and how it can be fixed.   After trying everything I could think of, I forced a fsck on boot which didn't have any affect.  I have other systems configured identically which don't exhibit this condition.  # df -h / Filesystem            Size  Used Avail Use% Mounted on /dev/sda1             9.7G  8.9G  318M  97% /  # du -shx --max-depth 1 / 5.2G    /  # lsof | awk 'BEGIN {t=0} /(deleted)/ {t+=$7} END {print t}' 0  # tune4fs -l /dev/sda1 | grep -E 'state|Free|Reserve|size|Inode' Filesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery sparse_super large_file Filesystem state:         clean Inode count:              2621440 Reserved block count:     131029 Free blocks:              212317 Free inodes:              2487281 Block size:               4096 Fragment size:            4096 Reserved GDT blocks:      639 Inodes per group:         32768 Inode blocks per group:   1024 Reserved blocks uid:      0 (user root) Reserved blocks gid:      0 (group root) Inode size:               128   Edit:  fsck says the partition is 2% non-contiguous.  For comparison to du above (sparseness):  # du -hxs --apparent-size / 4.9G    / Have Google index different languages at the same URL instead of just the default (English) I have a multilingual PHP site. I have set English as the default language.  The language changes automatically according to the browser settings. If it is French, the site will be seen in French.  However in the Google search results, even if I have the browser in French, the English language appears in the results. How can I fix that?  To be clear I don't want to use subdomains or URLs like www.example.com/fr/. I would like it to work like Facebook. What is the most appropriate way to configure biblatex for use with an unsupported language? How to implement a tree data-structure in Java? How to stop creating .DS_Store on Mac? In the case of languages with a C-like syntax, we declare the main() method to return an int or float value (or void).  Is it possible to declare a non-void return type from main() in Java?  If not, then why not?  Does this mean that a Java program doesn't return any value to the OS? Add source to figure caption How can I add a source to a figure? I need to add \ref, \cite or just free text. Something like that: \begin{figure} [ht]   \centering   \includegraphics[width=0.95\textwidth]{res/figure.pdf}     \caption{Caption}     \source{\ref{},\cite{} or free Text}   \label{fig:gliederung} \end{figure}  Should give me:  The source shouldn't appear in \listoffigures. Information on month old flights Where can I get flight info for a flight a month ago for an insurance claim? Flight stat sites will only show a weeks worth of data. Upgrade to the latest PHP version in ubuntu 16.04 What Sith Lords were turned to the Light Side? What's the main difference between Intel processor generations? What are the main differences between each processor generation of Intel processors/chipsets? Is there a performance difference?  I've already seen processors from first to sixth generation, however I don't know/understand the exact differences. Conjugacy classes in $A_n$. Suppose $n$ is a non negative integer $\geq 4$ and $\sigma\in S_n$ a permutation. Conjugacy classes in $S_n$ are completley determined by the cycle structure of $\sigma$. If we let the alternating group $A_n$.act on $S_n$ by conjugation, the orbits coincide with the conjugacy classes in $S_n$ except for those (even) permutations whose cycle structure is composed of even cycles (which corresponds to cycles of uneven length) of distinct order (fixed points are treated as cycles of length $1$.) See   For instance a $3$-cycle in $A_4$ has cycle structure $[3,1]$ which fits the bill, and a $5$-cycle in $A_5$ or $A_6$ works too, since the cycle structure is $[5]$ and $[5,1]$ respectively. On the other hand, a $3$-cycle in $A_5$ will does not satisfy the criteria as it has cycle structure $[3,1,1]$ with two fixed points.  In this case, the conjugacy class of $\sigma$ inside $S_n$ splits in $2$ orbits of the conjugation action of $A_n$, and if $\tau$ is any odd permutation, for instance $(12)$, then we have $$\mathrm{Conj}_{S_n}(\sigma)=\mathcal{O}(\sigma)\coprod\mathcal{O}(\tau\sigma\tau^{-1})$$  My question is How can we differentiate between the two orbits? Does it have geometric meaning?    I can see that this information can be useful when looking at representations of the alternating groups, since there are as many irreducible representations as conjugacy classes. As for some geometric interpretation, I ask because there is one for the three cycles in $A_4$. If $S_4$ is understood as the group of symmetries of a regular tetrahedron, then $A_4$ is the subgroup of direct symmetries, and a $3$-cycle corresponds to a rotation of angle $\frac{2\pi}{3}$ or $\frac{4\pi}{3}$ with axis passing through one of the vertices. Conjugacy classes inside $A_n$ preserve the angle, and that's how we can tell them apart. In this case the computations are so simple we don't really need this picture, but I think it is a nice way to understand the fact $3$-cycles in are not all conjugate inside $A_4$... Intuition behind measurable random variables and $\sigma$-algebra I've been trying to understand $\sigma$-algebras and how it encodes information in context of filtration. While certain parts seem clear and logical, I can't say I get the whole picture.  I'll try to explain the counter-intuition I get with the classical example of : the probability space $\Omega = \{ HH, HT, TH, TT \}$ and a r.v. $X(\omega)$ equal to the number of heads.  At times $0$, $1$ and $2$ the available information is represented using $\sigma$-algebras $\mathcal{F}_0=\{\emptyset,\Omega\}$, $\mathcal{F}_1=\{\emptyset, \Omega, \{HH,HT\},\{TH,TT\}\}$ and $\mathcal{F}_2=\{\emptyset, \Omega,\{HH,HT\},\{TH,TT\},\{HH\},\{HT\},\{TH\},\{TT\}\}$.  One can notice that $X(\omega)$ is not measurable with respect to $\mathcal{F}_0$ and $\mathcal{F}_1$, because $X^{-1}((\frac{3}{2}; +\infty))=\{HH\}$. To me it is quite surprising: intuitively $X$ makes perfect sense at all times. In particular it has an expected value at time $0$, which I interpret as that the probability and value of all outcomes $\{\omega\}$ can be computed. How do you think of a non-measurable function?  Here's another way of expressing the same confusion. The most natural choice of $\sigma$-algebra in a finite discrete case is $\mathcal{F}=2^\Omega$, and it is implicitly used in all elementary probability problems. However, this choice of $\mathcal{F}$ does not reflect the fact that some information is known or unknown, conditional probability does. Does it mean that the statement "$\sigma$-algebra is known information" make sense only in conditioning? Why is it convenient then? It is well known that $\sqrt{2}$ is irrational, and by modifying the proof (replacing 'even' with 'divisible by $3$'), one can prove that $\sqrt{3}$ is irrational, as well.  On the other hand, clearly $\sqrt{n^2} = n$ for any positive integer $n$.  It seems that any positive integer has a square root that is either an integer or irrational number.        How do we prove that if $a \in  \mathbb N$, then $\sqrt a$ is an integer or an irrational number?      I also notice that I can modify the proof that $\sqrt{2}$ is irrational to prove that $\sqrt[3]{2}, \sqrt[4]{2}, \cdots$ are all irrational.  This suggests we can extend the previous result to other radicals.        Can we extend 1? That is, can we show that for any $a, b \in \mathbb{N}$, $a^{1/b}$ is either an integer or irrational?