I was inserting some data on the fields of my website then i copy and pasted a string from another text editor(MS Word), then on my console log it recognizes the long single hyphen ( – ) which is the same as at PHP. But then when i execute the query the value from the database becomes different which is this:  `â€“`   This is the filtering that i do but as i said php recognizes it as a long hyphen ( – ) and that's the reason why they can't catch it. My question is why? Or any solution on the DB?      $_raw_data = $_POST['edit_data'];     $_raw_data = preg_replace('/[^A-Za-z0-9\- \'"{},:;[]]/', '', json_encode($_raw_data));     $_raw_data = str_replace("'", "''", $_raw_data);     $_raw_data = json_decode($_raw_data, true);
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.
Drawing a 3D cylinder, and a circle shape on the x---y plane I'm trying to draw a cylinder on the three dimensional space, and I also want its projection on the x--y plane. I found the first answer  to be very useful. I just copy-paste it to my document, and modify it as follows (the modifications are only inside the \begin{tikzpicture} tags):   \documentclass[parskip]{scrartcl} \usepackage[margin=15mm]{geometry} \usepackage{tikz}  \pgfmathsetmacro{\xdeg}{30} \pgfmathsetmacro{\xx}{cos(\xdeg)} \pgfmathsetmacro{\xy}{sin(\xdeg)}  \pgfmathsetmacro{\ydeg}{120} \pgfmathsetmacro{\yx}{cos(\ydeg)} \pgfmathsetmacro{\yy}{sin(\ydeg)}  \pgfmathsetmacro{\zdeg}{80} \pgfmathsetmacro{\zx}{cos(\zdeg)} \pgfmathsetmacro{\zy}{sin(\zdeg)}  \newcommand{\tdcyl}[5]{% origin x, origin y, origin z, radius, height     \path (1,0,0);     \pgfgetlastxy{\cylxx}{\cylxy}     \path (0,1,0);     \pgfgetlastxy{\cylyx}{\cylyy}     \path (0,0,1);     \pgfgetlastxy{\cylzx}{\cylzy}     \pgfmathsetmacro{\cylt}{(\cylzy * \cylyx - \cylzx * \cylyy)/ (\cylzy * \cylxx - \cylzx * \cylxy)}     \pgfmathsetmacro{\ang}{atan(\cylt)}     \pgfmathsetmacro{\ct}{1/sqrt(1 + (\cylt)^2)}     \pgfmathsetmacro{\st}{\cylt * \ct}     \filldraw[fill=white] (#4*\ct+#1,#4*\st+#2,#3) -- ++(0,0,#5) arc[start angle=\ang,delta angle=-180,radius=#4] -- ++(0,0,-#5) arc[start angle=\ang+180,delta angle=180,radius=#4];     \filldraw[fill=white] (#1,#2,#3+#5) circle[radius=#4]; }       \begin{tikzpicture}[x={(\xx*1cm,\xy*1cm)},y={(\yx*1cm,\yy*1cm)},z={(\zx*1cm,\zy*1cm)}]          \tdcyl{-3}{-3}{0}{1}{3} % x y z   r h         \tdcyl{0}{0}{0}{1}{3} % x y z   r h           \draw (-3,0,0) -- (3,0,0) node[circle,fill=white] {x};         \draw (0,-3,0) -- (0,3,0) node[circle] {y};         \draw (0,0,-3) -- (0,0,3) node[circle] {z};     \end{tikzpicture}     \end{document}   I added another cylinder and tweaked the positions to fit what I need. This produces the following:      Which is almost what I want, except that I want to see the projection of that cylinder on the x--y plane, but unfortunately, the top cylinder hides the full circle. When I disable the top cylinder:      \begin{tikzpicture}[x={(\xx*1cm,\xy*1cm)},y={(\yx*1cm,\yy*1cm)},z={(\zx*1cm,\zy*1cm)}]          \tdcyl{-3}{-3}{0}{1}{3} % x y z   r h            \draw (-3,0,0) -- (3,0,0) node[circle,fill=white] {x};         \draw (0,-3,0) -- (0,3,0) node[circle] {y};         \draw (0,0,-3) -- (0,0,3) node[circle] {z};     \end{tikzpicture}   Now the projection is shown again:   But the top cylinder is missing...  How can I make the top cylinder transparent, or, alternatively, and even better; how do I create one long cylinder and emphasize its projection on the x--y plane?   BTW, what determines the position of the labels x,y,z in the above code? I want to reposition them so they won't overlap with the axis. Thanks in advanced! These questions are really bothering me. Any help would be much appreciated.  Let $p$ be prime  a) If $(G, \oplus)$ has order $2p$, prove that every proper subgroup of $(G, \oplus)$ is cyclic  b) If $(G, \oplus)$ has order $p^2$, prove that $(G, \oplus)$ has a subgroup of order $p$ US tourism/business visa from non-resident country I applied for multiple visas before (not US visa), but all of them were from my residence country. In all of these cases, I can get official paper which support my evidence (bank statement, letter which states I am employed with high salary, marriage certificate, security clearance, ...).  It is the same question as , but I am not residing; I have a business visa.  case-specific details: I am from Egypt, I have business visa for Ireland. While in Ireland, I want to apply for US business visa.  Why not to apply from Egypt? Because the waiting time is too long (75 days). The waiting time in Ireland in only 18 days. Both visits (Ireland, US) are short visits (3 weeks for each). Sometimes a suggested edit is  because of a concurrent direct edit that takes precedence.  Since this is no fault of the edit suggestor, such rejections should not count against the suggestor when counting .  Here are some examples where it happened: A geometric reason why the square of the focal length of a hyperbola is equal to the sum of the squares of the axes? When I teach conics, I give a simple geometric argument for the Pythagorean relation for ellipses. (By "Pythagorean relation" I mean the fact that the square of the focal length $c$ is the difference of the squares of the semimajor and semiminor axes, i.e. $c^2=|a^2-b^2|$ for the ellipse defined by $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$.) The picture argument goes as follows: just draw the obvious isosceles triangle from the two foci to one of the two points at the end of the minor axis. We see two right triangles; in each, one leg is the focal length $c$ and the other leg is the semiminor axis, while the hypotenuse is the semimajor axis. The result follows from the Pythagorean theorem applied to this right triangle.  But when it comes to the Pythagorean relation for hyperbolas, I can't think of an equally convincing picture to draw. Instead I have to give a rather inelegant algebraic argument for the relation $c^2=a^2+b^2$ (for the hyperbola defined by $\frac{x^2}{a^2}-\frac{y^2}{b^2}=1$, with focal length $c$), directly from the definition of the hyperbola. The messy details are below.*  Now, obviously there is an asymmetry between the argument for the ellipse and the argument for the hyperbola: the ellipse argument is almost trivial and doesn't involve working straight from the locus definition, but the hyperbola argument is tedious and does require working straight from the definition. So, my question:     Is there an equally persuasive picture I could draw to convince high   school students of the Pythagorean relation for hyperbolas -- without having to get technical with points at infinity, say?   The natural triangle to draw is the right triangle with legs from the center to a vertex and from that vertex to an asymptote, which has legs of length $a$ and $b$; but then the problem becomes why the length along the asymptote should be equal to $c$. I doubt there is a purely (Euclidean) geometrical reason because this triangle lies on the asymptote, not on the hyperbola itself; I suspect some sort of limiting procedure will be required.    [*] The tedious algebraic details:     The foci lie at $(\pm c,0)$.   Say $a&gt;b$. Then hyperbola is the locus of points $(x,y)$ such that       $$\left|\sqrt{(x+c)^2+y^2}-\sqrt{(x-c)^2+y^2}\right|=2a$$      Assume for simplicity the expression between the absolute value bars   is positive. (The algebra is even more tedious if we don't make such a   simplifying assumption.) Then moving the right root to the other side   and squaring gives      $$(x+c)^2+y^2=4a^2+(x-c)^2+y^2+4a\sqrt{(x-c)^2+y^2}$$      Simplifying gives      $$xc-a^2=a\sqrt{(x-c)^2+y^2}$$      and upon squaring again we have      $$x^2c^2-2xca^2+a^4=a^2(x^2-2xc+c^2+y^2)=a^2x^2-2xca^2+c^2a^2+a^2y^2$$      which reduces to      $$x^2(c^2-a^2)-y^2a^2=a^2(c^2-a^2)$$      Defining $b^2:=c^2-a^2$ brings the equation into the form   $x^2/a^2+y^2/b^2=1$, and the Pythagorean relation follows from the   definition of $b$. deploying and retrieving Address settings (State & Country picklists) Suppose I have two tables that don't have many columns (3, for example). How can I position them side by side? I have accounts in Stack Overflow, Programmers, Unix &amp; Linux and Area 51. I don't want to continue my Area 51 account, so I planned to delete my Area 51 account. I have performed the following steps to delete my account, but I couldn't!  Case 1     If your account has votes or posts do the following steps:         Edit the "About Me" section of your profile to say “please delete me”.   Contact the SE support to request deletion.      I edited my "About Me" section to "please delete me". When I contacted SE Support to delete my account, I couldn't make a request. I am getting the following error:  This operation is incomplete. please do it in main site.   For deleting Area 51 account, when I do it main site, in link for deletion column I gave the Area 51 link. It says that:  it is not valid link!   Case 2     If the account has not interacted with the site yet (votes or posts), click on the delete button on your user page next to the edit link.   I am not eligible for this case!  Then how to delete my Area 51 account? Any help is appreciated! Moderncv package - cventry date width Page title with substitution on views page I have a view page that requires a dynamic page title. It is a simple substitution of the label field.  If I use {{ label }} it works fine for the title displayed on the page, but it doesn't substitute the label for the actual page title (in meta)  I was able to fix this by using hook_views_post_render using the following code  // Set the route title. $route = \Drupal::routeMatch()-&gt;getCurrentRouteMatch()-&gt;getRouteObject(); $route-&gt;setDefault('_title', $title);  $view-&gt;setTitle($title);   However, the title only works if the page is not cached. For the cached pages, the page title is missing. This feels like a bug in drupal, but I am hoping that there is a simple way to get this done. Ubuntu does not offers me "install alongside Windows" Is there a subtle difference between "somebody" and "someone", "anybody" and "anyone"? Are there any subtle differences between "somebody" and "someone", or can they be used completely interchangeably? Similarly, can you imagine a situation in which you would prefer "anybody" to "anyone" or vice versa? Can a pixie fly higher than their altitude of one? In the pixie description on the compendium:     Altitude Limit: You fall at the end of your turn if you are using your racial fly speed and are more than 1 square above the ground (see the rules for flying and falling in the Rules Compendium).   So can a pixie choose to go two or more squares above the ground?   Here are the relevant rules from the compendium:  Fly speed:     A creature that has a fly speed can fly a number of squares up to that speed as a move action. If it is stunned or knocked prone while flying, it falls. See also “Flying” and "Hover".   Flying:     Flight      Some creatures have the innate ability to fly, whereas others gain the ability through powers, magic items, and the like. The rules for flight in the DUNGEONS &amp; DRAGONS game stress abstraction and simplicity over simulation. In real life, a flying creature’s ability to turn, the speed it must maintain to stay aloft, and other factors put a strict limit on flight. In the game, flying creatures face far fewer limitations.      FLIGHT      Flight follows the basic movement rules, with the following clarifications.         Fly Speed: To fly, a creature takes the walk, run, or charge action but uses its fly speed in place of its walking speed. A creature that has a fly speed can also shift and take other move actions, as appropriate, while flying.   Moving Up and Down: While flying, a creature can move straight up, straight down, or diagonally up or down. There is no additional cost for moving up or down.   Falling Prone: If a creature falls prone while it is flying, it falls. This means a flying creature falls when it becomes unconscious or suffers any other effect that knocks it prone. The creature isn’t actually prone until it lands and takes falling damage.   Remaining in the Air: A flying creature does not need to take any particular action to remain aloft; the creature is assumed to be flying as it fights, moves, and takes other actions. However, a flying creature falls the instant it is stunned, unless it can hover.   Landing: If a creature flies to a surface it can hold onto or rest on, the creature can land safely.   Terrain: Terrain on the ground does not affect a flying creature if the terrain isn’t tall enough to reach it. Because of this rule, flying creatures can easily bypass typical difficult terrain, such as a patch of ice on the ground. Aerial terrain can affect flying creatures.      Crashing        Falling while Flying: If a creature falls while it is flying, it descends the full distance of the fall but is likely to take less damage than a creature that can’t fly. Subtract the creature’s fly speed (in feet) from the distance of the fall, then figure out falling damage. If the difference is 0 or less, the creature lands without taking damage from the fall. For example, if a red dragon falls when it is 40 feet in the air, subtract its fly speed of 8 (8 squares = 40 feet) from its altitude. The difference is 0, so the dragon lands safely and is not prone.         If a creature is flying when it starts a high-altitude fall, it has one chance to halt the fall by making a DC 30 Athletics check as an immediate reaction, with a bonus to the check equal to the creature’s fly speed. On a success, the creature falls 100 feet and then stops falling. On a failure, the creature falls as normal.         High-Altitude Falls: Some encounters take place very high above the ground. In such an encounter, it is possible for a creature to spend more than one round falling to the ground. As a rule of thumb, a creature falls up to 500 feet during its first turn of falling. If it is still falling at the start of its turn, it can take actions on that turn as normal, then falls up to 500 feet at the end of the turn. If none of those actions expressly halts a fall, the creature falls up to 500 feet at the end of the turn. This sequence continues until the creature lands. Let $ Y = \{ (1,1),(0,0\} \subset \mathbb A_k^2$. Find the $ \mathbb I(Y)$.   As if $f(x,y) \in \mathbb I(Y)$ then as $f(0,0)=0$ hence constant term of $f$ is zero and as $f(1,1)=0$ therefore sum of the coefficients of $f(x,y)$ is zero. But how can we describe this set properly? I was browsing through the apt folder to try my proxy settings and I was unable to find the apt.conf file in Ubuntu 11.04. Is there any alternative file for it?  Adding proxy settings to 99-synaptic in apt.conf.d does not help as it gets overwritten everytime I restart the system. today I installed Ubuntu 64-bit on a netbook. When the netbook boots this, error report appeared. I think there is a problem with the partitions.  Gave up waiting for root device. Common problems:   — Boot args (cat /proc/cmdline)     — Check rootdelay= (did the system wait long enough?)     — Check root= (did the system wait for the right device?)   — Missing modules (cat /proc/modules; ls /dev) ALERT! /dev/mapper/ubuntu--vg-root does not exist. Dropping to a shell!   BusyBox v.1.21.1 (Ubuntu 1:1.21.1-1ubuntu1) built-in shell (ash)    Enter 'help' for list of built-in commands.    (initramfs)   Output of lsblk as requested:  $ lsblk NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 232.9G  0 disk  ├─sda1   8:1    0   231G  0 part  ├─sda2   8:2    0     1K  0 part  └─sda5   8:5    0     2G  0 part [SWAP] sr0     11:0    1   1.2G  0 rom  /cdrom loop0    7:0    0   1.1G  1 loop /rofs After upgrading to macOS Sierra, I'm getting the notification that "Your disk is almost full. Save space by optimizing storage.":    The options appear to be to store my files in iCloud, automatically delete files, or manually delete files:    My problem/irritation is that I have 80GB free of my 440GB volume.  The question: is there a way to silence this notification in a (semi-)permanent fashion, or to change the threshold it uses for the notification? When to Garbage Collect Determine which app is drawing on top of other apps? Is there a way to determine which application is drawing on top of other applications?  For example, Facebook Messenger app can draw the chat bubbles on top of everything, but how do I know which app is doing this?  My problem:  I have an app which is drawing ads on top of everything and I wanna know which app is doing this. Not just to uninstall it, but to warn everyone that uses this app. (I didn't install any application recently and I already verified the recent updates.)  I tried to use the Dump View Hierarchy for UI Automator from the Android Studio, but it seems that the applications that draw on top can't be selected this way.  (Click image to enlarge) I'm trying to  when I run into this:     "You have already deleted 5 of your own posts today; further deletes are blocked"      I found conflicting information on this very annoying limit:   This post from May 25, 2010: . This is marked . If this is no longer the case, please edit that question and flag it as . Then , indicates that the problem has risen from the dead -- despite :     Each time that I've seen it (pruning subpar answers), it's been a user who is deleting their own redundant zero-upvote answers. Can you tweak the algorithm slightly so answers with less than one upvote don't count towards tripping this flag?     (Emphasis added.) :     I don't mind it when         cleaning up redundant answers on questions that have multiple alternate good answers   cleaning up old, "less awesome" answers that are no longer reflective of the user's current skill level         (Emphasis added.)     So why do we have barriers in place, to making SO answers less, "less awesome"?      Proposed Solution:  Please let us (¿once again?) delete an unlimited number of our own answers, when they have zero up-votes and are not marked as the answer.  Otherwise, please edit the linked questions to clear up the confusion.