My utf-8 is not working in php with pdo. when i store België  i have in my db Belgi&euml; in my index page of html  i have  &lt;meta content="text/html" charset="utf-8" /&gt;  and in my php page i have   I have tried this but this isn't working  $db = new PDO("mysql:host=$host;dbname=$dbname",$username,$password, array(PDO::MYSQL_ATTR_INIT_COMMAND =&gt;  "SET NAMES utf8"));          $db-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);   When i load the data from the db into a table then i have again the right value België.  But with geocoder when i took a longer value like Jan Breydelstadion, Koning Leopold III-laan, Brugge, België then i get a error Zerro_results.  But when i change the word  Jan Breydelstadion, Koning Leopold III-laan, Brugge, Belgi&euml; to Jan Breydelstadion, Koning Leopold III-laan, Brugge, België in my mysql  then my geocoder error is gone.
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.
I'm running Drush on a host that has multiple versions of PHP installed. By default, php --version would give you 5.2.x, but php53 and php54 are also available. So in my .bash_profile I have alias php='php53' (php --version = 5.3.13), which makes Drush work for some commands.  However, I still get "Your command line PHP installation is too old. Drush requires at least PHP 5.3.2" messages for some very useful commands.  A couple of really annoying instances:   drush pm-update will report that it has backed up and then updated all modules and core successfully, then return the PHP version error and restore all backups. In verbose mode, the command that comes before the error is: php /home/[username]/drush/drush.php  --backend=2 --verbose --root=/home/[username]/webapps/drup --uri=http://[domain name]  pm-updatecode-postupdate 2&gt;&amp;1 drush archive-dump will immediately return the PHP version error   The other commands I have tried so far work fine. I'm not sure why this would be, if Drush is sometimes using the php53 binary, and other times not, or if it just has trouble detecting the version correctly, but some very important features are broken for me. Convergence in Distribution in Order Statistics Let $X_1, X_2, \ldots$ be iid from Exp$(\theta)$ with density function $f(x) = \frac{1}{\theta}e^{-\frac{x}{\theta}}$. (a) Find the limiting distribution of $M_n = Y_1 - \theta\ln(n)$ and $T_n = nY_n$, where $Y_1$ and $Y_n$ represent the first and last order statistics (among $n$ observations) respectively. Answer: I have obtained the CDF of X to be: $$F_x(x) = 1 - e^{-\frac{x}{\theta}}$$ the CDF of $Y_1$ to be: $$F_{Y_1} = 1 = e^{-\frac{xn}{\theta}}$$ the CDF of $M_n$ to be: $$F_{M_n}(x) = \left[1 - \frac{1}{n}e^{-\frac{x}{\theta}}\right]^n$$ with limiting distribution $$e^{-e^{-\frac{x}{\theta}}}$$ the CDF of $T_n$ to be: $$F_{T_n}(x) = 1 - e^{-\frac{x}{\theta}}$$ which is also the limiting distribution. (b) Show that $M_n$ and $T_n$ are asymptotically independent. Answer: I've tried finding the joint PDF for ordered statistics by using the equation $$g_{ij}(y_i, y_j) = \frac{n!}{(i - 1)!(j - i - 1)!(n - j)!}[F(y_i)]^{i - 1}[F(y_j) - F(y_i)]^{j - i - 1}[1 - F(y_j)]^{n - j}f(y_i)f(y_j)$$ however, it is a mess based on my CDFs. Any suggestions on a different approach? Pagination not working with custom loop Prove that if $a \mid b$ then $\gcd(a,b) = |a|$ Open subscheme of an irreducible component remains open? How to scp in Python? What is the best collation to use for MySQL with PHP? I need to read a properties files that's buried in my package structure in com.al.common.email.templates.  I've tried everything and I can't figure it out.  In the end, my code will be running in a servlet container, but I don't want to depend on the container for anything. I write JUnit test cases and it needs to work in both. Give each site a parallel site for polling, recommendations and subjective-ish stuff Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com. After logging in on terminal with user name and password, how do I start the GUI? I am new to Ubuntu, and I am working on a Mac. The Ubuntu installation was done by someone else. I logged in with the user name and password, but I'm not sure what next to do in the terminal to get to the graphical interface. Could someone assist or point me in a direction where I can get useful guidelines? I have done research, but nothing I found helped me.   When I tried to start the lightdm greeter, I got the following message:  lightdm.service not found     Update: My understanding is that Ubuntu Server is installed. pgfplots: prevent single plot from being listed in legend In order to fill the area between two complex curves I use tables and the vertcat command (see ).   Now I don't want the plotted area to appear in my legend, just the two curves. Is there any command to prevent the yellow area plot from being added to my legend?  this could be a minimal example:  \documentclass{article} \usepackage{pgfplots}  \begin{document} \begin{tikzpicture}   \begin{axis}[area style,axis on top]     \addplot+[mark=none,fill=yellow,draw=none] {0.1*x^2} \closedcycle;     \addplot[mark=none,draw=red,line legend] {0.1*x^2};     \addplot[mark=none,draw=blue,line legend] {0.0*x^2};     \legend{red curve,blue curve};     % \legend{\empty,red curve,blue curve};   \end{axis} \end{tikzpicture} \end{document}   With this legend{...}-command the last plot is skipped, an additional \empty doesn't help, too.  Sadly, drawing the first to plots together with fill=yellow,draw=red is not an option for me. Does anybody know any inside hacks? As far as I know, there is no command shown in the manual. Thanks in advance. Changing default width of blocks in beamer I use a custom Beamer theme for my presentations. In my presentations I'd like to use blocks (\begin{block}…\end{block}). These blocks are rendered slightly too wide to fit into my theme. Is there a way how I can set the default width of blocks, e.g. to .9\textwidth? I was recently reading some Lord of the Rings/Stargate SG-1 crossover fanfiction. It is a guilty pleasure, I admit :) In this story, it was suggested by Col. O'Neill to destroy the Ring using a nuclear device. Truth be told I stopped reading at this point, as it was getting to be a little much even for me.  Obviously, this is not canonical in either universe, but it made me wonder: When Elrond said that "only in the fires of Mt. Doom may it be unmade," was he speaking literally? Or was this merely the only known active volcano in Middle Earth? In other words, was whatever magic that protected the One Ring from damage location-based or did it just make it very resistant to destructive force, and Mt. Doom just happened to be hot enough to do this? I know there is (understandably) little information about such technicalities of how magic works in Middle Earth, but I'll accept any reasonable conjecture/consensus as an answer. With a Canon 550D camera and a Tamron 18-270 mm zoom lens, I tried to fix shutter time, aperture (f/8.0 to cover all zoom range), and ISO, so the exposure meter read 0.0 with 18 mm focal length and while focusing on a uniform white wall.  Then I changed to 270 mm focal length, but the exposure reading did not change significantly (only to -0.7).  However, I had expected exposure to change, since only (18 mm / 270 mm) ** 2 = 1/225 of the wall is now covered in compare the coverage when focal length is 18 mm, thus only 1/225 of the light gets to the sensor after the change of focal length.  Why does exposure not change when narrowing the field of view with change of focal length? Sending signals to USB port using C I want to send a simple 5V signal to the usb port. The USB cabel's insulation will be removed and connected to a relay which is connected to an electric door system. I think I should write this code in C. Can somebody give me a hint? Start a new process without blocking the terminal Is it possible to do this? For example if I run "gedit tifatul.txt" via the command line, my terminal becomes blocked and I can't enter other command in this terminal before I quit gedit. Can I start a program (like gedit) without blocking the terminal? In windows I think this can be done like "start notepad tifatul.txt" Display Custom Fields in a SharePoint 2010 Content Query Web Part Using SharePoint 2010, Having Custom List With 4 Columns, Now I am Using Content Query Web-part To Display List Data ,But Currently It Display Only First Column, SO How to Display Custom Fields in a SharePoint 2010 Content By Query Web Part What happens with lethargy when Haste is cast again on a creature before first cast runs out? Haste states     When the spell ends, the target can't move or take actions until after its next turn, as a wave of lethargy sweeps over it.   However, let's say Character A cast Haste on Character B. In the 10th round (final round of haste if concentration not broken), Character B casts Haste on himself.  What happens during the next round?    Do they lose a round of the "new" haste while they are lethargic and lose movement and actions? Does the new haste override the lethargy until it ends? Is it some combination? Retain AC/Dex modifications but lose actions/movement? None of the above? How to show the full path of a file or directory in the terminal? I need to know how the directory name in order to type it out in the terminal. How do I access the names of directories?   Windows Explorer used to have a title bar with the full path. Can someone please help me figure out how to see the full path of a certain file? What can I do to lift a 10 year ban for making a mistake in my UK visa application? I am a Nigerian citizen.  In 2007 I was twice denied a visa to the UK.  Recently I was filling out an application for another UK visitor visa and by mistake I answered no to the question whether I had ever been denied a UK visa, instead of yes.  When reviewing my application, the visa officer found out about the previous visa rejections and as a result I got a 10 year ban on travel to the UK.  What can I do to lift my 10 year ban?   Will this ban affect my chances of obtaining a visitor visa to the USA?