I have an stored procedure in MySQL Database that execute a query like &quot;SELECT * FROM table&quot; and return this rows.  I want to create a JSON with this information, how can i do that? This is my code: Main &lt;?php   include &quot;config.php&quot;;  include &quot;utils.php&quot;;   $dbConn =  connect($db);   if ($_SERVER['REQUEST_METHOD'] == 'GET'){     $sth = $dbConn-&gt;prepare(&quot;CALL consulta_administrador()&quot;);    $sth-&gt;execute();     $result = $sth-&gt;fetchAll();    var_dump($result);    echo json_encode($result); }  ?&gt;  config.php &lt;?php    $db = [   'host' =&gt; 'myDBHost',   'username' =&gt; 'myUsername',   'password' =&gt; 'myPassword',   'db' =&gt; 'myDB'    ];  ?&gt;  utils.php &lt;?php  function connect($db) {   try {       $conn = new PDO(&quot;mysql:host={$db['host']};dbname={$db['db']}&quot;, $db['username'], $db['password']);       $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);              return $conn;   } catch (PDOException $exception) {       echo &quot;Error:&quot; , $exception-&gt;getMessage(), '&lt;br&gt;';       die();   } } ?&gt;
I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.
When playing with the complete elliptic integral of the first kind and its Fourier-Legendre expansion, I discovered that a consequence of $\sum_{n\geq 0}\binom{2n}{n}^2\frac{1}{16^n(4n+1)}=\frac{1}{16\pi^2}\,\Gamma\left(\frac{1}{4}\right)^4 $ is:     $$\int_{0}^{1}\frac{\arctan x}{\sqrt{x(1-x^2)}}\,dx = \tfrac{1}{32}\sqrt{2\pi}\,\Gamma\left(\tfrac{1}{4}\right)^2\tag{A}$$   which might be regarded as a sort of Ahmed's integral under steroids.  I already have a proof of this statement (through Fourier-Legendre expansions), but I would be happy to see a more direct and elementary proof of it, also because it might have some consequences about the moments of $K(x)$ of the form $\int_{0}^{1}K(x)\,x^{m\pm 1/4}\,dx$, which are associated with peculiar hypergeometric functions. Prove that $\mathbb{N}^k$ is countable for every $k \in \mathbb{N}$.  I am told that we can go about this inductively.   Let $P(n)$ be the statement: “$\mathbb{N}^n$ is countable” $\forall n \in \mathbb{N}$.  Base Case: $\mathbb{N}^1 = \mathbb{N}$ is countable by definition, so $\checkmark$  Inductive Step: $\mathbb{N}^{k+1}$ $“=”$ $\mathbb{N}^k \times \mathbb{N}$  We know that $(A,B)$ countable $\implies$ $A \times B$ is countable. I am stuck on the part where I have to prove the rest, but I know that, for example, $(1,2,7) \in \mathbb{N}^3 \notin \mathbb{N}^2 \times \mathbb{N}$ but instead $((1,2),7) \in \mathbb{N}^2 \times \mathbb{N}$. So how would I go about proving the statement. In how many ways can we choose $r$ numbers from $\{1,2,3,...,n\}$,   In a way where we have no consecutive numbers in the set? (like $1,2$) Why is $(2, 1+\sqrt{-5})$ not principal? Why is $(2, 1+\sqrt{-5})$ not principal in $\mathbb{Z}[\sqrt{-5}]$?   Say $(2,1+\sqrt{-5})=(\alpha)$, then since $2\in(2,1+\sqrt{-5})$ we have $2\in (\alpha)$, so $\alpha\mid2$ in $\mathbb Z[\sqrt{-5}]$. Writing $2=\alpha\beta$ in $\mathbb Z[\sqrt{-5}]$ and taking norms, $4=N(\alpha)N(\beta)$ in $\mathbb Z$, so $N(\alpha)\mid4$ in $\mathbb Z$. Similarly, since $\sqrt{-5}\in(\alpha)$ we get $N(\alpha)\mid5$, thus $N(\alpha)$ is a common divisor of $4$ and $5$, therefore $N(\alpha)=(1)$, so $\alpha$ is a unit. But that means $1\in (2,1+\sqrt{-5})=(\alpha)$, so it must be the whole ring, but it cannot to reach a contradiction, so how can I find an element, which is not in $(2, 1+\sqrt{-5})$.  Or is there a simpler method ? (Maybe not UFD would imply not PID) What is the time span of The Last Jedi? What would be the value of $\sum\limits_{n=0}^\infty \frac{1}{an^2+bn+c}$ I would like to evaluate the sum  $$\sum_{n=0}^\infty \frac{1}{an^2+bn+c}$$  Here is my attempt:    Letting    $$f(z)=\frac{1}{az^2+bz+c}$$  The poles of $f(z)$ are located at   $$z_0 = \frac{-b+\sqrt{b^2-4ac}}{2a}$$  and  $$z_1 = \frac{-b-\sqrt{b^2-4ac}}{2a}$$  Then  $$ b_0=\operatorname*{Res}_{z=z_0}\,\pi \cot (\pi z)f(z)= \lim_{z \to z_0} \frac{(z-z_0)\pi\cot (\pi z)}{az^2+bz+c}= \lim_{z \to z_0} \frac{\pi\cot (\pi z)+(z_0-z)\pi^2\csc^2 (\pi z)}{2az+b} $$  Using L'Hopital's rule. Continuing, we have the limit is  $$ \lim_{z \to z_0} \frac{\pi\cot (\pi z)+(z_0-z)\pi^2\csc^2 (\pi z)}{2az+b}= \frac{\pi\cot (\pi z_0)}{2az_0+b} $$  For $z_0 \ne 0$  Similarly, we find  $$b_1=\operatorname*{Res}_{z=z_1}\,\pi \cot (\pi z)f(z)=\frac{\pi\cot (\pi z_1)}{2az_1+b}$$  Then   $$\sum_{n=-\infty}^\infty \frac{1}{an^2+bn+c} = -(b_0+b_1)=\\ -\pi\left( \frac{\cot (\pi z_0)}{2az_0+b} + \frac{\cot (\pi z_1)}{2az_1+b}\right)=  -\pi\left( \frac{\cot (\pi z_0)}{\sqrt{b^2-4ac}} + \frac{\cot (\pi z_1)}{-\sqrt{b^2-4ac}}\right)= \frac{-\pi(\cot (\pi z_0)-\cot (\pi z_1))}{\sqrt{b^2-4ac}}= \frac{\pi(\cot (\pi z_1)-\cot (\pi z_0))}{\sqrt{b^2-4ac}} $$  Then we have  $$\sum_{n=0}^\infty \frac{1}{an^2+bn+c} = \frac{\pi(\cot (\pi z_1)-\cot (\pi z_0))}{2\sqrt{b^2-4ac}}$$    Is this correct?  I feel like I made a mistake somewhere.  Could someone correct me?  Is there an easier way to evaluate this sum? Can I get a \widebar without using the mathabx package? One can use \bar to put a bar over a letter in math mode, but often the bar isn't wide enough. An alternative is \overline, but this isn't an accent, so it doesn't take into account the skew of the letter. In the following example, the bar extends too far to the left:    Now the mathabx package offers a \widebar accent, but this has several drawbacks:   mathabx changes a lot of other things, The \widebar sits slightly higher than \bar and \overline, In previewers (checked with kpdf and acroread), the \widebar appears fuzzy, which \bar and \overline don't.   So my question is: How can I put a wide bar over a letter in math mode without the above drawbacks? Brie Cheese and expiration date I have a Brie Cheese that has not been opened. It shows an expiration date that is 6 weeks ago. Is it still safe to eat? I have a fraction with sums above and under the line. How can I convince LaTeX to write the indices of the sums under the sigma instead of next to it?  \begin{displaymath}   \frac{\sum_{s \in S} s^2}{\sum_{p \in P} p^2} \end{displaymath} How do I efficiently compute $a^b\bmod c$:  When $b$ is huge, for instance $5^{844325}\bmod 21$? When $b$ is less than $c$ but it would still be a lot of work to multiply $a$ by itself $b$ times, for instance $5^{69}\bmod 101$? When $(a,c)\ne1$, for instance $6^{103}\bmod 14$?  Are there any other tricks for evaluating exponents in modular arithmetic?  This is being asked in an effort to cut down on duplicates, see  and . Why normal acceleration doesn't bring a change in speed? Suppose There's a particle of mass m moving with speed $v_{0}$, at certain moment a force starts acting on it (centripetal force) and it start uniform circular motion  Now every other reference states that centripetal force only brings about change only in direction  But plugging-in things in the equations paint a different picture  suppose  normal/centripetal acceleration = $A$  then $|v| = \sqrt{v_{0}^2+\frac{(A t)^2}{1}}$  we can certainly see that factor of $t$ will bring change in magnitude of velocity   Secondly, why the velocity is always tangential to the circle, but how can we mathematically show such? Intuitively for me if there's constant acceleration toward a certain then at some point of time, the body should 'slack' and fall toward the direction of acceleration   Here' a picture for a reference: Blog showing up as mobile, won't exit Zooming to selection in arcpy.mapping and only seeing selected features? I selected data by using select layer by attribute, then I need to only select these selection and zoom in to the selection.  my code is this, it can zoom in base on the scale I set, but I see other adjacent polygon that has other Code_No, why?  Layer = arcpy.mapping.ListLayers(mxd, "lyr", df)        arcpy.SelectLayerByAttribute_management(lyr, "NEW_SELECTION", "Code_NO = '%s'"%mycodeNo)            df.extent = lyrLayer1.getSelectedExtent() df.scale *= 2 How can I create and extract zip archives from the command line? From the Immediate Window in Visual Studio:   &gt; Path.Combine(@"C:\x", "y") "C:\\x\\y" &gt; Path.Combine(@"C:\x", @"\y") "\\y"   It seems that they should both be the same.    The old FileSystemObject.BuildPath() didn't work this way... Who are the Steam Mascots? So with the Steam Summer Sale in full swing, I've finally taken notice of the Steam Mascots.  Judging by the latest background, the black one, at least, has a name: Cyl.  Do the other two have names as well? Are there only these three?   What's their story? I ran dolphin like this:  dolphin . &amp;   I see messages in the console like these:  QPixmap::scaled: Pixmap is a null pixmap   How can I keep the console clean or silent? SQL comma-separated row with Group By clause If you shine a light away from the center of a Schwarzchild black hole, will it stay still? $$ A $$  Light is travelling away from the absolute center of the Schwarzchild black hole (i.e. none of that spinning/stretching field) at $\ C $, and so shouldn't $\ \Delta C$ need to be greater than $\ C $ in order for the light to collapse into the black hole, therefore violating the relativistic limit of $\ C $?    It seems like light would just 'hover' right in the center of a black hole then. Because if it goes away from it, the event horizon pulls it back, and if it goes into it, the velocity change must be greater than $\ C $ which violates general relativity; so technically there's no way for the light to move away, and so it would just be still.  The thing is that the light must move at the speed of light or general relativity doesn't work. It's massless... But in the center of a black hole, if the above is true (it can't move or escape), then it is not travelling at the speed of light. So it cannot be still.  It cannot be spinning in a constant orbit either, because that would require velocity in an outward angle. And it cannot move in an outwardly fashion, only in an inwardly one.  Is it spinning in an infinitely decaying spiral towards the center?  If so what happens to it if and when it reaches the direct and complete center, i.e. The case of it being 'shot' from the center.    $$ B $$  If you shot light at an angle towards a black hole, but not directly to the center of it  then that light from the outside will eventually become the same as the light that I said was shot from the center to the outside; because in both cases, they end up in an infinitely decaying spiral.    If so it would end up exactly like the light in the above paragraph, so then we need to figure out what happens to that light to figure this one out, or vice versa.    $$ C $$  If you shot light directly towards the center of a black hole it would have no spiral to decay into, so therefore it must stop at some point in the center of a black hole. If it stops though, it loses it's momentum and violates general relativity again because it's energy "disappears".    If so then it violates conservation laws. So I'm assuming this simply is not true.    Is the light travelling into a black hole somehow still travelling at the speed of light, in every direction possible where that direction keeps it facing towards the center?  If so, why is there not a point at which the only thing left for the light to do is stay still, since all other paths would increase the distance between it and the black hole's center, and therefore become Case A. And if there isn't, what would happen if there was?  Also, if it's a time and observation answer where it supposedly takes and infinite amount of time for C to hit the center, wouldn't it be the case that the black hole is 'eating' all of the available light in the universe and keeping it in stasis?  Also, what happens in a Kerr black hole then? Does it just rip the field of time/gravity at an angle such that the light would never get closer than the center? Expected value of $|X - Y|$ Let $X \sim U(0, 1)$ and $Y \sim U(0, 2)$ be independent random variables. What's the expected value of $|X - Y|$? I found $f_{X}(x) = 1$ and $f_{Y} = \frac{1}{2}$ so that $f_{XY}(x, y) = \frac{1}{2}$ and $$\mathbb{E}[|x - y|] = \int_{0}^{1} \int_{0}^{2} \frac{|x - y|}{2} \mathop{dy} \mathop{dx},$$ but how can I compute this quantity? It looks tricky. I know the trick where you split the integral in the one-dimensional case, but I'm having trouble getting it in the two-dimensional case.