Ajax redirect not performed
How to manage a redirect request after a jQuery Ajax call
Enumerate or list all variables in a program of [your favorite language here] A friend asked me last week how to enumerate or list all variables within a program/function/etc. for the purposes of debugging (essentially getting a snapshot of everything so you can see what variables are set to, or if they are set at all). I looked around a bit and found a relatively good way for Python:   #!/usr/bin/python                                                                                                                                                                                                                            foo1 = "Hello world" foo2 = "bar" foo3 = {"1":"a",         "2":"b"} foo4 = "1+1"  for name in dir():     myvalue = eval(name)     print name, "is", type(name), "and is equal to ", myvalue   which will output something like:   __builtins__ is &lt;type 'str'&gt; and is equal to  &lt;module '__builtin__' (built-in)&gt; __doc__ is &lt;type 'str'&gt; and is equal to  None __file__ is &lt;type 'str'&gt; and is equal to  ./foo.py __name__ is &lt;type 'str'&gt; and is equal to  __main__ foo1 is &lt;type 'str'&gt; and is equal to  Hello world foo2 is &lt;type 'str'&gt; and is equal to  bar foo3 is &lt;type 'str'&gt; and is equal to  {'1': 'a', '2': 'b'} foo4 is &lt;type 'str'&gt; and is equal to  1+1   I have so far found a partial way in PHP (courtesy of ) but it only lists all variables and their types, not the contents:   &lt;?php // create a few variables $bar = 'foo'; $foo ='bar'; // create a new array object $arrayObj = new ArrayObject(get_defined_vars()); // loop over the array object and echo variables and values for($iterator = $arrayObj-&gt;getIterator(); $iterator-&gt;valid(); $iterator-&gt;next())         {         echo $iterator-&gt;key() . ' =&gt; ' . $iterator-&gt;current() . '&lt;br /&gt;';         } ?&gt;   So I put it to you: how do you list all variables and their contents in your favorite language?    Edit by : I propose this question follows the spirit of a little "". If you do not agree, just edit and remove the tag and the link. Why do metals only glow red, yellow and white and not through the full range of the spectrum? A characterisation of quadratic extensions contained in cyclic extensions of degree 4 Let $D$ be a squarefree integer. I am trying to prove that $\mathbb Q[\sqrt D]$ is contained in a Galois extension of $\mathbb Q$ with Galois group $\mathbb Z/4$ if and only if $D$ is the sum of two squares, $D = a^2 + b^2$ with $a,b\in \mathbb Q$.   The hint in the exercise in Dummit and Foote suggests considering the extension $\mathbb Q[\sqrt{s + s\sqrt D}]$ for the forward direction. However, I am unsure how to show that this extension is Galois, much less that its Galois group is cyclic of order 4.   For the reverse direction, I expressed the given Galois extension as $\mathbb Q[\sqrt{a+b\sqrt D}]$ for some $a,b\in \mathbb Q$. I showed that this extension has $\mathbb Q[\sqrt{c^2 - d^2 D}]$ as a subfield for some $c,d \in \mathbb Q$. From this, I deduced that the $\sqrt D$ and $\sqrt{c^2 - d^2 D}$ generate the same extension, so $\sqrt D = x \sqrt{c^2 - d^2 D}$ for some $x$, and hence that $D = \frac{x^2 c^2}{1 + x^2 d^2} $. It seems that there should be a way to decompose this as a sum of two squares, but I did not see how.   I did not tag this as homework as I am studying it independently. Find $F$-related vector fields on $M\times N$, where $F(x)=(x, f(x))$ I am reading Lee's book on Differential geometry. In Chapter 4, Lee has this exercise.  Let $M$, $N$ be smooth manifolds, and let $f:M\to N$ be a smooth map. Define $F : M\to M \times N$ by $F(x) = (x, f(x) )$. Show that for every smooth vector field $V$ of $M$ , there is a smooth vector field on $W$ on $M \times N$ that is $F$-related to $V$.  I can understand that we must have $W_{(x,f(x))}=V_x\oplus Df(x)V_p$ for all $x\in M.$ The set $\{(x,f(x)):x\in M\}$ is a closed set in $M\times N.$ Therefore, if we can show that for all $(p,f(p))\in M\times N$ there is a neighbourhood $U_p$ and a smooth vector field on $U_p$ extending $V_x\oplus Df(x)V_x$ we are done by partition of unity. But I cannot show that. Can someone help me out? If anonymity is so important, why is it not universal? A frequent argument brought up in support of voting anonymity is that it can lead to potential grudges. Certainly the review system is of the same nature.  I cannot wrap my mind around the fact that voting is anonymous and reviewing is not. Either both should be public--and this would be fine since public reviewing has been successful--or both should be anonymous--and I assume this would be the desired option since this community holds anonymity so dear.  One could say that voting rates the posts, the actual meat of the site, while reviewing is based on clarifying the purpose of the site and cleaning it up.   answer makes the point that the community can trust that votes are a good measure of quality for the very reason that they do not know who cast them; the mentality that a high-ranking member may have supported something could blur the line between "science" and "politics/religion."  Reviewing, then, can be seen as a judgment of specific members rather than quality of edit/questions, which seems to fall precisely under the "politics/religion" umbrella--the review system is much more vulnerable to grudges due to this.  So let's discuss the differences and the implications of these disjointed anonymity policies. Recently I paid a lot (almost one month of my salary) for repairing my car. I am wondering if there is a way to get deduction on federal or state taxes (USA, California). Why Process Builder doesn't work on Delete Scenario? Seeking podcasts related to geospatial technologies? I would like to make a list of podcasts related to geospatial technologies.  Do you listen to any that you find interesting and informative? What does ':' (colon) do in JavaScript? I'm learning JavaScript and while browsing through the jQuery library I see : (colon) being used a lot. What is this used for in JavaScript?   // Return an array of filtered elements (r) // and the modified expression string (t)    return { r: r, t: t }; Html Textarea elements only wrap when they reach a space or tab character. This is fine, until the user types a looooooooooooooooooooooong enough word. I'm looking for a way to strictly enforce line breaks (eg.: even if it results in "loooooooooooo \n ooooooooooong").    The best I've found is to add a zero-width unicode space after every letter, but this breaks copy and paste operations. Anyone know of a better way?  Note: I'm referring to the "textarea" element here (i.e.: the one that behaves similarly to a text input) - not just a plain old block of text. How can the following inequation be proven?  $$a^2 + b^2 + c^2 \ge ab + bc + ca$$ Google Mobile Friendly test shows "other error" for resource loads I get the error "Couldn't load 23 page resources" when doing the mobile friendly test at     However, the error message is (the rather unfriendly) "Other error."  When I visit the site in Chrome using Developer Tools and setting the device toolbar to "Responsive," it works fine with no errors, and when I go the Google Search Console and do Crawl->Fetch As Google, I get no errors. sort() and reverse() functions do not work Make grub keep its default boot under kernel updates I dual-boot my machine and I want it to default to boot into windows so that whenever I restart the machine remotely from my home it will be able to get back into Windows (instead of Ubuntu).  The problem is that every time Ubuntu upgrades the kernel, I have to reset the default boot item of grub back to windows. This is because the grub menu loader uses positions i.e. 6 for default OS to boot. And when Ubuntu installs a new kernel it changes that order.  I am looking for a way to configure grub to remember its default boot item under kernel updates. Group of even order contains an element of order 2 I am working on the following problem from group theory:     If $G$ is a group of order $2n$, show that the number of elements of $G$ of order $2$ is odd.   That is, for some integer $k$, there are $2k+1$ elements $a$ such that $a \in G,\;\; a*a = e$, where $e$ is the identity element of $G$. Installing Ubuntu on one of two hard drives Proving $\sum_{k=0}^n\binom{2n}{2k} = 2^{2n-1}$ I'm undergraduate student of mathematics.  I need to prove: $$\sum_{k=0}^{n} \binom{2n}{2k}= 2^{2n-1}$$ Can you please help me I have a hierarchical category tree and checkboxes next to each item that allow to enable/disable the correpsonding category.    I assume it is an expected default behavior that all subategories of natural environment become checked when I check the natural environment category. But what about unchecking it again: Should this automatically uncheck all subcategories or restore the previous state in case some were checked already?  Furthermore... Should unchecking one of the subcategories cause the parent category to become unchecked? Start Mathematica without the menu bar? Riddle (simple arithmetic problem/illusion) I'm not sure how well known this "riddle" is but here it goes.  3 people go to a restaurant, each buy food worth 10.00.  When they're done, they give 30.00 to the waitress.  She gives the money to the manager, manager says they paid too much, gives 5.00 back to the waitress.  She comes back to the table, gives a dollar back to each person and then puts the remaining 2.00 in her pocket for tip.  So now, each person has paid 9.00.  9.00 x 3 = 27.00.  Plus the 2.00 in the waitresses pocket is 29.00.  What happened to the 30th dollar?  So what's the issue with this way of calculating (since if you backward it works fine), that doesn't give us the correct result?