I want to use htmlspecialchars to english and hebrew words, but when I save a hebrew word, it save it as the code of the word (e.g. &amp;#1513;&amp;#1500;&amp;#1493;&amp;#1501; for "שלום"). Code:   $txt=htmlspecialchars($txt, ENT_QUOTES, 'UTF-8');   I tried to use htmlentities, but same result.   I thought maybe to make htmlspecialchars  by hand, i.e. change &gt; to '&amp;gt;' and "" to &amp;#039; etc .   Does it safe to do it?   And how can I do it?(replace special chars to their code) I didn't find explanation how to make it  Edit- I solved it: need to add this code  header('Content-Type: text/html; charset=utf-8');   I declared the html header as utf8, but I didn't declare also the php as utf8.
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.
What is The Rule of Three? "Have you ever seen anyone walk (walking) the streets like that?" Have you ever seen anyone walk the streets like that? Have you ever seen anyone walking the streets like that?  Are both the above sentences grammatically correct? Do they mean the same?  I saw him kiss her the other day. I saw him kissing her the other day.  Are both the above sentences grammatically correct? Do they mean the same? And I'm sorry, if the latter two sentences come off immature .-. I couldn't come up with better sentences. Organize uploads by year, month and day datatool with longtable Tourist to F1 change of status within 60 days I have a PhD place at a US university starting Aug 21 but want to visit a different university for casual research for 6 weeks from July 1. This is longer than the 30 day grace period for the F1. Can I arrive on the visa waiver program or tourist visa in July and then just stay on for the PhD? I guess I might need to change status. Will this work?  Please don’t suggest exiting and reentering, that’s too expensive.  (British masters student in UK) This is the code that's giving me trouble.   f = Frame(root, width=1000, bg="blue") f.pack(fill=X, expand=True)  l = Label(f, text="hi", width=10, bg="red", fg="white") l.pack()   If I comment out the lines with the Label, the Frame displays with the right width.  However, adding the Label seems to shrink the Frame down to the Label's size.  Is there a way to prevent that from happening? 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. Optional argument to \item Given a set $\mathcal{S}$ of size $n$, let a $k$-partition of $\mathcal{S}$ be a grouping into $k$ disjoint classes $$(S_1 ,S_2,...,S_k)$$   Where the $S_i$ do not necessarily contain the same number of elements.  Let $C(S_1, S_2, ... S_k)$ be the set of combinations which can be made by taking exactly one element of each class, (i.e. $C(S_1, S_2, ... S_k)$ is the Cartesian Product $S_1 \times S_2 \times ...\times S_k$). For a given $(n,k)$, what is the minimum number of k-partitions $N$ such that  $\bigcup\limits_{i=1}^{N} C(S_1^{(i)}, S_2^{(i)}, ...,S_3^{(i)}) = $ All Possible Combinations  Example:  for $n=4$ and $k=2$, $\mathcal{S} = \{1,2,3,4\}$ we can choose:  $$ S^{(1)} = \left\{\left\{ 1, 2\right\}, \left\{ 3, 4\right\}\right\}$$ $$ S^{(2)} = \left\{\left\{ 1, 3\right\}, \left\{ 2, 4\right\}\right\}$$  Then $$C_{1} = \left\{\left\{ 1, 3\right\} ,\left\{ 1, 4\right\},\left\{ 2, 3\right\},\left\{ 2, 4\right\}\right\}$$ $$C_{2} = \left\{\left\{ 1, 2\right\} ,\left\{ 1, 4\right\},\left\{ 2, 3\right\},\left\{ 3, 4\right\}\right\}$$  and $C_1 \cup C_2 =$ All possible combinations and $N=2$. I don't really get why these hyperbolic functions are named after trig functions. Can someone enlighten me? Why is __init__() always called after __new__()? I'm just trying to streamline one of my classes and have introduced some functionality in the same style as the .  However, I'm a bit confused as to why __init__ is always called after __new__. I wasn't expecting this. Can anyone tell me why this is happening and how I can implement this functionality otherwise? (Apart from putting the implementation into the __new__ which feels quite hacky.)  Here's an example:  class A(object):     _dict = dict()      def __new__(cls):         if 'key' in A._dict:             print "EXISTS"             return A._dict['key']         else:             print "NEW"             return super(A, cls).__new__(cls)      def __init__(self):         print "INIT"         A._dict['key'] = self         print ""  a1 = A() a2 = A() a3 = A()   Outputs:  NEW INIT  EXISTS INIT  EXISTS INIT   Why? Why use gradient descent for linear regression, when a closed-form math solution is available? I am taking the Machine Learning courses online and learnt about Gradient Descent for calculating the optimal values in the hypothesis.  h(x) = B0 + B1X   why we need to use Gradient Descent if we can easily find the values with the below formula? This looks straight forward and easy too. but GD needs multiple iterations to get the value.  B1 = Correlation * (Std. Dev. of y/ Std. Dev. of x)  B0 = Mean(Y) – B1 * Mean(X)   NOTE: Taken as in   I did checked on the below questions and for me it was not clear to understand.      The above answers compares GD vs. using derivatives. Find count of all combination of numbers whose sum is x I want to find the sum of all combination of numbers whose sum is x, for e.g.  when x = 3 f(x) = countOf(111,12,21,3) = 4 Does the given matrix have a square root? Given the following matrix, I was asked to tell whether the matrix is the square of some matrix or not.  $$ \begin{pmatrix} 1 &amp; 0 &amp; 0\\ 0 &amp; -1 &amp; 0\\ 0 &amp; 0 &amp; -1 \end{pmatrix} $$  Since this matrix is diagonal, a square root is  $$ \begin{pmatrix} 1 &amp; 0 &amp; 0\\ 0 &amp; i &amp; 0\\ 0 &amp; 0 &amp; i \end{pmatrix} $$ Am I right? Given  $$ y_n=\left(1+\frac{1}{n}\right)^{n+1}\hspace{-6mm},\qquad n \in \mathbb{N}, \quad n \geq 1. $$ Show that $\lbrace y_n \rbrace$ is a decreasing sequence. Anyone can help ?  I consider the ratio $\frac{y_{n+1}}{y_n}$ but I got stuck. What happens to the human inside the titan when the titan dies? Just to be clear I'm NOT talking about those who where swallowed.       We know that titans used to be humans and then somehow they transformed into titans.   When they kill a titan it completely Vaporizes and nothing is left. So what happens to the human inside them?     Could it be like when Eren was testing his limits and each time he fused more with the titan body? If so, why could Ymir live in titan form for over 60 years and still transform back into human? "sudo -u postgres psql postgres" does not ask for password What does this depiction of a black hole in the movie Interstellar mean? I was expecting a whirlpool in 3D and the matter glowing from friction as it nears the center, as I expected a event horizon to be negligible visually.  How does this depiction work? How big is the central sphere? I am puzzled by the perpendicular circles. Are they the event horizons if they are both visible? What would be a path of a particle as it gets swallowed into the singularity? If I use the starting wealth rolls of my class, do I keep any remaining money left over? If I use the starting wealth rolls of my class, do I keep any remaining money left over after I buy equipment?  In D&amp;D 5e you can roll the 4d4 &times; 10 to determine starting gold, forgoing any equipment your class and background  gets.  This is not up for question.  What is up for question is whether or not the PC keeps any remaining gold that they don't spend on equipment.   As far as I have been able to tell, this is not explicitly stated in the PHB nor in the Basic Rules documents. How to find a global minimum for $\frac{1}{2}x^tQx-b^tx$