In a grid based system, where users can build their own walls to create buildings, how do you determine which parts are indoors?
Determine if a set of tiles on a grid forms an enclosed shape
Independence of Gaussian variables Accessing variables from other functions without using global variables I've heard from a variety of places that global variables are inherently nasty and evil, but when doing some non-object oriented Javascript, I can't see how to avoid them. Say I have a function which generates a number using a complex algorithm using random numbers and stuff, but I need to keep using that particular number in some other function which is a callback or something and so can't be part of the same function.   If the originally generated number is a local variable, it won't be accessible from, there. If the functions were object methods, I could make the number a property but they're not and it seems somewhat overcomplicated to change the whole program structure to do this. Is a global variable really so bad? How can we prove that every odd perfect square is congruent to $1$ modulo $8$? I have downloaded tar.gz files. But I don't know how to install it. How do I install this kind of file? How can I disable landscape mode in Android? How can I disable landscape mode for some of the views in my Android app? Should I use UUID as well as ID Casting two cantrips, both modified by metamagic? Can you cast one cantrip, modifying it with "Twinned Spell" (Fire Bolt) to target 2 creatures, and then cast another cantrip as a Bonus Action (Fire Bolt), using "Quickened Spell" to target one of the previous creatures or another creature? Identifying Coordinate System of Shapefile when Unknown? Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have. GPU compute grayed out New line in Sql Query General solution of expected value of E(f(X))? This is maybe a trivial question I came up while solving a few examples and understanding Markov/Chebyshev inequalities and subsequently in evaluating Chernoff bounds. Suppose $X$ is a random variable with some distribution $p$ and we need to evaluate $\mathbb{E}[f(X)]$. Here, $f(X)$ may or may not have the same distribution as $X$. In my case, if $f(X) = e^{sX}$, where $s&gt;0$. I would work out this problem by letting $Z = e^{sX}$ and   $\mathbb{E}[f(X)] = \mathbb{E}[Z] = \int_{\infty}^{\infty}z \hspace{0.2em}p(z)dz$.   Now I find the distribution of $Z$ as: $P\{ Z \leq z \} \implies P\{ e^{sX} \leq z \} \implies P\{ X \leq \frac{\log(z)}{s}\} = \int_{-\infty}^{\frac{\log(z)}{s}}x.p(x)dx $  thereby substituting this into the expectation one gets $\mathbb{E}[Z] = \int_{\infty}^{\infty}z\hspace{0.2em} \left(\int_{-\infty}^{\frac{\log(z)}{s}}x\hspace{0.2em}p(x)dx\right)^{\prime} dz$  According to the Law of Unconscious Statistician , this approximates distribution of $Z$ as $p$. I understand the backward proof through calculus, I don't follow the measure theory approach. For example I don't follow how this works if say $X \sim Gamma$. Is there a source I can read through for someone with no measure theory background? Unable to set DYLD_FALLBACK_LIBRARY_PATH in shell on OSX 10.11.1 In shell scripts used for unit testing with dynamic libraries in a directory other than the typical @rpath, I have previously been able to set DYLD_FALLBACK_LIBRARY_PATH to set the directory containing the libraries. Under 10.11.1, bash seems to ignore attempts to set this environment variable:  $ sh -x testscript.sh + DYLD_FALLBACK_LIBRARY_PATH=/Users/something/testinglibs + export DYLD_FALLBACK_LIBRARY_PATH + exec printenv   and DYLD_FALLBACK_LIBRARY_PATH is not present in printenv's output.  Is this a security-related hack in 10.11's shell? I haven't been able to find this change documented in man pages or online. I have Ubuntu on my laptop. Now I want install Windows 7 in a dual-boot. How can I do this? I can't lose my Ubuntu files, and I'm afraid that I might break . Go  for UEFI only! What happened to Finn's blaster at Maz Kanata's? When entering, we see that Finn has the blaster that was given to him earlier:    However, when the fighting begins, Finn tells Maz that he needs a weapon and no longer has his blaster with him.  It seems unlikely to have been lost in the first shots, given how it is secured across his body.  Also, Han and Chewie didn't lose their weapons and they are arguably less secure.  Now, when the team gets to the Resistance base, Finn again has his blaster:    So where was this blaster during the battle? How do I integrate the following $$\int \frac{dx}{\sin^3 x + \cos^3 x}$$ ?  It appears that I am supposed to break this up into $(\sin x + \cos x)(1-\cos x \sin x)$, but the next thing to do is not apparent to me. Javascript profanity match NOT replace "An SQL Server database schema" or "a SQL Server database schema"? Possible Duplicate:          I got the following sentence from the book I'm reading:     You can take a database-first approach   by first creating a SQL Server   database schema.   From what I learned, I think it should be "an SQL Server database schema", not "a SQL Server database schema". So which one is correct? Bug in Mathematica TeXForm generating \left\left Aborting a shell script if any command returns a non-zero value