Assignment in onMapReady() not working after method ends
What is a NullPointerException, and how do I fix it?
How to "add existing frameworks" in Xcode 4? How do I suppress error messages from cp? How does matter know to obey physical laws? First of all, you may say that, this is a "why" question and in physics we don't ask such a question and instead we ask about "how". However, I want to discuss this with you.  We model the behavior of matter by physical laws, for example by quantum mechanics laws. I want to know how the matter, say electron, knows that it must obey such a law. What forces the electron to obey quantum mechanics laws?  If you consider a simulation of the universe in a computer, in the view of someone  simulated in that computer the physical laws are just there. They may not know what keeps  in check the simulated matter to obey physical laws, but in our perspective those simulated physical laws are there because we implemented them as zero and ones in a hard disk. If we wanted, we could change those physical laws and in the eye of the simulated person everything would be still fine.  Is there a scientific attempt to discuss this issue? so that I can read about it. Number of integer solutions of $x^2 + y^2 = k$ I'm looking for some help disproving an answer provided on a  I posted about computing the number of double square combinations for a given integer.    The original question is from the Facebook Hacker Cup       Source: Facebook Hacker Cup   Qualification Round 2011      A double-square number is an integer $X$   which can be expressed as the sum of   two perfect squares. For example, 10   is a double-square because $10 = 3^2 + 1^2$.   Given $X$, how can we determine the   number of ways in which it can be   written as the sum of two squares? For   example, $10$ can only be written as $3^2 + 1^2$   (we don't count $1^2 + 3^2$ as being different). On the other hand,   $25$ can be written as $5^2 + 0^2$ or as   $4^2 + 3^2$.      You need to solve this problem for $0 \leq X \leq 2,147,483,647$.      Examples:      $10 \Rightarrow 1$      $25 \Rightarrow 2$      $3 \Rightarrow 0$      $0 \Rightarrow 1$      $1 \Rightarrow 1$   In response to my original question about optimizing this for F#, I got the following response which I'm unable to confirm solves the given problem correctly.       Source:       Again, the number of integer solutions   of $x^2 + y^2 = k$ is four times the   number of prime divisors of $k$ which   are equal to $1 \bmod 4$.      Knowing this, writing a program which   gives the number of solutions is easy:   compute prime numbers up to $46341$ once   and for all.      Given $k$, compute the prime divisors of   $k$ by using the above list (test up to   $\sqrt{k}$). Count the ones which are   equal to $1 \bmod 4$, and sum. Multiply   answer by $4$.   When I go through this algorithm for $25$, I get $8$ which is not correct.          For each prime factor (pf) of $25$ ($5$, $5$ are prime factors of $25$)         if pf % $4$ = $1$ (true for both $5$'s), add $1$ to count      return $4$ * count (count would be $2$ here).          So for $25$, this would be $8$ Iterating each character in a string using Python In C++, I can iterate over an std::string like this:  std::string str = "Hello World!";  for (int i = 0; i &lt; str.length(); ++i) {     std::cout &lt;&lt; str[i] &lt;&lt; std::endl; }   How do I iterate over a string in Python? Jquery Validation for dynamically added rows that has multiple element with same name Evil thoughts without actions? Examples of bijective map from $\mathbb{R}^3\rightarrow \mathbb{R}$ Could any one give an example of a bijective map from $\mathbb{R}^3\rightarrow \mathbb{R}$?  Thank you. On , there are download options for only certain logos/icons. Shouldn't this include all the graduated sites logos/icons? I think it should. save as a video as .mp4 So I made an intro using animation and it saves it as a .blend and I want it so save as a video like .mp4 or something like that. I've tried changing the codec because I tried opening the intro with windows media instead of blend. I didn't try all the codec's but I tried some of them. Basis of the null space Find the basis of the null space for the matrix  $$D = \begin{bmatrix}0 &amp; 0 &amp; 0 &amp; 0\\0 &amp; 1 &amp; 1 &amp; 0\\1 &amp; 1 &amp; 0 &amp; 0\\1 &amp;1 &amp; 0 &amp; 0\end{bmatrix}.$$  I computed the solution by letting eigenvectors $(x,y,z,w)$ such that $y+z=0,x+y=0$, and I got a basis vector $\{(1,-1,1,0), (0,0,0,1)\}$ . But from one textbook  I have found the solution as $\{(1,0,0,0),(0,0,1,1)\}$. May I made a mistake? Thanks! Connect Tikz nodes via two parallel arrows I am just starting to learn using Tikz and am a little lost within its seemingly infinite amount of options and possibilities.  What I am trying to do is visualize a few Matlab function interaction (which one calls which one, what is the in- and output). Since there are only about six subroutines, I place each one manually as a node. This is an example:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{shapes,positioning}  \begin{document}  \begin{tikzpicture}[auto] \node           [rounded rectangle,draw]        (node1)     {Node 1}; \coordinate [above=of node1]                                (input); \node           [rounded rectangle,draw]    at  (-10:6cm) (node2)       {Node 2}; \draw           [-&gt;,very thick]             ([xshift=0.1cm]  input.south)  --                  node {right}                ([xshift=0.1cm]  node1.north); \draw           [-&gt;,very thick]             ([xshift=-0.1cm] node1.north) --                  node {left}                 ([xshift=-0.1cm] input.south); \draw                                            (node1) -- (node2);  \end{tikzpicture}  \end{document}     Now I would like to apply these double in/out arrows I (probably pretty awkwardly) created using xshift to all node connections, so in this example also for the connection between Node 1 and Node 2. Ideally, the space between these two arrows would be the same, independant of their angle and they would nicely connect to the outer line of the nodes. Any idea how I could achieve this? Similar questions I have found only used rectangle and orthogonal lines. What lens characteristics are important in star photography? In optimal world I would buy a lens that is good in every way. But I'm on a budget and have to find a balance in quality and price. I'm looking for a lens for star photography, so in my case it will be a wide angle lens with good characteristics for capturing points of light in a dark sky. What would those characteristics be?  So far I've learned about , which seems like a thing to note when comparing different lenses for star photography. It would be quite disappointing if stars turned into long teardrops on the edges of a photograph even when every precaution was taken to make all stars sharp round points of light.  Vignetting would be an example of lens characteristic not so important in this use.  Many characteristics of a lens turn better when aperture is slightly stopped down, but I suppose I'd be wanting to use a lens with wide open aperture when trying to capture the stars in a dark night sky.  I'm not asking for lens recommendations. But, as an example of what kind of lenses I've been looking at, I name  manual focus lens. Its price level is $350'ish in Amazon and seems to run with name Rokinon too. It seems to be reasonably sharp even when wide open - my camera is an APS-C sensor camera. I am auditing a Linear Algebra class, and today we were taught about the rank of a matrix. The definition was given from the row point of view:      "The rank of a matrix A is the number   of non-zero rows in the reduced   row-echelon form of A".   The lecturer then explained that if the matrix $A$ has size $m  \times n$, then $rank(A) \leq m$ and $rank(A) \leq n$.   The way I had been taught about rank was that it was the smallest of    the number of rows bringing new information the number of columns bringing new information.    I don't see how that would change if we transposed the matrix, so I said in the lecture:  "then the rank of a matrix is the same of its transpose, right?"   And the lecturer said:   "oh, not so fast! Hang on, I have to think about it".   As the class has about 100 students and the lecturer was just substituting for the "normal" lecturer, he was probably a bit nervous, so he just went on with the lecture.  I have tested "my theory" with one matrix and it works, but even if I tried with 100 matrices and it worked, I wouldn't have proven that it always works because there might be a case where it doesn't.  So my question is first whether I am right, that is, whether the rank of a matrix is the same as the rank of its transpose, and second, if that is true, how can I prove it?  Thanks  :) This question is regarding the minecraft Beta 1.8 prerelease -- I have a beautiful house in single player survival which I'd like to record while flying.  I want to be able to change the game mode of my survival map to creative to be able to fly through it without installing a mod. I know it is possible if you run the map on a multiplayer server via the command /gamemode &lt;user&gt; 0|1 but I want to achieve this in single player :)  I think this would be possible through editing your level.dat file as I think that's where the game mode for the map is stored. Let's say I have Windows installed on drive C, however I install all of my programs on the D drive, and I keep my user profile on the D drive as well (things like My Documents). How can I have Windows use those folders instead of the ones on the C drive? I'm trying to compute the shadow of 3D objects on the ground. To do this I'm assuming parallel rays from Sun origin.   Let's assume the Sun direction is given by azimuth $\varphi$ and elevation $\theta$ angles. So the direction unit vector is retrieved as:  $$ \hat{\mathbf{s}} = \mathbf{R}_y\left(\theta\right)\mathbf{R}_z\left(\varphi\right)\hat{\boldsymbol{\imath}}$$  where $\mathbf{R}_{x/y/z}$ are the rotation matrices along the $x, y, z$ axes given by, for example, Euler-Rodrigues equation, and $\hat{\boldsymbol{\imath}}$ is the unit vector along $x$-axis.  A point on a ray-line has the equation:  \begin{equation} \mathbf{r} = \mathbf{r}_p + \lambda\hat{\mathbf{s}}  \tag{1} \end{equation}  being $\mathbf{r}_p$ a point on that line.  A point on a general plane is given by the equation:  \begin{equation} \left(\mathbf{r} - \mathbf{r_0}\right)\cdot \hat{\mathbf{n}} = 0 \tag{2} \end{equation}  being $\mathbf{r}_0$ a point on the plane and $\hat{\mathbf{n}}$ the unit vector normal to that plane.   Ensuring the validity of both equations (1) and (2) allows to compute the $\lambda$ multiplier and retrieve the position vector of the projected point (writing $\tilde{\mathbf{r}} = \mathbf{r_p} - \mathbf{r_o}$)  \begin{gather} \lambda = - \left(\frac{\tilde{\mathbf{r}}\cdot \hat{\mathbf{n}}} {\hat{\mathbf{s}}\cdot\hat{\mathbf{n}}}\right) \\ \mathbf{r}_\text{proj} = \mathbf{r}_p - \left(\frac{\tilde{\mathbf{r}}\cdot \hat{\mathbf{n}}} {\hat{\mathbf{s}}\cdot\hat{\mathbf{n}}}\right)\hat{\mathbf{s}} \tag{3} \end{gather}  Applying eq. (3) to all the vertices of a mesh $\left\{\mathbf{r}_{p_i}\right\}$ .   A problem can be noted: $\hat{\mathbf{s}}\cdot \hat{\mathbf{n}}$ can be zero (e.g. Sun is horizontal, i.e. the ray is ortogonal to the normal of plane).   Are there some conceptual mistakes in my reasoning? Is there a way to rewrite the operation as a linear operator applied to the set of vertices position vectors?   $$ \left[\mathbf{A}\right]\left\{\mathbf{r}_{p_i}\right\} = \mathbf{r}_\text{proj}$$ Filter dict to contain only certain keys? Stop asking me if Community auto-flags were helpful Electron Flow Confusion Using conventional notation in the diagram below, I understand that the circuit is not complete because the diode is in reverse bias. But knowing that the electrons actually flow from the negative to the positive terminal(direction of the arrows), wouldn't the electrons take a path from the negative terminal of the battery, go through the lamp and stop at the diode(the red path in the picture). If they would, then why doesn't the lamp light up with the first electrons that are able to flow through it before the voltage in the wire is built up and the current stops.