jQuery click to hide fix
hide div if clicked outside of it
Algorithm to detect intersection of two rectangles? I'm looking for an algorithm to detect if two rectangles intersect (one at an arbitrary angle, the other with only vertical/horizontal lines).  Testing if a corner of one is in the other ALMOST works.  It fails if the rectangles form a cross-like shape.  It seems like a good idea to avoid using slopes of the lines, which would require special cases for vertical lines. (mód 1) is not copied correctly Please consider the following MWE:  \documentclass{article} \usepackage[spanish]{babel} \selectlanguage{spanish} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \begin{document} Works: áéà  Does not work: \(\pmod1\) \end{document}   The áéà text is copied correctly, but if I try to copy (mód 1) it says: (m´od 1).  Does anyone know why this happens? How is it solved?  Thanks! Why did this edit get attributed to the community user? It seems that  by the OP of  was attributed to the community user.   I'm assuming that the edit was by the OP from the edit summary:     updated my question   and from the actual update. Both texts are speaking in the first person. Using k-fold cross-validation for time-series model selection Question: I want to be sure of something, is the use of k-fold cross-validation with time series is straightforward, or does one need to pay special attention before using it?   Background: I'm modeling a time series of 6 year (with semi-markov chain), with a data sample every 5 min. To compare several models, I'm using a 6-fold cross-validation by separating the data in 6 year, so my training sets (to calculate the parameters) have a length of 5 years, and the test sets have a length of 1 year. I'm not taking into account the time order, so my different sets are :   fold 1 : training [1 2 3 4 5], test [6] fold 2 : training [1 2 3 4 6], test [5] fold 3 : training [1 2 3 5 6], test [4] fold 4 : training [1 2 4 5 6], test [3] fold 5 : training [1 3 4 5 6], test [2] fold 6 : training [2 3 4 5 6], test [1].   I'm making the hypothesis that each year are independent from each other. How can I verify that? Is there any reference showing the applicability of k-fold cross-validation with time series. Homology of $S^1 \times (S^1 \vee S^1)$ I'm trying to solve question 2.2.9(b) in Hatcher's Algebraic Topology.   Question: Calculate the homology groups of $X=S^1 \times (S^1 \vee S^1)$.  My attempt: I try to use the Mayer-Vietoris sequence.   Let $A=S^1 \times (S^1 \vee \text{small bit}) =S^1\times S^1$ and $B=S^1 \times ( \text{small bit} \vee S^1)=S^1 \times S^1$. (Unsure how to express this, but hopefully this is clear enough.)   Then $A\cap B=S^1\times \{\text{point}\}=S^1$ and $A\cup B=X$.  The Mayer-Vietoris sequence then gives us an exact sequence in reduced homology as follows:  $$0 \to \mathbb{Z}^2 \to \tilde{H}_2(X) \to \mathbb{Z} \to \mathbb{Z}^2 \to \tilde{H}_1(X) \to 0.$$  Is it possible from this exact sequence to determine the homology groups, in some algebraic fashion? Or do I need to determine what the maps are? How do I determine the maps? $E|X-m|$ is minimised at $m$=median For a continuous random variable $X$, I want to show that $E|X-m|$ is minimum implies $m$ is the median of the distribution. Assume that the distribution function is $F$ and the density function is $f$.  In this case, we basically need to minimize  $$\int_x |x-m|f(x)\,dx=\int_{x&gt;m}(x-m)f(x)\,dx+\int_{x&lt;m}(m-x)f(x)\,dx.$$  I am finally being left with $2mF(m)-m+E(X)-2\int_{x&lt;m}xf(x)\,dx$. What does it mean to minimise this expression? Is there some way out?  Well, my intuition says that since I have to prove that $F(m)=0.5$, I somehow will need to show that $E|X-m|$ is minimised if $2mF(m)-m=0$ (as then I will get $F(m)=0.5$ How do I install software using the Ubuntu Software Center? The title says it all. I'd like to know how I can install software - an example is the Chromium web browser. Software to read a QR code? I saw a  reading a book, but I don't have a smart phone to check it.    So I just took a picture of it and saved my PC. And I downloaded libdecoderqr0, libdecodeqr-dev, libdecodeqr-examples for reading it. But I don't know how to use it.    What do I do next, or is there a nicer way to read QR codes? How to fix slow wireless on machines with Intel wireless cards? Mathematical notation around the world How to boot WUBI installed Ubuntu within Windows 8? Is it possible to retrieve a previous un-evaluated, un-normalized input? Verb/Subject Agreement Make/Makes On the  it is mentioned that it is not a Cayley graph.    How it this proved? Honestly I don't even know how to start this. The only criteria I can think of is that all vertices must have the same degree. Also the degree being odd should imply that one generator of the group has order 2. But then how do I proceed?  Edit: As already mentioned in the comments, the link did not answer my question. Is the comma usage proper in this sentence? Controlling bandwith while using GPRS on Windows 7 I have an issue with my windows 7 machine using a lot of bandwith while connected to the internet. I'm trying to limit the bandwith by using Opera in Turbo mode, but some other program is sucking down content and emptying my GPRS mobile plan.   Is there some way I can control which applications are allowed to use bandwith while on GPRS? Preferable only Opera should be able to use the network.   Thanks. Python: [Errno 2] No such file or directory: 'lines.txt' Aliased edge around light source in cycles Often when a mesh light is visible in the camera, the edges are not anti-aliased.  No matter how many samples I do, the lamp border always looks jagged and pixelated.  Is this a rendering error? How can I get around this issue?    And zoomed in 4x: Implications and Ordinary language It's not difficult to show that  $$(1-z^2)^{-1/2}=\sum_{n=0}^\infty \binom{2n}{n}2^{-2n}z^{2n}$$  On the other hand, we have $(1-z^2)^{-1}=\sum z^{2n}$.  Squaring the first power series and comparing terms gives us  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}2^{-2n}=1$$  that is,  $$\sum_{k=0}^n \binom{2k}{k}\binom{2(n-k)}{n-k}=2^{2n}$$  My question: is there a more direct, combinatorial proof of this identity?  I've been racking my brains trying to come up with one but I'm not having much success.