This is a very strange problem I have never experienced before.  I perform these following stataments  //Grabs the currency from the bank account $stmt = $db-&gt;prepare("SELECT * FROM accounts WHERE account_id = '$accountid'");         $stmt-&gt;execute();         $result = $stmt-&gt;get_result();         if($result-&gt;num_rows &gt; 0) {             while($row = $result-&gt;fetch_assoc()) {                 $bankcurrency = $row['currency'];             }         }         $stmt-&gt;close();  //Finds the symbol of the speicific currency         $stmt = $db-&gt;prepare("SELECT * FROM currencies WHERE currency = ?");         $stmt-&gt;bind_param("s", $bankcurrency);         $stmt-&gt;execute();         $result = $stmt-&gt;get_result();         if($result-&gt;num_rows &gt; 0) {             while($row = $result-&gt;fetch_assoc()) {                 echo $symbol = $row['symbol'];             }         }         $stmt-&gt;close();   The output of the symbol from these statements are � The output should have been $  You would think I have something wrong with my database input, but no, because if I try:  $stmt = $db-&gt;prepare("SELECT * FROM currencies WHERE currency = 'USD'");         //$stmt-&gt;bind_param("s", $bankcurrency);         $stmt-&gt;execute();         $result = $stmt-&gt;get_result();         if($result-&gt;num_rows &gt; 0) {             while($row = $result-&gt;fetch_assoc()) {                 echo $symbol = $row['symbol'];             }         }         $stmt-&gt;close();   This then outputs $ This makes no sense as the data and statements are exactly the same.  You don't need to declare strings or variables in PHP which is why it makes no sense to me?  My database structure is simply:  accounts database:  name: currency Type: TEXT Value: USD   currencies database:  name: symbol Type: TEXT Value: $   Of course I have other rows, but these are the affected ones  You could say my database is the problem, but since the second statement works fine out outputs $ that is clearly not the problem.  I can't understand what is wrong  EDIT: If I add in $bankcurrency = 'USD'; it also displays USD as you would expect, so there is a problem with my first statement
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.
Let $f\colon\mathbb R\to\mathbb R$ be twice differentiable with $f(x)\to 0$ as $x\to\infty$ and $f''$ bounded. Show that $f'(x)\to0$ as $x\to\infty$. (This is inspired by  to a different question) Is there any other way to do a clean install withot formatting /home? I think my Ubuntu is a bit broken from messing around with it.  Unfortunately during installation, I did not make a separate partition for /home. Now I need to re-install but want to keep my music and films.  Any ideas... How to tell whether a field is required or not in Apex by describe fields (Built-in) way in JavaScript to check if a string is a valid number I'm hoping there's something in the same conceptual space as the old VB6 IsNumeric() function? How do I switch between keyboard layouts? I want to switch between English and another language.  I have tried Lubuntu and it was easy, I figured it out from the friendly menus. But in Ubuntu everything is so cryptic. Create tar archive of a directory, except for hidden files? I'm wanting to create a tar archive of a specific directory (with its subdirectories of course). But when I do it, using the tar command, I get a list of files that were included, for example:     a calendar_final/._style.css      a calendar_final/style.css   As you can see, there are two versions of the same file. This goes for every file, and there are many. How do I exclude the temporary files, with the ._ prefix, from the tar archive? Bash/Korn shell script edited on Windows throws error '...^M: not found' I wrote a Bash script in Windows using Notepad++.  cxStopAllServicesOnSERVER.sh  #!/usr/bin/bash cd "/some/path" echo "Hi. Logs can be found at "`pwd`"/cxStartStopLogger.log" echo "["`date`"]*** STOPPING ALL SERVICES ON SERVER ***" &gt;&gt; "cxStartStopLogger.log" exit   Now after uploading it and setting the required file permissions, I tried executing it as follows:  bash-3.00$ cat cxStopAllServicesOnSERVER.sh #Let's have a look at the code. #!/usr/bin/bash cd "/some/path/" echo "Hi. Logs can be found at "`pwd`"/cxStartStopLogger.log" echo "["`date`"]*** STOPPING ALL SERVICES ON SERVER ***" &gt;&gt; "cxStartStopLogger.log"  bash-3.00$ # Code and hashbang 'looks' correct,  bash-3.00$ # if there is any issue with the format (EOL characters and such)  bash-3.00$ # we cannot see it using cat. bash-3.00$  bash-3.00$ sh cxStopAllServicesOnSERVER.sh cxStopAllServicesOnSERVER.sh[2]: /some/path^M:  not found Hi. Logs can be found at /some/path/cxStartStopLogger.log bash-3.00$ # Note that ^M appears at the end of the line.  bash-3.00$ bash -x cxStopAllServicesOnSERVER.sh + cd $'/some/path\r' : No such file or directory1.sh: line 2: cd: /some/path ++ pwd ' echo 'Hi. Logs can be found at /some/path/cxStartStopLogger.log Hi. Logs can be found at /some/path/cxStartStopLogger.log ++ date + echo '[Sun' Nov 18 00:28:17 EST '2012]*** STOPPING ALL SERVICES ON SERVER ***' bash-3.00$ # Note that '\r' return character appears at the end of the line.   Problem: When I change the code to korn shell I face the same issue. Appears that an incorrect character is getting added at the end of the line.   NOTE: I found the solution and have posted the same as an answer. Feel free to update or improve it to help other beginners that may face the same issue.  Thanks! Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea to gather from multiple source some explanation and ways to fix this error.  Symptoms I am getting the error below appearing in my console, what does it mean and how do I fix it?  NullReferenceException: Object reference not set to an instance of an object Does there exist an holomorphic function such that $|f(z)|\geq \frac{1}{\sqrt{|z|}}$? I have some trouble solving this problem: Does there exist a holomorphic function $f$ on $\mathbb C\setminus \{0\}$ such that $$|f(z)|\geq \frac{1}{\sqrt{|z|}}$$ for all $z\in\mathbb C \setminus \{0\}$? I don't know where to start. My intuition is that you would get a problem with the singularity near $0$, but I am not sure how to prove it. Any help would be appreciated! Thanks! Links that are italics and bold not showing as links in Mobile Web Okami is now reborn in High Definition for PS3. The graphics are obviously better, sharper and yet preserves the gist of the original game, however I can swear some of the texts have changed as well.  My PS2 console is no longer available to me so I can't test it myself, but does anyone know whether there are any changes to the game (aside from graphics) or not? In QGIS, I want to make polygons from a set of intersecting lines. Looking at the screenshot here, I want chop the purple line (it's a closed line, not a polygon) where it crosses the green and blue lines. The result hopefully would be a polygon where I have hatched in red. I have quite a few to do.    I have tried the QGIS tool previously called Polygonizer (see ), but now called Polygonize. This is a tool that, given a layer containing a set of crossing lines arranged essentially like a # symbol, should create a polygon from the enclosed space in the middle.  (In QGIS 2.01, Polygonize is in the top menu bar: go to Processing -> Commander, then type "Polygonize" on the command line, select "Processing algorithm: Polygonize" from the list that appears, and press Enter.)   At the momemt Polygonize doesn't work properly. Is there another way to do what I want to do?   For example, wouldn't it be great if the QGIS 'Split Feature' command was able to work like MapInfo's 'Polyline Split', where you select the polygons to split, then select an already-drawn polyline to split by, and voila. But Split Feature seems not to work that way.    UPDATE: Detail of problems with running Polygonize.  I have 64-bit QGIS 2.01 installed to Windows 7 from the installer package, QGIS-OSGeo4W-2.0.1-3-Setup-x86_64.exe.  The routine processed an output from my shapefile, but did not create a polygon from the region enclosed by intersections between the blue, green and purple lines. (Note: in the actual input file, all these lines are on the same layer; the screenshot just colours them differently for illustrative purposes). What I got instead was a simple conversion of the purple outline to a polygon, as though the program completely ignored the blue and green lines.  When I node-edited the closed purple line, to open it so that I had a set of open crossing lines like in the # symbol, and then ran Polygonize again, nothing happened. No crash, but no visible polygon in the output file.    When I used Nick Hopton's own  data, I got a crash; see screenshot: Partial or entire Image Blurring in TikZ?  I have seen some examples of drop shadow blurring in the pgf-blur package version 1.01 by Martin Giese but this isn’t what I mean.  Is it somehow possible to do partial or entire Image Blurring in TikZ, just like what one may do in Adobe Photoshop? How do I make a textbox that only accepts numbers? Align  elements side by side Fundamental Theorem of Algebra - an elementary complex analysis proof? We begin by assuming that a non-constant complex polynomial $$p(z)=a_n z^n+a_{n-1}z^{n-1}+...+a_1 z+a_0,$$ where $a_0 \neq 0$, doesn't vanish in $\mathbb{C}$. Therefore $1/p$ is also an analytical function everywhere. Note that $(p(z)-a_0)/z$ is a polynomial and therefore, due to Cauchy's theorem, the following integral must be zero.  $$\int_{S_r^1}\frac{(p(z)-a_0)/z}{p(z)}dz=\int_{S_r^1}\frac{a_nz^{n-1}+a_{n-1}z^{n-2}+...+a_1}{a_nz^n+a_{n-1}z^{n-1}+...+a_1 z+a_0}dz=0.$$  On the other hand  $$\int_{S_r^1}\frac{a_nz^{n-1}+a_{n-1}z^{n-2}+...+a_1}{a_nz^n+a_{n-1}z^{n-1}+...+a_1 z+a_0}dz$$  $$=\int_{0}^{2\pi}\frac{a_n(re^{i\theta})^{n-1}+a_{n-1}(re^{i\theta})^{n-2}+...+a_1}{a_n(re^{\theta})^n+a_{n-1}(re^{i\theta})^{n-1}+...+a_1 (re^{i\theta})+a_0}(ire^{i\theta})d\theta$$  $$=\int_{0}^{2\pi}i d\theta - \int_{0}^{2\pi}\frac{a_0 i}{a_n(re^{i\theta})^n+a_{n-1}(re^{i\theta})^{n-1}+...+a_1 (re^{i\theta})+a_0}d\theta$$ $$=2\pi i -\int_{0}^{2\pi}\frac{a_0i}{p(re^{i\theta})}d\theta.$$  Let $r \rightarrow \infty$ and the integral approaches value $2\pi i$ - a contradiction. Therefore $1/p$ can't be entire and $p$ must vanish somewhere in the complex plane.  EDIT: I have changed this post and deleted the idea that the integral $\int_{\partial D_r}\frac{(p(z)-a_0)/z}{p(z)}dz=0$ could be evaluated with the fundamental theorem of calculus. Now, as it stands, this proof is essentially the same as the one that Mr. José Carlos Santos points out in his comment. How can I get distribution name and version number in a simple shell script? We have a Barbarian on our team that very much likes to switch up his weapons; he goes from a Dwarven Hammer, to a pair of Hand-Axes, to occasionally just going bare-fisted. No issues there, he's fairly adept with all 3.  However, I have only just recently picked up on the way that he rolls his attacks for the two Hand-Axes: He rolls the first attack, adds his modifiers etc. Then he rolls the second attack, this time without modifiers, which is all well and good. But I'm not sure if this action uses his bonus action or not, or is considered a separate action (though, being a level 4 Barbarian, he only has one action per turn), or is merely part of the same action.  If we have a look at the Two-Weapon Fighting feature from the Fighter's fighting styles:     Two-Weapon Fighting   When you engage in two-weapon fighting, you can add your ability modifier to the damage of the second attack. (PHB5e p.72)   Similarly, the Dual Wielder feat also uses the Two-Weapon Fighting feat:     Dual Wielder   You master fighting with two weapons, gaining the following benefits:      ...         You can use two-weapon fighting even when the one-handed melee weapons you are wielding aren’t light. (PHB5e p.164, emphasis mine)      So; yes, this gives a bonus to the second weapon attack, but having asked a  to clarify which action this secondary weapon attack belongs to, it was determined that this uses your bonus action;     [...] the second attack requires a bonus action   So after that long winded explanation, here is the question: Without any additional feats, can you wield and use two weapons at once, and if so, how many actions does it require to make a full attack with both weapons in a turn? Cross-reference packages: which to use, which conflict? Inspired by my earlier question , here is another similar question.  There are many different packages for making cross references. Among them , , , , … The  package defines its own cross-referencing command for theorems…  Which collection of packages provides which kind of functionality, and which packages cause conflicts with each other? Why is Tony Stark in the Iron Man suit unaffected by G-forces, inertia and blunt force trauma? Tony's suit is an engineering marvel, and they explain many facets of the technology to help give legitimacy to the special powers, abilities and weapons it has.  I never read the Iron Man comics, but in the movie they really don't have a technological explanation for how he miraculously seems to be unaffected by crushing G-forces of sudden acceleration, the inertia of sudden stops and hair-pin turns, and especially the blunt force trauma from getting smashed in the face with Thor's hammer.  Certainly it appears the suit takes punishment, but Tony always remains unscatched, never a collapsed lung, broken bone or even a bloody nose.  In my infantile understanding of theoretical physics, the same technology that would be used to counter G-forces and sudden blunt force trauma to the body inside would be the very same technology used for  which in my honest opinion would be a much more stunning technological achievement than his heralded Arc Reactor.  Was their ever an explanation proferred for this and if so was it indeed attributed to Anti-Gravity?