&lt;?php $insert =  "I want to store Å Ä Ö in my database";  mysql_query(" INSERT INTO test (text) VALUE ('$insert')") or die(mysql_error()); ?&gt;   Just by using this piece of code, the database stopped storing data as fast as a special symbol (Å Ä Ö) was encountered so in this case I would only find the string "I want to store " in my database table. However I tried to put:  &lt;?php mysql_query("SET NAMES 'utf8'") or die(mysql_error());  mysql_query("SET CHARACTER SET 'utf8'") or die(mysql_error());  ?&gt;   before the INSERT script, it worked somewhat better but now the issue is that all the special symbols are replaced with question marks ( ? ) in the database tables. My table collation is utf8_swedish_ci. The meta, charset is UTF-8.
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.
Intro  I'm working on a lightweight package that allows you to put any content (typically LaTeX code) in an environment, then use that content multiple times, each time scanned separately, so you can use it both as verbatim output and interpreted as LaTeX.  Its main purpose is to typeset LaTeX code and its 'result' side-by-side; useful for documenting TeX packages without having to copy/paste code. But it has other purposes as well.  After experimenting with \scantokens until I gave up in tears, I arrived at the filecontents environment, which almost solved my problem singlehandedly!  The Problem  The problem is, when reintroducing filecontented code through \input, LaTeX adds an implicit newline at the end, which translates to whitespace that I can't seem to get rid of.  I've seen many semi-related questions floating around, with answers employing techniques like:   reading a file line-by-line, using \everyeof in some clever way, playing with \endlinechar or using packages such as catchfile   but none of them provides a clear answer to the following question:  The Question  How can I \input a file without getting the implicit newline?  Minimal Working Example  \documentclass[margin=1mm]{standalone}  \usepackage{filecontents}  \begin{filecontents*}{tmp.tex}     \LaTeX{}\end{filecontents*}  \begin{document}     \fbox{\input{tmp.tex}} \end{document}     Note the extra whitespace to the right of the box.  Note also that I'm definitely not adding any explicit whitespace. Even a manually produced file (so, not using filecontents) with no newlines at all exhibits the same problem. I have a vps using Ubuntu 12.04 LTS and I my host corrupted my vps so now it won't boot up. When it boots up it says:  Booting from Hard Disk... error: file not found. grub rescue&gt;   How can I fix/repair this? Why is using a wild card with a Java import statement bad? How does extra damage work for critical hits? I'm a bit confused on how extra damage works for critical hits. Let's take the following example: A thief with sneak attack rolls a crit. I'm under the impression he rolls double his normal attack damage dice AND double his Sneak Attack damage dice. Is this accurate? Another example, I finished DM-ing my first campaign recently. The Giant Spider enemy monster has an melee attack that causes a constitution saving throw. If the player fails, the enemy rolls an additional 2D8 of damage. In this situation, if there was a critical hit, and the player failed their saving throw, would I also roll double dice on the additional damage? Or is that considered a separate attack? How can I randomize order of elements in a list? A result of Stieltjes Integral While studying the Riemann - Stieltjes integral, I read this exercise in my book:  "Let $f:[a, b]\to \mathbb{R}$ be a bounded function. Denoted $L(P, f)$ the lower Darboux sum and $|P|$ the mesh of the partition $P$. Prove that for every $\epsilon&gt;0$, there exists $\delta&gt;0$ such that for every partition $P$ with $|P|&lt;\delta$, we have: $\underline{\int_{a}^{b}}f(x)dx-L(P, f)&lt;\epsilon$."  My question is: Can we generalize this problem for Stieltjes integral, with $\underline{\int_{a}^{b}}f(x)d\alpha$ instead of $\underline{\int_{a}^{b}}f(x)dx$?  Particularly, can we have this theorem?  Let $f:[a, b]\to \mathbb{R}$ be a bounded function and $\alpha$ is a monotonic function on $[a, b]$ . Denoted $L(P, f, \alpha)$ the lower Darboux sum and $|P|$ the mesh of the partition $P$. Prove that for every $\epsilon&gt;0$, there exists $\delta&gt;0$ such that $\underline{\int_{a}^{b}}f(x)d\alpha-L(P, f, \alpha)&lt;\epsilon$ for every partition $P$ with $|P|&lt;\delta$?  I don't know how the mesh of the partition relate to the function $\alpha$. Is an empty set equal to another empty set? If $k=1$, we have \begin{align} \sum_{n\ge1}\frac{1}{\binom{2n}{n}}&amp;=\frac12\sum_{n\ge1}n\mathrm{B}(n,n)\\ &amp;=\frac12\int _{0}^{1}\sum_{n\ge1}n(t-t^2)^{{n-1}}{\mathrm  d}t\\ &amp;=\frac12\int _{0}^{1}\frac{1}{(t-t^2-1)^2}{\mathrm  d}t\\ &amp;=\frac13+\frac{2\sqrt3\pi}{27} \end{align} I wonder if there exists a general formula of $\sum_{n\ge1}{\binom{2n}{n}^{-k}}$ with $k\in\Bbb N^*$. This may involve some ${}_pF_q$ functions. options for [for /f "usebackq" %%f in (`find "" path`) do] sentence in batch I symplified my problem: @echo off set res=  for /f &quot;usebackq&quot; %%f in (`find &quot;a&quot; list.txt`) do set res=%%f echo %res%  pause&gt;nul and that things.txt file in the code is like:  list.txt file in the code is: apple pitch pear melon mango  As you expect, the result of this code is mango  because the line 'mango' is located below the line 'apple' and 'pear' But the result I want is apple  or pear  Specifically, I want to put each of the other values above mango such as apple and pear into the variable res using option keys provided. is there any way to do that? I have been texture painting in look dev mode. But when i try to render it, everything looks very dark. I have 3 sun lights in my scene, ambient turned on in Eevee settings. What am i missing? I really like the look of my scene in Look Dev mode, how can i achieve the same look when my scene is rendered too? dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) nginx The Software up-to-date Option automatically download the upgrade for nginx. but While installing it's giving me the following error:  Reading package lists... Done Building dependency tree        Reading state information... Done The following NEW packages will be installed:   nginx 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/434 kB of archives. After this operation, 977 kB of additional disk space will be used. (Reading database ... 291344 files and directories currently installed.) Unpacking nginx (from .../nginx_1.4.7-1~precise_amd64.deb) ... ----------------------------------------------------------------------  Thanks for using nginx!  Please find the official documentation for nginx here: * http://nginx.org/en/docs/  Commercial subscriptions for nginx are available on: * http://nginx.com/products/  ---------------------------------------------------------------------- dpkg: error processing /var/cache/apt/archives/nginx_1.4.7-1~precise_amd64.deb (--unpack):  trying to overwrite '/etc/logrotate.d/nginx', which is also in package nginx-common 1.4.6-1+precise0 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing:  /var/cache/apt/archives/nginx_1.4.7-1~precise_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)   Actually that file /etc/logrotate.d/nginx does not exist in this folder. Ok, I must be missing something obvious, but I'm having trouble adding a link to user/%/edit to the main menu.  In the Menu UI, I clicked "add link," set the title to "Account settings," and then was at a loss about what to put for the path.  I know how to generate a link to the account edit page using views, which is what I've always done before, but this time I actually need to add the link to the "Main Menu." What's the easiest way to run GUI apps on Windows Subsystem for Linux as of 2018? I am trying to invite my son (IOS Pocket Edition) to my realms server (mac osx).   I keep getting the response "Could Not Invite The Provided Name" when I try to invite him. His name is all regular characters with no spaces . . . just letters and numbers.  Are the two game types incompatible, and if they are Is it possible to create the same type of 24/7 available server that is only open to him and other invitees like the OSX realms?   Thanks in advance for any clarification. EDIT:  It seems that I've also had edits that stacked well, so I'm not sure if I had a timing problem, or was just delusional.  The one thing that can be fixed, that I'll turn this question into, is a feature request so that when I go to re-edit (either within the 5-minute grace period, or before a suggested edit is approved), it brings up the old edit summary text.  Right now, it brings up a blank edit summary, and this replaced the first one I did.  This isn't really intuitive, and even knowing that's what it's doing, I still forget to put everything in.  Original Question:  It has happened a few times now, when on a site where I don't have edit privileges, that I make an edit.  I then see that the edit didn't work quite right, so I go back in to re-edit it.  This creates a brand new edit review, with an additional useless summary. How about we have the same grace period to re-edit your up-for-review edit, as there is for a normal edit? Of course, it wouldn't be possible once it's been approved. Whenever I boot Ubuntu, I get a message that it cannot mount my windows partition, and I can choose to either wait, skip or manually mount.  When I try to enter my Windows partition through Nautilus I get a message saying that this partition is hibernated and that I need to enter the file system and properly close it, something I have done with no problem so I don't know why this happens.    Here's my partition table, if any more data is needed please let me know.     Device Boot      Start         End      Blocks   Id  System /dev/sda1            2048    20000767     9999360   83  Linux /dev/sda2        20002814   478001151   228999169    5  Extended /dev/sda3   *   478001152   622532607    72265728    7  HPFS/NTFS/exFAT /dev/sda4       622532608   625141759     1304576   82  Linux swap / Solaris /dev/sda5        20002816   478001151   228999168   83  Linux How can I use awk to (sometimes) remove the first character of a column? Python List vs. Array - when to use? If you are creating a 1d array, you can implement it as a List, or else use the 'array' module in the standard library.  I have always used Lists for 1d arrays.  What is the reason or circumstance where I would want to use the array module instead?  Is it for performance and memory optimization, or am I missing something obvious? Chrome Extension Message passing: response not sent Why are there no line numbers in the code listings? Would it make discussing code easier if you could simply refer to a particular line or range, or am I wrong?